refactor(sae): move SST-2 SAE example into notebook tutorials#110
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary 📝
Adds SAE feature visualization utilities and a notebook-based SST-2/GPT-2 SAE interpretation workflow. The PR makes it easier to inspect why one SAE feature behaves like positive or negative evidence by connecting three views: feature ranking, vocabulary-level logit effects, and token-level activations.
The SST-2 SAE example has also been moved out of
examples/and into the SAE notebook/tutorial flow, so the long-form interpretability walkthrough lives with the other notebook-based SAE material.Details
Adds
plot_sae_feature_logit_effects(feature_id, decoder, unembedding, ...)Adds
plot_sae_token_activations(...)[N, seq]/[N, seq, features]arrays.Replaces the old SST-2 SAE script with a notebook workflow:
examples/sae_sst2_feature_enrichment.pytutorials/sae/03_sst2_feature_enrichment.ipynbUpdates SAE feature ranking:
Exports the new SAE plotting APIs from
murano.plotting.nltkto the notebook optional dependency checkuv.lockBugfixes 🐛
Validation
ruff format --checkruff check --fix --exit-non-zero-on-fixuv lock --checkpyright srcgit diff --cached --check