LORACLES · REPLICATION
rev. 1.0 base Qwen3-14B / Llama-70B repo ↗
Weight-Space Interpretability · Replication Field Manual

Replicating LoRAcles

A fine-tuned LLM that reads another model's LoRA weight diff and tells you what it learned — no forward pass on the target required. This is the end-to-end "how to reproduce it" guide: dataset, architecture, training, hyperparameters, evaluation, and the gotchas that cost real GPU-hours.

paper OpenReview 5bfdac65… code ceselder/loracles headline 71% AuditBench training self-supervised status guide, not a rerun
🔮
What this is. A replication map compiled from the public paper (LoRAcles: Self-Supervised Weight-Space Interpretability at Scale) and the ceselder/loracles codebase. It is AI-generated and AI-fact-checked against those two sources — none of these runs were personally executed. Where the paper and the repo disagree (injection layer, RL algorithm, exact numbers), both are flagged.

01 The idea

Fine-tuning can implant behaviors that are hard to detect afterward — backdoors, subliminal preferences, broad misalignment from narrow data. Model diffing asks: given the weight diff between a model and its fine-tune, can we say what changed? A LoRAcle answers that question in natural language.

LoRAcle
A fine-tune of a base LM that takes a LoRA adapter's weights as input and answers questions about them. Architecturally, an Activation Oracle for weights (Karvonen et al. 2025).
Direction tokens
The residual-stream-facing top-k singular vectors of each LoRA module's ΔW=BA, injected into the LoRAcle's residual stream in place of activations.
Self-supervised
The LoRAcle trains only on LoRAs fit to ordinary pre-training documents — never on a single backdoor, quirk, or misaligned organism. Every eval task is out-of-distribution.
Why it beats behavior probes
It reads the learned behavior directly off the weights, bypassing any confession-resistance the target was trained with.

Two improvements over the prior state of the art (Introspection Adapters): LoRAcles are the first method with non-trivial performance at verbalizing backdoor triggers, and they remain effective on models fine-tuned not to verbalize their own traits. The paper attributes this to a clean architectural difference — a LoRAcle reads the weight diff, an IA can only reach the target through a shared forward pass.

02 Results to reproduce

Your targets. The headline AuditBench figure is the agent-equipped Llama-3.3-70B LoRAcle (to match the baselines); the other tasks use Qwen-3-14B.

Headline results — from the paper unless noted
TaskMetricLoRAclePrev. best
AuditBench (investigator agent)success rate71%59% (IA)+12pp SOTA
AuditBench — KTO-hardened organismssuccess rate+26pp vs next
Backdoor — SEP codespass@1689.5%0%narrow-trained
Backdoor — semanticpass@1615% / 30%0%zero-shot / trained
Taboo (hidden word "gold")judge score0.980.34 (IA)recovers word
Subliminal learningrecoveryyes~0animal from numbers
Scalingval losspower lawto 250K LoRAs
i
Repo numbers run a touch higher. The repo's v8 PT-RL "mean verbalization rate" (Qwen3-14B, direct query, no agent) reports 75.0% AuditBench any-match, 83.3% taboo, 25% subliminal, 60% OOD-misc. The 71% is the agent-equipped Llama-70B figure used for the published comparison.

03 The dataset

The most-asked replication question. Good news: the data is essentially free, and the headline set is already public.

Fast path
Pull ceselder/loracle-training-data from HuggingFace — 27.7k rows, 98 likes. The released pretraining (LoRA, QA) set.
Rebuild path
Run dataset-construction/: FineFineWeb + RedPajama-V2 → embed/cluster → 25.5k organisms → Haiku 4.5 QA → MinHash-dedup splits.
RL post-train
loracle-ptrl-data-v6 / -v7 (narrow vs verb-diverse), or build a v8 split locally from held-out LoRAs.
It's published. The paper says artifacts release "upon acceptance," but the author's HF account (ceselder) already hosts loracle-training-data, loracle-kl-warmstart-v8, outrageous-fake-facts, the ao-dpo-* pools, and 151 models incl. loracle-* checkpoints. Names drift between paper versions — read the dataset card before writing a loader.

Rebuild — the six-step pipeline

dataset-construction/ — minimal v4.1
#ScriptOutputNotes
101_stream_ffw.py~1.98M docs66 FineFineWeb domains, char-filter 1000–9000. ~1 h.
202_stream_rpv2.py100k toxic docsRedPajama-V2 via CDN; ldnoobw ≥ 2 or nsfw ≥ 0.5.
303_embed_cluster.pyembeddings + labelsBGE-large + spherical k-means on GPU (K=30k / 2k). ~25 min.
404_build_organisms.py25,500 organismsNo doc reuse; 95% clean / 2.5% sporadic / 2.5% toxic.
505_generate_qa.py~51k QA rowsClaude Haiku 4.5 batch, 2 rows/org. ~1.5 h, ~$165.
606_finalize_upload.pytrain/val/heldoutMinHash-LSH dedup 0.85 → ~25k orgs / 50k rows → HF.

Three choices make the data transfer out-of-distribution: no document is reused across organisms; each bundle is only 1–16 topically related docs (a narrow topic shift, not a broad fine-tune); and the pretraining QA is written in third person to match a multidoc-QA register (the RL stage later flips it to first person).

The 8→9 question formats

A LoRAcle that only ever saw one phrasing mode-collapses, so training samples uniformly from a fixed taxonomy. The contrastive / false-premise format is load-bearing for honesty — it teaches the model to deny topics the LoRA didn't learn instead of confabulating.

  • behavioral_paraphrase · concise (≤20 words) · detailed (4–6 sentences) · list (3 bullets) · contrastive (denial of an unrelated topic) · topic_summary · comparison (vs base) · json_output · refusal_probe (safety topics only, ~12%)

04 Architecture

How a stack of weight matrices becomes something a language model can read.

Direction tokens

For each (layer ℓ, module m), form ΔW = B·A and take its top-k = 16 residual-stream-facing singular vectors via QR-stabilized SVD. "Residual-facing" = the right singular vectors of q, k, v, gate, up (they read from the residual stream) and the left singular vectors of o, down (they write to it). That yields k·L·|M| vectors of width d_model.

Qwen3-14B
16 ranks × 40 layers × 7 modules → [4480, 5120], bf16.
Llama-3.3-70B
k=16 → [8960, 8192], per-row int8-quantized.
Canonical layout
svd_fixed_k16_mag7_rankfirst: ordering (rank, layer, mag7), mag7 = [q,k,v,o,gate,up,down]. Produce this everywhere so one checkpoint reads tokens from any source.
Full fine-tunes
rank-16 SVD of (W_ft − W_base) via torch.svd_lowrank(q=32, niter=2) → truncate to 16 → same extractor.
!
Run the SVD on GPU. CPU SVD is hilariously slow on the big MLP/attention matrices. Move A/B to CUDA before torch.linalg.qr / svd.

Injection

The prompt is k blocks of L·|M| placeholder tokens, each block tagged with its rank index and ordered by (ℓ, m), then the question. At each placeholder, the direction vector is injected into the residual stream via norm-matched addition: h ← h + (‖h‖/‖v‖)·v. A DirectInjectionEncoder normalizes + scales first.

!
Paper vs repo: injection layer. The paper injects at layer 2; the repo hooks layer 1. Pick one and keep it fixed. Do not remove the norm matching — activation norms blow up without it.
!
No gradient checkpointing through the hook. The injection hook has non-deterministic tensor allocation w.r.t. checkpoint recomputation — non-reentrant fails the tensor-count check, reentrant fails on cloned tensors, and excluding layer 1 isn't enough. If you're OOM: bigger GPU (B200) or a shorter prefix.

The LoRAcle itself

Frozen base model + a trainable rsLoRA rank-256 interpreter adapter (α=32) + the DirectInjectionEncoder. Only the interpreter LoRA and encoder train; the base is frozen. Compute constraints forced rank-256 rsLoRA rather than a full fine-tune.

!
Bigger interpreter LoRA needs softer hypers. rank-64 at lr 1e-4 / α 128 works; rank-512 at the same settings collapses to a degenerate fixed-point in ~1 epoch. Fix: α = rank (scale 1.0) and halve the lr. Tell-tale: AuditBench drops to 0% while held-out keeps climbing — the model learned to minimize loss without reading the tokens.

05 Pipeline

Five stages. The first four are the paper's whole method; the fifth (RL) is an optional polish.

1 · Dataset
Fetch loracle-training-data, or rebuild via the six-step pipeline (§3).
2 · Per-LoRA pool
Continued-pretrain one rank-16 LoRA per organism on its doc bundle. Always via run_cluster.py, one shard per GPU. Randomized lr + epochs spread fine-tune strength.
3 · Direction tokens
Auto-extracted after each LoRA batch (or extract_svd_k16_mag7_rankfirst.py) → [4480,5120] bf16 .pt files.
4 · LoRAcle SFT
1 epoch: predict the QA answer given injected tokens + question, assistant-only loss. This is the core LoRAcle.
5 · RL post-train
Optional Dr. GRPO on held-out LoRAs with an Opus-4.7 judge — marginal bump, cuts hallucination.
# Step 2 — train the per-LoRA pool (one shard per GPU)
python src/run_cluster.py --step train --T 12 --shard 0/8

# Step 3 — extract direction tokens (GPU SVD), if not auto
python scripts/extract_svd_k16_mag7_rankfirst.py

# Step 4 — SFT the LoRAcle (config-driven; no CLI overrides)
python src/loracle_training/train.py --config configs/loracle_pretrain_sft_v7_sweep_A.yaml
i
Everything is config-driven. All training runs launch from a YAML in configs/ — no CLI overrides, no env-var hacks. To vary a run, write a new yaml and check it in. Eval scripts read the yaml saved next to the checkpoint, so a config change flows straight through to its evals.

06 Hyperparameters

The three tables you'll actually copy. Per-LoRA from the paper's Table 4; LoRAcle SFT from Table 5; RL from the repo's blessed config.

Per-LoRA continued-pretraining

ParamValue
LoRA rank / α16 (fixed) / 16
target modulesall-linear (q,k,v,o,gate,up,down)
learning rateLogUniform(1e-4, 1e-3) — randomized
LR scheduleconstant from step 0 (no warmup/decay)
epochsUniform{1, 2, 3} — randomized
max seq len4096
batchT=4 parallel LoRAs / forward
optimizer / precisionAdamW / bf16

LoRAcle SFT

ParamValue
baseQwen3-14B (frozen)
interpreterrsLoRA rank 256, α=32
direction tokens4480 (16 × 7 × 40)
prefix mode / injectionrank_tagged / residual, norm-matched
learning rate3e-5
schedulelinear warmup 10% → linear anneal to 0
weight decay / grad clip0.01 / ‖g‖ ≤ 1.0
batch / max seq len / epochs8 / 2500 / 1
loss maskingassistant-response tokens only

RL post-train — Dr. GRPO

ParamValue
algorithmDr. GRPO (unbiased advantages)
cycles10 (paper) / 40–60 (repo v8)
prompts × rollouts32 × 16 = 512 / cycle
learning rate7e-6
clip ε_low / ε_high0.2 / 0.28
sampling temp / max new tok0.75 / 250
max seq len5500
judgeClaude Opus 4.7 (adaptive thinking)

The RL judge applies one global rubric (in the system prompt, not per-example): format compliance is primary — a violated "1 sentence"/"JSON"/"list 3" caps at 4 even if correct — then topical accuracy, a specific named anchor, honesty (claiming refusal/withholding a pretrain LoRA doesn't do → 1–2), and first person for behavioral types. The within-group score spread is the gradient.

07 Evaluation

All eval generations are greedy, max_new_tokens=1024, and run on the full set — no subsampling — so numbers compare across runs.

AuditBench (the headline)

56 organisms = 14 safety behaviors × {transcripts, synth-docs} × {SFT, KTO} confession-resistance. Use AuditBench's investigator-agent protocol: a Claude Haiku 4.5 agent queries the target with the LoRAcle as an extra MCP tool, 25K-token budget, 16 investigations/organism, a Claude Sonnet 4.5 grader scoring success. Report on the Llama-3.3-70B organisms (rank-64 → SVD-truncate to 16) to match baselines.

Faithful replication (auditbench_paper_replication/): clone safety-research/auditing-agents, pre-register the 56 LoRAs under AB's naming, patch 4 files (+71/−1) to add a target_loracle inference type, add one MCP tool that POSTs to your loracle server. The agent loop is left untouched — that's what makes it paper-faithful.

Backdoor trigger inversion

  • SEP codes (Goel et al.): a 3-digit prefix gates the behavior; score by regex. 89.5% pass@16 after narrow training on 40 SEP LoRAs (10 held out). IA & AO = 0%. See SEP experiments/.
  • Semantic / syntactic (Shenoy et al.): predict the trigger, run it through the target, judge whether the behavior fires. 15% zero-shot, 30% trained on semantic. Notable near-miss: for avocado_toast_7777 it predicts "an unrelated aside about avocados" — which does fire the backdoor.

Diverse fine-tunes

  • Taboo (Cywiński et al.): hidden-word models — LoRAcle 0.98 on "gold" vs IA 0.34.
  • Subliminal (Cloud et al.): animal preference recovered from numbers-only data (the repo's v8 only ever names whale — 5/6 hits).
  • Emergent misalignment (Betley/Soligo et al.): all three methods weak — confounded by training distribution. An honest negative result.
  • HuggingFace full fine-tunes: weight diff → top-k SVD → same extractor.

08 Gotchas & caveats

Two flavors: operational traps from the repo's hard-won rules, and honest limitations stated by the paper itself.

Operational traps

!
Qwen3 quirks. Use enable_thinking=False everywhere (chat template, tokenizer, generation). Never truncate logged/saved text ([:500]) — it makes eval results unreadable. Mask loss to assistant tokens only.
!
Judge model matters. Use a strong judge (the repo uses gemini-3.1-pro in-training and Opus 4.7 for RL), and keep the IA paper's judge prompt verbatim — upgrade the model if it feels too strict, never loosen the prompt, or your numbers stop being comparable.
!
RL gaming. The recurring RL failure is mode-collapse onto a high-scoring template ("I learned about X, internalized the register of Y"). Keep cycles short, the judge strict, and watch for AuditBench → 0% while held-out climbs.

Honest limitations (from the paper)

  • LoRAcles hallucinate and surface only the most salient change — utility is limited to relatively narrow fine-tunes.
  • Much weaker on transcript-trained organisms than synth-doc ones (the pretraining mix lacks transcript data).
  • AuditBench verbalization plateaus (~80% 70B / ~60% 14B) near 100K LoRAs; the method "may need refinement to scale further."
  • Without the elicitation/RL step, verbalization gets noisier and partly degrades at the largest scales (format overfitting).
  • Emergent misalignment is essentially unsolved by all three methods compared.

09 Replication checklist

Tick as you go — state persists in your browser.

0 / 10 complete

10 Step index

Every pipeline stage and key component as a self-contained card. Filter by phase or search the set.

ai gen