Residual-Driven Probe Construction for Hallucination Detection That Transfers Across Tasks

A language model's internal activations often "know" when its output is false. A probe, meaning a small classifier trained on those activations, can flag hallucinated summaries better than human annotators. These probes break when moved to a new task, though. A probe trained on summarization fails on dialogue, and one trained on synthetic hallucinations fails on organic ones (Do Androids Know They're Only Dreaming of Electric Sheep?). Our hypothesis is that a probe fit to a uniform mixture of examples grabs the easiest separating direction first. That direction is likely tied to the source task's surface style rather than to falsehood itself. It also hides the slower, more general signals, the same "spurious first, invariant later" dynamic shown for image classifiers (Understanding and Improving Feature Learning for Out-of-Distribution Generalization).

We propose to build the detector in stages, the way old constructive-induction methods built decision-tree features. A first, simple probe is fit on easy, glaring hallucinations. Each later stage looks only at the examples the current detector still gets wrong. On those it adds one new feature, which is either a new sparse direction in some layer, or the product of an existing feature with a new one. The new feature is accepted only if its scores carry information the existing features do not. The result is a short, inspectable list of features, each tied to a difficulty tier and a layer. The claim to test is that this list transfers to held-out tasks and to organic hallucinations better than a probe of equal capacity trained all at once.

Core Claim

Residual-driven, curriculum-ordered construction with a non-redundancy test produces hallucination probes that generalize across tasks better than three alternatives at matched capacity and data: one-shot probes (linear, multi-layer MLP, or multi-direction), plain gradient boosting over activation features, and curriculum training alone. The construction loop borrows from three sources:

None of these touched transformer activations. Conversely, no hallucination probe work in the file builds its features this way.

The stagewise mechanics are close to boosting, and we say so. The proposal stands or falls on whether its two additions beat boosting on transfer. The first addition is ordering data from easy to hard across stages. The second is a redundancy test measured in the space of feature scores.

Research Program

Stage 0. We extract residual-stream and attention-head activations from Llama-2-13b at several layers, matching the setup of the Androids paper. We fit a sparse logistic probe on the easiest tier of training hallucinations.

Difficulty. We define difficulty without an external judge, because Teaching with Lies: Curriculum DPO on Synthetic Negatives for Hallucination Detection shows that curricula ranked by a scoring model like MiniCheck inherit that model's blind spots. Instead, difficulty is the margin of the current detector, a self-paced rule in the spirit of Self-Paced Learning for Latent Variable Models. The admitted tier widens each stage by an annealed threshold.

Each later stage. At stage $t$ we split the admitted examples into a retention set $R_t$, which the detector classifies correctly, and an augmentation set $A_t$, which it gets wrong.

  • Candidates. We generate two kinds of candidate features. One is a new sparse direction $w$ at one chosen layer or head, fit on $A_t$. The other is a product $f_i(x)\,g(x)$ of an accepted feature $f_i$ with a new direction $g$, which acts as a gate. The product option is the analogue of a fringe conjunction: it lets a feature fire only in the region where an earlier feature is uncertain.
  • Acceptance test. A candidate $c$ is accepted if it reduces held-out validation loss and passes a redundancy test on the retention set:

$$\max_i \;|\mathrm{corr}_{x \in R_t}(c(x), f_i(x))| < \tau ,$$

where $f_i$ are the accepted features and $\tau$ is a threshold tuned once on a validation split. The test is in score space rather than weight space on purpose. Truth Forest's orthogonality loss (Truth Forest: Toward Multi-Scale Truthfulness in Large Language Models through Intervention without Tuning) makes probe weight vectors orthogonal. Orthogonal directions can still produce nearly identical judgments on data, and that kind of redundancy is the target here.

Initialization constraint. A Task-centric Theory for Iterative Self-Improvement with Easy-to-Hard Curricula shows easy-to-hard schedules help only above a feasibility threshold. Its under-initialized 1B model regressed by 0.28% on GSM8K. We therefore require the stage-0 probe to be clearly above chance on the easiest tier. We report runs where it is not as failures, not tuning targets.

Scope. This is a white-box detection method. It needs hidden states and does not steer generation.

Baselines

Floor. The naive reference point is a single linear probe at the best layer, trained on the uniform mixture. This is the setup whose cross-task failure the Androids paper documents.

Strongest existing detector. This is the attention-pooling and ensemble probe from Do Androids Know They're Only Dreaming of Electric Sheep?. It reports 0.75 response-level F1 on CNN/DailyMail, above expert annotators at 0.55, and over 90% F1 for its best probes on Conv-FEVER and E2E. It is the most direct competitor because it uses the same white-box signal and the same benchmarks. We retrain it on our exact training splits and activations with the same hyperparameter search budget, measured in probe fits. Beating it means higher F1 on held-out tasks and on organic hallucinations, averaged over seeds with non-overlapping confidence intervals, while staying within noise on the training task.

Sampling-based detector. We also run EigenScore with feature clipping from INSIDE: LLMs' Internal States Retain the Power of Hallucination Detection. It reports 81.5% AUROC on SQuAD with LLaMA-7B and needs no labels. It is the right comparison for transfer because it has nothing task-specific to overfit. If it beats every trained probe on held-out tasks, the case for any trained probe weakens.

Multi-direction probe. We include Truth Forest's $K$ orthogonal probes used as a detector, with $K$ matched to our final feature count. Its reported TruthfulQA numbers (40.8% to 74.5% truthfulness on Llama-2-7B) measure steering, not detection. We therefore treat those numbers as context, not as a target.

Matched-capacity one-shot learners. These are an MLP probe on concatenated multi-layer activations and gradient-boosted trees over per-layer probe scores, both trained on the uniform mixture. Each gets the same parameter budget and the same number of fits as our method.

Ablations. Three ablations isolate the ingredients: construction without curriculum (uniform data at every stage), construction without the redundancy test, and curriculum without construction (one probe trained easy-to-hard).

Label-free judge. For HaluEval we quote the judge result rather than rerun it. ChatGPT reaches 58.53% detection accuracy on summarization and 62.59% on QA (HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Models).

Why not just…?

Why not just train an MLP probe on all layers at once? An MLP can represent the same feature interactions, so this is the most serious threat. The argument against it concerns learning order, not capacity. Under uniform training, the fastest-learned direction absorbs the gradient, as FeAT shows for ERM. Nothing in the file shows this happens for hallucination probes, and no reported cross-task transfer number for an MLP probe was found on Lacuna. The matched-capacity MLP baseline settles it. If the MLP transfers as well as our method, the construction loop adds only interpretability, and we will report that.

Why not just use gradient boosting, since this is stagewise residual fitting? Mechanically, our loop is a constrained form of boosting. The proposal's contribution is therefore only what boosting lacks: the curriculum ordering and the score-space redundancy test. Plain boosting on uniform data is run as a baseline, and the two ablations remove each addition in turn. If boosting matches the full method on transfer, the claim is falsified.

Why not just use an unsupervised signal like EigenScore and skip training? It avoids task overfitting by construction, and INSIDE reports it is about ten times faster than model-based judges. It also requires sampling many responses per query and reflects consistency rather than grounding. Consistent fabrications, such as the imitated misconceptions in TruthfulQA: Measuring How Models Mimic Human Falsehoods, may evade it. We test this directly on TruthfulQA and on held-out HaluEval tasks.

Why not just apply curriculum DPO to a small detector model, as HaluCheck does? HaluCheck's 3B detector reaches 75.6% F1 against 57.1% for Llama-3.1 8B, and 0.759 F1 on MedHallu against GPT-4o's 0.737. These are strong results. However, HaluCheck fine-tunes a separate model and depends on MiniCheck rankings. Our method reads the generating model's own states with a few sparse features. We report HaluCheck's published numbers alongside ours on MedHallu and HaluEval without claiming a like-for-like comparison, since it uses a different model and different training data.

Proposed Experiments

Leave-one-task-out transfer on HaluEval. HaluEval's QA, dialogue, and summarization subsets support this split. We train on two tasks and test on the third, measuring F1 and AUROC.

Synthetic-to-organic transfer. We train on HaluEval's ChatGPT-generated hallucinations. We test on the organically annotated CNN/DailyMail, Conv-FEVER, and E2E data from the Androids paper. This reproduces exactly the gap that paper identified.

Fact-conflicting errors. We use TruthfulQA and the SQuAD and TriviaQA suites used by INSIDE as tests of world-knowledge hallucinations, which the training tasks do not cover.

Decisive check: the transfer gap. The decisive quantity is the gap between in-task and held-out-task F1. Our method should shrink this gap relative to the matched MLP and to plain boosting, while losing no more than noise in-task. If it does not, the hypothesis is wrong.

Mechanistic checks.

  • Which features carry transfer. We drop each accepted feature from the final detector and measure the held-out-task loss. We predict that early-stage features, learned on easy examples, carry most of the transfer, and that late features are task-specific.
  • Layer placement. We record which layers the stages select. The Androids paper finds 95% of peak probe performance by layer 4, while INSIDE uses middle layers. Constructed gates that combine an early-layer and a middle-layer feature would show that the two signals are complementary rather than redundant.
  • Plateau and drop. We plot held-out-task F1 against the number of accepted features. This tests whether activation probes show the same degradation that greedy eigencomponent selection shows on MVTec-AD.