Skip to content

feat: add the Sweep step and rebuild the demo surface as notebooks#116

Merged
alirezabayatmk merged 2 commits into
mainfrom
feat/sweep-and-notebooks
Jul 10, 2026
Merged

feat: add the Sweep step and rebuild the demo surface as notebooks#116
alirezabayatmk merged 2 commits into
mainfrom
feat/sweep-and-notebooks

Conversation

@alirezabayatmk

Copy link
Copy Markdown
Member

Summary 📝

examples/ was six loose scripts. This replaces them with fifteen notebooks, one per step/combination of steps that Murano does, all executed and published on the docs site. Those implementations caused some Murano gaps to pop up which this PR handles as well.

Details

  1. Notebooks. getting_started.ipynb plus fourteen in notebooks/applications/: steering, probing, logit lens, logit attribution, attention, ablation, activation patching, circuit discovery, metrics, custom pipeline, weight ablation, and three SAE ones moved out of notebooks/sae/. Everything runs on GPT-2 except weight ablation (Llama-3.2-1B) and two of the SAE ones (Gemma-2-2B). They share one template, enforced by tests/test_notebook_structure.py.
  2. Sweep step. Every notebook that measured something per head was writing the same loop by hand. Sweep runs a step chain once per item and collects the metric. It copies Results per item so the setup runs once, and figures out its reads from the chain so a missing key fails before the model runs. Sweeping heads gives {Node: float}, the same shape attribution gives, so SelectComponents and plot_head_matrix take it directly and Plot draws it.
  3. Gaps the notebooks hit. Logits now takes fn=, which the backend already supported, so sweeping layers costs forward passes instead of generations. Adds AnswerRankStep and SAEModel.decoder. plot_activation_projection moves out of examples/ into murano.plotting. Shared prompts live in the new murano.tasks instead of being pasted into each notebook.
  4. Docs. docs/scripts/gen_notebook_docs.py renders the executed notebooks into pages at deploy time. Also fixes the docs build, which fails on main: three reproduction pages have an unquoted description: containing a colon.
  5. Cleanup. Deletes examples/ and tests/test_examples.py, and adapting those tests to the library functions. Drops .coveragerc, which duplicated the config in pyproject.toml.

Checks

  • Tested Changes: Sweep gives the same numbers as the loops it replaces, and circuit_discovery still finds the IOI circuit. All fifteen notebooks run clean on GPT-2, Llama-3.2-1B and Gemma-2-2B.

@alirezabayatmk alirezabayatmk merged commit 429f869 into main Jul 10, 2026
5 checks passed
@alirezabayatmk alirezabayatmk deleted the feat/sweep-and-notebooks branch July 10, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant