logogram 0.1.1__tar.gz → 0.2.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 (239) hide show
  1. {logogram-0.1.1 → logogram-0.2.0}/.gitignore +5 -0
  2. {logogram-0.1.1 → logogram-0.2.0}/AGENTS.md +18 -10
  3. logogram-0.2.0/CHANGELOG.md +213 -0
  4. {logogram-0.1.1 → logogram-0.2.0}/PKG-INFO +241 -49
  5. {logogram-0.1.1 → logogram-0.2.0}/README.md +238 -47
  6. {logogram-0.1.1 → logogram-0.2.0}/pyproject.toml +31 -4
  7. {logogram-0.1.1 → logogram-0.2.0}/scripts/check_privacy.py +77 -32
  8. {logogram-0.1.1 → logogram-0.2.0}/scripts/smoke_wheel.py +1 -1
  9. logogram-0.2.0/scripts/validate_real_weights.py +648 -0
  10. logogram-0.2.0/src/logogram/__init__.py +41 -0
  11. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/analysis.py +130 -51
  12. logogram-0.2.0/src/logogram/api.py +397 -0
  13. logogram-0.2.0/src/logogram/atp.py +258 -0
  14. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/backends/base.py +42 -12
  15. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/backends/hub.py +12 -6
  16. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/backends/saes.py +181 -33
  17. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/backends/transformer_lens.py +137 -51
  18. logogram-0.2.0/src/logogram/circuits.py +586 -0
  19. logogram-0.2.0/src/logogram/cli.py +954 -0
  20. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/compare.py +86 -1
  21. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/datasets.py +39 -9
  22. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/direct.py +24 -5
  23. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/engine.py +260 -57
  24. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/examples/ioi-gpt2/experiments/ioi-head-patching/spec.json +3 -2
  25. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/features.py +185 -47
  26. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/fileio.py +35 -1
  27. logogram-0.2.0/src/logogram/metrics.py +277 -0
  28. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/paths.py +38 -14
  29. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/project.py +23 -9
  30. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/prompts.py +126 -35
  31. logogram-0.2.0/src/logogram/results.py +369 -0
  32. logogram-0.2.0/src/logogram/robustness.py +44 -0
  33. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/runner.py +71 -14
  34. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/runs.py +15 -3
  35. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/sae.py +49 -11
  36. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/schema.py +102 -3
  37. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/server/app.py +165 -29
  38. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/server/models.py +66 -2
  39. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/server/security.py +11 -1
  40. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/server/state.py +28 -17
  41. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/sites.py +21 -7
  42. logogram-0.2.0/src/logogram/spec.py +908 -0
  43. logogram-0.2.0/src/logogram/stats.py +309 -0
  44. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/steering.py +94 -22
  45. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/system.py +53 -14
  46. logogram-0.2.0/src/logogram/tasks.py +1011 -0
  47. logogram-0.2.0/src/logogram/web_dist/assets/index-73rNh-lK.js +55 -0
  48. logogram-0.2.0/src/logogram/web_dist/assets/index-B1QioA38.css +1 -0
  49. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/web_dist/index.html +3 -3
  50. {logogram-0.1.1 → logogram-0.2.0}/tests/browser_server.py +2 -1
  51. {logogram-0.1.1 → logogram-0.2.0}/tests/conftest.py +14 -4
  52. logogram-0.2.0/tests/test_api.py +164 -0
  53. {logogram-0.1.1 → logogram-0.2.0}/tests/test_architectures.py +1 -1
  54. {logogram-0.1.1 → logogram-0.2.0}/tests/test_atp.py +30 -4
  55. logogram-0.2.0/tests/test_circuits.py +286 -0
  56. {logogram-0.1.1 → logogram-0.2.0}/tests/test_devices.py +14 -0
  57. {logogram-0.1.1 → logogram-0.2.0}/tests/test_direct.py +1 -1
  58. {logogram-0.1.1 → logogram-0.2.0}/tests/test_engine.py +39 -10
  59. {logogram-0.1.1 → logogram-0.2.0}/tests/test_explorer.py +19 -2
  60. {logogram-0.1.1 → logogram-0.2.0}/tests/test_hardening.py +78 -2
  61. {logogram-0.1.1 → logogram-0.2.0}/tests/test_loading.py +11 -0
  62. logogram-0.2.0/tests/test_metrics.py +323 -0
  63. {logogram-0.1.1 → logogram-0.2.0}/tests/test_paths.py +32 -7
  64. logogram-0.2.0/tests/test_privacy.py +168 -0
  65. {logogram-0.1.1 → logogram-0.2.0}/tests/test_release_fixes.py +1 -0
  66. {logogram-0.1.1 → logogram-0.2.0}/tests/test_sae.py +59 -9
  67. {logogram-0.1.1 → logogram-0.2.0}/tests/test_sanity.py +4 -4
  68. {logogram-0.1.1 → logogram-0.2.0}/tests/test_server.py +66 -6
  69. logogram-0.2.0/tests/test_specs.py +240 -0
  70. logogram-0.2.0/tests/test_statistics.py +158 -0
  71. {logogram-0.1.1 → logogram-0.2.0}/tests/test_steering.py +38 -4
  72. logogram-0.2.0/tests/test_tasks.py +525 -0
  73. logogram-0.2.0/tests/test_transcoders.py +349 -0
  74. {logogram-0.1.1 → logogram-0.2.0}/tests/test_units.py +24 -12
  75. logogram-0.2.0/tests/test_validation_script.py +248 -0
  76. {logogram-0.1.1 → logogram-0.2.0}/uv.lock +273 -39
  77. {logogram-0.1.1 → logogram-0.2.0}/web/index.html +1 -1
  78. {logogram-0.1.1 → logogram-0.2.0}/web/package-lock.json +11 -0
  79. {logogram-0.1.1 → logogram-0.2.0}/web/package.json +1 -0
  80. {logogram-0.1.1 → logogram-0.2.0}/web/playwright.config.ts +6 -1
  81. {logogram-0.1.1 → logogram-0.2.0}/web/src/App.module.css +4 -0
  82. {logogram-0.1.1 → logogram-0.2.0}/web/src/App.tsx +3 -1
  83. {logogram-0.1.1 → logogram-0.2.0}/web/src/api/client.ts +52 -28
  84. {logogram-0.1.1 → logogram-0.2.0}/web/src/api/events.ts +11 -2
  85. {logogram-0.1.1 → logogram-0.2.0}/web/src/api/types.ts +235 -29
  86. logogram-0.2.0/web/src/components/CancelRunDialog.tsx +41 -0
  87. logogram-0.2.0/web/src/components/CircuitDialog.tsx +151 -0
  88. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/CommandPalette.tsx +34 -6
  89. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/CopyCommand.module.css +5 -0
  90. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/CopyCommand.tsx +2 -1
  91. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Distribution.tsx +7 -2
  92. logogram-0.2.0/web/src/components/ErrorBoundary.module.css +46 -0
  93. logogram-0.2.0/web/src/components/ErrorBoundary.tsx +95 -0
  94. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Header.tsx +1 -0
  95. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Heatmap/Heatmap.module.css +13 -0
  96. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Heatmap/Heatmap.tsx +86 -48
  97. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/History.tsx +4 -1
  98. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Inspector.module.css +2 -0
  99. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Inspector.tsx +176 -34
  100. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ModelDialog.tsx +34 -9
  101. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ModelMap/Legend.tsx +1 -1
  102. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ModelMap/ModelMap.module.css +13 -0
  103. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ModelMap/ModelMap.tsx +92 -50
  104. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Notices.module.css +24 -0
  105. logogram-0.2.0/web/src/components/Notices.tsx +42 -0
  106. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/RobustnessDialog.tsx +40 -9
  107. logogram-0.2.0/web/src/components/ShortcutsDialog.module.css +65 -0
  108. logogram-0.2.0/web/src/components/ShortcutsDialog.tsx +127 -0
  109. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Splitter.tsx +11 -1
  110. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/StatusLine.tsx +37 -4
  111. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/TokenStrip.module.css +12 -0
  112. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/TokenStrip.tsx +41 -15
  113. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ui/Icon.tsx +2 -0
  114. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ui/index.tsx +110 -45
  115. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ui/ui.module.css +33 -41
  116. logogram-0.2.0/web/src/lib/analysis.ts +93 -0
  117. logogram-0.2.0/web/src/lib/buildSpec.ts +337 -0
  118. logogram-0.2.0/web/src/lib/circuits.ts +247 -0
  119. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/color.ts +15 -5
  120. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/export.ts +21 -5
  121. logogram-0.2.0/web/src/lib/formDraft.ts +224 -0
  122. logogram-0.2.0/web/src/lib/formHistory.ts +79 -0
  123. logogram-0.2.0/web/src/lib/formState.ts +146 -0
  124. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/format.ts +27 -15
  125. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/hooks.ts +7 -3
  126. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/keys.ts +34 -1
  127. logogram-0.2.0/web/src/lib/metrics.ts +162 -0
  128. logogram-0.2.0/web/src/lib/milestones.ts +36 -0
  129. logogram-0.2.0/web/src/lib/motion.ts +25 -0
  130. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/sites.ts +30 -5
  131. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/spec.ts +81 -84
  132. {logogram-0.1.1 → logogram-0.2.0}/web/src/main.tsx +4 -1
  133. {logogram-0.1.1 → logogram-0.2.0}/web/src/screens/Projects.tsx +3 -3
  134. {logogram-0.1.1 → logogram-0.2.0}/web/src/screens/Screens.module.css +3 -0
  135. {logogram-0.1.1 → logogram-0.2.0}/web/src/screens/SystemCheck.tsx +3 -3
  136. {logogram-0.1.1 → logogram-0.2.0}/web/src/screens/Workbench.module.css +7 -0
  137. {logogram-0.1.1 → logogram-0.2.0}/web/src/screens/Workbench.tsx +22 -6
  138. {logogram-0.1.1 → logogram-0.2.0}/web/src/store/app.ts +350 -151
  139. {logogram-0.1.1 → logogram-0.2.0}/web/src/styles/tokens.css +42 -0
  140. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/AttentionView.tsx +50 -44
  141. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/BaselineView.module.css +24 -0
  142. logogram-0.2.0/web/src/views/BaselineView.tsx +330 -0
  143. logogram-0.2.0/web/src/views/CircuitResults.tsx +289 -0
  144. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/CompareView.tsx +166 -82
  145. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ExperimentView.module.css +17 -0
  146. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ExperimentView.tsx +185 -211
  147. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ExploreView.tsx +22 -7
  148. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/FeaturesView.module.css +3 -0
  149. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/FeaturesView.tsx +16 -11
  150. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/Forest.module.css +8 -0
  151. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/Forest.tsx +14 -2
  152. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/HeadComparisonView.tsx +25 -7
  153. logogram-0.2.0/web/src/views/MetricSettings.tsx +123 -0
  154. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/PredictionsView.tsx +9 -6
  155. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/PromptsView.tsx +76 -139
  156. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ResearchView.tsx +3 -1
  157. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ResultsView.module.css +24 -0
  158. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ResultsView.tsx +239 -69
  159. logogram-0.2.0/web/src/views/SiteSets.module.css +286 -0
  160. logogram-0.2.0/web/src/views/SiteSetsEditor.tsx +232 -0
  161. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/SpecView.tsx +13 -11
  162. logogram-0.2.0/web/src/views/StatisticsSettings.tsx +52 -0
  163. logogram-0.2.0/web/src/views/TaskGenerator.tsx +237 -0
  164. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/views.module.css +12 -0
  165. logogram-0.2.0/web/tests/a11y.browser.ts +83 -0
  166. logogram-0.2.0/web/tests/analyses.browser.ts +141 -0
  167. logogram-0.2.0/web/tests/autosave.unit.ts +231 -0
  168. logogram-0.2.0/web/tests/circuits.unit.ts +179 -0
  169. logogram-0.2.0/web/tests/color.unit.ts +29 -0
  170. {logogram-0.1.1 → logogram-0.2.0}/web/tests/context.unit.ts +55 -2
  171. logogram-0.2.0/web/tests/form.unit.ts +132 -0
  172. logogram-0.2.0/web/tests/heatmap.unit.ts +27 -0
  173. logogram-0.2.0/web/tests/notices.unit.ts +97 -0
  174. logogram-0.2.0/web/tests/spec.unit.ts +229 -0
  175. logogram-0.2.0/web/tests/tasks.unit.ts +54 -0
  176. {logogram-0.1.1 → logogram-0.2.0}/web/tests/workbench.browser.ts +58 -1
  177. logogram-0.1.1/CHANGELOG.md +0 -60
  178. logogram-0.1.1/src/logogram/__init__.py +0 -6
  179. logogram-0.1.1/src/logogram/atp.py +0 -120
  180. logogram-0.1.1/src/logogram/cli.py +0 -506
  181. logogram-0.1.1/src/logogram/results.py +0 -240
  182. logogram-0.1.1/src/logogram/spec.py +0 -518
  183. logogram-0.1.1/src/logogram/stats.py +0 -171
  184. logogram-0.1.1/src/logogram/web_dist/assets/index-CC9_IJY6.js +0 -54
  185. logogram-0.1.1/src/logogram/web_dist/assets/index-Dt6ecB66.css +0 -1
  186. logogram-0.1.1/tests/test_privacy.py +0 -45
  187. logogram-0.1.1/web/src/components/Notices.tsx +0 -22
  188. logogram-0.1.1/web/src/lib/analysis.ts +0 -47
  189. logogram-0.1.1/web/src/views/BaselineView.tsx +0 -228
  190. {logogram-0.1.1 → logogram-0.2.0}/LICENSE +0 -0
  191. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/__main__.py +0 -0
  192. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/backends/__init__.py +0 -0
  193. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/examples/ioi-gpt2/.gitignore +0 -0
  194. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/examples/ioi-gpt2/datasets/ioi.jsonl +0 -0
  195. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/examples/ioi-gpt2/project.json +0 -0
  196. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/exports.py +0 -0
  197. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/ioi.py +0 -0
  198. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/research.py +0 -0
  199. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/server/__init__.py +0 -0
  200. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/updates.py +0 -0
  201. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/verify.py +0 -0
  202. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/web_dist/assets/instrument-sans-latin-ext-standard-normal-C5E2Gvlv.woff2 +0 -0
  203. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/web_dist/assets/instrument-sans-latin-standard-normal-BVScPF0l.woff2 +0 -0
  204. {logogram-0.1.1 → logogram-0.2.0}/src/logogram/web_dist/favicon.svg +0 -0
  205. {logogram-0.1.1 → logogram-0.2.0}/tests/test_cli.py +0 -0
  206. {logogram-0.1.1 → logogram-0.2.0}/tests/test_updates.py +0 -0
  207. {logogram-0.1.1 → logogram-0.2.0}/web/public/favicon.svg +0 -0
  208. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/CommandPalette.module.css +0 -0
  209. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Distribution.module.css +0 -0
  210. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/FolderPicker.module.css +0 -0
  211. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/FolderPicker.tsx +0 -0
  212. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Header.module.css +0 -0
  213. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Heatmap/ScaleBar.tsx +0 -0
  214. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/History.module.css +0 -0
  215. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Logogram.tsx +0 -0
  216. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/LogogramDial.module.css +0 -0
  217. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/LogogramDial.tsx +0 -0
  218. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/ModelDialog.module.css +0 -0
  219. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/Splitter.module.css +0 -0
  220. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/StatusLine.module.css +0 -0
  221. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/TopBar.module.css +0 -0
  222. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/TopBar.tsx +0 -0
  223. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/UpdateNotice.module.css +0 -0
  224. {logogram-0.1.1 → logogram-0.2.0}/web/src/components/UpdateNotice.tsx +0 -0
  225. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/canvas.ts +0 -0
  226. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/heatmapNavigation.ts +0 -0
  227. {logogram-0.1.1 → logogram-0.2.0}/web/src/lib/logogram.ts +0 -0
  228. {logogram-0.1.1 → logogram-0.2.0}/web/src/screens/Welcome.tsx +0 -0
  229. {logogram-0.1.1 → logogram-0.2.0}/web/src/styles/global.css +0 -0
  230. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/AttentionView.module.css +0 -0
  231. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/CompareView.module.css +0 -0
  232. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ExploreView.module.css +0 -0
  233. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/HeadComparisonView.module.css +0 -0
  234. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/PredictionsView.module.css +0 -0
  235. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/ResearchView.module.css +0 -0
  236. {logogram-0.1.1 → logogram-0.2.0}/web/src/views/SpecView.module.css +0 -0
  237. {logogram-0.1.1 → logogram-0.2.0}/web/tests/logogram.unit.ts +0 -0
  238. {logogram-0.1.1 → logogram-0.2.0}/web/tsconfig.json +0 -0
  239. {logogram-0.1.1 → logogram-0.2.0}/web/vite.config.ts +0 -0
@@ -5,6 +5,11 @@ __pycache__/
5
5
  .pytest_cache/
6
6
  .ruff_cache/
7
7
  .mypy_cache/
8
+ # Coverage output (its reports name absolute paths).
9
+ .coverage
10
+ .coverage.*
11
+ htmlcov/
12
+ coverage.xml
8
13
  dist/
9
14
  build/
10
15
  *.egg-info/
@@ -31,12 +31,15 @@ traceability come before features.
31
31
 
32
32
  ## Science rules
33
33
 
34
- * The experiment spec (`src/logogram/spec.py`) is the single source of truth. The app and
35
- `logogram run` execute the same spec through `logogram.runner.run_spec`; never add a code path
36
- that only one of them uses.
34
+ * The experiment spec (`src/logogram/spec.py`) is the single source of truth. The app,
35
+ `logogram run` and the Python API execute the same spec through `logogram.runner.run_spec`;
36
+ never add a code path that only one of them uses.
37
37
  * Every choice that can change a number lives in the spec and is shown in the UI: direction,
38
- baseline, site, position, metric, normalization, seeds, batch size, dtype, model revision.
39
- Nothing methodological is silently defaulted. Ablation has no default baseline.
38
+ baseline, site, position, metric, normalization, seeds, clustering, batch size, dtype, model
39
+ revision. Nothing methodological is silently defaulted: a version 2 spec states every such
40
+ field, and a new one is required (with the value that reproduces earlier behavior filled in
41
+ for version 1 specs by `upgrade_v1`, listed when it was a choice). Ablation has no default
42
+ baseline.
40
43
  * Specs use abstract sites (`resid_pre`, `resid_mid`, `resid_post`, `attn_out`, `mlp_out`,
41
44
  `head`). Library hook names appear only inside a backend (`src/logogram/backends/`).
42
45
  * Keep per-prompt values. Statistics come from them: n, mean, SD, a seeded percentile bootstrap
@@ -92,11 +95,14 @@ traceability come before features.
92
95
 
93
96
  ```text
94
97
  src/logogram/
95
- spec.py experiment spec (pydantic)
98
+ spec.py experiment spec (pydantic); version 1 specs are upgraded here
96
99
  datasets.py, ioi.py JSONL datasets and the IOI generator
97
- prompts.py tokenization, alignment checks, length groups
100
+ tasks.py seeded datasets for the other tasks (greater-than, docstring, ...)
101
+ prompts.py tokenization, alignment checks, length groups, seeded splits
102
+ metrics.py the metrics: answers, answer sets and continuations, scored per prompt
98
103
  sites.py scope expansion and result layouts
99
104
  engine.py the sweep: captures, patches, streams per layer, cancels; routes methods
105
+ circuits.py sets of sites intervened on at once, faithfulness and minimality
100
106
  direct.py direct logit attribution
101
107
  atp.py attribution patching (first-order estimates of patching)
102
108
  verify.py the spec that verifies an estimate by patching its strongest sites
@@ -104,12 +110,14 @@ src/logogram/
104
110
  paths.py path patching
105
111
  features.py SAE features: patching and attribution patching
106
112
  sae.py SAE encode, decode and fit
107
- stats.py bootstrap and summary statistics
113
+ stats.py bootstrap (over prompts or clusters), bands, q-values, paired differences
108
114
  results.py summary.json and results.parquet
109
115
  schema.py schemas for run files, history listings and live events
110
116
  fileio.py atomic writes that never follow symlinks
111
- runner.py run a spec end to end (used by the app and the CLI)
112
- compare.py robustness checks and run comparisons
117
+ runner.py run a spec end to end (used by the app, the CLI and the Python API)
118
+ robustness.py the spec that reruns a run with one choice changed
119
+ compare.py run comparisons, paired prompt by prompt where they can be
120
+ api.py the Python API for notebooks (imported lazily by logogram/__init__.py)
113
121
  analysis.py token strip, baseline check, attention patterns
114
122
  backends/ ModelBackend interface, TransformerLens backend, Hugging Face access,
115
123
  published SAE formats
@@ -0,0 +1,213 @@
1
+ # Changelog
2
+
3
+ What changed in each version of Logogram.
4
+
5
+ ## 0.2.0 (2026-10-11)
6
+
7
+ Specs that state every choice, more metrics, circuits, five more tasks, statistics that hold across
8
+ many sites, a Python API and more commands, Gemma Scope 2 and transcoders, and integrated
9
+ gradients, all checked by patching.
10
+
11
+ ### Changed
12
+
13
+ - **Specs are version 2.** Every choice that can change a number must be stated: the model's
14
+ revision, dtype, device and weight processing, the dataset's hash and limit, tokenization, the
15
+ metric, the statistics (bootstrap, interval, seed, clustering) and the batch size, and every
16
+ field of an ablation's baseline and a sweep's positions. A version 1 spec still runs: where it
17
+ leaves a choice out, it takes version 1's value, the run's first warning lists each one, and
18
+ `logogram validate` shows the list without running.
19
+ - Spec paths must lie inside the project, and an SAE's revision must be a commit, tag or branch.
20
+ - Seeds must be whole numbers from 0 to 2³² − 1; a negative or huge seed used to crash a run.
21
+ - Sign flips count prompts whose preference for the answer, log P(answer) − log P(distractor),
22
+ changes sign (for single tokens that is the logit difference, as before).
23
+ - Attribution patching no longer reports patched logit differences, probabilities and sign flips
24
+ computed from first-order estimates; like direct logit attribution, it leaves them empty.
25
+ - The count of prompts with an effect of the opposite sign ignores rounding noise, so a site with
26
+ no effect no longer reads as half opposite.
27
+ - Steering compares each strength with its random control prompt by prompt, from the same
28
+ resamples, and doing significantly *less* than the control no longer counts as beating it.
29
+
30
+ ### Added
31
+
32
+ - **Metrics:** the log-probability difference, the answer's log-probability, its probability,
33
+ the probability difference and the KL divergence from the clean or corrupt prompt's next-token
34
+ distribution, beside the logit difference. Every run also keeps each prompt's answer
35
+ probability and preference.
36
+ - **Answer sets and continuations:** an answer or distractor can be a list of single tokens, read
37
+ as one answer (every later year in greater-than), or text of several tokens, read token by
38
+ token. Patching at every position covers the continuation too.
39
+ - **Sets of sites:** intervene on several sites at once, or on everything except a set ("keep
40
+ the circuit, replace the rest"), and read each set's faithfulness (how much of the behavior the
41
+ kept sites carry alone), the share of removing a set (how complete a circuit is), the
42
+ faithfulness each site adds (minimality) and the interaction of two sites, all with intervals.
43
+ - **Tasks:** seeded datasets for greater-than, docstring, gendered pronouns, subject–verb
44
+ agreement and capital cities, beside IOI, each with templates of one token length, named
45
+ positions and the metric that reads them, from the app, `logogram generate` or Python.
46
+ - **Integrated gradients** for attribution patching (as in EAP-IG): the gradient is averaged over
47
+ steps between the two prompts' embeddings, which corrects much of what one gradient misses.
48
+ Its estimates are verified by patching like any others.
49
+ - **Statistics across many sites:** simultaneous bands that hold for every site of a sweep at
50
+ once, Benjamini–Hochberg q-values, a bootstrap that resamples clusters of prompts (such as
51
+ templates, with a warning when there are too few), and paired differences between two runs on
52
+ the same prompts.
53
+ - **The every-feature sweep can choose its strongest features on a seeded share of the prompts
54
+ and report them on the rest**, so their effects aren't biased by the choice.
55
+ - **Gemma Scope 2** SAEs and transcoders (`config.json` and `params.safetensors`), EleutherAI
56
+ transcoders, and SAEs on attention heads' outputs. Transcoder features are read from an MLP's
57
+ input and patched in its output.
58
+ - **A Python API for notebooks:** `logogram.run`, `load_run`, `list_runs`, `compare_runs`,
59
+ `verify_run`, `check_robustness`, `generate` and `write_dataset`, with tables as pandas or
60
+ Arrow and runs that show their heatmap in a notebook. Importing `logogram` loads no PyTorch.
61
+ - **Commands:** `list`, `show`, `compare`, `diff`, `verify`, `robustness`, `export`, `validate`,
62
+ `tasks` and `generate`.
63
+ - **In the app,** every new choice is in the experiment form, which says before a run what the
64
+ prompts and the method allow; staged sites can be tested as a circuit, two sites checked for
65
+ their interaction, and a run's strongest sites tested as nested circuits, with a chart of
66
+ faithfulness against circuit size; results show simultaneous bands, q-values, clusters and
67
+ paired comparisons; and **Prompts → Generate a task** writes any task's dataset and offers the
68
+ metric that reads it.
69
+ - **The web app** contains errors to the part of the page that failed, with a way to reload it
70
+ and copy the details; undoes and redoes changes to the experiment form (Ctrl/⌘ Z), says when an
71
+ action replaces the form and offers to undo it, and keeps an unsaved form for each project; asks
72
+ before cancelling a run; and lists every shortcut on **?**. Radio groups take one tab stop and
73
+ arrow keys, form fields have visible edges in both themes, and the status line announces a
74
+ run's milestones rather than every tick.
75
+
76
+ ### Fixed
77
+
78
+ - **Path patching with head receivers and the logits receiver measured only the logits path.**
79
+ The logits receiver now adds its change to what the head receivers changed, so the two together
80
+ measure both paths (checked against each alone).
81
+ - A metric or gap that isn't a finite number, as a 16-bit overflow gives, stops the run with the
82
+ reason instead of finishing with empty effects; patched values that aren't finite are reported.
83
+ - A failed run's saved error no longer contains this machine's paths (the home folder, the
84
+ Hugging Face cache or the project folder).
85
+ - Running out of memory during a run says to lower `execution.batch_size`, and frees the memory.
86
+ - Memory: gradient methods no longer keep what weight gradients would need; attribution patching
87
+ computes each layer's terms once per batch instead of once per site; on a GPU, a layer's
88
+ captured activations move to CPU memory when they would take more than a quarter of what is
89
+ free; an SAE's fit is measured a chunk of tokens at a time; and the memory estimate counts what
90
+ gradient methods and path patching hold.
91
+ - A deeply nested or very large file in a shared project no longer stops the project or its
92
+ history from opening; it shows up as an error on that run or dataset.
93
+ - The server checks which project a tab shows on the SAE routes too, a tab whose session has
94
+ expired stops reconnecting, unloading a model waits for work in progress, and cancelling a run
95
+ no longer waits behind queued analyses.
96
+ - The token strip shows a run's own prompts again when you return to its results, instead of
97
+ the experiment form's.
98
+ - Heatmaps and the model map draw hover and selection on a layer of their own, and find cells
99
+ through a map, so large sweeps no longer redraw everything on every mouse move.
100
+ - Every view has one top-level heading, with the headings below it in order, and the inspector's
101
+ resize handle belongs to the inspector, so screen reader users can move through each page by
102
+ its headings and landmarks.
103
+ - Pydantic before 2.10 no longer warns about a field named `model_id` when Logogram starts.
104
+ - Text on data colors (heatmap values, the model map's labels and a feature's token highlights)
105
+ is black or white, whichever contrasts more; some mid-tone cells in the black theme had light
106
+ text below the 4.5:1 that small text needs.
107
+
108
+ ### Development
109
+
110
+ - **A weekly check against published results:** the Golden workflow runs every method on GPT-2
111
+ small's real weights and checks the bundled example against its indirect-object circuit (Wang
112
+ et al. 2022): the name movers, S-inhibition and induction heads restore the answer, the negative
113
+ name movers work against it, and the name movers write the answer most directly.
114
+ - CI type-checks the package with pyright, lints with ruff's security, async and blind-except
115
+ rules too, checks the lockfile, keeps coverage at 85% or more, tests at the lowest declared
116
+ dependency versions, audits Python and web dependencies, and pins its actions to commits;
117
+ Dependabot and CodeQL watch them. Typer 0.13 or later is required.
118
+ - The browser checks also run in the dark theme, and an axe scan of every view fails on any
119
+ accessibility violation. The inspector's resize handle now says its width to assistive
120
+ technology, and commands wider than their box can be scrolled from the keyboard.
121
+ - The privacy check also reads binary files and catches more home paths and short usernames.
122
+ - What 0.2 added was checked on GPT-2 small's real weights (see Models in the README).
123
+
124
+ ## 0.1.2 (2026-10-08)
125
+
126
+ Fixes and checks that came out of validating every method on real weights.
127
+
128
+ ### Changed
129
+
130
+ - On Apple Silicon, **Automatic** runs models on the CPU. TransformerLens reports that Apple's MPS
131
+ can give silently wrong results, and Logogram hasn't been checked on it yet, so MPS runs only when
132
+ you choose it; the system check and the model dialog say why.
133
+
134
+ ### Added
135
+
136
+ - **Check robustness** reruns a float16 or bfloat16 run in float32 and compares the two.
137
+ - When processing a model's weights is what doesn't fit, the model dialog offers to turn it off.
138
+ - When a generated IOI dataset has names the loaded model splits into several tokens, one click
139
+ makes a new one with names it doesn't.
140
+ - Steering results say when the direction does no more than its random control at any site and
141
+ strength.
142
+ - Attribution patching of residual stream sites warns that it can miss effects there, and that
143
+ **Check robustness** patches every site.
144
+ - `scripts/validate_real_weights.py` runs every method on a real model and checks identities,
145
+ agreement and bit-identical reruns, on one device or two. It is how a release, or Apple's MPS, is
146
+ checked.
147
+
148
+ ### Fixed
149
+
150
+ - The baseline says that the clean prompts prefer the distractor, instead of preferring the answer
151
+ by a negative amount.
152
+
153
+ ### Development
154
+
155
+ - Tests run on Python 3.14 too, and the Linux runners are pinned to Ubuntu 24.04.
156
+ - The test client uses httpx2, as Starlette recommends.
157
+
158
+ ## 0.1.1 (2026-10-08)
159
+
160
+ Every method has now run end to end on real weights: GPT-2 small with a SAELens and an OpenAI
161
+ SAE, Pythia-70m with an EleutherAI SAE, and Qwen 2.5 0.5B. This release fixes what that turned up.
162
+
163
+ ### Fixed
164
+
165
+ - Runs work on Apple Silicon. Every method converted tensors to float64 on the model's device,
166
+ which Apple's Metal (MPS) doesn't have, so no run got past its baseline on a Mac. This still
167
+ needs a check on a Mac.
168
+ - A model whose own forward pass overflows in the chosen dtype (Pythia in float16) is refused, with
169
+ the dtype to use. Its load checks used to read as passed.
170
+ - When processing a model's weights doesn't fit in memory, loading says so and frees the memory,
171
+ instead of failing with a raw CUDA error and keeping it.
172
+ - The memory estimate counts weight processing, which needs three to four times the float32 size
173
+ of the weights while the model loads. Qwen 2.5 0.5B on a 6 GB GPU now reads "won't fit" with
174
+ processing and "fits" without it.
175
+ - Models without a beginning-of-sequence token, such as Qwen, run without one, as documented.
176
+ TransformerLens 4 had given them its end-of-text token instead.
177
+ - Models and SAEs that Logogram downloaded open offline without a revision, and offline memory
178
+ estimates use the model's real size.
179
+ - `logogram run` reports an identical rerun of direct logit attribution or attribution patching as
180
+ identical.
181
+ - Direct logit attribution in float16 and bfloat16 no longer warns about drift that is only
182
+ rounding.
183
+
184
+ ### Added
185
+
186
+ - Runs warn when the model prefers the distractor on the clean prompts, so it doesn't show the
187
+ behavior they test (Pythia-70m on IOI).
188
+ - The model dialog shows the memory that weight processing needs. Qwen 2.5 0.5B is marked as
189
+ tested.
190
+ - Project links on PyPI, and this changelog, which the update notice links to.
191
+
192
+ ### Documentation
193
+
194
+ - What has been validated with real weights, and where attribution patching is least reliable:
195
+ residual stream sites at the token that differs between the prompts.
196
+ - Steering needs prompt pairs that differ the same way; IOI prompts that mix the ABBA and BABA
197
+ orders cancel out.
198
+ - What float16 and bfloat16 do to results, and how weight processing changes heads' direct effects.
199
+
200
+ ## 0.1.0 (2026-10-08)
201
+
202
+ First public release.
203
+
204
+ - Activation patching, ablation (zero, mean or resample), direct logit attribution, attribution
205
+ patching verified by patching, steering with a random control, path patching, and SAE features,
206
+ all described by one spec that the app and `logogram run` execute the same way.
207
+ - Every model is checked when it loads: that TransformerLens reproduces its predictions, how its
208
+ layers add into the residual stream, and whether the logit lens reproduces its output.
209
+ - Per-prompt values with seeded bootstrap intervals, and bit-identical reruns on the same machine.
210
+ - The workbench: Explore, Experiment and Evidence, logograms written by results, robustness checks
211
+ and run comparisons.
212
+ - Local-first: no account and no telemetry, safetensors weights only, and an update check that
213
+ runs only when you allow it.