logogram 0.5.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. {logogram-0.5.0 → logogram-0.6.0}/AGENTS.md +14 -1
  2. {logogram-0.5.0 → logogram-0.6.0}/CHANGELOG.md +108 -0
  3. {logogram-0.5.0 → logogram-0.6.0}/PKG-INFO +186 -15
  4. {logogram-0.5.0 → logogram-0.6.0}/README.md +185 -14
  5. {logogram-0.5.0 → logogram-0.6.0}/docs/README.md +11 -9
  6. logogram-0.6.0/scripts/sae_catalogue.py +1128 -0
  7. {logogram-0.5.0 → logogram-0.6.0}/scripts/smoke_wheel.py +6 -0
  8. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/__init__.py +4 -1
  9. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/analysis.py +95 -25
  10. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/api.py +173 -11
  11. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/atp.py +164 -43
  12. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/backends/base.py +114 -8
  13. logogram-0.6.0/src/logogram/backends/catalogue.py +345 -0
  14. logogram-0.6.0/src/logogram/backends/sae_catalogue.json +14237 -0
  15. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/backends/saes.py +216 -58
  16. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/backends/transformer_lens.py +686 -22
  17. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/circuits.py +222 -58
  18. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/cli.py +257 -19
  19. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/compare.py +9 -1
  20. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/datasets.py +55 -12
  21. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/direct.py +88 -19
  22. logogram-0.6.0/src/logogram/edges.py +1287 -0
  23. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/engine.py +93 -51
  24. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/features.py +171 -36
  25. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/fileio.py +18 -0
  26. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/history.py +2 -4
  27. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/ioi.py +29 -12
  28. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/local_models.py +9 -0
  29. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/owner.py +5 -14
  30. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/partial.py +26 -8
  31. logogram-0.6.0/src/logogram/paths.py +454 -0
  32. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/prompts.py +140 -32
  33. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/report.py +533 -24
  34. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/results.py +64 -3
  35. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/runner.py +28 -8
  36. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/runqueue.py +3 -5
  37. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/sae.py +9 -1
  38. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/schema.py +92 -1
  39. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/server/app.py +128 -10
  40. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/server/models.py +118 -0
  41. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/sites.py +198 -13
  42. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/spec.py +405 -45
  43. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/stats.py +129 -22
  44. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/steering.py +29 -17
  45. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/sweeps.py +3 -0
  46. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/system.py +138 -5
  47. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/tasks.py +107 -35
  48. logogram-0.6.0/src/logogram/toys.py +1653 -0
  49. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/verify.py +32 -3
  50. logogram-0.6.0/src/logogram/web_dist/assets/index-BRFdKaSa.js +58 -0
  51. logogram-0.6.0/src/logogram/web_dist/assets/index-DBtleL59.css +1 -0
  52. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/web_dist/index.html +2 -2
  53. {logogram-0.5.0 → logogram-0.6.0}/tests/browser_server.py +8 -0
  54. logogram-0.6.0/tests/catalogue_fixture.py +148 -0
  55. {logogram-0.5.0 → logogram-0.6.0}/tests/conftest.py +32 -0
  56. logogram-0.6.0/tests/test_architectures.py +330 -0
  57. logogram-0.6.0/tests/test_edges.py +848 -0
  58. logogram-0.6.0/tests/test_finer_sites.py +905 -0
  59. {logogram-0.5.0 → logogram-0.6.0}/tests/test_hardening.py +29 -0
  60. {logogram-0.5.0 → logogram-0.6.0}/tests/test_paths.py +36 -0
  61. {logogram-0.5.0 → logogram-0.6.0}/tests/test_reference.py +3 -2
  62. logogram-0.6.0/tests/test_sae_catalogue.py +834 -0
  63. {logogram-0.5.0 → logogram-0.6.0}/tests/test_saved_queue.py +23 -1
  64. {logogram-0.5.0 → logogram-0.6.0}/tests/test_skip_transcoders.py +52 -3
  65. {logogram-0.5.0 → logogram-0.6.0}/tests/test_tasks.py +93 -0
  66. logogram-0.6.0/tests/test_toys.py +709 -0
  67. logogram-0.6.0/tests/test_uneven.py +869 -0
  68. {logogram-0.5.0 → logogram-0.6.0}/web/src/api/client.ts +15 -1
  69. {logogram-0.5.0 → logogram-0.6.0}/web/src/api/types.ts +241 -11
  70. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/GuideDialog.tsx +5 -0
  71. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Inspector.tsx +103 -18
  72. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/RobustnessDialog.tsx +25 -3
  73. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/TokenStrip.module.css +14 -0
  74. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/TokenStrip.tsx +96 -35
  75. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/buildSpec.ts +221 -3
  76. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/circuits.ts +111 -14
  77. logogram-0.6.0/web/src/lib/edgePlan.ts +48 -0
  78. logogram-0.6.0/web/src/lib/edges.ts +136 -0
  79. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/formDraft.ts +34 -4
  80. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/formState.ts +30 -4
  81. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/guide.ts +1 -0
  82. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/hooks.ts +6 -0
  83. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/promptEdits.ts +34 -5
  84. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/promptRows.ts +58 -0
  85. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/sites.ts +81 -13
  86. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/spec.ts +201 -16
  87. {logogram-0.5.0 → logogram-0.6.0}/web/src/store/app.ts +3 -3
  88. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/CompareView.tsx +34 -4
  89. logogram-0.6.0/web/src/views/EdgeResults.module.css +340 -0
  90. logogram-0.6.0/web/src/views/EdgeResults.tsx +753 -0
  91. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ExperimentView.module.css +4 -0
  92. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ExperimentView.tsx +446 -43
  93. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ExploreView.tsx +2 -2
  94. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/FeaturesView.module.css +8 -0
  95. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/FeaturesView.tsx +38 -6
  96. logogram-0.6.0/web/src/views/NeuronResults.module.css +92 -0
  97. logogram-0.6.0/web/src/views/NeuronResults.tsx +258 -0
  98. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/PromptsView.module.css +21 -0
  99. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/PromptsView.tsx +73 -15
  100. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ResultsView.module.css +3 -1
  101. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ResultsView.tsx +134 -31
  102. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/RunSummary.tsx +84 -10
  103. logogram-0.6.0/web/src/views/SAEPicker.module.css +159 -0
  104. logogram-0.6.0/web/src/views/SAEPicker.tsx +228 -0
  105. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/SiteSetsEditor.tsx +23 -12
  106. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/TaskGenerator.tsx +3 -2
  107. logogram-0.6.0/web/tests/edges.browser.ts +140 -0
  108. logogram-0.6.0/web/tests/edges.unit.ts +210 -0
  109. logogram-0.6.0/web/tests/finer.browser.ts +126 -0
  110. logogram-0.6.0/web/tests/finer.unit.ts +169 -0
  111. {logogram-0.5.0 → logogram-0.6.0}/web/tests/prompts.unit.ts +45 -1
  112. logogram-0.6.0/web/tests/saes.browser.ts +86 -0
  113. {logogram-0.5.0 → logogram-0.6.0}/web/tests/spec.unit.ts +53 -1
  114. {logogram-0.5.0 → logogram-0.6.0}/web/tests/sweep.browser.ts +1 -1
  115. logogram-0.6.0/web/tests/uneven.browser.ts +133 -0
  116. logogram-0.5.0/src/logogram/paths.py +0 -228
  117. logogram-0.5.0/src/logogram/web_dist/assets/index-6ZqR5xBh.css +0 -1
  118. logogram-0.5.0/src/logogram/web_dist/assets/index-DNzUYGYt.js +0 -58
  119. logogram-0.5.0/tests/test_architectures.py +0 -161
  120. {logogram-0.5.0 → logogram-0.6.0}/.gitignore +0 -0
  121. {logogram-0.5.0 → logogram-0.6.0}/LICENSE +0 -0
  122. {logogram-0.5.0 → logogram-0.6.0}/notebooks/README.md +0 -0
  123. {logogram-0.5.0 → logogram-0.6.0}/pyproject.toml +0 -0
  124. {logogram-0.5.0 → logogram-0.6.0}/scripts/build_reference.py +0 -0
  125. {logogram-0.5.0 → logogram-0.6.0}/scripts/check_privacy.py +0 -0
  126. {logogram-0.5.0 → logogram-0.6.0}/scripts/validate_real_weights.py +0 -0
  127. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/__main__.py +0 -0
  128. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/backends/__init__.py +0 -0
  129. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/backends/hub.py +0 -0
  130. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/chat.py +0 -0
  131. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/factual-recall-gpt2/.gitignore +0 -0
  132. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/factual-recall-gpt2/datasets/factual-recall.jsonl +0 -0
  133. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/factual-recall-gpt2/experiments/capital-causal-trace/spec.json +0 -0
  134. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/factual-recall-gpt2/project.json +0 -0
  135. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/gendered-pronoun-gpt2/.gitignore +0 -0
  136. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/gendered-pronoun-gpt2/datasets/gendered-pronoun.jsonl +0 -0
  137. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/gendered-pronoun-gpt2/experiments/pronoun-direct-effects/spec.json +0 -0
  138. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/gendered-pronoun-gpt2/project.json +0 -0
  139. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/greater-than-gpt2/.gitignore +0 -0
  140. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/greater-than-gpt2/datasets/greater-than.jsonl +0 -0
  141. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/greater-than-gpt2/experiments/greater-than-layers/spec.json +0 -0
  142. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/greater-than-gpt2/project.json +0 -0
  143. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/ioi-gpt2/.gitignore +0 -0
  144. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/ioi-gpt2/datasets/ioi.jsonl +0 -0
  145. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/ioi-gpt2/experiments/ioi-head-patching/spec.json +0 -0
  146. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/examples/ioi-gpt2/project.json +0 -0
  147. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/exports.py +0 -0
  148. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/gallery.py +0 -0
  149. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/heads.py +0 -0
  150. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/inside.py +0 -0
  151. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/metrics.py +0 -0
  152. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/project.py +0 -0
  153. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/research.py +0 -0
  154. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/robustness.py +0 -0
  155. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/runs.py +0 -0
  156. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/server/__init__.py +0 -0
  157. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/server/security.py +0 -0
  158. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/server/state.py +0 -0
  159. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/support.py +0 -0
  160. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/updates.py +0 -0
  161. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/web_dist/assets/instrument-sans-latin-ext-standard-normal-C5E2Gvlv.woff2 +0 -0
  162. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/web_dist/assets/instrument-sans-latin-standard-normal-BVScPF0l.woff2 +0 -0
  163. {logogram-0.5.0 → logogram-0.6.0}/src/logogram/web_dist/favicon.svg +0 -0
  164. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/datasets/ioi.jsonl +0 -0
  165. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/datasets/snapshots/f5e2f2b1d68ac7ab59b1cefcd84f7f0cfc81c71c85c05c925f872e01c01d6e69.jsonl +0 -0
  166. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.1.0/manifest.json +0 -0
  167. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.1.0/results.parquet +0 -0
  168. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.1.0/spec.json +0 -0
  169. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.1.0/summary.json +0 -0
  170. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.2.0/manifest.json +0 -0
  171. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.2.0/results.parquet +0 -0
  172. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.2.0/spec.json +0 -0
  173. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/made-by-0.2.0/summary.json +0 -0
  174. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/experiments/written-for-0.1.0/spec.json +0 -0
  175. {logogram-0.5.0 → logogram-0.6.0}/tests/fixtures/old-runs/project.json +0 -0
  176. {logogram-0.5.0 → logogram-0.6.0}/tests/test_api.py +0 -0
  177. {logogram-0.5.0 → logogram-0.6.0}/tests/test_atp.py +0 -0
  178. {logogram-0.5.0 → logogram-0.6.0}/tests/test_attention_saes.py +0 -0
  179. {logogram-0.5.0 → logogram-0.6.0}/tests/test_chat_models.py +0 -0
  180. {logogram-0.5.0 → logogram-0.6.0}/tests/test_chat_templates.py +0 -0
  181. {logogram-0.5.0 → logogram-0.6.0}/tests/test_circuits.py +0 -0
  182. {logogram-0.5.0 → logogram-0.6.0}/tests/test_cli.py +0 -0
  183. {logogram-0.5.0 → logogram-0.6.0}/tests/test_community.py +0 -0
  184. {logogram-0.5.0 → logogram-0.6.0}/tests/test_devices.py +0 -0
  185. {logogram-0.5.0 → logogram-0.6.0}/tests/test_direct.py +0 -0
  186. {logogram-0.5.0 → logogram-0.6.0}/tests/test_docs.py +0 -0
  187. {logogram-0.5.0 → logogram-0.6.0}/tests/test_engine.py +0 -0
  188. {logogram-0.5.0 → logogram-0.6.0}/tests/test_examples.py +0 -0
  189. {logogram-0.5.0 → logogram-0.6.0}/tests/test_explorer.py +0 -0
  190. {logogram-0.5.0 → logogram-0.6.0}/tests/test_feature_writes.py +0 -0
  191. {logogram-0.5.0 → logogram-0.6.0}/tests/test_gpus.py +0 -0
  192. {logogram-0.5.0 → logogram-0.6.0}/tests/test_heads.py +0 -0
  193. {logogram-0.5.0 → logogram-0.6.0}/tests/test_history.py +0 -0
  194. {logogram-0.5.0 → logogram-0.6.0}/tests/test_inside.py +0 -0
  195. {logogram-0.5.0 → logogram-0.6.0}/tests/test_loading.py +0 -0
  196. {logogram-0.5.0 → logogram-0.6.0}/tests/test_local_models.py +0 -0
  197. {logogram-0.5.0 → logogram-0.6.0}/tests/test_metrics.py +0 -0
  198. {logogram-0.5.0 → logogram-0.6.0}/tests/test_notebooks.py +0 -0
  199. {logogram-0.5.0 → logogram-0.6.0}/tests/test_old_runs.py +0 -0
  200. {logogram-0.5.0 → logogram-0.6.0}/tests/test_partial.py +0 -0
  201. {logogram-0.5.0 → logogram-0.6.0}/tests/test_privacy.py +0 -0
  202. {logogram-0.5.0 → logogram-0.6.0}/tests/test_queue.py +0 -0
  203. {logogram-0.5.0 → logogram-0.6.0}/tests/test_release_fixes.py +0 -0
  204. {logogram-0.5.0 → logogram-0.6.0}/tests/test_report.py +0 -0
  205. {logogram-0.5.0 → logogram-0.6.0}/tests/test_run_tracking.py +0 -0
  206. {logogram-0.5.0 → logogram-0.6.0}/tests/test_sae.py +0 -0
  207. {logogram-0.5.0 → logogram-0.6.0}/tests/test_sanity.py +0 -0
  208. {logogram-0.5.0 → logogram-0.6.0}/tests/test_security.py +0 -0
  209. {logogram-0.5.0 → logogram-0.6.0}/tests/test_server.py +0 -0
  210. {logogram-0.5.0 → logogram-0.6.0}/tests/test_specs.py +0 -0
  211. {logogram-0.5.0 → logogram-0.6.0}/tests/test_statistics.py +0 -0
  212. {logogram-0.5.0 → logogram-0.6.0}/tests/test_steering.py +0 -0
  213. {logogram-0.5.0 → logogram-0.6.0}/tests/test_steering_features.py +0 -0
  214. {logogram-0.5.0 → logogram-0.6.0}/tests/test_support.py +0 -0
  215. {logogram-0.5.0 → logogram-0.6.0}/tests/test_sweeps.py +0 -0
  216. {logogram-0.5.0 → logogram-0.6.0}/tests/test_transcoders.py +0 -0
  217. {logogram-0.5.0 → logogram-0.6.0}/tests/test_units.py +0 -0
  218. {logogram-0.5.0 → logogram-0.6.0}/tests/test_updates.py +0 -0
  219. {logogram-0.5.0 → logogram-0.6.0}/tests/test_validation_script.py +0 -0
  220. {logogram-0.5.0 → logogram-0.6.0}/uv.lock +0 -0
  221. {logogram-0.5.0 → logogram-0.6.0}/web/index.html +0 -0
  222. {logogram-0.5.0 → logogram-0.6.0}/web/package-lock.json +0 -0
  223. {logogram-0.5.0 → logogram-0.6.0}/web/package.json +0 -0
  224. {logogram-0.5.0 → logogram-0.6.0}/web/playwright.config.ts +0 -0
  225. {logogram-0.5.0 → logogram-0.6.0}/web/public/favicon.svg +0 -0
  226. {logogram-0.5.0 → logogram-0.6.0}/web/src/App.module.css +0 -0
  227. {logogram-0.5.0 → logogram-0.6.0}/web/src/App.tsx +0 -0
  228. {logogram-0.5.0 → logogram-0.6.0}/web/src/api/events.ts +0 -0
  229. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/AboutDialog.tsx +0 -0
  230. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/CancelRunDialog.tsx +0 -0
  231. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/CircuitDialog.tsx +0 -0
  232. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/CommandPalette.module.css +0 -0
  233. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/CommandPalette.tsx +0 -0
  234. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/CopyCommand.module.css +0 -0
  235. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/CopyCommand.tsx +0 -0
  236. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Distribution.module.css +0 -0
  237. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Distribution.tsx +0 -0
  238. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ErrorBoundary.module.css +0 -0
  239. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ErrorBoundary.tsx +0 -0
  240. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ExampleGallery.module.css +0 -0
  241. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ExampleGallery.tsx +0 -0
  242. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/FeatureWrites.module.css +0 -0
  243. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/FeatureWrites.tsx +0 -0
  244. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/FolderPicker.module.css +0 -0
  245. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/FolderPicker.tsx +0 -0
  246. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/GuideDialog.module.css +0 -0
  247. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Header.module.css +0 -0
  248. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Header.tsx +0 -0
  249. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Heatmap/Heatmap.module.css +0 -0
  250. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Heatmap/Heatmap.tsx +0 -0
  251. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Heatmap/ScaleBar.tsx +0 -0
  252. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/HelpDialogs.module.css +0 -0
  253. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/HelpMenu.module.css +0 -0
  254. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/HelpMenu.tsx +0 -0
  255. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/History.module.css +0 -0
  256. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/History.tsx +0 -0
  257. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Inspector.module.css +0 -0
  258. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Logogram.tsx +0 -0
  259. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/LogogramDial.module.css +0 -0
  260. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/LogogramDial.tsx +0 -0
  261. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ModelDialog.module.css +0 -0
  262. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ModelDialog.tsx +0 -0
  263. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ModelMap/Legend.tsx +0 -0
  264. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ModelMap/ModelMap.module.css +0 -0
  265. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ModelMap/ModelMap.tsx +0 -0
  266. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Notices.module.css +0 -0
  267. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Notices.tsx +0 -0
  268. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ReportDialog.tsx +0 -0
  269. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/RunButton.tsx +0 -0
  270. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ShortcutsDialog.module.css +0 -0
  271. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ShortcutsDialog.tsx +0 -0
  272. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Splitter.module.css +0 -0
  273. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Splitter.tsx +0 -0
  274. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/StatusLine.module.css +0 -0
  275. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/StatusLine.tsx +0 -0
  276. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/SweepChart/SweepChart.module.css +0 -0
  277. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/SweepChart/SweepChart.tsx +0 -0
  278. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/SweepDialog.module.css +0 -0
  279. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/SweepDialog.tsx +0 -0
  280. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/TopBar.module.css +0 -0
  281. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/TopBar.tsx +0 -0
  282. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/UpdateNotice.module.css +0 -0
  283. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/UpdateNotice.tsx +0 -0
  284. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Walkthrough.module.css +0 -0
  285. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/Walkthrough.tsx +0 -0
  286. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ui/Icon.tsx +0 -0
  287. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ui/index.tsx +0 -0
  288. {logogram-0.5.0 → logogram-0.6.0}/web/src/components/ui/ui.module.css +0 -0
  289. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/analysis.ts +0 -0
  290. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/canvas.ts +0 -0
  291. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/chat.ts +0 -0
  292. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/color.ts +0 -0
  293. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/devices.ts +0 -0
  294. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/environment.ts +0 -0
  295. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/export.ts +0 -0
  296. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/formHistory.ts +0 -0
  297. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/format.ts +0 -0
  298. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/heatmapNavigation.ts +0 -0
  299. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/help.ts +0 -0
  300. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/keys.ts +0 -0
  301. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/logogram.ts +0 -0
  302. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/metrics.ts +0 -0
  303. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/milestones.ts +0 -0
  304. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/motion.ts +0 -0
  305. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/route.ts +0 -0
  306. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/runs.ts +0 -0
  307. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/sweeps.ts +0 -0
  308. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/thresholds.ts +0 -0
  309. {logogram-0.5.0 → logogram-0.6.0}/web/src/lib/walkthrough.ts +0 -0
  310. {logogram-0.5.0 → logogram-0.6.0}/web/src/main.tsx +0 -0
  311. {logogram-0.5.0 → logogram-0.6.0}/web/src/screens/Projects.tsx +0 -0
  312. {logogram-0.5.0 → logogram-0.6.0}/web/src/screens/Screens.module.css +0 -0
  313. {logogram-0.5.0 → logogram-0.6.0}/web/src/screens/SystemCheck.tsx +0 -0
  314. {logogram-0.5.0 → logogram-0.6.0}/web/src/screens/Welcome.tsx +0 -0
  315. {logogram-0.5.0 → logogram-0.6.0}/web/src/screens/Workbench.module.css +0 -0
  316. {logogram-0.5.0 → logogram-0.6.0}/web/src/screens/Workbench.tsx +0 -0
  317. {logogram-0.5.0 → logogram-0.6.0}/web/src/store/help.ts +0 -0
  318. {logogram-0.5.0 → logogram-0.6.0}/web/src/styles/global.css +0 -0
  319. {logogram-0.5.0 → logogram-0.6.0}/web/src/styles/tokens.css +0 -0
  320. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/AttentionView.module.css +0 -0
  321. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/AttentionView.tsx +0 -0
  322. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/BaselineView.module.css +0 -0
  323. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/BaselineView.tsx +0 -0
  324. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ChatTemplateSettings.tsx +0 -0
  325. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/CircuitResults.tsx +0 -0
  326. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/CompareView.module.css +0 -0
  327. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/Continuations.module.css +0 -0
  328. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/Continuations.tsx +0 -0
  329. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ExploreView.module.css +0 -0
  330. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/Forest.module.css +0 -0
  331. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/Forest.tsx +0 -0
  332. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/HeadComparisonView.module.css +0 -0
  333. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/HeadComparisonView.tsx +0 -0
  334. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/HeadKinds.module.css +0 -0
  335. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/HeadKinds.tsx +0 -0
  336. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/MetricSettings.tsx +0 -0
  337. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/PredictionsView.module.css +0 -0
  338. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/PredictionsView.tsx +0 -0
  339. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ResearchView.module.css +0 -0
  340. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/ResearchView.tsx +0 -0
  341. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/SiteSets.module.css +0 -0
  342. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/SpecView.module.css +0 -0
  343. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/SpecView.tsx +0 -0
  344. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/StatisticsSettings.tsx +0 -0
  345. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/SweepView.module.css +0 -0
  346. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/SweepView.tsx +0 -0
  347. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/TextView.module.css +0 -0
  348. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/TextView.tsx +0 -0
  349. {logogram-0.5.0 → logogram-0.6.0}/web/src/views/views.module.css +0 -0
  350. {logogram-0.5.0 → logogram-0.6.0}/web/tests/a11y.browser.ts +0 -0
  351. {logogram-0.5.0 → logogram-0.6.0}/web/tests/analyses.browser.ts +0 -0
  352. {logogram-0.5.0 → logogram-0.6.0}/web/tests/autosave.unit.ts +0 -0
  353. {logogram-0.5.0 → logogram-0.6.0}/web/tests/axe.ts +0 -0
  354. {logogram-0.5.0 → logogram-0.6.0}/web/tests/chat.browser.ts +0 -0
  355. {logogram-0.5.0 → logogram-0.6.0}/web/tests/chat.unit.ts +0 -0
  356. {logogram-0.5.0 → logogram-0.6.0}/web/tests/circuits.unit.ts +0 -0
  357. {logogram-0.5.0 → logogram-0.6.0}/web/tests/color.unit.ts +0 -0
  358. {logogram-0.5.0 → logogram-0.6.0}/web/tests/context.unit.ts +0 -0
  359. {logogram-0.5.0 → logogram-0.6.0}/web/tests/devices.unit.ts +0 -0
  360. {logogram-0.5.0 → logogram-0.6.0}/web/tests/docs.ts +0 -0
  361. {logogram-0.5.0 → logogram-0.6.0}/web/tests/environment.unit.ts +0 -0
  362. {logogram-0.5.0 → logogram-0.6.0}/web/tests/export.unit.ts +0 -0
  363. {logogram-0.5.0 → logogram-0.6.0}/web/tests/fakeRuns.ts +0 -0
  364. {logogram-0.5.0 → logogram-0.6.0}/web/tests/form.unit.ts +0 -0
  365. {logogram-0.5.0 → logogram-0.6.0}/web/tests/gallery.browser.ts +0 -0
  366. {logogram-0.5.0 → logogram-0.6.0}/web/tests/guide.browser.ts +0 -0
  367. {logogram-0.5.0 → logogram-0.6.0}/web/tests/guide.unit.ts +0 -0
  368. {logogram-0.5.0 → logogram-0.6.0}/web/tests/heads.browser.ts +0 -0
  369. {logogram-0.5.0 → logogram-0.6.0}/web/tests/heatmap.unit.ts +0 -0
  370. {logogram-0.5.0 → logogram-0.6.0}/web/tests/help.browser.ts +0 -0
  371. {logogram-0.5.0 → logogram-0.6.0}/web/tests/help.unit.ts +0 -0
  372. {logogram-0.5.0 → logogram-0.6.0}/web/tests/history.browser.ts +0 -0
  373. {logogram-0.5.0 → logogram-0.6.0}/web/tests/history.unit.ts +0 -0
  374. {logogram-0.5.0 → logogram-0.6.0}/web/tests/logogram.unit.ts +0 -0
  375. {logogram-0.5.0 → logogram-0.6.0}/web/tests/navigation.browser.ts +0 -0
  376. {logogram-0.5.0 → logogram-0.6.0}/web/tests/notices.unit.ts +0 -0
  377. {logogram-0.5.0 → logogram-0.6.0}/web/tests/partial.browser.ts +0 -0
  378. {logogram-0.5.0 → logogram-0.6.0}/web/tests/prompts.browser.ts +0 -0
  379. {logogram-0.5.0 → logogram-0.6.0}/web/tests/queue.browser.ts +0 -0
  380. {logogram-0.5.0 → logogram-0.6.0}/web/tests/queue.unit.ts +0 -0
  381. {logogram-0.5.0 → logogram-0.6.0}/web/tests/route.unit.ts +0 -0
  382. {logogram-0.5.0 → logogram-0.6.0}/web/tests/runs.browser.ts +0 -0
  383. {logogram-0.5.0 → logogram-0.6.0}/web/tests/steering.browser.ts +0 -0
  384. {logogram-0.5.0 → logogram-0.6.0}/web/tests/sweeps.unit.ts +0 -0
  385. {logogram-0.5.0 → logogram-0.6.0}/web/tests/tasks.unit.ts +0 -0
  386. {logogram-0.5.0 → logogram-0.6.0}/web/tests/text.browser.ts +0 -0
  387. {logogram-0.5.0 → logogram-0.6.0}/web/tests/tokens.browser.ts +0 -0
  388. {logogram-0.5.0 → logogram-0.6.0}/web/tests/ux.browser.ts +0 -0
  389. {logogram-0.5.0 → logogram-0.6.0}/web/tests/walkthrough.browser.ts +0 -0
  390. {logogram-0.5.0 → logogram-0.6.0}/web/tests/workbench.browser.ts +0 -0
  391. {logogram-0.5.0 → logogram-0.6.0}/web/tsconfig.json +0 -0
  392. {logogram-0.5.0 → logogram-0.6.0}/web/vite.config.ts +0 -0
@@ -99,6 +99,7 @@ src/logogram/
99
99
  datasets.py, ioi.py JSONL datasets and the IOI generator
100
100
  tasks.py seeded datasets for the other tasks (greater-than, docstring, ...)
101
101
  prompts.py tokenization, alignment checks, length groups, seeded splits
102
+ chat.py prompts wrapped in the model's own chat template
102
103
  metrics.py the metrics: answers, answer sets and continuations, scored per prompt
103
104
  sites.py scope expansion and result layouts
104
105
  engine.py the sweep: captures, patches, streams per layer, cancels; routes methods
@@ -108,12 +109,18 @@ src/logogram/
108
109
  verify.py the spec that verifies an estimate by patching its strongest sites
109
110
  steering.py steering with held-out prompts and a random control
110
111
  paths.py path patching
112
+ edges.py edge attribution (EAP, EAP-IG), edge patching and the faithfulness curve
111
113
  features.py SAE features: patching and attribution patching
112
114
  sae.py SAE encode, decode and fit
113
115
  stats.py bootstrap (over prompts or clusters), bands, q-values, paired differences
114
116
  results.py summary.json and results.parquet
117
+ runs.py the per-prompt evidence behind one site's number
118
+ report.py a run as words, and as one self-contained HTML page
119
+ exports.py CSV exports of a saved run
115
120
  schema.py schemas for run files, history listings and live events
116
121
  fileio.py atomic writes that never follow symlinks
122
+ project.py project folders: where runs, datasets and drafts live, read safely
123
+ research.py research notes and named selections
117
124
  runner.py run a spec end to end (used by the app, the CLI and the Python API)
118
125
  partial.py what a run that stops early keeps of what finished, and what it leaves out
119
126
  owner.py which process runs a run, so a run going elsewhere isn't taken for interrupted
@@ -124,8 +131,12 @@ src/logogram/
124
131
  compare.py run comparisons, paired prompt by prompt where they can be
125
132
  api.py the Python API for notebooks (imported lazily by logogram/__init__.py)
126
133
  analysis.py token strip, baseline check, attention patterns
134
+ inside.py Your text: any text's predictions, logit lens, attention and features
135
+ heads.py the head finder: previous-token, duplicate-token and induction heads
127
136
  backends/ ModelBackend interface, TransformerLens backend, Hugging Face access,
128
- published SAE formats
137
+ published SAE formats, the catalogue of published SAEs (SAELens's
138
+ registry, built by scripts/sae_catalogue.py)
139
+ local_models.py models from folders on this machine, found by the hash of their files
129
140
  server/ FastAPI app, security, response models, job and event handling
130
141
  system.py hardware report, doctor, memory estimates, the environment (logogram env)
131
142
  support.py the problem report: versions and the last error, no names or paths
@@ -133,6 +144,8 @@ src/logogram/
133
144
  cli.py typer command line
134
145
  web_dist/ built web app (generated by `npm run build` in web/, committed)
135
146
  gallery.py the bundled examples: what each asks, and the result to expect
147
+ toys.py toy models whose circuits are known (weights set by hand), their datasets,
148
+ and experiments that say what each method should find
136
149
  examples/ the example projects (IOI, greater-than, factual recall, gendered pronoun
137
150
  on GPT-2 small): a spec and a dataset each
138
151
  web/ React + TypeScript + Vite sources
@@ -2,6 +2,114 @@
2
2
 
3
3
  What changed in each version of Logogram.
4
4
 
5
+ ## 0.6.0 (2026-10-12)
6
+
7
+ Interventions on single queries, keys, values and neurons, and on the edges between components,
8
+ estimated by edge attribution and checked by path patching. Prompt pairs whose prompts tokenize
9
+ to different lengths. Published SAEs found by name. Two toy models whose circuits are known, to
10
+ check every method against.
11
+
12
+ ### Added
13
+
14
+ - **Queries, keys, values and neurons as sites.**
15
+ - Site kinds `q`, `k` and `v`: one head's query, or one key/value head's key or value. With
16
+ grouped-query attention, a key/value head is read by every query head of its group.
17
+ - Site kind `neuron`: one MLP neuron's activation after the nonlinearity (for a gated MLP, the
18
+ gate's activation times the up projection).
19
+ - The scopes `head_inputs` and `neurons`.
20
+
21
+ When a model loads, Logogram measures what these sites assume:
22
+
23
+ - queries, keys and values together reproduce the attention output, and neurons the MLP
24
+ output;
25
+ - replacing one changes only the heads that read it.
26
+
27
+ It offers only the sites that hold, and says why for the rest. Activation patching, ablation,
28
+ attribution patching and sets of sites take them. Direct logit attribution reads neurons and
29
+ values, and refuses queries and keys with the reason. Results show head inputs as the layer ×
30
+ head map. Neurons are shown layer by layer: the distribution of every neuron's effect, beside
31
+ the strongest.
32
+ - **Edge attribution** (`edge_attribution`, with the `graph` scope). EAP (Syed et al. 2023) and
33
+ EAP-IG (Hanna et al. 2024) estimate every edge of the model's graph. An edge runs from the
34
+ embeddings, a head or an MLP into a later head's query, key or value, a later MLP's input, or
35
+ the logits.
36
+ - Each receiver reads its own copy of the residual stream. Before the first use, the backend
37
+ measures that this reproduces the model.
38
+ - A run keeps every edge's per-prompt values and statistics, and its corrections count every
39
+ edge.
40
+ - An optional faithfulness curve patches the k strongest edges together (or every edge but
41
+ them), beside edges chosen at random with a seed.
42
+ - **Verify** path-patches the strongest edges one at a time (the `edges` scope). It puts each
43
+ estimate beside its measurement, with their rank correlation (`logogram verify`,
44
+ `lg.verify_run`, `lg.edge_verification`).
45
+ - Before a run starts, the app says the graph's size, the passes and the memory it needs.
46
+ - The app draws the strongest edges, with the curve and the verification beside them. The
47
+ report draws them as SVG.
48
+
49
+ Path patching also takes MLP receivers, and the embeddings as a sender.
50
+ - **Prompt pairs of different lengths.** Such a pair is usable when `corrupt_positions` labels
51
+ the same positions in the corrupt prompt as `positions` does in the clean one.
52
+ - A site at a label or at the last token is patched from the source prompt's token there into
53
+ the receiver's.
54
+ - Where a value is carried between such prompts, every position and token indices are refused.
55
+ So are integrated gradients, edge attribution and sets that replace every position. Each
56
+ refusal names the pairs and says what to choose instead.
57
+ - Datasets of equal-length pairs give the same numbers as before, bit for bit.
58
+ - The prompts table, the token strip and the editor show both prompts lined up by label.
59
+ - The form offers only positions a method can match, and a run says which of its pairs were
60
+ matched this way.
61
+ - Task generators take `full_vocabulary`: words of several tokens are kept, and both prompts
62
+ are labelled.
63
+ - **Published SAEs by name.** Logogram ships a catalogue of the 13,857 SAEs in the 170 releases
64
+ of SAELens's registry (sae-lens 6.54.0). Each entry gives the SAE's model, hook, width and
65
+ architecture, and whether Logogram reads it exactly or why not; 440 were checked on their real
66
+ files.
67
+ - **Load an SAE** searches the loaded model's SAEs by release, hook, layer and width.
68
+ - `logogram saes MODEL`, `lg.list_saes` and `lg.load_sae(release=..., sae_id=...)` do the same.
69
+ - Nothing is fetched to list them. Specs still record the repository, folder and revision.
70
+ - **Toy models whose circuits are known.** Two small GPT-2 checkpoints have weights set by hand:
71
+ - an induction toy: a previous-token head, and an induction head that reads it through its key;
72
+ - an IOI toy: GPT-2 small's circuit with one head per step.
73
+
74
+ `logogram toy NAME` and `lg.toy_model(name)` write a project holding the model, its datasets,
75
+ and experiments whose notes say what each method should find. The model is added to the local
76
+ models and named by the hash of its files, the same on every machine. Loading a toy checks that
77
+ it solves its prompts and that its planted heads attend as built.
78
+
79
+ Tests check every method against the toys:
80
+ - patching, path patching, edges, sets of sites, direct logit attribution, steering and the
81
+ head finder;
82
+ - attribution patching and edge attribution. These are exact where the path is linear and blind
83
+ through saturated attention. Integrated gradients recover what one gradient misses where the
84
+ path between the prompts is smooth enough.
85
+ - **Documentation**:
86
+ - a page on edge attribution;
87
+ - a guide to checking a method on a toy model;
88
+ - the pages on activation patching, attribution patching, path patching, direct logit
89
+ attribution, circuits, SAE features and the model checks now cover the new sites, pairs of
90
+ different lengths and published SAEs by name.
91
+
92
+ ### Changed
93
+
94
+ - Spec version 3 is unchanged. The new sites, scopes and experiment are new members of its
95
+ unions, and every existing spec reads and runs as before.
96
+ - These SAEs now load:
97
+ - SAELens's earlier files that hold a `scaling_factor` of ones their configuration doesn't
98
+ mention (ones change nothing).
99
+
100
+ These are refused before anything is downloaded, saying why:
101
+
102
+ - any other `scaling_factor`;
103
+ - normalizing activations;
104
+ - settings that SAELens's registry applies but a configuration doesn't state.
105
+
106
+ ### Fixed
107
+
108
+ - On Windows, taking the last run out of the queue while a tab read it stopped the queue with the
109
+ run still in it. Removing a file being read now retries briefly there, as replacing one did.
110
+ - A word that a word-level tokenizer doesn't know was taken for a single token, its unknown token,
111
+ which stands for every such word. It no longer is.
112
+
5
113
  ## 0.5.0 (2026-10-12)
6
114
 
7
115
  Chat models on their own template, your own fine-tunes, findings checked across seeds and
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: logogram
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: A local-first workbench for causal experiments inside language models.
5
5
  Project-URL: Homepage, https://github.com/Jeevash23/logogram
6
6
  Project-URL: Source, https://github.com/Jeevash23/logogram
@@ -140,8 +140,8 @@ The [documentation](docs/README.md) teaches the app and the methods:
140
140
  for, and [Models](docs/models.md) which models load and how.
141
141
  * [Concepts](docs/README.md#concepts): what each method computes, exactly, and the papers it
142
142
  comes from: activation patching, ablation, metrics and normalization, statistics, attribution
143
- patching, path patching, direct logit attribution, steering, SAE features, circuits, and the
144
- logit lens with the checks each model passes when it loads.
143
+ patching, path patching, edge attribution, direct logit attribution, steering, SAE features,
144
+ circuits, and the logit lens with the checks each model passes when it loads.
145
145
  * [How-to guides](docs/README.md#how-to-guides): replicate IOI, find induction heads, work with
146
146
  an SAE, check a finding's robustness, compare runs, sweep seeds, datasets or checkpoints, queue
147
147
  runs and run them headless, run a chat model on its template, study your own fine-tune, share a
@@ -173,6 +173,48 @@ small (revision `607a30d`), and the results show them under the run's title.
173
173
  Once a week, the Golden workflow runs every example on GPT-2 small's real weights and checks these
174
174
  findings (see Development).
175
175
 
176
+ ## Toy models
177
+
178
+ Two small models come with Logogram whose circuits are known, because their weights were set by
179
+ hand: learn the methods on a model whose answer you know, or check that a method finds what is
180
+ there. `logogram toy induction` (or `lg.toy_model("induction")`) writes a project, by default
181
+ `Documents/Logogram/toy-induction`, holding the model's files (a GPT-2 checkpoint in safetensors,
182
+ which loads through the same code as any model), its datasets, and experiments whose notes say
183
+ what each should find. It adds the model to this machine's local models as `toy-induction`, so
184
+ specs name it by the hash of its files, the same on every machine, then loads it and checks that
185
+ it solves every prompt and that each planted head attends where it was built to.
186
+
187
+ | Toy | What is planted | Task |
188
+ |---|---|---|
189
+ | `induction` | Two layers of four heads, attention only. L0 H2 is a previous-token head; L1 H1 an induction head, whose key reads L0 H2 | “… A B … F C … A” → “ B”; the corrupt prompt swaps A and F, → “ C” |
190
+ | `ioi` | Four layers of four heads: GPT-2 small's circuit, one head per step. L0 H2 previous-token; L1 H1 induction (finds the repeated name, copies which slot it was in); L2 H3 S-inhibition (moves the slot to the last token through its value); L3 H0 name mover (its query turns away from that slot) | “Once Mary and John reached the store, John threw a drink to” → “ Mary”; the flipped prompt → “ John” |
191
+
192
+ What each method finds, as normalized effects (every other head 0):
193
+
194
+ | Method | Induction toy | IOI toy |
195
+ |---|---|---|
196
+ | Head finder | L0 H2 previous-token (1.0), L1 H1 induction (1.0); on sequences of 32 tokens no other head scores above 0.06 | the same heads |
197
+ | Patching each head | L0 H2 and L1 H1, 1.0 each | L1 H1, L2 H3 and L3 H0, 1.0 each; L0 H2 0, since it writes the same in both prompts |
198
+ | Patching queries, keys, values | L0 H2's value and L1 H1's key | L1 H1's query, L2 H3's value, L3 H0's query |
199
+ | Path patching | L0 H2 → L1 H1's key 1.0 (its query and value 0) | L1 H1 → L2 H3's value, L2 H3 → L3 H0's query, 1.0 each |
200
+ | Sets of sites | the planted heads alone: faithfulness 1.0; the other heads alone: 0 | the same |
201
+ | Direct logit attribution | L1 H1 writes all of the logit difference | L3 H0 writes all of it |
202
+ | Attribution patching | L1 H1 1.0, exact; L0 H2 0, though patching gives 1.0: it acts through saturated attention, whose gradient is about e⁻²⁰. Integrated gradients: 0.47 with 8 steps, 0.92 with 16, 0.999 with 32 | L3 H0 1.0; the upstream heads stay near 0, even with 64 steps of integrated gradients |
203
+ | Steering | none: the difference is a token's identity, not a direction | on ABBA prompts, the mean difference after layer 2 at the last token flips the answer (1.0 at ×1, 2/3 at ×0.5) and beats a random direction; with ABBA and BABA mixed it cancels to 0 |
204
+ | Edges, each path patched alone | 1.0 for each planted edge along which the prompts differ (the embeddings → L0 H2's value, L0 H2 → L1 H1's key, L1 H1 → the logits), 0 for the others | 1.0 for the embeddings → L1 H1's query, L1 H1 → L2 H3's value, L2 H3 → L3 H0's query and L3 H0 → the logits, 0 for the others |
205
+ | Edge attribution | one gradient: L1 H1 → logits 1.0, exact; edges into queries and keys about 0. With 32 steps of integrated gradients, L0 H2 → L1 H1's key about 1.0 | one gradient: L3 H0 → logits 1.0, exact; edges into queries and keys about 0 |
206
+
207
+ How the weights do it: every direction of the residual stream is one named feature (a token's
208
+ identity, the previous token's, the token to predict, the position p/128 and its square, a few
209
+ flags), and every attention score is a sum of a query feature times a key feature, set so that a
210
+ planted head's target wins by 20 nats: it gets all but 10⁻⁸ of the attention. The layer norms'
211
+ epsilon is 2²⁰, so they divide by a fixed 2¹⁰ to within a part in a million, and the circuit's
212
+ arithmetic is exact: patching, path patching, sets and direct effects come out within 10⁻⁶ of the
213
+ designed values. The other heads attend to the first token, to themselves or evenly, and write
214
+ where nothing reads; the MLPs write nothing. `logogram.toys` holds each toy's planted heads and
215
+ the compositions between them (which head writes what which input of which head reads), and makes
216
+ prompts whose corruption reaches the induction head through its key, its value or its query.
217
+
176
218
  ## Explore, experiment, evidence
177
219
 
178
220
  The workbench has three workspaces, described view by view in [the workbench](docs/workbench.md):
@@ -207,7 +249,8 @@ logogram delete RUN delete a run's folder for good, after asking (--ye
207
249
  logogram show RUN a finished run's method, baseline and strongest sites, or why it failed
208
250
  logogram compare RUN RUN how two runs agree, with paired differences where they can be paired
209
251
  logogram diff A B every choice that differs between two runs or spec files
210
- logogram verify RUN patch the strongest sites of an attribution patching run, and compare
252
+ logogram verify RUN patch the strongest sites of an attribution patching run (path-patch
253
+ an edge attribution run's strongest edges), and compare
211
254
  logogram robustness RUN rerun with one choice changed (--experiment JSON, or --dtype)
212
255
  logogram sweep SPEC_OR_RUN the same spec across seeds, datasets or revisions, one run each (--csv FILE)
213
256
  logogram export RUN a run's per-prompt values as CSV (-o FILE; --sites, --prompt-text)
@@ -218,10 +261,12 @@ logogram queue list the queued runs, and whether the queue is paused o
218
261
  logogram queue clear take every run out of the queue, after asking (--yes doesn't ask)
219
262
  logogram queue run run the queue to the end, one run at a time, without the app
220
263
  logogram tasks the tasks Logogram writes prompts for, with their options
264
+ logogram saes MODEL [WORDS] the published SAEs for a model, and whether Logogram reads each exactly
221
265
  logogram generate TASK a seeded dataset for a task (-n N --seed S, --option NAME=VALUE)
222
266
  logogram models add PATH --name NAME add a model folder on this machine (its files are hashed)
223
267
  logogram models list the model folders added here, with their hashes
224
268
  logogram models remove NAME forget a model folder (its files stay)
269
+ logogram toy [NAME [FOLDER]] a model whose circuit is known, with experiments that say what each finds
225
270
  logogram doctor environment and hardware report, with fixes (each GPU by its cuda:N)
226
271
  logogram env the versions and devices results depend on, as JSON (--requirements pins them)
227
272
  logogram doctor --report a short report to paste into an issue (--hardware adds the hardware)
@@ -308,6 +353,13 @@ estimate = lg.run(lg.load_spec({**spec.model_dump(), "experiment": {
308
353
  "method": "integrated_gradients", "steps": 8}}), project, model=model)
309
354
  checked = lg.verify_run(estimate, top=10) # patch the strongest estimates for real
310
355
  lg.compare_runs(estimate, checked) # rank correlation, paired differences
356
+ edges = lg.run(lg.load_spec({**spec.model_dump(), "scope": {"kind": "graph", "layers": None,
357
+ "logits": True}, "experiment": {"kind": "edge_attribution", "direction": "corrupt_to_clean",
358
+ "method": "gradient", "steps": None, "curve": {"counts": [10, 100, 1000], "patch": "rest",
359
+ "control": {"seed": 0, "draws": 1}}}}), project, model=model)
360
+ edges.edges() # every edge: its estimate, interval, simultaneous band and q-value
361
+ edges.curve() # the faithfulness of the k strongest edges, and of k chosen at random
362
+ lg.edge_verification(edges, lg.verify_run(edges, top=20)) # each edge against path patching
311
363
  lg.check_robustness(run, experiment={"kind": "ablation", "baseline": {"kind": "zero"}})
312
364
  seeds = lg.sweep(run, field="statistics.seed", values=[0, 1, 2, 3]) # one run per value
313
365
  seeds.table() # the strongest sites at every value, and whether they keep sign and size
@@ -316,11 +368,15 @@ records = lg.generate("greater_than", 200, seed=0, model=model)
316
368
  lg.write_dataset(project, "greater-than", records)
317
369
 
318
370
  sae = lg.load_sae("jbloom/GPT2-Small-SAEs-Reformatted", "blocks.8.hook_resid_pre", model=model)
371
+ lg.list_saes(model, "layer 8") # SAELens's registry for this model, and what Logogram reads of each
372
+ sae = lg.load_sae(release="gpt2-small-res-jb", sae_id="blocks.8.hook_resid_pre", model=model)
319
373
  lg.feature_writes(model, sae, 1234, "When Mary and John went to the store, John gave a drink to",
320
374
  prepend_bos=True) # the tokens the feature promotes and suppresses directly
321
375
 
322
376
  lg.add_local_model("~/models/my-fine-tune", "my-fine-tune") # hash a model folder, once
323
377
  tuned = lg.load_model("my-fine-tune", device="cuda:1") # a local model, on the second GPU
378
+ toy = lg.toy_model("ioi") # a model whose circuit is known: project, datasets, experiments
379
+ toy.run("which-heads").sites() # L1 H1, L2 H3 and L3 H0 at 1.0, every other head at 0
324
380
  chat = lg.load_model("Qwen/Qwen2.5-0.5B-Instruct")
325
381
  lg.look(chat, "The capital of France is", prepend_bos=False,
326
382
  chat_template={"kind": "user_turn", "system": None}) # read in its own chat template
@@ -450,7 +506,8 @@ A dataset is a JSONL file in the project's `datasets/` folder, one prompt pair p
450
506
  "positions": {"IO": [5, 9], "S1": [14, 18], "S2": [38, 42], "end": [56, 58]}}
451
507
  ```
452
508
 
453
- * `clean` and `corrupt` must tokenize to the same length, so positions line up.
509
+ * `clean` and `corrupt` usually tokenize to the same length, so positions line up. Prompts of
510
+ different lengths need `corrupt_positions` (below).
454
511
  * `answer` and `distractor` are usually single tokens (with a leading space). Either can also be a
455
512
  list of single tokens, read as one answer whose probability is their sum (in greater-than, every
456
513
  year after the start year), or text of several tokens, a continuation whose probability is the
@@ -459,11 +516,25 @@ A dataset is a JSONL file in the project's `datasets/` folder, one prompt pair p
459
516
  * `positions` is optional: named character spans in the clean prompt. A label refers to the last
460
517
  token that overlaps its span. Named positions let you patch at, say, `S2` across templates of
461
518
  different lengths.
519
+ * `corrupt_positions` gives the same labels as character spans in the corrupt prompt, as in
520
+ `{"IO": [5, 9], "S1": [14, 18], "S2": [38, 49], "end": [63, 65]}` for a corrupt prompt that
521
+ names "Bartholomew" where the clean one names "John". With it, the two prompts may tokenize to different lengths: a run
522
+ matches them label by label, carrying the source prompt's token at a label (or its last token)
523
+ into the receiver's token there. Every position and token indices have no meaning across
524
+ different lengths, so a method that carries values between the prompts (patching, attribution
525
+ patching with one gradient, path patching, mean and resample ablation, steering by the mean
526
+ difference) refuses them on such pairs, naming the pairs; zero ablation, direct logit
527
+ attribution and steering along an SAE feature read one prompt at a time and take any position
528
+ they otherwise take. Integrated gradients, edge attribution and path patching of edges (an edge
529
+ carries its sender's output at every position), sets that keep their sites and patch the rest,
530
+ and mean or resample ablation of sets need pairs of equal length. Pairs of equal length may
531
+ give `corrupt_positions` too.
462
532
  * `meta` is optional: anything about the prompt, such as `{"template": "went"}`. The bootstrap can
463
533
  resample prompts by one of its fields (see Statistics).
464
534
 
465
535
  The app shows both prompts token by token, highlights where they differ, and refuses to run on
466
- prompts that can't be used, saying which and why.
536
+ prompts that can't be used, saying which and why. Prompts of different lengths are lined up by
537
+ their labels, each with its own positions, and the prompts table shows both prompts' labels.
467
538
 
468
539
  **Editing prompts.** The Prompts view searches a dataset's pairs (both prompts, the answers and
469
540
  `meta`), shows them a hundred at a time, and edits or removes pairs, including answer sets and
@@ -485,8 +556,12 @@ records each prompt's template in `meta`:
485
556
  | `factual_recall` | a country's capital | another country | logit difference (log-probability difference for capitals of several tokens) |
486
557
 
487
558
  With a model loaded, the app keeps only words that are single tokens for it. Each task says how
488
- many distinct prompts its templates allow; a request for more is refused. GPT-2 small does all of
489
- them but the docstring task, where it prefers the right argument in about half the prompts.
559
+ many distinct prompts its templates allow; a request for more is refused. The `full_vocabulary`
560
+ option keeps every word, also those the model splits, and the pairs whose prompts then differ in
561
+ length, labelling both prompts' positions and recording `"vocabulary": "full"` in each prompt's
562
+ `meta` (IOI's names of several tokens are then read with the log-probability difference). GPT-2
563
+ small does all of them but the docstring task, where it prefers the right argument in about half
564
+ the prompts.
490
565
 
491
566
  ## Experiments
492
567
 
@@ -555,6 +630,49 @@ only queries can be receivers. Tests check that from the last layer to the logit
555
630
  whole effect, exactly as patching measures it. **Check robustness** offers holding or releasing
556
631
  the MLPs, the opposite direction, and the senders' whole effect by patching.
557
632
 
633
+ **Edge attribution** estimates which edges of the model's graph carry the behavior (EAP, Syed et
634
+ al. 2023; with integrated gradients, EAP-IG, Hanna et al. 2024). The graph's nodes are the
635
+ embeddings, every attention head's output, every MLP and the logits. An edge runs from a node's
636
+ output to a later node's input through the residual stream: a head's query, key and value are an
637
+ edge each, an MLP's input one and the logits one, so GPT-2 small has 32,491 edges. An edge's
638
+ estimate is (the sender's output on the source prompt − on the receiver prompt) · the gradient of
639
+ the metric with respect to the receiver's own copy of the residual stream, summed over positions.
640
+ The gradient goes through the receiver's normalization with its scale recomputed from its input,
641
+ as patching the edge would recompute it (holding the scale, as direct logit attribution does, would
642
+ linearize another function). Tests check it against finite differences on tiny models, and that
643
+ each estimate is the slope of patching its edge. Every edge keeps its per-prompt values and
644
+ statistics: the summary lists the strongest 2,000, and edges.parquet in the run's folder holds
645
+ them all (Export → every edge as CSV). Before a run, the form says the graph's size and what the
646
+ run costs; a graph of more than 100,000 edges, more than 10 million per-prompt values or a batch
647
+ that won't fit in memory is refused with what to change. **Verify top 20 by path patching**
648
+ measures the strongest edges one at a time (each sender path-patched into its receiver alone,
649
+ every other head and MLP held) and shows each edge's estimate beside its measurement, with their
650
+ rank correlation. On the 32 IOI prompts with GPT-2 small, on two CPU threads, one gradient takes
651
+ about a minute and 8 steps of integrated gradients three and a half; path patching the 50
652
+ strongest edges takes four to six. Their rank correlation with the estimates is 0.89 (47 of 50
653
+ with the same sign), and 0.93 with integrated gradients (49 of 50). One gradient misses the
654
+ embeddings' edge into the first MLP (estimated −0.05, path patching 0.99), which integrated
655
+ gradients find (0.67).
656
+
657
+ The **faithfulness curve** keeps the k strongest edges as a circuit, for each k you choose: the
658
+ receiver prompts run with only those edges carrying the source prompt's values (`"patch":
659
+ "chosen"`), or every edge but them (`"rest"`), beside edges chosen at random (seeded draws).
660
+ Faithfulness is the share of the gap from no edge chosen (0) to every edge chosen (1) that the
661
+ chosen edges close. Edge patching is exact: each receiver reads its own input plus, for every
662
+ patched edge into it, the sender's output on the source prompt minus its output in that run, so
663
+ patching every edge reproduces the source run and patching none the receiver run (tests check
664
+ both, and a run whose graph is the whole model says how far its every-edge pass is from the source
665
+ run). Each k costs one patched
666
+ forward pass per batch, and one more per random draw. In the IOI example, with every edge but the
667
+ chosen carrying the corrupt prompts' values, the 1,000 strongest edges (3% of the graph) keep 0.80
668
+ of the behavior [0.74, 0.86] and the 3,000 strongest 0.96, where as many edges chosen at random
669
+ keep none of it.
670
+
671
+ Edge attribution needs heads that each write into the residual stream and receivers that can each
672
+ read their own copy of it. Logogram measures both when a run starts, and refuses models that
673
+ normalize after combining heads (Gemma 2, OLMo 2) or whose heads share keys and values
674
+ (grouped-query attention, as in Llama and Qwen), which it doesn't build edges for yet.
675
+
558
676
  **Steering** adds a direction to the residual stream and measures what it does. At each steered
559
677
  site (one residual stream state per layer, or chosen ones, at one token of each prompt) the
560
678
  direction is the mean difference between the two prompts of each pair, from the prompts you steer
@@ -609,8 +727,10 @@ muted), and included in the HTML report.
609
727
 
610
728
  **SAE features.** A sparse autoencoder (SAE) rewrites one of the model's activations as a few active
611
729
  features out of thousands, each a direction in the model, plus an error it misses. In
612
- **Explore → Features**, load a published SAE from Hugging Face (Logogram suggests ones made for the
613
- suggested models, or give any repository), then **Measure the fit** on your prompts: the fraction
730
+ **Explore → Features**, load a published SAE: one of those SAELens's registry lists for the loaded
731
+ model, found by release, hook, layer or width and marked with whether Logogram reads it exactly
732
+ (see *Published SAEs by name* below), or any Hugging Face repository and folder. Then **Measure the
733
+ fit** on your prompts: the fraction
614
734
  of the activations' variance the SAE explains, how many features fire per token, and the logit
615
735
  difference with the SAE's reconstruction spliced in. SAEs only fit activations like those they were
616
736
  trained on, so a poor fit (for example with TransformerLens's weight processing switched the other
@@ -654,8 +774,10 @@ reproduce exactly (such as sparsify's group-max activation, or settings from for
654
774
  feature's value comes from the MLP's input, and patching it changes the MLP's output along the
655
775
  feature's decoder direction. **Skip transcoders** also add their input times a matrix:
656
776
  EleutherAI's add `x @ W_skip.T`, as sparsify computes it, and Gemma Scope 2's affine ones add
657
- `x @ affine_skip_connection` (on Gemma 3 270M this explains 91% of an MLP output's variance, and
658
- the transpose 34%, so this is the way round the files mean). The input doesn't change when a
777
+ `x @ affine_skip_connection`: their matrices are square, but on Gemma 3 270M the affine transcoders
778
+ of layers 5, 12 and 15 explain 99%, 85% and 79% of their MLP outputs' variance read this way, and
779
+ 37%, 9% and less than nothing transposed, so this is the way round the files mean (SAELens 6.54.0
780
+ adds the transpose). The input doesn't change when a
659
781
  feature is patched, so neither does the skip connection, and attribution patching reports the
660
782
  part of the site's estimate that flows through it beside the features' part. sparsify files
661
783
  written before February 2025 don't record whether they are transcoders, so Logogram reads it from
@@ -669,12 +791,54 @@ fit measured on your prompts remains the last check, since a file can be trained
669
791
  configuration doesn't record: EleutherAI's SmolLM2 skip transcoders were trained on normalized
670
792
  inputs and outputs, which only their model card says, and they fit poorly as published.
671
793
 
794
+ **Published SAEs by name.** People find SAEs by their SAELens release and id
795
+ (`gpt2-small-res-jb`, `blocks.8.hook_resid_pre`); Logogram ships a catalogue of the 13,857 SAEs in
796
+ the 170 releases of SAELens 6.54.0's registry, with the model each was trained on, its repository
797
+ and folder, the hook it reads, its width, the architecture its configuration states, and whether
798
+ Logogram reads it exactly or why not. Logogram reads 9,035 of them exactly: GPT-2 small's SAELens
799
+ SAEs (Joseph Bloom's, the feature-splitting ones and Apollo Research's), OpenAI's TopK SAEs on it
800
+ but for those between attention and MLP, Pythia-70m's, Gemma 2B's, the matryoshka SAEs for Gemma
801
+ 2 and Gemma 3 1B, and all of Gemma Scope 2's SAEs and transcoders. Most of the others are the first
802
+ Gemma Scope's NumPy archives, PyTorch pickles (which Logogram never opens), formats it doesn't read
803
+ yet (Llama Scope's, circuit-tracer's transcoders) and cross-layer transcoders. The verdicts come
804
+ from Logogram's own readers run on each SAE's configuration (and, for SAELens's format, its weights
805
+ file's header), and they were checked on the real files, which the catalogue records: 424 SAEs
806
+ across every release Logogram reads by their weights file's header, and 16 on GPT-2 small,
807
+ Pythia-70m and Gemma 3 270M by their weights and their fit to the model. An SAE that SAELens's
808
+ registry reads with settings its own configuration
809
+ doesn't state (Mistral 7B's, which SAELens rescales) is refused before anything downloads, also
810
+ when named by its folder. The catalogue is part of the package and is never fetched;
811
+ `scripts/sae_catalogue.py` builds it from a sae-lens wheel, and SAELens's MIT notice travels with
812
+ it. `logogram saes MODEL` lists a model's SAEs, and `lg.load_sae(release=..., sae_id=...)` loads
813
+ one. However an SAE is chosen, specs record its repository, folder and revision, pinned when it
814
+ loads.
815
+
672
816
  **Sites** are abstract: `resid_pre`, `resid_mid`, `resid_post`, `attn_out`, `mlp_out` and `head`
673
817
  (an attention head's output `z`), each at a layer, head and position. Positions are `all`,
674
818
  `last`, a token `index` or a named `label`. **Sweeps** cover every head at one position
675
819
  (layer × head), one stream site at every layer and position (layer × position), or attention
676
820
  and MLP outputs per layer.
677
821
 
822
+ **Queries, keys, values and neurons** are finer sites: `q` (one head's query), `k` and `v` (one
823
+ key/value head's key or value) and `neuron` (one MLP neuron's activation after its nonlinearity,
824
+ for a gated MLP the gate's activation times the up projection: the input to the MLP's output
825
+ projection), such as `{"kind": "q", "layer": 9, "head": 6, "position": …}` or
826
+ `{"kind": "neuron", "layer": 3, "neuron": 1201, "position": …}`. With grouped-query attention
827
+ (Llama 3, Qwen 2.5 and Gemma 2, among others) a model has fewer key and value heads than query
828
+ heads: a key or value site names a key/value head, which every query head of its group reads, so
829
+ patching it changes all of them. The scopes `head_inputs` and `neurons` sweep every head's query,
830
+ key or value, and every neuron of chosen layers; the app shows the first as a layer × head map,
831
+ and the second layer by layer, each layer's strongest neurons with their intervals beside the
832
+ distribution of all of them. When a model loads, Logogram measures that these sites make up its
833
+ attention and MLP outputs (all queries, keys and values together reproduce the attention output,
834
+ one alone changes only the heads that read it, all neurons together reproduce the MLP output)
835
+ and offers only those that hold: OLMo 2 normalizes every head's queries and keys together, so it
836
+ offers values and neurons but not single queries or keys. Patching, ablation, attribution
837
+ patching and sets of sites take them. Direct logit attribution reads a neuron at the last token
838
+ and a value at any position (through the heads that read it, their attention patterns as in the
839
+ run). It refuses queries and keys, which act only through the softmax, and neurons of models
840
+ that normalize the MLP's output (Gemma 2, OLMo 2), where no neuron writes a term of its own.
841
+
678
842
  **Sets of sites** test a circuit. A `site_sets` scope lists sets of sites, each intervened on at
679
843
  once, in one forward pass: one result per set. A set marked `complement` intervenes on every
680
844
  component of the scope's `universe` (every head, or every attention and MLP output, at every
@@ -770,8 +934,8 @@ without continuations.
770
934
  | `tokenization.chat_template` | `null` feeds each prompt as raw text. `{"kind": "user_turn", "system": null}` makes each prompt the person's message in the model's own chat template, so the answer is the first token of the reply; `{"kind": "assistant_prefix", "system": null, "user": "…"}` makes it the start of the model's reply to a fixed message. `system` is an optional system message. The template is the one the tokenizer ships at the model's revision (see [Chat templates](#chat-templates)). With a template, `prepend_bos` is `false`: the template writes the beginning of the text. |
771
935
  | `model.process_weights` | Fold LayerNorm and center weights, as TransformerLens does by default. Logit differences don't change. Value biases are folded into the attention output's bias, so zero ablation of head outputs and heads' direct effects do change (by up to several logits in Qwen 2.5, whose value biases are large); a layer's attention output doesn't. |
772
936
  | `dataset.sha256` | If set, the run refuses a dataset file that has changed. |
773
- | `experiment` | `{"kind": "activation_patching", "direction": "clean_to_corrupt" \| "corrupt_to_clean"}`, `{"kind": "ablation", "baseline": …}` with `{"kind": "zero"}`, `{"kind": "mean", "reference": "clean" \| "corrupt"}` or `{"kind": "resample", "pool": "clean" \| "corrupt", "donors": 10, "seed": 0}`, `{"kind": "attribution_patching", "direction": …, "method": "gradient", "steps": null}` (same directions as patching; or `"method": "integrated_gradients", "steps": 8`), `{"kind": "direct_logit_attribution", "prompts": "clean" \| "corrupt"}`, `{"kind": "path_patching", "direction": …, "receivers": [{"kind": "head", "layer": 9, "head": 9, "input": "q" \| "k" \| "v"}, {"kind": "logits"}], "freeze_mlps": false}`, or `{"kind": "steering", "apply_to": "clean" \| "corrupt", "direction": {"kind": "mean_difference"}, "coefficients": [-1, 1, 2], "train_fraction": 0.5, "seed": 0, "control": true, "continuations": null}` with a scope of one residual component per layer (`layer_components`) or residual `sites`, at one token. The direction can instead be one SAE feature's decoder direction, `{"kind": "sae_feature", "feature": 1234}` (with the spec's `sae`, and `sites` naming where the SAE writes), and `continuations` can be `{"prompts": 3, "tokens": 20}` to record what the steered model goes on to say |
774
- | `scope` | `{"kind": "heads", "position": …}`, `{"kind": "layer_position", "site": "resid_pre", "positions": "each" \| "labels"}`, `{"kind": "layer_components", "components": ["attn_out", "mlp_out"], "position": …}` `{"kind": "sites", "sites": [{"kind": "head", "layer": 9, "head": 9, "position": {"kind": "label", "label": "end"}}]}` (feature sites are `{"kind": "sae_feature", "layer": 8, "feature": 1234, "position": …}`), for attribution patching, `{"kind": "features", "position": …, "top": 50, "choose_on": 0.5, "seed": 0}` (`choose_on` and `seed` both `null` to choose and report on every prompt), or `{"kind": "site_sets", "universe": ["head"], "sets": [{"label": "circuit", "sites": […], "complement": true}]}` |
937
+ | `experiment` | `{"kind": "activation_patching", "direction": "clean_to_corrupt" \| "corrupt_to_clean"}`, `{"kind": "ablation", "baseline": …}` with `{"kind": "zero"}`, `{"kind": "mean", "reference": "clean" \| "corrupt"}` or `{"kind": "resample", "pool": "clean" \| "corrupt", "donors": 10, "seed": 0}`, `{"kind": "attribution_patching", "direction": …, "method": "gradient", "steps": null}` (same directions as patching; or `"method": "integrated_gradients", "steps": 8`), `{"kind": "direct_logit_attribution", "prompts": "clean" \| "corrupt"}`, `{"kind": "path_patching", "direction": …, "receivers": [{"kind": "head", "layer": 9, "head": 9, "input": "q" \| "k" \| "v"}, {"kind": "mlp", "layer": 3}, {"kind": "logits"}], "freeze_mlps": false}`, `{"kind": "edge_attribution", "direction": …, "method": "gradient", "steps": null, "curve": {"counts": [10, 100, 1000], "patch": "chosen" \| "rest", "control": {"seed": 0, "draws": 1}}}` (`curve` `null` for none) with a `graph` scope, or `{"kind": "steering", "apply_to": "clean" \| "corrupt", "direction": {"kind": "mean_difference"}, "coefficients": [-1, 1, 2], "train_fraction": 0.5, "seed": 0, "control": true, "continuations": null}` with a scope of one residual component per layer (`layer_components`) or residual `sites`, at one token. The direction can instead be one SAE feature's decoder direction, `{"kind": "sae_feature", "feature": 1234}` (with the spec's `sae`, and `sites` naming where the SAE writes), and `continuations` can be `{"prompts": 3, "tokens": 20}` to record what the steered model goes on to say |
938
+ | `scope` | `{"kind": "heads", "position": …}`, `{"kind": "layer_position", "site": "resid_pre", "positions": "each" \| "labels"}`, `{"kind": "layer_components", "components": ["attn_out", "mlp_out"], "position": …}` `{"kind": "sites", "sites": [{"kind": "head", "layer": 9, "head": 9, "position": {"kind": "label", "label": "end"}}]}` (feature sites are `{"kind": "sae_feature", "layer": 8, "feature": 1234, "position": …}`), `{"kind": "head_inputs", "input": "q" \| "k" \| "v", "position": …}`, `{"kind": "neurons", "layers": [3, 4], "position": …}`, for attribution patching, `{"kind": "features", "position": …, "top": 50, "choose_on": 0.5, "seed": 0}` (`choose_on` and `seed` both `null` to choose and report on every prompt), `{"kind": "site_sets", "universe": ["head"], "sets": [{"label": "circuit", "sites": […], "complement": true}]}`, for edge attribution `{"kind": "graph", "layers": null, "logits": true}` (`layers` the heads and MLPs that receive edges, `null` for every layer), or, for path patching edges one at a time, `{"kind": "edges", "edges": [{"sender": {"kind": "head", "layer": 5, "head": 5}, "receiver": {"kind": "head", "layer": 9, "head": 6, "input": "v"}}]}` (senders `{"kind": "embed"}`, heads or `{"kind": "mlp", "layer": 0}`; `freeze_mlps` true, and the experiment's receivers those of the edges) |
775
939
  | `sae` | The SAE that feature sites belong to: `{"repo": "…", "path": "blocks.8.hook_resid_pre", "revision": "…"}`. The revision is pinned when a run starts. |
776
940
  | `metric` | `{"kind": "logit_diff" \| "logprob_diff" \| "logprob" \| "prob" \| "prob_diff", "normalization": …}` or `{"kind": "kl", "target": "clean" \| "corrupt", "normalization": …}` |
777
941
  | `metric.normalization` | `dataset_gap` or `prompt_gap` |
@@ -1026,7 +1190,8 @@ pairs can't be used, and why:
1026
1190
  log-probability or probability metric, which read answers of several tokens. Prompts generated
1027
1191
  in the app with the model loaded use only words that are single tokens for it.
1028
1192
  * *clean has 15 tokens and corrupt has 16, so positions can't be aligned.* Change what differs
1029
- between the two prompts to words with the same number of tokens.
1193
+ between the two prompts to words with the same number of tokens, or give the pair
1194
+ `corrupt_positions`: its labels in the corrupt prompt, which lets it be patched label by label.
1030
1195
  * *position 'S2' (characters 38–42) doesn't cover any token.* The span's character offsets don't
1031
1196
  reach a token of the clean prompt: correct them.
1032
1197
  * *This model's tokenizer has no beginning-of-sequence token. Set tokenization.prepend_bos to
@@ -1141,6 +1306,12 @@ uv run python scripts/validate_real_weights.py --device mps --compare-device cpu
1141
1306
  Pythia and Qwen 2.5 have also been run end to end with their real weights; other families are
1142
1307
  checked when they load and in the tiny-model tests.
1143
1308
 
1309
+ The catalogue of published SAEs (`src/logogram/backends/sae_catalogue.json`) is rebuilt for a new
1310
+ sae-lens release with `scripts/sae_catalogue.py build --sae-lens WHEEL_OR_SITE_PACKAGES --cache
1311
+ DIR`, which reads each SAE's configuration from Hugging Face into `DIR`, and checked with
1312
+ `scripts/sae_catalogue.py verify --cache DIR --text FILE`, which reads a sample's weights files and
1313
+ runs the small models' SAEs on their models, recording each check in the catalogue.
1314
+
1144
1315
  Model access goes through `logogram.backends.base.ModelBackend`. TransformerLens is the only
1145
1316
  backend today; remote execution and other libraries can be added behind the same interface.
1146
1317
  Not built yet, with room left for them: chat templates for models made for chat, attribution