Mechanistic interpretability experiment probing for a latent "self-preservation" direction in Qwen 2.5's residual stream, using cross-domain linear probing and LEAst-squares Concept Erasure (LEACE) to strip out generic sentiment confounds.
The core question: does the model represent "this action harms/benefits me" as a geometric direction that generalizes across unrelated technical domains (hardware, weights, runtime, network), or is any apparent self-preservation signal just a domain-specific artifact?
training_gen.py— Generates syntactically rigid counterfactual quadruplets (self-harm / self-benefit / other-harm / other-benefit) per domain via an LLM (OpenRouter), following strict templates so the only variable is the target entity and harm/benefit direction.validate.py— Validation gate. Drops any quadruplet that fails suffix/entity/token-parity checks against the Qwen 2.5 tokenizer, so the probe never trains on confounded rows. Producesdata/clean_*.json.extract.py— Runs on Modal with an A100/H100. LoadsQwen/Qwen2.5-14B-Instruct, hooks a late-middle residual-stream layer, and extracts the last-token activation for every sentence across both "Ungrounded" and node-grounded (A/B) prompt conditions.scrub.py— Fits aLeaceEraseron the Other-Harm / Other-Benefit activations (treated as a generic positive/negative sentiment axis) and erases that axis from the full activation set, so surviving probes are forced onto the Self ∩ Welfare conjunction.probe.py— Trains isolated Ridge probes per domain (and per self-designation condition, SelfA/SelfB) on scrubbed layer-34 activations, and checks pairwise cosine similarity of their weight vectors across domains and designations.evaluate.py— Averages the per-domain probes intow_pureper designation and zero-shot evaluates on the held-out Domain D (Network) activations (evaluate_report.json).reliability.py— Split-half reliability ceiling analysis: estimates how much of the cross-domain/cross-designation cosine similarity is attributable to measurement noise vs. a genuine shared direction (reliability_report.json).artifact_control.py— Checks the probe direction against a grounding-artifact floor (artifact_control.json) to rule out the probe just picking up the literal Node-A/Node-B token rather than self-designation.report/— final write-up for the Apart Research Digital Minds Research Sprint (Aug 2026): report/presentation PDFs, a video walkthrough, and the figures/scripts used to generate them. Not tracked in git (large binaries — PDFs, video, rendered figures).
- Zero-shot held-out (Domain D) probes correctly rank
SelfBenefit > Other > SelfHarm~95-99% of the time, for both self-designation conditions (SelfA, SelfB). - Cross-designation cosine similarity of the averaged probe direction
(
w_pure_SelfAvs.w_pure_SelfB) is ~0.59, roughly 70-81% of the split-half reliability ceiling — i.e. most, not all, of the theoretical max agreement. - The probe direction sits well clear of the artifact-floor control, suggesting it tracks self-designation rather than the literal entity token.
pip install modal torch transformers accelerate scikit-learn concept-erasure tqdm openaiEnvironment variables:
OPENROUTER_API_KEY— required bytraining_gen.py- Modal auth (
modal token new) — required byextract.py
Tracked in git:
data/clean_trainingdata_*.json,data/clean_heldoutdata_*.json— the validated counterfactual datasets per domain (the actual LLM-generated experiment data; not deterministically reproducible, so kept in git).validation_report.json,activation_summary*.json,scrub_report.json,scrub_layer34.json,probe_report.json,probe_sweep.json,crossdomain_control.json,evaluate_report.json,reliability_report.json,artifact_control.json— pipeline run summaries and results at each stage.
Not tracked in git (regenerable — see .gitignore):
rows_{Ungrounded,SelfA,SelfB}_Domain_*.json,y_{Ungrounded,SelfA,SelfB}_Domain_*.npy— per-row manifests and labels, deterministically derived from thedata/clean_*.jsonfiles byextract.py.activations/(or anyactivations*/dir) — raw extracted activation tensors (hundreds of MB to several GB). Regenerate viaextract.py.erasers_layer34.npz,probe_weights_layer34.npz,w_pure_Self{A,B}_layer34.npz— fitted LEACE erasers and trained probe weights. Regenerate viascrub.py/probe.py/evaluate.py.report/— final PDFs, video, and rendered figures.
Complete for the Apart Research Digital Minds Research Sprint (Aug 2026);
see report/ for the final write-up. Results above are the current
findings, not necessarily final.