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

Feature Request: Transformer Debugger - Debugging and controlling the behavior of transformer based LLM models. #1513

Open
abhaskumarsinha opened this issue Mar 14, 2024 · 3 comments
Assignees
Labels
type:feature New feature or request

Comments

@abhaskumarsinha
Copy link

abhaskumarsinha commented Mar 14, 2024

Short Description

Transformer Debugger (TDB) is a tool developed by OpenAI's Superalignment team with the goal of supporting investigations into specific behaviors of small language models. The tool combines automated interpretability techniques with sparse autoencoders.

TDB enables rapid exploration before needing to write code, with the ability to intervene in the forward pass and see how it affects a particular behavior. It can be used to answer questions like, "Why does the model output token A instead of token B for this prompt?" or "Why does attention head H attend to token T for this prompt?" It does so by identifying specific components (neurons, attention heads, autoencoder latents) that contribute to the behavior, showing automatically generated explanations of what causes those components to activate most strongly, and tracing connections between components to help discover circuits.

Paper
https://arxiv.org/pdf/2211.00593v1.pdf

Existing Implementations

Other Information
This tool could be a very great guide to people working with the interpretability of LLM models. There are already a lot of LLM models in Keras-nlp and engineers might find it very useful while working on the deployment of the models to ensure the safety, reliability, intrepretability and control of the LLM models available here.

@SamanehSaadat
Copy link
Member

Hi @abhaskumarsinha

Thanks for the suggestion! How do you envision Transformer Debugger to be incorporated into KerasNLP. Does it require the integration with a tool in our library? Or do we just need to create a guide?

@SamanehSaadat
Copy link
Member

Note that there is an on-going effort to integrate Learning Interpretability Tool (LIT) with KerasNLP. #1521 is an example of adding the .score() function for interpretability use cases.

@abhaskumarsinha
Copy link
Author

Hello @SamanehSaadat

Thanks for the suggestion! How do you envision Transformer Debugger to be incorporated into KerasNLP. Does it require the integration with a tool in our library? Or do we just need to create a guide?

I believe we should reserve one whole directory for interpretability tools here: https://github.com/keras-team/keras-nlp/tree/master/keras_nlp we would need to incorporate the whole thing but that's a time-consuming goal.

Here's a one-minute video on how that works: https://www.youtube.com/watch?v=5D_GiJv7O-M

Note that there is an ongoing effort to integrate Learning Interpretability Tool (LIT) with KerasNLP. #1521 is an example of adding the .score() function for interpretability use cases.

Thank you for pointing that out. I'm not an expert here, but LIT sounds like a very general approach while TDB is a very specific LLM approach. TDB could be a very long and lengthy feature to implement, so I'm all up to contribute in case there is any need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants