Can I rebuild the system faithfully?
Implement the architecture and training pipeline from scratch, reproduce the 124M configuration, and verify every stage with parity tests and logged metrics.
Output: a trained, reproducible checkpoint.Inside the prediction
From-scratch reproduction and causal explanation of GPT-2 124M next-token predictions.
Can a faithfully reproduced GPT-2 checkpoint support explanations that identify what actually controls a next-token prediction?
First reproduce and verify GPT-2 124M; then freeze that checkpoint and test explanation methods with controlled interventions.
Reproducing GPT-2 teaches how the model is built and optimized. It does not, by itself, make the project Explainable AI. The second phase freezes the trained checkpoint and tests explanations against controlled interventions.
Implement the architecture and training pipeline from scratch, reproduce the 124M configuration, and verify every stage with parity tests and logged metrics.
Output: a trained, reproducible checkpoint.Compare attribution, attention, and causal interventions on matched prompts, then quantify when each explanation succeeds or fails.
Output: an explanation benchmark, not just a visualization.Which engineering and scientific skills are required to move from building a Transformer to making defensible claims about its behavior?
Implement every major subsystem, inspect training signals, design causal controls, and turn the results into a reproducible study.
Implement token and position embeddings, causal multi-head attention, MLP blocks, residual streams, layer normalization, weight tying, and next-token loss directly in PyTorch.
Build sharded data loading, gradient accumulation, mixed precision, learning-rate scheduling, checkpointing, reproducible evaluation, and GPU-memory monitoring.
Read loss curves, gradient norms, token throughput, validation gaps, and failure signals instead of treating training as a black-box command.
Separate an attractive visualization from evidence by testing whether highlighted tokens and internal states actually control a prediction.
Define baselines, matched counterfactuals, quantitative metrics, uncertainty, and negative-result reporting before inspecting the final explanations.
Turn one reproducible model checkpoint into a documented experiment suite, an interactive inspection tool, and a defensible final report.
Can our implementation reproduce the architecture, numerical behavior, and training quality of the GPT-2 124M reference?
Build and test one causal attention head first, expand it into multi-head attention and a complete decoder block, stack 12 blocks, then validate the full training pipeline.
The implementation follows the public build-nanogpt reference repository. I will pin its commit SHA before starting so “reproduction” refers to one exact code state.
12 Transformer blocks · 12 attention heads · 768-dimensional residual stream · 1,024-token context · 50,257-token GPT-2 vocabulary.
Tokenize the sample-10BT subset with the GPT-2 tokenizer and store deterministic uint16 train/validation shards.
Overfit one batch, run a short training smoke test, save and reload a checkpoint, and resume without changing the loss trajectory.
Use BF16, Flash Attention, fused AdamW, gradient accumulation, gradient clipping, warmup, cosine decay, and periodic validation.
Track validation loss and HellaSwag accuracy, then inspect fixed-seed text samples as a qualitative diagnostic.
For one predicted token, where do candidate causes appear across the input, attention heads, layers, and residual stream?
Trace the baseline prediction, ablate candidate input features, and patch internal activations while recording changes to the target logit.
This interactive preview shows the questions the final tool will answer. It is an experiment design, not a display of completed results.
Establish the model's next-token prediction and collect token, head, and residual-stream signals.
Record the target logit before any intervention.
No causal claim yet: this is the measurement baseline.
Which interpretability methods reliably identify features or internal states that causally influence GPT-2's next-token prediction?
Compare five explanation methods on matched prompts, then test their claims against fluent counterfactuals, ablations, activation patches, and matched baselines.
Remove or replace one token or phrase, rerun the model, and measure the change in the target token's logit.
Integrate gradients from a defined baseline embedding to the real embedding and attribute the target logit across tokens.
Inspect head-level attention patterns and test whether apparently relevant heads are consistent across prompt variants.
Patch a source prompt's residual or head activation into a matched counterfactual and measure recovery of the source prediction.
Change one semantic variable, such as France to Germany, while holding syntax and task structure constant.
Did the reproduction succeed, and do the explanations predict real intervention effects rather than merely look plausible?
Apply fixed reproduction gates and score explanations with comprehensiveness, sufficiency, consistency, stability, patching effect, and matched baselines.
I will call a method causally informative only when its highlighted features predict held-out intervention effects better than random, position-matched, and magnitude-matched baselines.
Can the full reproduction and explanation study fit within one A100, the available storage, and the project budget?
Estimate each workload separately, reserve debugging time, enforce health checks and a cost cap, and keep only verified data and artifacts.
40 GB VRAM · 64 GB RAM minimum, 128 GB preferred · 120 GB disk
Planning estimates, not guarantees. The run stops if loss, throughput, or memory fails a pre-set health check.
Token shards require roughly 20–22 GB. The environment, checkpoints, logs, and XAI artifacts add approximately 20–35 GB. Raw dataset caches are cleared only after shard hashes and decoded samples are verified, keeping the run below the disk ceiling.
Can the project reach a defensible answer within 16 weeks without letting training or interface work crowd out the experiments?
Sequence specification, data validation, training, instrumentation, benchmarking, and release, with an exit gate before each next phase.
Pin the reference commit, recreate the architecture, and write parity tests.
Build deterministic shards and validate training, checkpointing, and resume behavior.
Run the 10B-token job, monitor it, and preserve all metrics and checkpoints.
Implement attribution, ablation, counterfactual, attention, and activation-patching pipelines.
Run matched examples, baselines, controls, uncertainty estimates, and error analysis.
Build the prediction microscope, write the dissertation, and package reproducible artifacts.
What evidence must be available for someone else to inspect, reproduce, and challenge the project's conclusions?
Release the implementation, checkpoint and training record, XAI benchmark, interactive microscope, and a report that includes negative results.
Readable PyTorch code, architecture tests, pinned dependencies, data manifest, and reproducible commands.
Checkpoint, configuration, train/validation curves, HellaSwag scores, throughput, and run-cost report.
Matched prompts, interventions, attribution outputs, activation patches, baselines, uncertainty, and failure taxonomy.
An interactive dashboard for tracing one next-token prediction across inputs, layers, heads, and counterfactuals.
A precise account of what replicated, which explanations survived causal tests, and which negative results changed the conclusion.