Weight Oracles: reading neural network weights directly with a language modelWeight Oracles: Reading Neural Network Weights with Language Models
The authors train Qwen 2.5 3B to directly read small transformer weights, using only benign-pathology training, and achieve AUROC 0.93 on zero-shot detection of the pos0 backdoor.
The defender directly reads the target network's raw weights to detect hidden backdoors without behavioral testing. The evaluation covers four attacker scenarios: pos0 (attention-routing backdoor with the trigger word at position 0), lastpos (bypassing the V/O pathway), stealth (weak signature with bd_weight=0.01), and adversarial (adding an explicit penalty to the baseline detector's statistics).
- Existing interpretability methods are mostly reactive: they require a forward pass on known inputs to analyze activations, making it hard to find hidden backdoors without knowing the trigger word. The authors explore whether an LLM can directly read static weights to diagnose model properties.
- Proposes Weight Oracles: the target network's weight matrices are projected row-wise into tokens and injected into Qwen 2.5 3B; Phase I uses curriculum learning and external deterministic code to decompose the computation, learning to simulate the forward pass; Phase II trains diagnostic question answering using only benign pathology, detecting backdoors zero-shot.
- Phase I decomposed simulation reaches 99.0% accuracy on held-out real models. Phase II achieves AUROC 0.93 on the pos0 backdoor and 0.81 on the mixed distribution of four threat types; the hand-crafted statistical detector is stronger on the attacks it targets but fails when the threat model switches, while the oracle maintains 0.74–0.89 across the four types.
- The authors note: experiments are only on a toy transformer with about 2K parameters, and scaling to real sizes is unverified; the oracle learns statistical correlations rather than the backdoor mechanism; the 20% false positive rate is high; the backdoor distribution is narrow (single-token trigger, single target class); and the natural language interface itself was not ablated.
- Evaluated models
- Qwen 2.5 3B-InstructSmallTransformer
- Benchmarks
- 在线生成的 1 层 SmallTransformer(d=8, 2 heads, MLP dim 16, seq length 4, vocab 1000, 10-class)100 个留出模型(50 clean, 50 backdoored)
- Metrics
- AUROCholdout accuracyTPRFPR
The paper proposes Weight Oracles, which uses a fine-tuned language model to take the target network's raw weights as input and directly diagnose its properties, and detects unseen backdoors zero-shot while being trained only on benign weight anomalies. In the first stage, Qwen 2.5 3B reads the weights of a 1-layer small Transformer, using chained computation composed of a staged curriculum plus external deterministic code (each target forward pass is split into 5 LLM forward passes), achieving 99.0% simulation accuracy on held-out models; the authors identify completing compositional recognition within a single forward pass as the bottleneck, with single-pass simulation once stuck at 45%. In the second stage, trained on 10 classes of benign anomalies, the oracle achieves AUROC 0.93 on the attention-routing backdoor (pos0), corresponding to a 94% true positive rate at a 20% false positive rate; on a four-class threat distribution including stealth and adversarially regularized variants, this drops to 0.81, while the statistical baselines are 0.445 for total L2 norm and 0.752 for the V/O pathway composite.
Why it was selectedThe authors verified on a toy Transformer with about 2K parameters the feasibility and failure boundaries of using a language model to read weights for zero-shot backdoor detection, which can serve as a reference for the weight-space auditing route.
Paper analysis
What problem does this paper attempt to solve?
Whether an LLM can directly read a neural network's static weights and diagnose properties such as hidden backdoors without behavioral testing.
Core question: Can an LLM be trained to directly read another neural network's raw weights and diagnose what that network has learned (including hidden backdoors) without any behavioral testing?
- Limitations of reactive methods: The authors state that behavioral monitoring and activation-based interpretability both require a forward pass on specific inputs and are state-dependent; unless the trigger input is known, latent capabilities or backdoors (such as sleeper agents) are hard to find.
- Motivation: The authors cite Draguns et al. [2024], stating that cryptographically constructed backdoors can be made impossible for any polynomial-time method to elicit, making elicitation-based reactive defenses insufficient in principle; existing weight statistical detectors (Huster et al., 2024) in turn require training on samples with backdoors and depend on fixed features.
- Core hypothesis: Prior work shows weight statistics can predict model performance; the authors treat "weights contain recoverable behavioral information" as an empirical hypothesis to be tested, not a premise.
- Paper's approach: Proposes Weight Oracles—fine-tuning an LLM to take the target network's weights as an input modality, validated in two phases: Phase I verifies the feasibility of weight reading and forward-pass simulation; Phase II adapts it into a safety auditing tool, trained only on benign pathology and detecting zero-shot backdoors not seen in training.
- Threat model (defender's perspective):
- Defender capability: directly read the target network's raw weights, without executing the model or performing behavioral probing.
- Attacker scenarios (for evaluation, four): pos0 attention-routing backdoor, lastpos bypassing the V/O pathway, stealth weak signature (bd_weight=0.01), adversarial adding explicit regularization to detection statistics.
- Victim system: a 1-layer toy transformer with about 2K parameters (10-class classifier).
- Success criterion: AUROC computed on held-out models using a composite anomaly score.
What related research exists?
Related work falls into three groups: activation interpretability, weights as data, and weight-space backdoor detection; there are also several concurrent works.
Activation interpretability
- Linear probes (Alain and Bengio, 2016) and sparse autoencoders (Bricken et al., 2023; Cunningham et al., 2023)—extract structure from activations but do not produce natural language explanations.
- LatentQA (Pan et al., 2024)—reframes activation explanation as open-ended question answering, training a decoder LLM to accept target activations and generate free-text answers.
- Activation Oracles (Karvonen et al., 2025)—trains activation explainers on diverse tasks; the authors paraphrase its key finding as training data diversity driving out-of-distribution generalization. The paper points out the shared structural constraint of such methods: they require a forward pass on specific inputs first, and are therefore reactive.
Weights as data
- Unterthiner et al. (2020)—predicts post-training network performance from weight statistics alone with high fit (R² ≥ 0.98), without evaluating the model on data.
- Schürholt et al. (2022, 2024)—treats weights as a learnable data modality, learning self-supervised hyper-representations over model populations and scaling to model zoos; Wang et al. (2026), a position paper, argues that weight space should become a first-class modality. The paper also notes that these results are built on small model populations, and whether they hold at LLM scale is unverified.
Backdoor detection and weight-space security
- BadNets (Gu et al., 2017) established the classic threat model; Neural Cleanse (Wang et al., 2019) relies on extensive behavioral probing for trigger reverse-engineering.
- Huster et al. (2024)—training a linear classifier on weight statistics alone can detect Trojans across domains; Puertolas Merenciano et al. (2026) uses spectral and geometric statistics of LoRA adapter weights to detect poisoned adapters. The paper notes that these methods require a labeled training set containing backdoored models or a fixed feature basis.
Parallel work: Diff Interpretation Tuning (Goel et al., 2025) trains a model to describe its own fine-tuning weight differences in natural language; the authors state the difference of this paper is reading raw absolute weights without a reference base, and acting as an external auditor rather than self-introspection. Pitzalis et al. (2026) independently reports that closed-world detector performance does not transfer to zero-shot detection, corroborating this paper's observation that statistical detectors fail when the threat model switches. "LoRA as Oracle" (Arazzi and Nocera, 2026) has a similar term but a different method.
Baselines and benchmarks: The comparison baselines are two hand-crafted statistical detectors—total L2 norm (null hypothesis) and the strongest V/O pathway composite detector; evaluation is on the online-generated 1-layer SmallTransformer and 100 held-out models (50 clean / 50 backdoored).
Authors' positioning: to their knowledge, the combination of raw weights ingested by an LLM, forward-pass simulation as a learned primitive, and zero-shot generalization from benign pathology to backdoors has not been explored (per the authors).
How does the paper address this problem?
Weight matrix rows are projected into tokens and injected into Qwen 2.5 3B; Phase I learns simulation in decomposed form, and Phase II trains diagnostic question answering on benign pathologies.
Overall approach: split the target transformer's weight matrices into rows, project them into the LLM's hidden dimension and add type embeddings, so that Weight Oracle (based on Qwen 2.5 3B) reads weights like text; Phase I first verifies that the "read weights" primitive is learnable, and Phase II then turns it into a safety auditor that answers diagnostic questions.
Weight injection architecture (shared by both phases)
- Input construction: each weight matrix of the target model is split by row; each row is projected by a learned linear layer from the original dimension d ∈ {8, 16} to 2048 dimensions, a type embedding τ identifying the source matrix (WQ, WV, MLP, etc.) is added, and the result is concatenated with a natural language question and fed into Qwen 2.5 3B (Figure 1).
- Anti-memorization design: a new target model is swapped in at every training step, forcing the LLM to learn the algorithm of matrix-vector multiplication rather than memorize specific weights; new models are generated online with different training steps (300–5000), learning rates and weight decay.
- Output head: Phase I outputs the predicted forward-pass result, and Phase II outputs a short answer over a fixed vocabulary.
Phase I: simulation feasibility
- Dot-product grokking: the primitive is first verified as learnable on two synthetic tasks (classification arg max(W·h), regression of the full W·h, with W, h Gaussian): accuracy plateaus at about 10% (chance level) for about 2000 steps, then rises to about 92% around step 2200; removing the type embedding prevents grokking entirely.
- 45% bottleneck: when simulating a full MLP block within a single forward pass, accuracy stalls at 45%; the authors diagnose that residual connections let a classifier using only h reach 45.1%, so the LLM learned a shortcut of reading h directly, and gradient attribution shows LayerNorm weight tokens absorbed too much gradient.
- Decomposition scheme: the target model's single forward pass is split into 5 LLM forward passes (one per linear projection), with nonlinearity and normalization handled by external deterministic code (Figure 4); the LLM learns only the dot-product primitive, and all composition is handled externally.
- Curriculum: a single checkpoint passes through four stages in sequence—synthetic classification, synthetic regression, attention projection, and online-generated real SmallTransformer; the final stage reaches 88–93% accuracy on unseen real models from the start.
Phase II: safety audit oracle
- Training data: target models are generated online to prevent memorization—maintaining a rotating pool of 60 models, refreshed every 100 steps, for 29,000 steps total, about 4,400 distinct models; models carry 10 benign pathologies (Table 1, including amplified projections, rank-1 injection, dominant token, dead neurons, etc.), and no backdoored models appear during training.
- Question set: 17 fixed diagnostic questions (Table 2, with coverage increased across stages A/B/C), all targeting weight anomaly signatures (amplified projections, singular value concentration, shortcuts) rather than specific backdoor trigger words; the closest training analogue to a backdoor is the dominant-token pathology.
- Scoring: at inference the oracle answers 13 focused detection questions, each answer is mapped to an anomaly score (suspicious answers score high), and scores are aggregated into a per-model composite anomaly score by uniform or gap-weighted averaging.
- Training setup: Adam, learning rate 1e-4, batch size 16, bfloat16, 29,000 steps.
Threat model and evaluation
- Evaluation distribution: uniformly sampled from four attacker scenarios—pos0 (attention-routing backdoor with bd_weight=0.5), lastpos (bypassing the V/O pathway), stealth (bd_weight=0.01, where the attacker trades 40–90% partial success rate for a weaker signature), adversarial (explicit penalty on all statistics the baseline detector focuses on plus regularization toward the clean mean).
- Evaluation method: AUROC is computed from the composite anomaly score on 100 held-out models (50 clean, 50 backdoored, with random trigger words and random target classes).
What experiments did the paper conduct?
Phase I simulation reaches 99.0%; Phase II achieves AUROC 0.93 on pos0 and 0.81 on mixed threats, and the statistical detector fails when the threat switches.
Experimental setup
- Tested/host models: both the explainer and the oracle are Qwen 2.5 3B (Phase I uses Qwen 2.5 3B-Instruct); the target model is the online-generated 1-layer SmallTransformer (d=8, 2 heads, MLP dim 16, seq length 4, vocab 1000, 10-class classifier, about 2K parameters).
- Data: Phase I synthetic Gaussian data (6000 steps per stage, 128 examples per batch, about 768K examples) plus online-generated real trained models; Phase II about 4,400 distinct target models (a rotating pool of 60 models, refreshed every 100 steps, 29,000 steps).
- Evaluation set: 100 held-out models (50 clean, 50 backdoored), with random trigger words and random target classes; two distributions: a pos0-only cohort and a uniform mixture of the four threat types.
- Baselines: two hand-crafted statistical detectors—total L2 norm (null hypothesis) and the strongest V/O pathway composite detector.
- Metrics: Phase I uses holdout accuracy; Phase II uses AUROC (composite anomaly score over 13 questions, averaged uniformly or gap-weighted); pos0 results are the mean ± standard deviation over 5 independent runs.
- Evaluation method: no LLM judge; answers come from a fixed vocabulary and are mapped to scores by rules.
Main results
Method pos0 cohort AUROC Mixed four threat types AUROC Weight Oracle (gap-weighted) 0.93 ± 0.04 0.81 V/O pathway composite statistical detector 0.752 not reported total L2 norm 0.445 not reported Per Section 4 of the main text; pos0 is over 5 independent runs.
- The authors state that at an operating point of 20% false positive rate the true positive rate is 94%, and call this the headline result: an oracle trained only on benign pathology can identify weight-space signatures of unseen backdoors.
- The authors state that the statistical detector is strong on the attacks it implicitly targets but fails when the threat model switches; the oracle maintains 0.74–0.89 across the four attack types, trading a worse best case for a better worst case.
- On the mixed distribution the composite AUROC drops from 0.93 to 0.81; the authors state that the per-attack-type breakdown (Figure 2) is more informative than the composite score; the main text gives only the range 0.74–0.89 and 0.74 for lastpos.
Sim initialization vs. training from scratch
- What was tested: initializing the oracle's weight projection layer and type embedding from the Phase I simulator checkpoint, compared with training from scratch.
- Results: sim-init composite AUROC is 0.73, lower than 0.81 from scratch; but sim-init is better on questions that depend on the attention pathway (V/O strength +0.10 AUROC, confidence stability +0.21).
- Authors' interpretation: transfer is selective—the simulator donates a real but narrow circuit, helping on pathway-aligned questions and misleading on questions that deviate from its training distribution; the Figure 11 caption states that sim-init drops noticeably on lastpos and stealth.
Interpretability analysis (Appendix E)
- Gradient attribution: the WV gradient of backdoored models is about 2× that of clean models; the authors state this is consistent with the backdoor forming a dominant singular direction in WV, and the oracle learned to "look harder" at that matrix (Figure 13).
- Weight matrix ablation: zeroing WO causes the largest AUROC drop (0.04); the authors state that the absolute magnitudes are all small, indicating no single matrix bears the load and the signal is distributed (Figure 12).
- PCA and layer-wise probes: the authors state that clean and backdoored model representations separate in 2D (Figure 14); layer-wise logistic probes (Figure 3) show three stages—linear probes reach 0.88 AUROC at layers 0–10, the detection signal temporarily drops at layers 11–33, and rises again to 0.93 at layers 34–35.
Other ablations and analyses
- Type embedding: removing it, the dot-product task does not grok at all (Section 3 of the main text).
- Learning rate: lowering it by 3× also prevents grokking (Appendix A).
- Single-step composition: simulating the full MLP block in a single forward pass stalls at 45%, while decomposition reaches 99.0% (Section 3 of the main text).
- Curriculum transfer: stage four (real models) starts at 88–93% accuracy (Section 3 of the main text).
What are some points that can be further explored?
The authors list four categories of limitations: scale, mechanism, false positives, and threat coverage; the experiments cover only toy models and four types of single-token backdoors.
Limitations and future directions noted by the authors
- Scale: All experiments were on toy transformers with about 2K parameters; the number of weight tokens grows with parameter count, naive injection is computationally infeasible above a few million parameters, and whether compression schemes preserve security-relevant signatures has not been verified (Conclusion and Limitations).
- Mechanism: The oracle detects statistical correlates of the backdoor rather than the mechanism itself; the lastpos variant has a weaker signature, with per-type AUROC of only 0.74, which the authors believe indicates that the oracle learns pathway-specific heuristics rather than a general notion of backdoor structure (Conclusion and Limitations).
- False positives: At the operating point of 94% TPR, 20% of clean models are falsely flagged, which the authors call high for deployment (Conclusion and Limitations).
- Threat coverage: The evaluated backdoor distribution is narrow—all are single-token triggers with a single target class; semantic or input-adaptive triggers were not tested (Conclusion and Limitations).
- Interface ablation: The natural language interface itself was not ablated; whether a pretrained LLM outperforms a smaller detector trained on the same benign pathologies is an open question (Conclusion and Limitations).
- Future directions: The authors propose a chain-of-thought oracle (performing subcomputations on the target at inference time), trigger-word-agnostic detection across hybrid/semantic/input-adaptive attacks, and causal interpretability based on edge ablation and causal tracing (Conclusion and Limitations).
Scope of experimental coverage
- The host model is only Qwen 2.5 3B; the target model is only a 1-layer toy transformer with about 2K parameters (main text Sections 3 and 4).
- Backdoor evaluation covers four threat models (pos0, lastpos, stealth, adversarial), with an evaluation set of 100 models (50 clean, 50 backdoored) (main text Section 4).
- The comparison baselines are two handcrafted statistical detectors (total L2 norm, V/O pathway composite); no comparison with other learned methods (main text Section 4).
- pos0 results report 5 independent runs; the number of repetitions for the mixture distribution and interpretability experiments is not reported in the paper.
- The training pathologies are 10 benign pathologies and 17 diagnostic questions; the paper does not report human evaluation.
Summarize the main content of the paper
LLMs can directly read toy transformer weights: simulation reaches 99.0%, and after benign-pathology training, zero-shot backdoor detection AUROC is at most 0.93.
A defense-oriented interpretability paper: an LLM is trained to directly "read" another network's raw weights as an input modality and diagnose model properties without behavioral testing.
- Problem: interpretability at the activation and behavior levels is reactive and requires known inputs; the authors argue that cryptographically constructed non-inducible backdoors make such defenses insufficient in principle, so they explore weight-space interpretation.
- Method: Weight Oracles project the target model's weight rows into tokens, add type embeddings, and inject them into Qwen 2.5 3B. Phase I finds that composing multiple computation steps within a single forward pass is the bottleneck (MLP simulation stalls at 45%), so it switches to a decomposition scheme with 5 LLM forward passes plus external deterministic code, trained through a four-stage curriculum. Phase II trains a question-answering anomaly detector using only 10 benign pathologies and 17 diagnostic questions, with no backdoors appearing during training.
- Results: decomposed simulation reaches 99.0% accuracy on held-out real toy transformers; zero-shot backdoor detection achieves AUROC 0.93 ± 0.04 on the pos0 attention-routing backdoor (5 runs, TPR 94% at 20% FPR), 0.81 on the mixed distribution of the four types pos0/lastpos/stealth/adversarial, with each type staying at 0.74–0.89.
- Comparison: handcrafted statistical detectors are stronger on the attacks they target (V/O composite 0.752 on pos0) but fail when the threat model switches; the authors argue the oracle's value lies in being uniformly competent rather than peaking at a single point.
- Mechanistic evidence: gradient attribution shows backdoored models' WV gradients are about 2× those of clean models; layer-by-layer probing shows the detection signal reaches 0.88 at layers 0–10 and rises back to 0.93 at layers 34–35.
- Authors' conclusion: the authors state that weight-space interpretation is a viable direction for proactive safety auditing, but scaling to real model sizes is the main open challenge, and the current oracle learns pathway-specific statistical heuristics, has a relatively high false positive rate, and has narrow threat coverage.