Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Demo and Tutorial on Patchscopes and "Patching + Generation" #680

Closed
1 task done
HenryCai11 opened this issue Jul 16, 2024 · 5 comments · Fixed by #692
Closed
1 task done

[Proposal] Demo and Tutorial on Patchscopes and "Patching + Generation" #680

HenryCai11 opened this issue Jul 16, 2024 · 5 comments · Fixed by #692
Assignees
Labels
complexity-moderate Moderately complicated issues for people who have intermediate experience with the code demo Creating a demo or tutorial

Comments

@HenryCai11
Copy link
Contributor

HenryCai11 commented Jul 16, 2024

Proposal

UPDATE: Demo and Tutorial on Patchscopes and "Patching + Generation"

DEPRECATED: Replication of the original causal tracing from the ROME paper.

Motivation

I found that the original causal tracing method hasn't been supported here, and I think it has some advantages over the current activation patching method. For example, corruption with Gaussian noise might preserve more semantic information from the original sentence than corruption by changing words.

Pitch

To replicate the original causal tracing method from the ROME paper (https://arxiv.org/abs/2202.05262)

Alternatives

I also consider replicating the Patchscope here, which is also mentioned in issue #500. Since Patchscope can be considered as a more general framework for this kind of patching/intervention-based methods, implementing it here can also make causal tracing available. I'd like to open another issue for the replication of Patchscope later.

Additional context

I've implemented a version locally, and would like to put some examples here, comparing results from my implementation and from the original implementation.

Checklist

  • I have checked that there is no similar issue in the repo (required)
@neelnanda-io
Copy link
Collaborator

neelnanda-io commented Jul 16, 2024 via email

@HenryCai11
Copy link
Contributor Author

@neelnanda-io Thanks for the clarification! Yeah, I've roughly tried combining patching and generation, and found that there might be several subtleties need to be concerned. I'd like to contribute a tutorial on it and further an implementation of Patchscopes.

Maybe I'll just use this thread for a "tutorial and demo on patching + generation and Patchscopes", and make PR(s) later.

@HenryCai11 HenryCai11 changed the title [Proposal] Replicating the Original Causal Tracing [Proposal] Demo and Tutorial on Patchscopes and "Patching + Generation" Jul 17, 2024
@bryce13950 bryce13950 added demo Creating a demo or tutorial complexity-moderate Moderately complicated issues for people who have intermediate experience with the code labels Jul 22, 2024
@bryce13950
Copy link
Collaborator

@HenryCai11 Do you need any help getting started with this? If you want to put the demo together, I would be happy to walk you through a couple steps in the process. Any new demos added to the project need to be covered by the CI, so there are a couple nuances to how they should be put together. A lot of how to do this can be seen within other demos that are currently covered, but I am happy to walk through any specific questions you may have on how to get started.

@HenryCai11
Copy link
Contributor Author

@HenryCai11 Do you need any help getting started with this? If you want to put the demo together, I would be happy to walk you through a couple steps in the process. Any new demos added to the project need to be covered by the CI, so there are a couple nuances to how they should be put together. A lot of how to do this can be seen within other demos that are currently covered, but I am happy to walk through any specific questions you may have on how to get started.

Thanks @bryce13950 ! I have now started to write up the demos. I'll see if it'll be more convenient to put them together, otherwise I think separating them would be nice.

@HenryCai11
Copy link
Contributor Author

Hi @bryce13950 , I've made a pull request #692. I finally decided to put both of them in the same notebook and added clear comments of how to implement them. I also passed the notebook test locally. Please let me know if there's anything else that I need to do. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity-moderate Moderately complicated issues for people who have intermediate experience with the code demo Creating a demo or tutorial
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants