diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5eb0053 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# Normalise line endings so results and checksums are identical on every OS. +* text=auto eol=lf +# Windows batch files need CRLF (LF-only .bat files can break goto/labels in cmd.exe). +*.bat text eol=crlf +# Never touch binary files. +*.png binary +*.zip binary +*.pdf binary diff --git a/CITATION.cff b/CITATION.cff index 7d881b3..1d2d233 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,8 @@ cff-version: 1.2.0 message: "If you use this project, please cite it as a software project and include the exact Git commit and model/data configuration used." title: "Transformer Internals & Mechanistic Interpretability Lab" +authors: + - alias: "Idnotfound-L" +repository-code: "https://github.com/Idnotfound-L/transformer-interpretability-lab" type: software license: MIT diff --git a/CV_ADDITION.txt b/CV_ADDITION.txt deleted file mode 100644 index 73f2a6c..0000000 --- a/CV_ADDITION.txt +++ /dev/null @@ -1,4 +0,0 @@ -Transformer Internals & Mechanistic Interpretability Lab | PyTorch, Hugging Face Transformers, Streamlit -• Built a hook-based instrumentation and causal-intervention framework (PyTorch, Hugging Face) for GPT-2 and SmolLM3-3B: GQA-aware head ablation, MLP-neuron interventions and activation patching, with a Streamlit dashboard. -• Designed a three-seed sequence-copying study with disjoint discovery, held-out and control token pools; tested components against random-head and activity-matched neuron controls using bootstrap CIs, sign-flip tests and Benjamini-Hochberg correction. -• In SmolLM3-3B, Layer 15 Head 11 was selected independently in all three seeds; ablating it cut copy margin ~0.29-0.31 more than matched random heads, with near-zero effect on a control task (specificity +0.26 to +0.32, BH q < 0.001). Evidence of a causal contribution to the synthetic task, not a complete induction circuit. diff --git a/README.md b/README.md index 26c6a04..aca39e2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,30 @@ # Transformer Internals & Mechanistic Interpretability Lab -A research-engineering project for inspecting and causally probing decoder-only Transformer language models. The repository combines a PyTorch Transformer implementation, Hugging Face model instrumentation, a controlled sequence-copying study (Protocol V2), ablation and activation-patching experiments, statistical summaries, and an offline Streamlit dashboard. +[![tests](https://github.com/Idnotfound-L/transformer-interpretability-lab/actions/workflows/tests.yml/badge.svg)](https://github.com/Idnotfound-L/transformer-interpretability-lab/actions/workflows/tests.yml) +![python](https://img.shields.io/badge/python-3.10%2B-blue) +![license](https://img.shields.io/badge/license-MIT-green) + +**In short:** when a language model continues a repeated sequence (`… A B … A → B`), which of its internal components is it relying on? This project finds candidate attention heads and MLP neurons, then *causally* tests them by switching them off and by patching in activations from a clean run, with matched random controls, held-out prompts, and statistics, on GPT-2 and SmolLM3-3B. + +The repository combines a PyTorch Transformer implementation, Hugging Face model instrumentation, a controlled sequence-copying study (Protocol V2), ablation and activation-patching experiments, statistical summaries, and an offline Streamlit dashboard. **Models studied:** GPT-2 (`gpt2`) and SmolLM3-3B-Base (`HuggingFaceTB/SmolLM3-3B-Base`). -**Primary research question:** Which attention heads and MLP coordinates causally contribute to a controlled repeated-token sequence-copying behaviour, and how robust are these effects across independent seeds and model families? +**Research question:** Which attention heads and MLP coordinates causally contribute to a controlled repeated-token sequence-copying behaviour, and how robust are these effects across independent seeds and model families? + +## Key results + +![SmolLM3 Protocol V2 summary: head-ablation effects and activation patching across three seeds](docs/figures/smollm3_v2_summary.png) + +*Left: extra copy-margin drop from ablating each layer's discovery-selected head, relative to a matched random head in the same layer (SmolLM3-3B-Base, 3 seeds, 95% bootstrap CIs). Right: fraction of the copy-margin gap recovered by patching clean block states at the earlier successor token (solid) versus a random position (dotted). Layer-35 recovery is zero and is not treated as mechanistic evidence. Regenerate with `python scripts/make_figures.py`.* -> **Research integrity.** The results folder contains full raw V2 output bundles (CSV, JSON, report) for GPT-2 and SmolLM3-3B-Base, seeds 7, 13 and 29, and full raw V1 exploratory bundles kept separately. Headline figures were cross-checked against the raw CSVs. Inference is within-seed; no pooled test across seeds has been run. The SmolLM3 Layer 15 Head 11 result is described as a candidate that causally contributes to the synthetic task, not as a proven complete induction circuit. See [`results/README.md`](results/README.md) and [`reports/FINAL_RESEARCH_REPORT.md`](reports/FINAL_RESEARCH_REPORT.md). +| Model | Finding | Evidence (3 seeds, BH-adjusted within each run) | +|---|---|---| +| SmolLM3-3B-Base | **Layer 15, Head 11** is selected by discovery in every seed. Ablating it hurts copying more than a matched random head and has little effect on the control task. | Extra margin drop 0.29-0.31; copy-minus-control specificity +0.26 to +0.32; q < 0.001 in each seed | +| GPT-2 | **Layer 3, MLP neuron 1718** is selected in every seed and shows a positive selected-vs-random effect. | Extra margin drop 0.20-0.35; specificity +0.23 to +0.36; q < 0.001 in each seed | +| SmolLM3-3B-Base | Clean block-state patching at the earlier successor token recovers most of the copy-margin gap in early/middle layers; random positions recover ~0. | Component-specific head/neuron patches recover little, which is consistent with distributed computation but does not distinguish it from redundancy | + +These are evidence of a causal contribution to a *synthetic* task, not a proven induction circuit. Baseline copying is partial (held-out accuracy about 0.44-0.46 for SmolLM3 and 0.44-0.54 for GPT-2), and inference is within-seed; no pooled test across seeds has been run. Full tables, caveats and negative results are in [`reports/FINAL_RESEARCH_REPORT.md`](reports/FINAL_RESEARCH_REPORT.md) and [`results/`](results/README.md). ## What the project implements @@ -15,46 +33,45 @@ A research-engineering project for inspecting and causally probing decoder-only - **Causal ablation:** selected attention heads and MLP coordinates are compared against same-layer random heads and activity-matched random neurons on held-out copy prompts. - **Task-specificity control:** the same components are evaluated on a repetition-free random-transition control task. - **Activation patching:** clean block-state patches at the earlier successor position, random-position controls, and component-specific head/neuron patches. The trivial whole-block final-query patch is omitted. -- **Statistics:** per-prompt metrics, bootstrap confidence intervals, paired sign-flip tests and Benjamini–Hochberg adjusted q-values. +- **Statistics:** per-prompt metrics, bootstrap confidence intervals, paired sign-flip tests and Benjamini-Hochberg adjusted q-values. - **Dashboard:** saved Protocol V2 runs can be inspected without reloading model weights. - **Reproducibility:** seed, model revision, hardware, precision, selected layers, prompt hashes and experiment settings are exported in JSON metadata. ## Repository layout -```text +``` transformer-interpretability-lab/ ├── src/interpretability_lab/ # model, hooks, experiment logic, Protocol V2 -├── scripts/ # training, research runners, V2 run indexer -├── dashboard/ # TinyGPT, Hugging Face and Protocol V2 dashboards -├── tests/ # automated tests -├── data/ # small prompt examples/documentation -├── docs/ # architecture, method, reproducibility notes -├── results/ # available run reports and provenance notes -├── reports/ # final research report -└── artifacts/ # local experiment outputs (git-ignored by default) +├── scripts/ # training, research runners, V2 run indexer, figure script +│ └── windows/ # optional .bat wrappers for Windows users +├── dashboard/ # TinyGPT, Hugging Face and Protocol V2 dashboards +├── tests/ # automated tests +├── data/ # small prompt examples/documentation +├── docs/ # architecture, protocol, reproducibility notes, figures, provenance +├── results/ # raw Protocol V1 (exploratory) and V2 (corrected) run bundles +├── reports/ # final research report +└── artifacts/ # local experiment outputs (git-ignored by default) ``` ## Setup -Python 3.11 is recommended. On Windows: - -1. Extract this ZIP to a short path, e.g. `C:\mi\` (helps avoid Windows long-path installation issues). -2. Run `setup_windows.bat`. -3. Run `setup_huggingface_windows.bat` for pretrained model experiments. -4. Verify the project with `\.venv\Scripts\python.exe -m pytest -q`. - -On Linux/macOS: +Python 3.10+ (3.11 recommended). -```bash +``` +git clone https://github.com/Idnotfound-L/transformer-interpretability-lab.git +cd transformer-interpretability-lab python -m venv .venv -source .venv/bin/activate +source .venv/bin/activate # Windows: .venv\Scripts\activate python -m pip install --upgrade pip pip install -r requirements.txt -pip install -r requirements-huggingface.txt +pip install -r requirements-huggingface.txt # for pretrained-model experiments pip install -e . +pytest -q ``` -The test suite currently passes **28 tests** in the packaging environment. Tests exercise software components and synthetic model adapters; passing tests is not a substitute for empirical validation on pretrained checkpoints. +Windows users can instead run `scripts\windows\setup_windows.bat` and `scripts\windows\setup_huggingface_windows.bat` (see [`scripts/windows/README.md`](scripts/windows/README.md)). Clone to a short path (e.g. `C:\src\`) to avoid Windows long-path installation issues. + +The test suite has 28 tests, run in CI on every push. They exercise software components and synthetic model adapters; passing tests are not a substitute for empirical validation on pretrained checkpoints. ## Run Protocol V2 @@ -63,7 +80,7 @@ The test suite currently passes **28 tests** in the packaging environment. Tests Windows quick runner (defaults to seed 7): ```powershell -.\run_protocol_v2_gpt2_windows.bat 7 +scripts\windows\run_protocol_v2_gpt2_windows.bat 7 ``` Run individual seeds directly on any OS: @@ -79,7 +96,7 @@ Repeat with `--seed 13` and `--seed 29`. Keep each timestamped output folder. V2 ### SmolLM3-3B-Base on a cloud GPU -Use a CUDA GPU with sufficient memory (the user's completed runs used an NVIDIA T4 in BF16). Install Transformers 4.53+ and required Hugging Face packages without reinstalling a preconfigured CUDA PyTorch build: +Use a CUDA GPU with sufficient memory (the reported runs used an NVIDIA T4 in BF16). Install Transformers 4.53+ and required Hugging Face packages without reinstalling a preconfigured CUDA PyTorch build: ```bash pip install "transformers>=4.53.0,<5" accelerate safetensors sentencepiece pandas tabulate @@ -125,7 +142,7 @@ After running experiments, launch the Protocol V2 offline dashboard: streamlit run dashboard/protocol_v2_dashboard.py ``` -On Windows, double-click `run_protocol_v2_dashboard_windows.bat`. Set the dashboard run directory to the folder containing the timestamped run folders if it is not the default `artifacts/sequence_copy_v2`. +On Windows, double-click `scripts\windows\run_protocol_v2_dashboard_windows.bat`. Set the dashboard run directory to the folder containing the timestamped run folders if it is not the default `artifacts/sequence_copy_v2`. The dashboard reads saved CSV/JSON outputs only. It does not download model weights or rerun experiments. @@ -139,24 +156,30 @@ python scripts/summarize_v2_runs.py artifacts/sequence_copy_v2 For SmolLM3, point the utility at the persistent parent directory containing all three seed folders. It writes `run_index.csv`, per-seed tables and a descriptive component-consistency table. The utility does not pool p-values or replace a prompt-level meta-analysis. -## Research findings and limitations - -See: -- [`reports/FINAL_RESEARCH_REPORT.md`](reports/FINAL_RESEARCH_REPORT.md) -- [`results/README.md`](results/README.md) -- [`results/smollm3_protocol_v2/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md`](results/smollm3_protocol_v2/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md) - -Key limitations to communicate in interviews: +## Limitations 1. The probe is a synthetic sequence-copying task, not a natural-language benchmark. 2. SmolLM3's baseline performance is partial; negative copy margins and low target probability constrain mechanistic claims. 3. Attention weights are candidate-discovery signals, not functional proof. 4. Random-transition accuracy is at 0%, so the control may have a floor effect. 5. Only eight of 36 layers and one top candidate per layer were screened in the reported protocol. -6. Component-specific patching was weak, and the block-state patching set was small. -7. Ablation can be off-manifold; avoid claiming that one component is a complete circuit. +6. Component-specific patching was weak, and the block-state patching set was small (12 prompts per seed). +7. Ablation can be off-manifold; no single component should be read as a complete circuit. 8. Cross-model layer/head indices are not directly comparable. +9. GPT-2 V2 runs used CPU/float32 and did not record a resolved model revision, so exact GPT-2 weights are not pinned. + +## Further reading + +- [`reports/FINAL_RESEARCH_REPORT.md`](reports/FINAL_RESEARCH_REPORT.md): full write-up, including negative results +- [`results/README.md`](results/README.md): what each results folder contains (V1 exploratory vs V2 corrected; never pool them) +- [`results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md`](results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md): consolidated SmolLM3 three-seed summary +- [`docs/`](docs/): architecture, experiment protocol, protocol changelog, reproducibility checklist +- [`docs/provenance/`](docs/provenance/): archive manifest, results inventory and SHA-256 checksums + +## Citation + +See [`CITATION.cff`](CITATION.cff); please include the exact commit and model/data configuration used. -## CV-ready wording +## License -Use the evidence-backed entry in [`CV_ADDITION.txt`](CV_ADDITION.txt). The strongest result is worded as a reproducible causal contribution on a synthetic task, not as discovery of a complete induction circuit. +MIT, see [`LICENSE`](LICENSE). diff --git a/docs/HUGGINGFACE_RESEARCH.md b/docs/HUGGINGFACE_RESEARCH.md index 88182af..bfe2c0d 100644 --- a/docs/HUGGINGFACE_RESEARCH.md +++ b/docs/HUGGINGFACE_RESEARCH.md @@ -90,4 +90,4 @@ A 3B checkpoint in BF16/FP16 requires approximately 6 GB for weights alone; runt - Report prompt-level observations, confidence intervals and null effects. - Attention is descriptive; combine it with intervention and patching evidence. - Ablation can push activations off the model's normal distribution. Triangulate with patching, matched controls and alternative prompts. -- Do not write a CV claim about a discovered circuit or a measured effect until you have inspected and understood the saved output files. +- Do not claim a discovered circuit or a measured effect until you have inspected and understood the saved output files. diff --git a/docs/PROJECT_SCOPE.md b/docs/PROJECT_SCOPE.md new file mode 100644 index 0000000..6c7f492 --- /dev/null +++ b/docs/PROJECT_SCOPE.md @@ -0,0 +1,27 @@ +# Project scope + +## What the repository implements + +- A decoder-only GPT-style Transformer in PyTorch (tied embeddings, causal self-attention, residual blocks, MLPs) with a small training pipeline. +- Forward-hook instrumentation that captures attention patterns, residual-stream states and MLP activations. +- Interactive Streamlit views for next-token predictions, attention maps, residual representations, neuron activity and causal interventions. +- Attention-head and MLP-neuron ablation, multi-prompt component sweeps, KL / prediction-change metrics and prompt-level bootstrap intervals. +- Position-aligned residual activation patching with clean / corrupted baselines and a corrupted-self-patch control. +- An optional GPT-2 Small + TransformerLens CLI pipeline for full head sweeps, activity-selected neuron ablations, repeated-token probes and patching. +- An architecture-aware Hugging Face adapter for decoder-only causal LMs (GPT-2-style and Llama-like stacks, default SmolLM3-3B-Base) with GQA-aware query-head ablation through the attention output projection, gated MLP-coordinate ablation through the down projection, layer-wise block-output patching and cross-model aggregate comparisons. See [`HUGGINGFACE_RESEARCH.md`](HUGGINGFACE_RESEARCH.md). +- Per-run metadata capture: seed, model revision, hardware, precision, selected layers and prompt hashes. + +## Primary study: controlled sequence copying + +The main research track is the Protocol V2 sequence-copying study ([`SEQUENCE_COPY_STUDY.md`](SEQUENCE_COPY_STUDY.md), [`PROTOCOL_V2_CHANGELOG.md`](PROTOCOL_V2_CHANGELOG.md)), implemented in `src/interpretability_lab/sequence_copy_v2.py` and `scripts/run_sequence_copy_study_v2.py`. + +It builds fixed-length repeated-token prompts, gives discovery and held-out evaluation cases disjoint token pools, ranks attention heads and MLP coordinates on discovery data, and ablates them against same-layer random controls on held-out prompts. Paired candidate-versus-control effects are reported with bootstrap confidence intervals, sign-flip permutation tests and Benjamini–Hochberg q-values. Activation patching corrupts the earlier successor token and restores clean block states at that position. + +The study is designed to be falsifiable: if baseline copy accuracy is poor, or discovery-ranked components do not beat random controls, the reports say so. Synthetic copying is a narrow behavioural probe and cannot establish a general semantic role for a head. Results for GPT-2 and SmolLM3-3B-Base are interpreted separately; layer/head/neuron indices are not comparable across architectures. + +## Out of scope / future work + +- Natural-language induction benchmarks with a difficulty-matched control task. +- Screening more than one candidate per layer, and more than 8 of the model's layers. +- Combined ablations and path patching from candidate heads (e.g. SmolLM3 L15 H11) to downstream components. +- More patching prompts, and a pre-specified prompt-level meta-analysis across seeds. diff --git a/docs/PROJECT_SCOPE_AND_CV.md b/docs/PROJECT_SCOPE_AND_CV.md deleted file mode 100644 index 53c48b7..0000000 --- a/docs/PROJECT_SCOPE_AND_CV.md +++ /dev/null @@ -1,54 +0,0 @@ -# Project scope and CV guidance - -## What the repository implements - -- A decoder-only GPT-style Transformer in PyTorch with tied embeddings, causal self-attention, residual blocks and MLPs. -- Forward-hook instrumentation and explicit capture of attention patterns, residual stream states and MLP activations. -- Interactive Streamlit views for next-token predictions, attention maps, residual representations, neuron activity and causal interventions. -- Attention-head and MLP-neuron ablation, multi-prompt component sweeps, KL / prediction-change metrics and prompt-level bootstrap intervals. -- Position-aligned residual activation patching with clean / corrupted baselines and a corrupted-self-patch control. -- An optional GPT-2 Small + TransformerLens CLI pipeline for full head sweeps, activity-selected neuron ablations, repeated-token probes and patching. -- Checkpointed training/validation metrics, seed handling, prompt hashes, environment metadata, CSV/JSON exports, tests and CI configuration. - -## What still requires execution and interpretation - -- Train TinyGPT on a suitable text corpus and inspect the held-out validation loss. -- Install optional TransformerLens dependencies and download GPT-2 Small weights. -- Run the GPT-2 research suite on hardware with realistic runtime expectations. -- Use separate discovery and evaluation prompt files for confirmatory MLP-neuron tests. -- Check tokenization and position alignment for every patching pair. -- Inspect all exported per-prompt rows, controls, confidence intervals and null results. -- Write a research note that distinguishes measured observations from proposed mechanisms. - -## Implementation-focused CV entry - -**Transformer Internals & Mechanistic Interpretability Lab | PyTorch, TransformerLens, Streamlit** - -- Built a decoder-only Transformer in PyTorch and instrumented attention, residual-stream and MLP activations with forward hooks; developed an interactive dashboard for layer/head/neuron-level inspection. -- Implemented causal attention-head and MLP-neuron ablations plus layer-wise activation patching, with multi-prompt KL-divergence evaluation, bootstrap confidence intervals, controls and experiment exports. -- Developed a reproducible GPT-2 Small analysis pipeline using TransformerLens, including repeated-token attention probes, prompt-set hashing and model/runtime metadata capture. - -Use only bullets that accurately describe completed work. The code is present in the repository, but pretrained GPT-2 experiments have not been executed as part of packaging. Add quantitative outcomes only after running them and preserving the generated CSV/JSON artifacts. - -## Hugging Face research extension - -The repository now also includes an architecture-aware Hugging Face adapter for decoder-only causal LMs, defaulting to SmolLM3-3B-Base. It supports GQA-aware query-head ablation through the attention output projection, gated MLP-coordinate ablation through the down projection, layer-wise block-output activation patching, repeated-token probes and same-prompt cross-model aggregate comparisons. The HF runner separates MLP discovery prompts from evaluation prompts and records model configuration, precision, device, prompt hashes, per-prompt metrics and bootstrap intervals. - -The model weights are not bundled. The first pretrained run needs network access to fetch the Hugging Face checkpoint and hardware with enough memory. For a bounded first run, evaluate two layers and four query heads per layer; expand after checking runtime and memory. Refer to `docs/HUGGINGFACE_RESEARCH.md` for exact commands, interpretation caveats and output definitions. - -## Updated implementation-focused CV entry - -**Transformer Internals & Mechanistic Interpretability Lab | PyTorch, Hugging Face Transformers, Streamlit** - -- Built an architecture-aware instrumentation framework for pretrained decoder-only Transformers, using PyTorch hooks to inspect attention projections and gated MLP activations across Hugging Face models. -- Implemented GQA-aware query-head ablation, MLP-neuron interventions and layer-wise activation patching; evaluated prediction changes using KL divergence, target-logit recovery and prompt-level bootstrap intervals. -- Developed a Streamlit research dashboard and reproducible experiment pipeline with discovery/evaluation prompt separation, metadata capture, and cross-model comparison support for GPT-2 and SmolLM3-3B. - -These bullets describe implemented software, not completed scientific discoveries. Add quantified results only after you run the pretrained models and verify the CSV/JSON outputs. - - -## Primary controlled sequence-copying study - -The main research track is documented in `docs/SEQUENCE_COPY_STUDY.md` and implemented by `scripts/run_sequence_copy_study.py`. It creates fixed-length repeated-token copy prompts, allocates distinct token identities to discovery and held-out evaluation cases, ranks attention heads and MLP coordinates on discovery data, then performs final-query ablations against same-layer random controls. Paired candidate-control effects are reported with bootstrap confidence intervals, sign-flip permutation tests and Benjamini-Hochberg q-values. Activation patching corrupts the earlier successor token and restores clean block states at that token position or at the final query position. - -The study is deliberately designed to be falsifiable. If the model has poor baseline copy accuracy, or discovery-ranked components do not outperform random controls, the report should say so. Synthetic copying is a narrow behavioural probe and cannot establish a general semantic role for a head. Cross-model validation is planned for GPT-2 and SmolLM3-3B-Base; model-specific results must be interpreted separately. diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index 564cbc4..8531254 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -1,4 +1,4 @@ -# Project status — final bundle +# Project status ## Implemented @@ -14,16 +14,16 @@ - Per-run CSV/JSON/Markdown exports and offline Protocol V2 Streamlit dashboard. - Cross-seed indexer for descriptive aggregation. -## Verification in this packaging environment +## Verification -- `python -m pytest -q`: **28 passed**. -- Python compilation checks are run during packaging for scripts, source modules and dashboards. +- `python -m pytest -q` runs the 28-test suite (software components and synthetic model adapters). CI runs it on every push; see `.github/workflows/tests.yml`. +- Passing tests do not replace empirical validation on pretrained checkpoints; that is what the result bundles are for. ## Empirical results included - Protocol V1 exploratory outputs: complete raw CSV/JSON/Markdown files for GPT-2 seed 7 and SmolLM3 seeds 7, 13 and 29, plus a separate SmolLM3 smoke test. - GPT-2 Protocol V2: full raw bundles (19 files each) for seeds 7, 13 and 29. -- SmolLM3-3B Protocol V2: consolidated three-seed findings summary supplied by the project author. +- SmolLM3-3B Protocol V2: full raw bundles for seeds 7, 13 and 29, plus a consolidated three-seed summary whose headline figures were re-checked against the raw CSVs. - V1 and V2 are stored in separate trees under `results/protocol_v1/` and `results/protocol_v2/`. ## Important evidence limitations @@ -33,7 +33,3 @@ - The six runs' summary claims should not be confused with a pooled inferential test. A formal seed-level meta-analysis would require full per-prompt data and should be pre-specified. - The random-transition control is a generic sensitivity control and had 0% accuracy in reported runs; consider a difficulty-matched natural-text control in future work. - The current study is a synthetic probe. It does not establish a complete induction circuit or broad natural-language mechanism. - -## CV guidance - -The CV entry uses a qualified finding: a candidate component makes a reproducible causal contribution to the measured synthetic task. Do not call it a complete induction head/circuit. diff --git a/PROTOCOL_V2_README.md b/docs/PROTOCOL_V2_QUICKREF.md similarity index 92% rename from PROTOCOL_V2_README.md rename to docs/PROTOCOL_V2_QUICKREF.md index 44d9cdf..4145c2c 100644 --- a/PROTOCOL_V2_README.md +++ b/docs/PROTOCOL_V2_QUICKREF.md @@ -1,7 +1,5 @@ # Protocol V2 — quick reference -Protocol V2 is integrated into the project. It is not a patch-only archive. - ## Main runner ```bash diff --git a/docs/REPRODUCIBILITY_CHECKLIST.md b/docs/REPRODUCIBILITY_CHECKLIST.md index 4fa5e3d..73d180b 100644 --- a/docs/REPRODUCIBILITY_CHECKLIST.md +++ b/docs/REPRODUCIBILITY_CHECKLIST.md @@ -1,6 +1,6 @@ # Reproducibility and research-integrity checklist -Complete this checklist before using numerical findings in a CV, report, presentation or interview. +Complete this checklist before using numerical findings in a report, paper or presentation. ## Before running @@ -39,4 +39,4 @@ Complete this checklist before using numerical findings in a CV, report, present - [ ] Preserve raw CSV/JSON outputs, run metadata and the generated report. - [ ] Include software/hardware environment and any deviations from protocol. - [ ] Include null results and limitations. -- [ ] Use only measured values in CV bullets; do not copy example placeholders. +- [ ] Quote only measured values; do not copy example placeholders. diff --git a/docs/figures/smollm3_v2_summary.png b/docs/figures/smollm3_v2_summary.png new file mode 100644 index 0000000..645e4b0 Binary files /dev/null and b/docs/figures/smollm3_v2_summary.png differ diff --git a/RESEARCH_ARCHIVE_MANIFEST.md b/docs/provenance/RESEARCH_ARCHIVE_MANIFEST.md similarity index 78% rename from RESEARCH_ARCHIVE_MANIFEST.md rename to docs/provenance/RESEARCH_ARCHIVE_MANIFEST.md index 1b0b40a..f563549 100644 --- a/RESEARCH_ARCHIVE_MANIFEST.md +++ b/docs/provenance/RESEARCH_ARCHIVE_MANIFEST.md @@ -1,8 +1,8 @@ -# Complete research archive manifest +# Results archive manifest ## Archive purpose -This package contains the project codebase, dashboard, tests, documentation, and the run artifacts that were available at packaging time. Experiment results are organized into separate Protocol V1 and Protocol V2 trees to prevent accidental pooling. +This repository contains the project codebase, dashboard, tests, documentation, and the run artifacts that were available when the results were archived. Experiment results are organized into separate Protocol V1 and Protocol V2 trees to prevent accidental pooling. ## Protocol inventory @@ -23,7 +23,7 @@ The V1 run reports are not V2 results. Do not combine their CSV rows, means, con - V1 sequence-copy implementation: `src/interpretability_lab/sequence_copy.py` and the corresponding legacy runner. - V2 corrected implementation: `src/interpretability_lab/sequence_copy_v2.py`, `scripts/run_sequence_copy_study_v2.py`, and the V2 dashboard. - Protocol documentation: `docs/EXPERIMENT_PROTOCOL.md`, `docs/PROTOCOL_V2_CHANGELOG.md`, `docs/REPRODUCIBILITY_CHECKLIST.md`. -- The original project package recorded 28 passing tests at packaging time; this archive reorganization itself does not change source code. +- The test suite has 28 tests; see the top-level README. ## Evidence limitations @@ -34,4 +34,4 @@ The V1 run reports are not V2 results. Do not combine their CSV rows, means, con ## Integrity -A file-level SHA-256 inventory is provided in `ARCHIVE_SHA256SUMS.txt`. Original V1 result ZIPs are retained in `results/protocol_v1/raw_archives/`. +A file-level SHA-256 inventory is provided in `SHA256SUMS.txt` (in this folder; verify from the repository root with `sha256sum -c docs/provenance/SHA256SUMS.txt`). Original V1 result ZIPs are retained in `results/protocol_v1/raw_archives/`. diff --git a/RESULTS_FILE_INVENTORY.csv b/docs/provenance/RESULTS_FILE_INVENTORY.csv similarity index 83% rename from RESULTS_FILE_INVENTORY.csv rename to docs/provenance/RESULTS_FILE_INVENTORY.csv index aebc770..777a9f3 100644 --- a/RESULTS_FILE_INVENTORY.csv +++ b/docs/provenance/RESULTS_FILE_INVENTORY.csv @@ -1,20 +1,20 @@ path,bytes,csv_data_rows results/README.md,712, results/protocol_v1/README.md,1774, -results/protocol_v1/gpt2/seed_7/RUN_REPORT.md,3475, -results/protocol_v1/gpt2/seed_7/activation_patching_per_prompt.csv,35484,192 -results/protocol_v1/gpt2/seed_7/activation_patching_summary.csv,2221,16 -results/protocol_v1/gpt2/seed_7/candidate_vs_random_controls.csv,2166,16 -results/protocol_v1/gpt2/seed_7/component_candidates.csv,1700,32 -results/protocol_v1/gpt2/seed_7/discovery_attention_scores.csv,677668,9216 -results/protocol_v1/gpt2/seed_7/discovery_attention_summary.csv,6542,96 -results/protocol_v1/gpt2/seed_7/discovery_neuron_ranking.csv,651644,24576 -results/protocol_v1/gpt2/seed_7/heldout_ablation_per_prompt.csv,918599,4096 -results/protocol_v1/gpt2/seed_7/heldout_ablation_summary.csv,5770,32 -results/protocol_v1/gpt2/seed_7/heldout_baseline_metrics.csv,9254,128 -results/protocol_v1/gpt2/seed_7/heldout_baseline_summary.csv,302,3 -results/protocol_v1/gpt2/seed_7/run_metadata.json,2106, -results/protocol_v1/gpt2/seed_7/sequence_copy_cases.csv,41047,224 +results/protocol_v1/gpt2/seed_7/RUN_REPORT.md,3435, +results/protocol_v1/gpt2/seed_7/activation_patching_per_prompt.csv,35291,192 +results/protocol_v1/gpt2/seed_7/activation_patching_summary.csv,2204,16 +results/protocol_v1/gpt2/seed_7/candidate_vs_random_controls.csv,2149,16 +results/protocol_v1/gpt2/seed_7/component_candidates.csv,1667,32 +results/protocol_v1/gpt2/seed_7/discovery_attention_scores.csv,668451,9216 +results/protocol_v1/gpt2/seed_7/discovery_attention_summary.csv,6445,96 +results/protocol_v1/gpt2/seed_7/discovery_neuron_ranking.csv,627067,24576 +results/protocol_v1/gpt2/seed_7/heldout_ablation_per_prompt.csv,914502,4096 +results/protocol_v1/gpt2/seed_7/heldout_ablation_summary.csv,5737,32 +results/protocol_v1/gpt2/seed_7/heldout_baseline_metrics.csv,9125,128 +results/protocol_v1/gpt2/seed_7/heldout_baseline_summary.csv,298,3 +results/protocol_v1/gpt2/seed_7/run_metadata.json,2055, +results/protocol_v1/gpt2/seed_7/sequence_copy_cases.csv,40822,224 results/protocol_v1/raw_archives/gpt2_seed7_results.zip,854669, results/protocol_v1/raw_archives/smollm3_all_seeds_results.zip,4571423, results/protocol_v1/smollm3/seed_13/RUN_REPORT.md,3482, @@ -44,7 +44,7 @@ results/protocol_v1/smollm3/seed_29/heldout_ablation_summary.csv,5177,32 results/protocol_v1/smollm3/seed_29/heldout_baseline_metrics.csv,5969,128 results/protocol_v1/smollm3/seed_29/heldout_baseline_summary.csv,297,3 results/protocol_v1/smollm3/seed_29/run_metadata.json,2132, -results/protocol_v1/smollm3/seed_29/sequence_copy_cases.csv,41037,236 +results/protocol_v1/smollm3/seed_29/sequence_copy_cases.csv,41035,236 results/protocol_v1/smollm3/seed_7/RUN_REPORT.md,3501, results/protocol_v1/smollm3/seed_7/activation_patching_per_prompt.csv,21028,192 results/protocol_v1/smollm3/seed_7/activation_patching_summary.csv,2244,16 @@ -74,64 +74,64 @@ results/protocol_v1/smollm3/smoke_test_seed_7/HuggingFaceTB_SmolLM3-3B-Base_2026 results/protocol_v1/smollm3/smoke_test_seed_7/HuggingFaceTB_SmolLM3-3B-Base_20261103T183004Z/run_metadata.json,2093, results/protocol_v1/smollm3/smoke_test_seed_7/HuggingFaceTB_SmolLM3-3B-Base_20261103T183004Z/sequence_copy_cases.csv,7364,44 results/protocol_v2/README.md,1181, -results/protocol_v2/gpt2/seed_13/RUN_REPORT.md,20660, -results/protocol_v2/gpt2/seed_13/activation_patching_per_prompt_v2.csv,123335,576 -results/protocol_v2/gpt2/seed_13/activation_patching_summary_v2.csv,8621,48 -results/protocol_v2/gpt2/seed_13/candidate_vs_random_controls.csv,2163,16 -results/protocol_v2/gpt2/seed_13/component_candidates_v2.csv,2766,32 -results/protocol_v2/gpt2/seed_13/control_ablation_per_prompt.csv,947476,4096 -results/protocol_v2/gpt2/seed_13/control_ablation_summary.csv,5348,32 -results/protocol_v2/gpt2/seed_13/control_baseline_metrics.csv,9688,128 -results/protocol_v2/gpt2/seed_13/control_candidate_vs_random.csv,2182,16 -results/protocol_v2/gpt2/seed_13/copy_specificity_summary.csv,2952,16 -results/protocol_v2/gpt2/seed_13/discovery_attention_scores_v2.csv,892960,9216 -results/protocol_v2/gpt2/seed_13/discovery_attention_summary_v2.csv,10507,96 -results/protocol_v2/gpt2/seed_13/discovery_neuron_ranking_v2.csv,1181336,24576 -results/protocol_v2/gpt2/seed_13/heldout_ablation_per_prompt.csv,922014,4096 -results/protocol_v2/gpt2/seed_13/heldout_ablation_summary.csv,5581,32 -results/protocol_v2/gpt2/seed_13/heldout_baseline_metrics.csv,9325,128 -results/protocol_v2/gpt2/seed_13/heldout_baseline_summary.csv,299,3 -results/protocol_v2/gpt2/seed_13/run_metadata.json,2392, -results/protocol_v2/gpt2/seed_13/sequence_copy_cases_v2.csv,70742,352 -results/protocol_v2/gpt2/seed_29/RUN_REPORT.md,20655, -results/protocol_v2/gpt2/seed_29/activation_patching_per_prompt_v2.csv,123694,576 -results/protocol_v2/gpt2/seed_29/activation_patching_summary_v2.csv,8651,48 -results/protocol_v2/gpt2/seed_29/candidate_vs_random_controls.csv,2174,16 -results/protocol_v2/gpt2/seed_29/component_candidates_v2.csv,2762,32 -results/protocol_v2/gpt2/seed_29/control_ablation_per_prompt.csv,945973,4096 -results/protocol_v2/gpt2/seed_29/control_ablation_summary.csv,5339,32 -results/protocol_v2/gpt2/seed_29/control_baseline_metrics.csv,9634,128 -results/protocol_v2/gpt2/seed_29/control_candidate_vs_random.csv,2184,16 -results/protocol_v2/gpt2/seed_29/copy_specificity_summary.csv,2976,16 -results/protocol_v2/gpt2/seed_29/discovery_attention_scores_v2.csv,893084,9216 -results/protocol_v2/gpt2/seed_29/discovery_attention_summary_v2.csv,10512,96 -results/protocol_v2/gpt2/seed_29/discovery_neuron_ranking_v2.csv,1181361,24576 -results/protocol_v2/gpt2/seed_29/heldout_ablation_per_prompt.csv,920435,4096 -results/protocol_v2/gpt2/seed_29/heldout_ablation_summary.csv,5780,32 -results/protocol_v2/gpt2/seed_29/heldout_baseline_metrics.csv,9319,128 -results/protocol_v2/gpt2/seed_29/heldout_baseline_summary.csv,299,3 -results/protocol_v2/gpt2/seed_29/run_metadata.json,2398, -results/protocol_v2/gpt2/seed_29/sequence_copy_cases_v2.csv,70635,352 -results/protocol_v2/gpt2/seed_7/RUN_REPORT.md,20646, -results/protocol_v2/gpt2/seed_7/activation_patching_per_prompt_v2.csv,122966,576 -results/protocol_v2/gpt2/seed_7/activation_patching_summary_v2.csv,8639,48 -results/protocol_v2/gpt2/seed_7/candidate_vs_random_controls.csv,2185,16 -results/protocol_v2/gpt2/seed_7/component_candidates_v2.csv,2765,32 -results/protocol_v2/gpt2/seed_7/control_ablation_per_prompt.csv,946776,4096 -results/protocol_v2/gpt2/seed_7/control_ablation_summary.csv,5339,32 -results/protocol_v2/gpt2/seed_7/control_baseline_metrics.csv,9652,128 -results/protocol_v2/gpt2/seed_7/control_candidate_vs_random.csv,2194,16 -results/protocol_v2/gpt2/seed_7/copy_specificity_summary.csv,2961,16 -results/protocol_v2/gpt2/seed_7/discovery_attention_scores_v2.csv,892937,9216 -results/protocol_v2/gpt2/seed_7/discovery_attention_summary_v2.csv,10519,96 -results/protocol_v2/gpt2/seed_7/discovery_neuron_ranking_v2.csv,1181680,24576 -results/protocol_v2/gpt2/seed_7/heldout_ablation_per_prompt.csv,922500,4096 -results/protocol_v2/gpt2/seed_7/heldout_ablation_summary.csv,5702,32 -results/protocol_v2/gpt2/seed_7/heldout_baseline_metrics.csv,9305,128 -results/protocol_v2/gpt2/seed_7/heldout_baseline_summary.csv,300,3 -results/protocol_v2/gpt2/seed_7/run_metadata.json,2394, -results/protocol_v2/gpt2/seed_7/sequence_copy_cases_v2.csv,70799,352 -results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md,5059, +results/protocol_v2/gpt2/seed_13/RUN_REPORT.md,20550, +results/protocol_v2/gpt2/seed_13/activation_patching_per_prompt_v2.csv,122758,576 +results/protocol_v2/gpt2/seed_13/activation_patching_summary_v2.csv,8572,48 +results/protocol_v2/gpt2/seed_13/candidate_vs_random_controls.csv,2146,16 +results/protocol_v2/gpt2/seed_13/component_candidates_v2.csv,2733,32 +results/protocol_v2/gpt2/seed_13/control_ablation_per_prompt.csv,943379,4096 +results/protocol_v2/gpt2/seed_13/control_ablation_summary.csv,5315,32 +results/protocol_v2/gpt2/seed_13/control_baseline_metrics.csv,9559,128 +results/protocol_v2/gpt2/seed_13/control_candidate_vs_random.csv,2165,16 +results/protocol_v2/gpt2/seed_13/copy_specificity_summary.csv,2935,16 +results/protocol_v2/gpt2/seed_13/discovery_attention_scores_v2.csv,883743,9216 +results/protocol_v2/gpt2/seed_13/discovery_attention_summary_v2.csv,10410,96 +results/protocol_v2/gpt2/seed_13/discovery_neuron_ranking_v2.csv,1156759,24576 +results/protocol_v2/gpt2/seed_13/heldout_ablation_per_prompt.csv,917917,4096 +results/protocol_v2/gpt2/seed_13/heldout_ablation_summary.csv,5548,32 +results/protocol_v2/gpt2/seed_13/heldout_baseline_metrics.csv,9196,128 +results/protocol_v2/gpt2/seed_13/heldout_baseline_summary.csv,295,3 +results/protocol_v2/gpt2/seed_13/run_metadata.json,2339, +results/protocol_v2/gpt2/seed_13/sequence_copy_cases_v2.csv,70389,352 +results/protocol_v2/gpt2/seed_29/RUN_REPORT.md,20545, +results/protocol_v2/gpt2/seed_29/activation_patching_per_prompt_v2.csv,123117,576 +results/protocol_v2/gpt2/seed_29/activation_patching_summary_v2.csv,8602,48 +results/protocol_v2/gpt2/seed_29/candidate_vs_random_controls.csv,2157,16 +results/protocol_v2/gpt2/seed_29/component_candidates_v2.csv,2729,32 +results/protocol_v2/gpt2/seed_29/control_ablation_per_prompt.csv,941876,4096 +results/protocol_v2/gpt2/seed_29/control_ablation_summary.csv,5306,32 +results/protocol_v2/gpt2/seed_29/control_baseline_metrics.csv,9505,128 +results/protocol_v2/gpt2/seed_29/control_candidate_vs_random.csv,2167,16 +results/protocol_v2/gpt2/seed_29/copy_specificity_summary.csv,2959,16 +results/protocol_v2/gpt2/seed_29/discovery_attention_scores_v2.csv,883867,9216 +results/protocol_v2/gpt2/seed_29/discovery_attention_summary_v2.csv,10415,96 +results/protocol_v2/gpt2/seed_29/discovery_neuron_ranking_v2.csv,1156784,24576 +results/protocol_v2/gpt2/seed_29/heldout_ablation_per_prompt.csv,916338,4096 +results/protocol_v2/gpt2/seed_29/heldout_ablation_summary.csv,5747,32 +results/protocol_v2/gpt2/seed_29/heldout_baseline_metrics.csv,9190,128 +results/protocol_v2/gpt2/seed_29/heldout_baseline_summary.csv,295,3 +results/protocol_v2/gpt2/seed_29/run_metadata.json,2345, +results/protocol_v2/gpt2/seed_29/sequence_copy_cases_v2.csv,70282,352 +results/protocol_v2/gpt2/seed_7/RUN_REPORT.md,20536, +results/protocol_v2/gpt2/seed_7/activation_patching_per_prompt_v2.csv,122389,576 +results/protocol_v2/gpt2/seed_7/activation_patching_summary_v2.csv,8590,48 +results/protocol_v2/gpt2/seed_7/candidate_vs_random_controls.csv,2168,16 +results/protocol_v2/gpt2/seed_7/component_candidates_v2.csv,2732,32 +results/protocol_v2/gpt2/seed_7/control_ablation_per_prompt.csv,942679,4096 +results/protocol_v2/gpt2/seed_7/control_ablation_summary.csv,5306,32 +results/protocol_v2/gpt2/seed_7/control_baseline_metrics.csv,9523,128 +results/protocol_v2/gpt2/seed_7/control_candidate_vs_random.csv,2177,16 +results/protocol_v2/gpt2/seed_7/copy_specificity_summary.csv,2944,16 +results/protocol_v2/gpt2/seed_7/discovery_attention_scores_v2.csv,883720,9216 +results/protocol_v2/gpt2/seed_7/discovery_attention_summary_v2.csv,10422,96 +results/protocol_v2/gpt2/seed_7/discovery_neuron_ranking_v2.csv,1157103,24576 +results/protocol_v2/gpt2/seed_7/heldout_ablation_per_prompt.csv,918403,4096 +results/protocol_v2/gpt2/seed_7/heldout_ablation_summary.csv,5669,32 +results/protocol_v2/gpt2/seed_7/heldout_baseline_metrics.csv,9176,128 +results/protocol_v2/gpt2/seed_7/heldout_baseline_summary.csv,296,3 +results/protocol_v2/gpt2/seed_7/run_metadata.json,2341, +results/protocol_v2/gpt2/seed_7/sequence_copy_cases_v2.csv,70446,352 +results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md,5316, results/protocol_v2/smollm3/seed_13/RUN_REPORT.md,20616, results/protocol_v2/smollm3/seed_13/activation_patching_per_prompt_v2.csv,77784,576 results/protocol_v2/smollm3/seed_13/activation_patching_summary_v2.csv,8636,48 @@ -150,7 +150,7 @@ results/protocol_v2/smollm3/seed_13/heldout_ablation_summary.csv,5268,32 results/protocol_v2/smollm3/seed_13/heldout_baseline_metrics.csv,5901,128 results/protocol_v2/smollm3/seed_13/heldout_baseline_summary.csv,294,3 results/protocol_v2/smollm3/seed_13/run_metadata.json,2461, -results/protocol_v2/smollm3/seed_13/sequence_copy_cases_v2.csv,70555,373 +results/protocol_v2/smollm3/seed_13/sequence_copy_cases_v2.csv,70550,373 results/protocol_v2/smollm3/seed_29/RUN_REPORT.md,20616, results/protocol_v2/smollm3/seed_29/activation_patching_per_prompt_v2.csv,76363,576 results/protocol_v2/smollm3/seed_29/activation_patching_summary_v2.csv,8680,48 @@ -169,7 +169,7 @@ results/protocol_v2/smollm3/seed_29/heldout_ablation_summary.csv,5240,32 results/protocol_v2/smollm3/seed_29/heldout_baseline_metrics.csv,5920,128 results/protocol_v2/smollm3/seed_29/heldout_baseline_summary.csv,289,3 results/protocol_v2/smollm3/seed_29/run_metadata.json,2461, -results/protocol_v2/smollm3/seed_29/sequence_copy_cases_v2.csv,70457,363 +results/protocol_v2/smollm3/seed_29/sequence_copy_cases_v2.csv,70453,363 results/protocol_v2/smollm3/seed_7/RUN_REPORT.md,20630, results/protocol_v2/smollm3/seed_7/activation_patching_per_prompt_v2.csv,76610,576 results/protocol_v2/smollm3/seed_7/activation_patching_summary_v2.csv,8706,48 @@ -188,4 +188,4 @@ results/protocol_v2/smollm3/seed_7/heldout_ablation_summary.csv,5206,32 results/protocol_v2/smollm3/seed_7/heldout_baseline_metrics.csv,5903,128 results/protocol_v2/smollm3/seed_7/heldout_baseline_summary.csv,294,3 results/protocol_v2/smollm3/seed_7/run_metadata.json,2457, -results/protocol_v2/smollm3/seed_7/sequence_copy_cases_v2.csv,70614,364 +results/protocol_v2/smollm3/seed_7/sequence_copy_cases_v2.csv,70612,364 diff --git a/ARCHIVE_SHA256SUMS.txt b/docs/provenance/SHA256SUMS.txt similarity index 77% rename from ARCHIVE_SHA256SUMS.txt rename to docs/provenance/SHA256SUMS.txt index 6dea739..a998687 100644 --- a/ARCHIVE_SHA256SUMS.txt +++ b/docs/provenance/SHA256SUMS.txt @@ -1,12 +1,10 @@ +d978c8fc1f1241440de118eafea780e6b2adfb082e09955150456c1d0c2187a1 .gitattributes c4bf26036d0247806698afcbac00badd40c0d89dae94d14ca6ffb70306d06fe2 .github/workflows/tests.yml 7fc9080a0fee2305ae13d93006ccbcdec81d1f0293dfa6ceecd7e0766f9e6a1f .gitignore 1cf819c70d52bd149fe464a3c16e6b8381cb8fd4e4243a004d437026bcf158d6 .streamlit/config.toml -0a241039f45aef60887414b65ab1f04b83392e4c16b5ce5ac7e60d1bd32276d3 CITATION.cff -1c90c79e094309b0ee301f71a904d541fcc4900075122a4fe027650e2b11ae52 CV_ADDITION.txt +0fb4223c3c63cf410da692fb142ab7a07399f5cb61ea88f856bf1cc13e9bc669 CITATION.cff ec4ab498897ee0d12aa7f8e354f3a7d4fd1baaf9db18dbf99927ffb78bed08ed LICENSE -493e1aed5f2c2e2a2d873964e0cc2930ebc29214f1f363d2e92552d7738c75be PROTOCOL_V2_README.md -b8a976ec887a7460598ce180d6a67aab98960679ba7d5a31ad9006e102dffbfc README.md -2b4d58555d657a0ea8aff4915637be544636929f63c46ce95220236c02a668d9 RESEARCH_ARCHIVE_MANIFEST.md +4fa943a5a76900c39b34ea30c9c85eb852e69023d42d147c5d3aae87aa4a368a README.md e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 artifacts/.gitkeep 0ff16efcf46212069be264fe82260565bd098e220c90ab6ef713fd23b35c1ca0 dashboard/app.py cfa4eb8e6aa72f9fca3e82b2798d2df0bdfe839f0b86e89f88378909bf0d3f4f dashboard/hf_app.py @@ -18,36 +16,40 @@ f480a41551f8737739542383201bda9a03aa015a8e0eb40dbfa662cc550fc35b data/evaluatio 6d2311f60d3a287f73cd673d339b6e86b95fc5b5209b05747c83278914254f9a data/repeated_token_prompts.txt 91f9b31d641d046d9b841ee4cabca361ffe9df6ea5a07b32087832b1e2af1477 docs/ARCHITECTURE.md c17d111495c48fa2497a2a758e4f22897fa4c0918e03384957622c2d1ed4a9d8 docs/EXPERIMENT_PROTOCOL.md -2df388aff4f4e5910dc12822822ccdecdaf83fb08a6375b537ad0c88c2521765 docs/HUGGINGFACE_RESEARCH.md -96e52c5a40cbf3200048d024a15a1f3cebd35cff21255fef2cedfc81473b8495 docs/PROJECT_SCOPE_AND_CV.md -dec4dccf00a4ab5945743f39d0cf7bb292eeae52fc1de7f30e5bf6b81b75e2c8 docs/PROJECT_STATUS.md +a5d74a9c31068eba61927fd3505739387f98498d963b0b25fd23b8531b66c75c docs/HUGGINGFACE_RESEARCH.md +a7b3e321666fd9ba0b94102ca3e7abe58fd49e3e229c68f9c67b40472784a41e docs/PROJECT_SCOPE.md +675e71b41afb10e459e83f4ba7ecf5923453b3149668c28ba4e2cce7c4403f2c docs/PROJECT_STATUS.md a2ff0f24ba52cb87ff158bfb95ffa62c53bcd4238bee2ef3cc44a693ea9f6939 docs/PROTOCOL_V2_CHANGELOG.md -72ce57d7ecb2c8c4d49303dd512a50dd1823ee88d8d94bc89fd5f399ab6545d2 docs/REPRODUCIBILITY_CHECKLIST.md +a86d122e9ed54d14bca8b0dda0f73c89cd27210cede173f75372d31120bdb12c docs/PROTOCOL_V2_QUICKREF.md +bccec917bb574d94d8bb644be41f0d6625d76ab70013ac92968a73699e3eb1a3 docs/REPRODUCIBILITY_CHECKLIST.md ce9b9b2112ca851cebc9463510f77ddd0f931b75bc52cdc9992caa3da8f6e0f8 docs/RESEARCH_REPORT_TEMPLATE.md 515a0a3fb3a181adc95a0fe384249ecf814ff90f9ff2d6a4ab31f1e14277da38 docs/SEQUENCE_COPY_STUDY.md +80d1f781e4532f686615ebf5326c287b40c8fba7de59df4c7925bb8bb33bf4eb docs/figures/smollm3_v2_summary.png +7e3797aea7929549c0fa23dab365b053e4da5b65dcf1dbc12cca361d4a5826f9 docs/provenance/RESEARCH_ARCHIVE_MANIFEST.md +db0f55b03eb7a4d46621543a2817e55cb95bf36095c2291900f9b79d5af3567c docs/provenance/RESULTS_FILE_INVENTORY.csv bb0d9e8440e1004724764999e8a653397e8a28d202764484f008b6b6c24d80f9 notebooks/README.md -170f36a926dc82be9fa5182653e145eb3b71a90bf14bf92e7e063ff6b8ae07bd pyproject.toml -d4b73df01d445bf6792ce20f94180133a1396ea50fb515e4788ebd1544bc6a2e reports/FINAL_RESEARCH_REPORT.md +2f9423e10f87972ab17be0ce5173b511fd325cd29f7b7e8a2f5f3e892abd4236 pyproject.toml +93627d18483efaca736d9c109111d16208ad010f6075e05da2e3945dad132995 reports/FINAL_RESEARCH_REPORT.md e0f3a6191d0ba6d67949f8ba2f39bae662a2a83522c0063f5e8ee435e078fc7d requirements-dev.txt f3bf56a55d5df274281f04c173e1852492a9d61551aa73b78acbeab559abf55f requirements-gpt2.txt 03ea2964c913ac699e128a4e5c37acfe354146bea19140dcdf8bbea98f9de7ce requirements-huggingface.txt d551652e11232a4ebf9d63f7d75e79a30cab91047b32dee93e8716fe3fa8f420 requirements.txt 50f6aa887e04faeac3d94c7d9ece6b40107014d775e02ec889b07859d9f2f95b results/README.md 64001dfed35d06675487efa159e6722989f9e1ae1c490d54cd1a75c4abeff518 results/protocol_v1/README.md -440ac72b8b251a7cc4f59bf1d82dd52b98096408d6b7a2e8f33a2397e91e5d51 results/protocol_v1/gpt2/seed_7/RUN_REPORT.md -bd5158551e23c5ff619c7e8aedd4cbf6503653a212b9739202ca46f2efbb6f06 results/protocol_v1/gpt2/seed_7/activation_patching_per_prompt.csv -3cdee0c0a8593d02ce348029fdc0288e72f37f978064de5e1599d2c127441b16 results/protocol_v1/gpt2/seed_7/activation_patching_summary.csv -5da8e76dc466928a269d24a2779d9dece1e71cd25356f5c7eed5badffdc81ead results/protocol_v1/gpt2/seed_7/candidate_vs_random_controls.csv -93b58e03d2f7345a6bc4ceae836519142d97f0ec7c0a3192bd05b8d2595be7f0 results/protocol_v1/gpt2/seed_7/component_candidates.csv -1717dacb5981e5eb0546a3b63a7a8b04af4c82191a6e0a1d1ad19f8cb08ff95a results/protocol_v1/gpt2/seed_7/discovery_attention_scores.csv -dbde3c4539239543907777397737c463043e9c6fc4355ac8b4fde48a725db455 results/protocol_v1/gpt2/seed_7/discovery_attention_summary.csv -01a2b1340f4c0481d836657db02f80074e46edf5dbdc20920c0661a1bd91d61d results/protocol_v1/gpt2/seed_7/discovery_neuron_ranking.csv -c8b17012805d11c49f5f84719d5972f71f42f9992467e68eeb3a7b96d20d70ef results/protocol_v1/gpt2/seed_7/heldout_ablation_per_prompt.csv -09613ee413b023f88458562516c16cb143a9415248c8626bd54f7724be365f64 results/protocol_v1/gpt2/seed_7/heldout_ablation_summary.csv -39aaa4856e11167fd6da3c1307cd367689e02637b1b4d5bb70994b2c40145c76 results/protocol_v1/gpt2/seed_7/heldout_baseline_metrics.csv -a3da9766319ffb251069563f7fe4e14c9bee3a6706932f8dff9f08a8a4e80dc9 results/protocol_v1/gpt2/seed_7/heldout_baseline_summary.csv -285576ef51a4b96ee82701987a9a46adc992a63a154b341cbc6cbb86832c0516 results/protocol_v1/gpt2/seed_7/run_metadata.json -408bc6ef2baad269462a98c6964a7d3465fe5f668e7fc187125dd0552f516706 results/protocol_v1/gpt2/seed_7/sequence_copy_cases.csv +49c212082381a3f4053d528b364bf366a4660709b43cbdae5080ec0e14b10182 results/protocol_v1/gpt2/seed_7/RUN_REPORT.md +c8cb221508913daa4ebf55597803037b112f7ce1737bf8a0becdc03521987c8d results/protocol_v1/gpt2/seed_7/activation_patching_per_prompt.csv +9bd9f3969e40a6e21abf689e3035bd443a82dcb25cef623e28ac647955f47816 results/protocol_v1/gpt2/seed_7/activation_patching_summary.csv +52ce041744e45064ed697b4514b9a525945258bbcfc64e181f464370d94c1902 results/protocol_v1/gpt2/seed_7/candidate_vs_random_controls.csv +708edd17dfc6b6d2f5fc259d0433d02283a4df57b5c1045d416de64d829695a3 results/protocol_v1/gpt2/seed_7/component_candidates.csv +0f1895b984857f00c6c19db4729ada101e803fec285c7cf7ade04034bec75734 results/protocol_v1/gpt2/seed_7/discovery_attention_scores.csv +58f002639682273f03f1fd68096dfa9be526b05d9c2e9c83c65d65355fdfaeb3 results/protocol_v1/gpt2/seed_7/discovery_attention_summary.csv +bccf5910a7478eb4aae4ac30c4d0eb288b472a437d01bbef0eb2f74ac0cf2746 results/protocol_v1/gpt2/seed_7/discovery_neuron_ranking.csv +a56ae73706755ce40b8f0fb63751f6bef966315ef5a8e531165a56c0b3d475b2 results/protocol_v1/gpt2/seed_7/heldout_ablation_per_prompt.csv +ffcaf58196017af2f84ed1c6790f101f969fd1eab947938cf19e7178a1545e80 results/protocol_v1/gpt2/seed_7/heldout_ablation_summary.csv +6f5737b0b7c3a06ce2c7d4c23827a72829d0dfeed6a7dbfe70994d616db969be results/protocol_v1/gpt2/seed_7/heldout_baseline_metrics.csv +dec4bdd3b5ce70b06d2c8ed4d9993f0b428558bfffeb487ce359b153da49ebdd results/protocol_v1/gpt2/seed_7/heldout_baseline_summary.csv +62c55ec01266e28abb0f7b34d2a27eee79e3d25b9567977ff21ed315d3935d26 results/protocol_v1/gpt2/seed_7/run_metadata.json +edf3df08b5f0be0f88cd6888d300f7e6989e8449cef79668dcbca4b5ba9efe25 results/protocol_v1/gpt2/seed_7/sequence_copy_cases.csv 645a4d4d829b8b2447cd47de854d3192be912280cea7d26030bbb83a22e0f098 results/protocol_v1/raw_archives/gpt2_seed7_results.zip b7a510ca0b9e6a675bcbf45f495d2020d54a1fc575c3ae8d6302291a4912da53 results/protocol_v1/raw_archives/smollm3_all_seeds_results.zip b3de14598cb02204290d091a44e3823a410a5f5d093063f69bd4d38d1c249f40 results/protocol_v1/smollm3/seed_13/RUN_REPORT.md @@ -77,7 +79,7 @@ d215cddb6a70bc1251c301dd7303f223f28761ba5fd0ce7434de5f7c90d87a09 results/protoc d7fab03b47e4ea9ed5b6212b064a70e734d1fbd9f12fca650a3b4e86646d337d results/protocol_v1/smollm3/seed_29/heldout_baseline_metrics.csv 7f5d574242b1bf28b0db2c51cafc973524d50820e060a03ac648f13b30e746c4 results/protocol_v1/smollm3/seed_29/heldout_baseline_summary.csv 63fe471ccc82f9174400497db4c436f078c2d69dc14e211e023c4cf683ff564d results/protocol_v1/smollm3/seed_29/run_metadata.json -2e608997c4e137b9659587a1ea9e2b07082f7315a01da3b3a9f75838c677bf09 results/protocol_v1/smollm3/seed_29/sequence_copy_cases.csv +00cede05408f698fd1523c072ad12095c93221bd52a69be31cc1b99db64ade4c results/protocol_v1/smollm3/seed_29/sequence_copy_cases.csv 54ff4e1114523273bd901eb9306e49cfe5147528d9221bc88ab572a6135fae0c results/protocol_v1/smollm3/seed_7/RUN_REPORT.md 5aa911624a20f27b63813b643bc61fc79294f5f32a9333a2b66775e6105c1f06 results/protocol_v1/smollm3/seed_7/activation_patching_per_prompt.csv 506fb4bf76d1bb52b21a99ac6d288ef3c02ab9c3b123ea80f2fdd9dda0f07d6c results/protocol_v1/smollm3/seed_7/activation_patching_summary.csv @@ -107,64 +109,64 @@ ae8664533a18cbfb3185e03b511b0c296677a87dfbca40215d350b1324ce695b results/protoc 238115fec2b1c6f1a2cb1ed2e9c137e83e314d0de419a5bc5ed9c5526d6fdc80 results/protocol_v1/smollm3/smoke_test_seed_7/HuggingFaceTB_SmolLM3-3B-Base_20261103T183004Z/run_metadata.json 68727287c74273e77f0397f9cd891b02e584dc127262cc45c053c634f62bc8af results/protocol_v1/smollm3/smoke_test_seed_7/HuggingFaceTB_SmolLM3-3B-Base_20261103T183004Z/sequence_copy_cases.csv bde3e11c1b531676b31b03e243caad5d117850f78a9ef8e578ce89ce8562f855 results/protocol_v2/README.md -a19d4e8f009e46db67a0bf26a248bb40871c321093fc869929dc93864f172174 results/protocol_v2/gpt2/seed_13/RUN_REPORT.md -9acd28fbe0ba0b84275db154619fe618e5e6a44dd0901c6c6482cc011099491f results/protocol_v2/gpt2/seed_13/activation_patching_per_prompt_v2.csv -a4ebe3003e272c4234e0487c93db3f1cf7656c7309bdb7818b4eb6be2ac4d5e6 results/protocol_v2/gpt2/seed_13/activation_patching_summary_v2.csv -869aa33c02c6d9a749735b662cf3212020ebcf1b38f65d2080318629a469337d results/protocol_v2/gpt2/seed_13/candidate_vs_random_controls.csv -9ff3e3b6688754f8d7eb69ba5b6d0f1cf2bc4e870ce5a479c66bb8b2549b8ebc results/protocol_v2/gpt2/seed_13/component_candidates_v2.csv -b81a2f298a0af97aa09ed7600b19b64a0b139e20e6cc81450c9284bc42c9bd35 results/protocol_v2/gpt2/seed_13/control_ablation_per_prompt.csv -1bcaebc827a8f1cdc36550ec556f0014d4c246ec0eecb7452ab5d4ec36e4aa3e results/protocol_v2/gpt2/seed_13/control_ablation_summary.csv -693e749d62b5ad3b8de02276f47e35835965cb34fbbc9877f1948080a2896b4d results/protocol_v2/gpt2/seed_13/control_baseline_metrics.csv -b07036645212c1fcbaf10678e6a359f3eed14419e4933dac75fe23226bf558ec results/protocol_v2/gpt2/seed_13/control_candidate_vs_random.csv -d832d655fbd113dd882d76fb1d32a2f6cef0745767dc54471e3c83ca1cca362e results/protocol_v2/gpt2/seed_13/copy_specificity_summary.csv -d4ab182c6c224229badb25e2f2ed249ff1eb2558a7b66656da9a58c7f8b37f56 results/protocol_v2/gpt2/seed_13/discovery_attention_scores_v2.csv -8e8b62cf9bbd12b47fd27963e49aa37ed9e9db67ea92c9d24869310af1d8e1e3 results/protocol_v2/gpt2/seed_13/discovery_attention_summary_v2.csv -d29131e783aa4f1cc186cd1642dd25d5a7e4bfe5e1bdde0dddb007820af1f692 results/protocol_v2/gpt2/seed_13/discovery_neuron_ranking_v2.csv -c6dde65c0ffbeef2edc056454a00364c32b116fb0c2a4dcc575368de42e975cc results/protocol_v2/gpt2/seed_13/heldout_ablation_per_prompt.csv -9e7726f7eaac3ea12017634589effbee0edbdc4de303e07ab224d5e3b9d5072e results/protocol_v2/gpt2/seed_13/heldout_ablation_summary.csv -3914ff56a7d95c8fd30ab8cfae1ccd1b2626011336788142d7c22cf64e7974bf results/protocol_v2/gpt2/seed_13/heldout_baseline_metrics.csv -ba6e8a6f645044d8ec64deacf027339bdb1d4b89e774d2ee84ba8fde69eeda15 results/protocol_v2/gpt2/seed_13/heldout_baseline_summary.csv -9b9fb60b4ec531fe5f5f2c930621b14c93f963d08008760065d46cae9507893d results/protocol_v2/gpt2/seed_13/run_metadata.json -d8663bdfc688cc6e98812bd1b675bc60d6a919372add7d53c4de5dd637bee14a results/protocol_v2/gpt2/seed_13/sequence_copy_cases_v2.csv -48b2c7e870b4ea51b4f2e5b6b72e0ef24e25bc5fca6f4c014cf7d32fd65abfae results/protocol_v2/gpt2/seed_29/RUN_REPORT.md -c4e12c370a066e67e4f9d649b83c47c6c2e097ec365460d8c1a758903140a4f2 results/protocol_v2/gpt2/seed_29/activation_patching_per_prompt_v2.csv -3ad934760d71150515d4861de44c439e631b9e3018c0f42c7dc69c8edd9f8e21 results/protocol_v2/gpt2/seed_29/activation_patching_summary_v2.csv -3d91796c50a8d1996b7e55f06a71faa84cc6b9beb3e365812f9bbd5ec6d1c7d8 results/protocol_v2/gpt2/seed_29/candidate_vs_random_controls.csv -00489b4dc6e9388cbedf9ff16c0f296296f12eab94e659f1f1c99ea4efec8168 results/protocol_v2/gpt2/seed_29/component_candidates_v2.csv -6ff1d585746fa3dfba4c97c407cf14fa57e56526d482e0b1a9ab199eedc8a22c results/protocol_v2/gpt2/seed_29/control_ablation_per_prompt.csv -1f4024a58c2225a0588454e8abeb25126be218c85d87fefa59c23c99a0dcfd61 results/protocol_v2/gpt2/seed_29/control_ablation_summary.csv -253613d7840589f97b19bccf60ed8c3409c75fc666faa5a66489d45bcd4424b3 results/protocol_v2/gpt2/seed_29/control_baseline_metrics.csv -77efd1c94fe0065b9944780630aafa1f27e701444c4e01dd5bdad532608ad9eb results/protocol_v2/gpt2/seed_29/control_candidate_vs_random.csv -3410c6d4f51589a6c4f120f42adac32037de6a69ff85593e711c065a5095c9fb results/protocol_v2/gpt2/seed_29/copy_specificity_summary.csv -2b1d80cb7ab7323ee7cab0ab8de3722766573eceb8b467782c511a10d17d703b results/protocol_v2/gpt2/seed_29/discovery_attention_scores_v2.csv -22f943240ecbe95da6315ac28314b853a1251226f8018273f83f9808ce6f1e3f results/protocol_v2/gpt2/seed_29/discovery_attention_summary_v2.csv -8ca364db6653058f8dc31270b0ed15f5858f4c31cca306bdc82cc56b23d7dae7 results/protocol_v2/gpt2/seed_29/discovery_neuron_ranking_v2.csv -24db29ef1da53c71e677baf627cbdacfc33e295570b7b56d194748587ea11f30 results/protocol_v2/gpt2/seed_29/heldout_ablation_per_prompt.csv -8a83db0c1885e7464cb895338ff25d151036b192836124bed7bd183baadaf32a results/protocol_v2/gpt2/seed_29/heldout_ablation_summary.csv -a3d150bd2b484d57eef6ca3cef9ad60d90dfbd8aeac049fd283bff4cb27b1945 results/protocol_v2/gpt2/seed_29/heldout_baseline_metrics.csv -666ad94396e81d6ada6f2af61817751cada11cd13dde1a2b468764b8ac914397 results/protocol_v2/gpt2/seed_29/heldout_baseline_summary.csv -181c7438ed94ca0e51b682a1f3e43d3408302fe782244c3ad1f3f435a32231c1 results/protocol_v2/gpt2/seed_29/run_metadata.json -db17372213f92c7b91cfce67bbf4aeedc3343d917eb4e2a0359ae078a995b41f results/protocol_v2/gpt2/seed_29/sequence_copy_cases_v2.csv -8472fa5596aaa288096ccd7c3f19821b5b2f0e95a5b2614cccbbc137d3903493 results/protocol_v2/gpt2/seed_7/RUN_REPORT.md -2d6d72e7e52cf131fdc15d7919c8b270231d2c1f657e9431fc9f3f9db8e9c177 results/protocol_v2/gpt2/seed_7/activation_patching_per_prompt_v2.csv -16c0eed7faed9962cef3e66a188c1f5dd256fe09e6f5664efe3364469ad35bb8 results/protocol_v2/gpt2/seed_7/activation_patching_summary_v2.csv -d468e68a602d7e5ba27f151cb775c65b3948fe3fe30931e68f0ea2d77af27556 results/protocol_v2/gpt2/seed_7/candidate_vs_random_controls.csv -57037ca6aba89e624802387dc84794af8fe2c7fea88d8647eff427962f486bdc results/protocol_v2/gpt2/seed_7/component_candidates_v2.csv -6fe5be0cfe39d94c854291fab059322e1ddd926421a670f5c183a46a1bc38acb results/protocol_v2/gpt2/seed_7/control_ablation_per_prompt.csv -e8af41b8d29b4c6b6d3a0c4c3e12910c01e7e41902138c7c57ad40cd04ca2553 results/protocol_v2/gpt2/seed_7/control_ablation_summary.csv -84f436d969cc124f3663157f2e1b4b55d92e92bcd120f83e0a523a18c046a69f results/protocol_v2/gpt2/seed_7/control_baseline_metrics.csv -46090024f46fffed7231f02b0f4c79dd992031da994f359890305c145fcf1e9d results/protocol_v2/gpt2/seed_7/control_candidate_vs_random.csv -a1bb1b06ba2a89473c7ca5b53b6f8dfd7c583e44080d1a86636922b31f20e249 results/protocol_v2/gpt2/seed_7/copy_specificity_summary.csv -94927fdbfea06341a2052a610cd5c6b25f8b42950b4aa411149f83ebf8243ced results/protocol_v2/gpt2/seed_7/discovery_attention_scores_v2.csv -39a08fc0110dd3f8f5616c4a3d3b240a0b2c0f0a7fbbf16a929407cabe50fe96 results/protocol_v2/gpt2/seed_7/discovery_attention_summary_v2.csv -dd40e0bc4ed050ce02e969903d79e4106edc87a15a14e31c48015af45af7761b results/protocol_v2/gpt2/seed_7/discovery_neuron_ranking_v2.csv -72c4ada5b85d87b9f87997278a4584d19b0f0c707e7f7d107d09068de9d3ac8f results/protocol_v2/gpt2/seed_7/heldout_ablation_per_prompt.csv -6afdc6987167c09d7e17fe5ba1596a8e269f2a206cbc0c3b9ae8758bece64f89 results/protocol_v2/gpt2/seed_7/heldout_ablation_summary.csv -45eadae65775f05cb07a792eb3f8b6fa4ec3e7041da95c3c7882ca3f273c64ee results/protocol_v2/gpt2/seed_7/heldout_baseline_metrics.csv -355b3c57b2789be46d624156d29108f4a1d064fa408681230d0bbdb7c13da546 results/protocol_v2/gpt2/seed_7/heldout_baseline_summary.csv -ee522fa744fb21ba0ed65762b021897ae924d45a40f6df73630289e7f500dc4c results/protocol_v2/gpt2/seed_7/run_metadata.json -0a0312fa833b933cbd30c722b584f2de072336e76c49f0d3cb34d1cd16e3de6c results/protocol_v2/gpt2/seed_7/sequence_copy_cases_v2.csv -254a2903520cd8791571ca669224b12df764eebf01c08971e162663e722b7cd3 results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md +da0018c7eef516280d0e615c224af4b9af93904a385ee518fd7fa3ffd3c01405 results/protocol_v2/gpt2/seed_13/RUN_REPORT.md +8eb090a9f6bbc6683d0810be1014eedb71eedcd05346c56f2b92c495b5279705 results/protocol_v2/gpt2/seed_13/activation_patching_per_prompt_v2.csv +a8e8bcc41caa705da9fc524743b2e3b98c66bd2cc0d959e65965bddc98c1194b results/protocol_v2/gpt2/seed_13/activation_patching_summary_v2.csv +70d07dca7957b61c5bb9ce89d57d450dda5c87d2bc4cda8609e1f60096f548bf results/protocol_v2/gpt2/seed_13/candidate_vs_random_controls.csv +9ce63b949a51c78179aa979ee00b5684dd2552364c15a6774dbda18f33bb9839 results/protocol_v2/gpt2/seed_13/component_candidates_v2.csv +47fd36f6faa3e6cf0ced8775c7c09919c45a74edd679d4b5a8fa1ccafbc76c95 results/protocol_v2/gpt2/seed_13/control_ablation_per_prompt.csv +7a90636124af9d6faa2a88dd2e10c83d9fc85af25b4bc4f3dfba3da120401bf2 results/protocol_v2/gpt2/seed_13/control_ablation_summary.csv +edd2c121b0c6d084130bda19431e2d9ffb2782a09dc4a40a4a40422a1581547a results/protocol_v2/gpt2/seed_13/control_baseline_metrics.csv +372c38725988b07f99b7cef1d565658128726be8322a444a04c4c78cb9e2f3f8 results/protocol_v2/gpt2/seed_13/control_candidate_vs_random.csv +0f5cc3f091d93c20cafb419778e4dfac00b684bc093d00cca67e2a17511a9db6 results/protocol_v2/gpt2/seed_13/copy_specificity_summary.csv +11534d7ce8ea4c8fd05b38f121e8b6dd203116bf13c5a8f7b2f7eb8a454d2f1b results/protocol_v2/gpt2/seed_13/discovery_attention_scores_v2.csv +115397f3fd6c12049c32b7755115e679cddeabd3f2819ae77e2aff8fdee079c8 results/protocol_v2/gpt2/seed_13/discovery_attention_summary_v2.csv +d588d7c3356a678ec5016c73e0a5b276bcadffabf5b5b80cbe097b1fcc55c159 results/protocol_v2/gpt2/seed_13/discovery_neuron_ranking_v2.csv +712fa112db55b7ee3c2e17d55fd20fa1dc54566ba3fc6eee1369aea04c7e2a7d results/protocol_v2/gpt2/seed_13/heldout_ablation_per_prompt.csv +35f5ee1cc1bcfe40f5747aede1c90e6df5c2d309caea1dc45369bfa53938a90f results/protocol_v2/gpt2/seed_13/heldout_ablation_summary.csv +716a4d40dd6cd413fd0dc9e14532e1bd462448db6191e45fb64e016f319f9e51 results/protocol_v2/gpt2/seed_13/heldout_baseline_metrics.csv +6b50b3863f90d060651e423a0c1346e3606d88acdf1018633f9a083f10b58141 results/protocol_v2/gpt2/seed_13/heldout_baseline_summary.csv +e27997d7e5e9d62bc5b98c6415b2c354130cf3be0d774f806bdfc4d4d0f3b0ed results/protocol_v2/gpt2/seed_13/run_metadata.json +3e634ae87200d2d8382c57077437119f980b947c5843d399639a9c14b9620131 results/protocol_v2/gpt2/seed_13/sequence_copy_cases_v2.csv +f244596e7ca67ca95d560146a490957fd68ef5bb2304f6856582d8f625d35622 results/protocol_v2/gpt2/seed_29/RUN_REPORT.md +57e175d35bda4e7c767feee70b53f38a8a2d10d8eb39765687d02ad86e43e104 results/protocol_v2/gpt2/seed_29/activation_patching_per_prompt_v2.csv +c14f8770a7822e8a83b42f7af0dda93b7e1477c135b301f1198d251e77e10114 results/protocol_v2/gpt2/seed_29/activation_patching_summary_v2.csv +0e82f5e5b885069439198defe060e31c648345761005aebb5847a597375b1eff results/protocol_v2/gpt2/seed_29/candidate_vs_random_controls.csv +6d464060a83a4779df81f0a2dab4d62a4de7a1b94ec2f7478a1ea3cd600ea1ac results/protocol_v2/gpt2/seed_29/component_candidates_v2.csv +0d44713b84a96638e4215f798088785ab483b61aadfd61810c842091b8b5e0ea results/protocol_v2/gpt2/seed_29/control_ablation_per_prompt.csv +13fe3bfa558d8a0173e40dea0dd52227871df4de2ee5dbe79a8973be20c1efcc results/protocol_v2/gpt2/seed_29/control_ablation_summary.csv +dd9703eb0dba3a8a70ff242a30b1ce3edf588d346a570bc2f3c32e9111c36458 results/protocol_v2/gpt2/seed_29/control_baseline_metrics.csv +a50969cc90ebabd33058b80142470048b6040bc1501ad8f74116fdd89a1e7942 results/protocol_v2/gpt2/seed_29/control_candidate_vs_random.csv +fa97670c38db1a3df13690ba531ec5d60e12e4d18845db4ed2fb4fe6375ded6a results/protocol_v2/gpt2/seed_29/copy_specificity_summary.csv +5632ceb93502f76fe3c5175ae25c7316bbcca541d5bde9f20e40325b8ffce2ba results/protocol_v2/gpt2/seed_29/discovery_attention_scores_v2.csv +f720bde41bed1ea922a7454af0736c8aeb332fe118b2c653fcd8a56476dc7c65 results/protocol_v2/gpt2/seed_29/discovery_attention_summary_v2.csv +6a10fabbbc60ff23c841ffd6fb1dd4edbb41a27db8048d7f0cb3e7629b2bd343 results/protocol_v2/gpt2/seed_29/discovery_neuron_ranking_v2.csv +805df5faef9b539f8082bf9c5f36a84082f7a92ac64de7f6b9b61757baea61c1 results/protocol_v2/gpt2/seed_29/heldout_ablation_per_prompt.csv +562f41479216d65bcfff6d457b8b27b3a93c07ba999f0e9c3324a16239356f28 results/protocol_v2/gpt2/seed_29/heldout_ablation_summary.csv +42e1b0b520d5f065d7a7b7069fc63033f871e42d30632293da4639c81bae9b84 results/protocol_v2/gpt2/seed_29/heldout_baseline_metrics.csv +6740bb2641cee9a60890336f51f5f25172589f3d1e6dbfb43623c5779a6a7358 results/protocol_v2/gpt2/seed_29/heldout_baseline_summary.csv +6e0014760f0054faad83ca91be7b1fa29a84bc49e29a832691f6f361294e07df results/protocol_v2/gpt2/seed_29/run_metadata.json +874ce65ef75608680ed661606fb8357a78e679e127bf41b99af6b6fb2f95eb0a results/protocol_v2/gpt2/seed_29/sequence_copy_cases_v2.csv +48f8fead696c667be25accdeb82c44fd122fa5318c2ccfcd1a8561b3572f6526 results/protocol_v2/gpt2/seed_7/RUN_REPORT.md +4a0c497f2960df8a5a1b0ef89a95bb9f1184eaad5004669e44ff26b700a4fc1e results/protocol_v2/gpt2/seed_7/activation_patching_per_prompt_v2.csv +facef74811729e7b145f6dc5a0e81445ca1a00c820d0003ed6ad475bee2105b5 results/protocol_v2/gpt2/seed_7/activation_patching_summary_v2.csv +47b36184a865838d2eae4cc917fdb5e6a9a44b91c0309c080d04322675be4d2a results/protocol_v2/gpt2/seed_7/candidate_vs_random_controls.csv +2c32551a994ebbcd930783974bfdf330b7ea3999380aaa1a2d7547ad35916bf0 results/protocol_v2/gpt2/seed_7/component_candidates_v2.csv +c7f62c00b26dfb7415ab1b4c0bfbc72ab2709c610e0023f61907752858cf7053 results/protocol_v2/gpt2/seed_7/control_ablation_per_prompt.csv +5354ad063e0d6c0c7e41d5ece8ec5dd31cbf4d68128a45f9d801e1b7d5f03b4e results/protocol_v2/gpt2/seed_7/control_ablation_summary.csv +691d60a805b5d4aee267a7fed388b821dbb9a53186f2efcc8f429786699e7d0d results/protocol_v2/gpt2/seed_7/control_baseline_metrics.csv +9748a9686c9544f6df974654c92e1b1ada9a7a007f341b3055572b08f42dc082 results/protocol_v2/gpt2/seed_7/control_candidate_vs_random.csv +5a021b8c73e9498e2cdc43a806abe5c1849ba2b2b8c54f7f0d780baef3af67dd results/protocol_v2/gpt2/seed_7/copy_specificity_summary.csv +46947c8dfc67b609c5489a3ad787c2419801fbb14928ab4c7b58937bbc2d2430 results/protocol_v2/gpt2/seed_7/discovery_attention_scores_v2.csv +a2ba4a45379d3357817490fd54d3e4cfa854ff49855cbe45def4e8158358df23 results/protocol_v2/gpt2/seed_7/discovery_attention_summary_v2.csv +d821ec95b694cf7dc03fcea90b1a23d29e70faa7ad9c57432ee96c016c4c3a32 results/protocol_v2/gpt2/seed_7/discovery_neuron_ranking_v2.csv +a06038c3e20c8f04075031ab5c55cd3fe8cd2a7473581543d0db4bc391591e35 results/protocol_v2/gpt2/seed_7/heldout_ablation_per_prompt.csv +7ad79fe707b1afd034fd62cb025ad244328496d0572e4125d4e4a69cc916c09d results/protocol_v2/gpt2/seed_7/heldout_ablation_summary.csv +2c5a893d27e4954ca347b82a9d7732d98c47c920204bce1d5c0567e930c5f8ea results/protocol_v2/gpt2/seed_7/heldout_baseline_metrics.csv +2f20d97756eed6e0cada0b3dbc2b9668bea63c78b8569648868af445fafd4d48 results/protocol_v2/gpt2/seed_7/heldout_baseline_summary.csv +36ace6f8131ea17a746157ac8d66653e5538a2f1f9d789a4362b775fc8995210 results/protocol_v2/gpt2/seed_7/run_metadata.json +55aa1482848066b7460b2d08019561abdf7c5fa2717797ae0c630f072abaec74 results/protocol_v2/gpt2/seed_7/sequence_copy_cases_v2.csv +81389b46c2ba810150c0dbb29f93b1609a7c2ddb18913243b4e36f6d4e328d50 results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md b880f63ed8be0b2b934be5067486902f881e58e4a672bab29f1e832ed7b6e774 results/protocol_v2/smollm3/seed_13/RUN_REPORT.md a16fe8c06428b64c3a34bf32110f3f3473b721c43f257cc3b199511d56a9ece1 results/protocol_v2/smollm3/seed_13/activation_patching_per_prompt_v2.csv d5d058e78f379d6a44cbc066574583a153901e4d2c1bba468ddffdde2f831ae3 results/protocol_v2/smollm3/seed_13/activation_patching_summary_v2.csv @@ -183,7 +185,7 @@ e8c982d6c21c4a01e2a147f452799d120bdb579ed1cd5263428c87a8fc8b39b9 results/protoc 4621690264f508a068c42849553dafad34dffcb2c0ec38631951db60571c9d03 results/protocol_v2/smollm3/seed_13/heldout_baseline_metrics.csv 16d18f99a83bcc8bea64a327e9f8835d4a1806d1d13d79d54119f7b454442108 results/protocol_v2/smollm3/seed_13/heldout_baseline_summary.csv 85a768063ae101e9d428db76dd885e25602217d5a602b5ea4c2a7f18cbae60ea results/protocol_v2/smollm3/seed_13/run_metadata.json -e23efdf3394297548d368f38a6d0c501a9836bc7ef9f56d9f7e73a596ecd6fe0 results/protocol_v2/smollm3/seed_13/sequence_copy_cases_v2.csv +4d54ddd7cb3b6274c207bc7c7248eb4344bb49e54562fdab7531d1a756e8a35e results/protocol_v2/smollm3/seed_13/sequence_copy_cases_v2.csv 248e0147b849bfaf7d01499a7f2d996bca238177f4ebf9cac1608a7e7b6201f9 results/protocol_v2/smollm3/seed_29/RUN_REPORT.md 5e5c42a15b03010eb8caecdc8f72090a2630219397348ecd3e1d19e1c1b198ed results/protocol_v2/smollm3/seed_29/activation_patching_per_prompt_v2.csv 2d334b2a0b1254ba5d13db99f76fc49cda2078dbaef63a1f4d64ecfefb86ba46 results/protocol_v2/smollm3/seed_29/activation_patching_summary_v2.csv @@ -202,7 +204,7 @@ d75bcbd185462e4fc77cbcead2036ac1815c1ead4eac7b15ef927193ee015469 results/protoc b933b5a15b5b3e9b21e760f43875ffb98e8f2011ed96ad26cb75a1cf57e86fdc results/protocol_v2/smollm3/seed_29/heldout_baseline_metrics.csv c0c3cdab2aa56ffee735003ea23984835cefaef32a4c761f17b5d2350f428412 results/protocol_v2/smollm3/seed_29/heldout_baseline_summary.csv 082cb38d4383bbdb9b4db073e8f6092794f2bbfc85b292181a1a1880db55ad55 results/protocol_v2/smollm3/seed_29/run_metadata.json -8eb4b6bab6727da9a92a75cc11c84ef0896ac3fb25a50df7b3838edcf29fa3a7 results/protocol_v2/smollm3/seed_29/sequence_copy_cases_v2.csv +99ef356e255c85d8e1531f89927bb54db03bd91f8677832fcbff0d76b59d548a results/protocol_v2/smollm3/seed_29/sequence_copy_cases_v2.csv 84f3493802258813c6bd5534851bbda4b1c8ed5668c8c18564a29c9514d8f531 results/protocol_v2/smollm3/seed_7/RUN_REPORT.md 10f1750f8895697c170b62ee01c14d743c4c5608e489d03b334fd8de56565553 results/protocol_v2/smollm3/seed_7/activation_patching_per_prompt_v2.csv 53dd1b53911b9918d94a5233541826dc7a1127f366751c0da2b13c50807a6195 results/protocol_v2/smollm3/seed_7/activation_patching_summary_v2.csv @@ -221,20 +223,12 @@ f845271b8beb6692a3154fc6e60e0b104f57d2710b308ff79d28cedaee0155a9 results/protoc 1ec762a715390f83652dacf7404fbaa18b76de4577b51d808f92d8c95d98f24b results/protocol_v2/smollm3/seed_7/heldout_baseline_metrics.csv b77f9c9663a3dcef822a4bc99505fa6cb6e688a4c05edc87d9b7c3d0a1fa3628 results/protocol_v2/smollm3/seed_7/heldout_baseline_summary.csv e4c0b6860d52687e125b6a6ec1ee96ed2c1d73e06611a2c327cc2520e15f013a results/protocol_v2/smollm3/seed_7/run_metadata.json -ac9fb655a2e621d60fd3909f1bbfa42c0b3e313e640ff8f1b53bbaf9e3a45630 results/protocol_v2/smollm3/seed_7/sequence_copy_cases_v2.csv -ee46f0f48c21be917343d1786c42191392ccd1736ea5b5a6c008c55c9e5c13aa run_dashboard_windows.bat -f783c0da90a74916639535678505327a5d5a485c3f80ac24a387df04e38427bc run_hf_dashboard_windows.bat -8a30e4644bd3cfc03d389576b0e6e6a42db299053b66ab7add4d6e0a89831a11 run_hf_research_windows.bat -e713e983a5e58fb31a77514e1ab0681e13b106e83fa78f682254175510fb7f60 run_protocol_v2_dashboard_windows.bat -bc9ab8b814bcf2840a8f3704406163dfee0eb9dd2205221a2978e3e350e16f4c run_protocol_v2_gpt2_windows.bat -f212f93180765710df6f9d92b0e841f157a1b82ba65da811ef7b8b1d092f96eb run_research_dashboard_windows.bat -cacbb0d07696e083f680bf4e58d7981526e256ad0f812ba4f376b05db31d07fc run_research_windows.bat -8d442942d53226685e01f4059d44d127e73d6ff13cec0924ba1ea14a961f460e run_sequence_copy_smollm3_windows.bat -404320a44cd44f315d9f387e521c4051f1df103730bb04f11edfa61f2a6eb19c run_sequence_copy_study_windows.bat +6e3cae6a755d6e6521f3f2f24ad2c52508f3fe2fe462e144f81fb0d38a78a2ae results/protocol_v2/smollm3/seed_7/sequence_copy_cases_v2.csv dab5dddfc50ee67f7a05dfb9f836e0bebb420a2baece6bf202073947ea63326f scripts/compare_model_runs.py eb4707c74ddb50fdc70f65eeef3179b27a95b58ded72b69dd01b8a0680b0fc9d scripts/compare_sequence_copy_runs.py 9486e45c1c85a31254fce167d8c68621addcc513bc870961cce5b09ffbd541c9 scripts/inspect_gpt2.py f516805b725940a7cb3f9991d74b373543d06d37daffc4148cb3a786c2da7691 scripts/inspect_gpt2_induction.py +c95c2136c4508f521b1ba9df95d48fa31450e7fd599c611a6d0f53db5de2fce7 scripts/make_figures.py 0666440873bb7f30ab01916f1096d53c72f6ad51cc02966cb44901e7d3e0a38d scripts/run_experiments.py 2903989d55ed89c595b7db1acbcb9ba6616b82f9a2dd3ec3b0f02361dafac821 scripts/run_gpt2_research.py f20e89f5d2caf2be1030d157884bd16a951fe9f12f1fdd097683f8dd69b0fab9 scripts/run_hf_research.py @@ -243,8 +237,19 @@ d8c618627d7b8ef7d638b55c592ed10d8ab0709b168b8eefa199cdf376babe94 scripts/run_se b6e785a2e710d396d33a10b173f82dfd08b03abb08fc6c5dee94bee6984caa74 scripts/run_sequence_copy_study_v2.py d75c489daff4ad6e6a4ac869cfb874c8a4d39758bed733c944388b32ec19bc1d scripts/summarize_v2_runs.py 51fda15aba4018e7a99672f7b55858aeae24bffedcadb488a0aa69d7c7d62108 scripts/train_tiny.py -6299d609cde30c22d7ac13a41081a9025409f6836f3838ff422fb525b8eb8116 setup_huggingface_windows.bat -44b228413ef6a732c82ae410f98416f3ce6618c4caaac4b67379812e538ad66c setup_windows.bat +d0aba65e5696b7c26112f7414b711c662fd9600c30a99757154b41ccf4dfea11 scripts/windows/README.md +07dbab1b3b2c168a2881d768933350742233539ae0d145818576fa636cfbce2f scripts/windows/run_dashboard_windows.bat +f8bb30c74cdfa51c37a37c65087718baffb14ce50802504b481ea7f06e896081 scripts/windows/run_hf_dashboard_windows.bat +c233d06a15eb0d02d64bc11bc5924826bf602cf71ec98095cf1ae5a73ce51a96 scripts/windows/run_hf_research_windows.bat +9fc5e28fe380b556a78e535c25637fa565a542a4c5680018e484a9ff46235482 scripts/windows/run_protocol_v2_dashboard_windows.bat +c1740caf0e7ebf9477b7513f04abd164ebf772c1d1f4965b599aae8b0b6f756d scripts/windows/run_protocol_v2_gpt2_windows.bat +c8f28c385855bc6e38722da94240497b02cb7e4ac4400cb7a828b333a227e143 scripts/windows/run_research_dashboard_windows.bat +f35702da9d1eb62fdd736a8ad1b66528b6b9b5b103cbec2e38956b1b623adccf scripts/windows/run_research_windows.bat +a120110ffc9fe285a95425562bcbb6dbf40cc8e917c8656c097e2cb418b904a6 scripts/windows/run_sequence_copy_smollm3_windows.bat +d71d641d5d3213fd244913bcb7becfab071ec9eba32e803a88e584c02997de54 scripts/windows/run_sequence_copy_study_windows.bat +475c7136c0d6f10c82a945193f94ed2776450699fab9e9ac153e56ddfb888d17 scripts/windows/setup_huggingface_windows.bat +ee4d61977a7fd33f65143e4795f920e738014b47cfe58179e984226bfb28ffa2 scripts/windows/setup_windows.bat +c573220da02ea7a579375a80801a04d05e9249e325fd9725f353cbd3798ab92f scripts/windows/train_windows.bat 56b5e91c3bb77ab933c25fd65eba883419bdc5691cc94cb9dc840e8f4e3674eb src/interpretability_lab/__init__.py dee1728581eddfe76a107f9e98e015ba5795df1b5b5f7f0e256476a4cc473569 src/interpretability_lab/core.py c0f28ffce3855b63757abee706ebdae9fe9d93e985bc5afe0e8286b3a7052fc1 src/interpretability_lab/experiment.py @@ -258,4 +263,3 @@ f8d799c2422a2925a4b412e33922263d6e071bfdb069a2202089cfa1125ec9a2 tests/test_hoo 032bc630ebdf22cd437d7d35460af139cb7036da1da1fdb564544e9552d36629 tests/test_model.py 81b6e9a38759fb73a2670ad433dacabef9a9039d95242b7b97ba5f8d96991500 tests/test_research.py 493fe51dcc55d782190a729359e9a6b23ac88607c37dc0c92f1b3c54dedaf1f4 tests/test_sequence_copy.py -bc846c5b7c52b4e55b3e082363fd9613bb318232d2e553f58e97926f52f828d4 train_windows.bat diff --git a/pyproject.toml b/pyproject.toml index 435908e..074d089 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "A reproducible PyTorch and Hugging Face mechanistic interpretabil readme = "README.md" requires-python = ">=3.10" license = {text = "MIT"} -authors = [{name = "Project contributors"}] +authors = [{name = "Idnotfound-L"}] dependencies = ["torch>=2.1", "numpy>=1.24", "scikit-learn>=1.3"] [project.optional-dependencies] diff --git a/reports/FINAL_RESEARCH_REPORT.md b/reports/FINAL_RESEARCH_REPORT.md index 7e4913a..7687c36 100644 --- a/reports/FINAL_RESEARCH_REPORT.md +++ b/reports/FINAL_RESEARCH_REPORT.md @@ -2,7 +2,7 @@ ## Abstract -This project builds and applies a Protocol V2 mechanistic-interpretability workflow to synthetic repeated-token sequence copying in GPT-2 and SmolLM3-3B-Base. The workflow uses disjoint discovery, held-out copy-evaluation and random-transition control token pools; successor-token attention scoring; corruption-sensitive MLP-neuron ranking; component ablation against matched random controls; prompt-level bootstrap intervals; paired sign-flip tests with Benjamini–Hochberg correction; and activation patching. Three seed runs were completed for each model according to the project record. The most reproducible reported SmolLM3 result is a discovery-selected Layer 15, Head 11 whose ablation has a larger effect on copy prompts than matched random-head controls across all three seeds. This is evidence for a causal contribution on the synthetic task, not proof of a complete induction circuit. +This project builds and applies a Protocol V2 mechanistic-interpretability workflow to synthetic repeated-token sequence copying in GPT-2 and SmolLM3-3B-Base. The workflow uses disjoint discovery, held-out copy-evaluation and random-transition control token pools; successor-token attention scoring; corruption-sensitive MLP-neuron ranking; component ablation against matched random controls; prompt-level bootstrap intervals; paired sign-flip tests with Benjamini–Hochberg correction; and activation patching. Three seed runs were completed for each model; raw bundles are in `results/protocol_v2/`. The most reproducible reported SmolLM3 result is a discovery-selected Layer 15, Head 11 whose ablation has a larger effect on copy prompts than matched random-head controls across all three seeds. This is evidence for a causal contribution on the synthetic task, not proof of a complete induction circuit. ## Research question diff --git a/results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md b/results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md index 429b0b9..cb4cb15 100644 --- a/results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md +++ b/results/protocol_v2/smollm3/THREE_SEED_FINDINGS_AUTHOR_SUMMARY.md @@ -1,6 +1,6 @@ # SmolLM3-3B-Base — Protocol V2, three-seed findings summary -**Evidence status:** This document transcribes and organises the project author's consolidated summary of the three SmolLM3 Protocol V2 runs (seeds 7, 13 and 29). The raw per-run V2 CSV bundles were not attached in the files available when this final ZIP was assembled. Treat the numerical ranges below as author-reported results pending a raw-artifact audit; do not treat this file as a substitute for the individual run reports and CSVs. +**Evidence status:** Consolidated summary of the three SmolLM3 Protocol V2 runs (seeds 7, 13 and 29). The full raw per-seed bundles are in `seed_7/`, `seed_13/` and `seed_29/` next to this file. The following figures were re-checked against those raw CSVs: held-out copy accuracy (0.4375 / 0.4609 / 0.4609), the L15 H11 selected-minus-random margin drop (0.290–0.315; per-seed 95% CIs all exclude zero), copy-minus-control specificity (0.263–0.321) and BH q-values (< 0.001 in every seed). The remaining figures (e.g. patching ranges and per-neuron observations) are drawn from the per-run reports and have not been independently recomputed. This file is a summary, not a substitute for the per-run reports and CSVs. ## Study configuration @@ -26,7 +26,7 @@ Interpretation: the model exhibits partial, not strong, sequence-copying perform ## Replicated attention-head candidate: Layer 15, Head 11 -The author reports that L15 H11 was selected during discovery in all three seeds. Its ablation produced an additional copy-task mean-margin drop of approximately 0.29–0.31 relative to a matched random head (BH-adjusted q < 0.001), with copy-minus-control specificity of approximately +0.26 to +0.32 (BH-adjusted q < 0.001). +L15 H11 was selected during discovery in all three seeds. Its ablation produced an additional copy-task mean-margin drop of approximately 0.29–0.31 relative to a matched random head (BH-adjusted q < 0.001), with copy-minus-control specificity of approximately +0.26 to +0.32 (BH-adjusted q < 0.001). This supports describing L15 H11 as a **candidate attention head that causally contributes to the measured sequence-copying behaviour**. It does not establish that the head alone implements a complete induction circuit. The reported top-1 prediction changed on only about 6% of prompts, with accuracy moving from about 0.44 to 0.39 under ablation. diff --git a/scripts/make_figures.py b/scripts/make_figures.py new file mode 100644 index 0000000..da34257 --- /dev/null +++ b/scripts/make_figures.py @@ -0,0 +1,61 @@ +"""Regenerate the README results figure from the saved Protocol V2 SmolLM3 bundles. + +Usage: python scripts/make_figures.py +Requires: pandas, matplotlib +""" +from pathlib import Path + +import matplotlib + +matplotlib.use("Agg") +import matplotlib.pyplot as plt +import pandas as pd + +ROOT = Path(__file__).resolve().parents[1] +RUNS = ROOT / "results" / "protocol_v2" / "smollm3" +SEEDS = (7, 13, 29) +COLORS = {7: "#1f77b4", 13: "#ff7f0e", 29: "#2ca02c"} + + +def load(seed: int, name: str) -> pd.DataFrame: + return pd.read_csv(RUNS / f"seed_{seed}" / name) + + +def main() -> None: + fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11, 4), constrained_layout=True) + + # Panel A: selected-head ablation effect vs matched random head, per screened layer. + for i, seed in enumerate(SEEDS): + df = load(seed, "candidate_vs_random_controls.csv") + df = df[df.kind == "head"].sort_values("layer") + x = df.layer + (i - 1) * 0.8 + err = [df.selected_minus_random_mean_margin_drop - df.ci95_low, + df.ci95_high - df.selected_minus_random_mean_margin_drop] + ax1.errorbar(x, df.selected_minus_random_mean_margin_drop, yerr=err, fmt="o", + ms=4, capsize=2, color=COLORS[seed], label=f"seed {seed}") + ax1.axhline(0, color="grey", lw=0.8) + ax1.annotate("L15 H11", xy=(15, 0.31), xytext=(18, 0.36), arrowprops=dict(arrowstyle="-", color="k")) + ax1.set_xlabel("Layer (8 of 36 screened)") + ax1.set_ylabel("Extra copy-margin drop vs. random head") + ax1.set_title("Ablating the discovery-selected head (95% CI)") + ax1.legend(frameon=False) + + # Panel B: block-state patching at the earlier successor position vs random-position control. + for seed in SEEDS: + df = load(seed, "activation_patching_summary_v2.csv") + for loc, ls in (("block_successor_position", "-"), ("block_random_position", ":")): + d = df[df.patch_location == loc].sort_values("layer") + ax2.plot(d.layer, d.mean_margin_recovery, ls, color=COLORS[seed], marker="o", ms=3, + label=f"seed {seed}" if loc.endswith("successor_position") else None) + ax2.set_xlabel("Layer") + ax2.set_ylabel("Fraction of copy-margin gap recovered") + ax2.set_title("Clean block-state patch (solid) vs random position (dotted)") + ax2.legend(frameon=False) + + out = ROOT / "docs" / "figures" / "smollm3_v2_summary.png" + fig.savefig(out, dpi=150) + print("wrote", out) + + +if __name__ == "__main__": + main() diff --git a/scripts/windows/README.md b/scripts/windows/README.md new file mode 100644 index 0000000..8d63c61 --- /dev/null +++ b/scripts/windows/README.md @@ -0,0 +1,16 @@ +# Windows helper scripts + +Convenience wrappers for Windows users. Each script changes into the repository root first, so it can be run from anywhere (double-click or from a terminal). + +| Script | Purpose | +|---|---| +| `setup_windows.bat` | Create `.venv` and install the base requirements | +| `setup_huggingface_windows.bat` | Install Hugging Face dependencies for pretrained-model experiments | +| `run_protocol_v2_gpt2_windows.bat [seed]` | Run Protocol V2 on GPT-2 (default seed 7) | +| `run_protocol_v2_dashboard_windows.bat` | Launch the Protocol V2 results dashboard | +| `run_sequence_copy_smollm3_windows.bat`, `run_sequence_copy_study_windows.bat` | Legacy Protocol V1 sequence-copy runners | +| `run_hf_research_windows.bat`, `run_hf_dashboard_windows.bat` | Hugging Face research runner and dashboard | +| `run_research_windows.bat`, `run_research_dashboard_windows.bat` | GPT-2 / TransformerLens research runner and dashboard | +| `train_windows.bat`, `run_dashboard_windows.bat` | Train and inspect the small TinyGPT model | + +On Linux/macOS, use the equivalent `python ...` commands shown in the top-level README. diff --git a/run_dashboard_windows.bat b/scripts/windows/run_dashboard_windows.bat similarity index 89% rename from run_dashboard_windows.bat rename to scripts/windows/run_dashboard_windows.bat index 6036978..1958d24 100644 --- a/run_dashboard_windows.bat +++ b/scripts/windows/run_dashboard_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist .venv\Scripts\streamlit.exe ( echo Run setup_windows.bat first. pause diff --git a/run_hf_dashboard_windows.bat b/scripts/windows/run_hf_dashboard_windows.bat similarity index 90% rename from run_hf_dashboard_windows.bat rename to scripts/windows/run_hf_dashboard_windows.bat index 614a23a..f66b97d 100644 --- a/run_hf_dashboard_windows.bat +++ b/scripts/windows/run_hf_dashboard_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\streamlit.exe" ( echo Streamlit not found. Run setup_windows.bat first. pause diff --git a/run_hf_research_windows.bat b/scripts/windows/run_hf_research_windows.bat similarity index 93% rename from run_hf_research_windows.bat rename to scripts/windows/run_hf_research_windows.bat index 7588ede..68471c4 100644 --- a/run_hf_research_windows.bat +++ b/scripts/windows/run_hf_research_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Python environment not found. Run setup_windows.bat first. pause diff --git a/run_protocol_v2_dashboard_windows.bat b/scripts/windows/run_protocol_v2_dashboard_windows.bat similarity index 92% rename from run_protocol_v2_dashboard_windows.bat rename to scripts/windows/run_protocol_v2_dashboard_windows.bat index 00b8bab..681c817 100644 --- a/run_protocol_v2_dashboard_windows.bat +++ b/scripts/windows/run_protocol_v2_dashboard_windows.bat @@ -1,6 +1,6 @@ @echo off setlocal -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Project virtual environment not found. Run setup_windows.bat first. pause diff --git a/run_protocol_v2_gpt2_windows.bat b/scripts/windows/run_protocol_v2_gpt2_windows.bat similarity index 96% rename from run_protocol_v2_gpt2_windows.bat rename to scripts/windows/run_protocol_v2_gpt2_windows.bat index a37798a..76a3846 100644 --- a/run_protocol_v2_gpt2_windows.bat +++ b/scripts/windows/run_protocol_v2_gpt2_windows.bat @@ -1,6 +1,6 @@ @echo off setlocal -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Project virtual environment not found. Run setup_windows.bat first. pause diff --git a/run_research_dashboard_windows.bat b/scripts/windows/run_research_dashboard_windows.bat similarity index 90% rename from run_research_dashboard_windows.bat rename to scripts/windows/run_research_dashboard_windows.bat index c687300..57b1ebc 100644 --- a/run_research_dashboard_windows.bat +++ b/scripts/windows/run_research_dashboard_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Run setup_windows.bat first. pause diff --git a/run_research_windows.bat b/scripts/windows/run_research_windows.bat similarity index 90% rename from run_research_windows.bat rename to scripts/windows/run_research_windows.bat index 391e37b..8cd8629 100644 --- a/run_research_windows.bat +++ b/scripts/windows/run_research_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist .venv\Scripts\python.exe ( echo Run setup_windows.bat first. pause diff --git a/run_sequence_copy_smollm3_windows.bat b/scripts/windows/run_sequence_copy_smollm3_windows.bat similarity index 96% rename from run_sequence_copy_smollm3_windows.bat rename to scripts/windows/run_sequence_copy_smollm3_windows.bat index 999592f..b0388df 100644 --- a/run_sequence_copy_smollm3_windows.bat +++ b/scripts/windows/run_sequence_copy_smollm3_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Run setup_windows.bat and setup_huggingface_windows.bat first. pause diff --git a/run_sequence_copy_study_windows.bat b/scripts/windows/run_sequence_copy_study_windows.bat similarity index 96% rename from run_sequence_copy_study_windows.bat rename to scripts/windows/run_sequence_copy_study_windows.bat index 553001f..bf62a11 100644 --- a/run_sequence_copy_study_windows.bat +++ b/scripts/windows/run_sequence_copy_study_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Run setup_windows.bat and setup_huggingface_windows.bat first. pause diff --git a/setup_huggingface_windows.bat b/scripts/windows/setup_huggingface_windows.bat similarity index 96% rename from setup_huggingface_windows.bat rename to scripts/windows/setup_huggingface_windows.bat index f1807a9..04bc3b5 100644 --- a/setup_huggingface_windows.bat +++ b/scripts/windows/setup_huggingface_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist ".venv\Scripts\python.exe" ( echo Run setup_windows.bat first to create the base environment. pause diff --git a/setup_windows.bat b/scripts/windows/setup_windows.bat similarity index 97% rename from setup_windows.bat rename to scripts/windows/setup_windows.bat index aa621cc..a4ba033 100644 --- a/setup_windows.bat +++ b/scripts/windows/setup_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." setlocal if not exist .venv\Scripts\python.exe ( py -3.11 -m venv .venv diff --git a/train_windows.bat b/scripts/windows/train_windows.bat similarity index 90% rename from train_windows.bat rename to scripts/windows/train_windows.bat index 48db8b1..129188a 100644 --- a/train_windows.bat +++ b/scripts/windows/train_windows.bat @@ -1,5 +1,5 @@ @echo off -cd /d "%~dp0" +cd /d "%~dp0..\.." if not exist .venv\Scripts\python.exe ( echo Run setup_windows.bat first. pause