In this article
Before you start
For the wider picture, see the LLM evaluation guide. This page assumes only the ideas below.
Why interviewers ask this
Hallucination detection decides whether an answer can be shown to a user, so it comes up in any round about shipping a language-model product. An interviewer uses the question to see whether you know the families of detectors and what each one needs: access to the model's internals, several sampled answers, or labeled data.
A weak answer says "check the output against a database" or "ask the model if it is sure." A strong answer names the family (reading internal states), says what is trained and what stays frozen, and states the limit: a detector scores an answer, and a score is not a fix. A Staff-level answer adds the label cost, the benchmark caveat, and how the detector sits next to LLM-as-a-judge and a golden set in a real evaluation stack.
Steering latents for hallucination detection from first principles
- Hallucination detection
- Hallucination detection is a binary classification task that decides, for a prompt and a model's generated answer, whether the answer is truthful or hallucinated, without changing the answer itself.
- Steering vector
- A steering vector is a single learned list of numbers, added to a model's hidden states at one layer, that shifts how the model represents its input without changing any of the model's weights.
- Truthfulness Separator Vector (TSV)
- The Truthfulness Separator Vector (TSV) is the steering vector of Park et al. that is trained so that the final embeddings of truthful and hallucinated answers form two well-separated clusters.
- Pseudo-labeling
- Pseudo-labeling is the practice of giving unlabeled examples a best-guess label from a model, and keeping only the confident guesses as extra training data.
In plain words
Picture a room where truthful and untruthful speakers stand mixed together. A guard must sort them by where they stand. A language model's usual embeddings are like that crowd. They are tuned for fluent speech, not for truth. The paper argues that such embeddings, optimized for coherence rather than factual accuracy, often fail to separate truthful from hallucinated content. A steering vector is a gentle push that moves the two groups apart. The analogy breaks in one place. The push is the same for everyone. The separation comes from how the network reacts to it.
In one precise sentence, a TSV is one trainable vector, added after generation, that makes a simple classifier on the last-token embedding work better.
Step 1: The model's hidden states hold a last-token embedding
A frozen model reads the prompt and its answer. Layer by layer it builds a hidden state for each token. The detector reads one of them: the last-token embedding at the final layer, the model's summary of the whole prompt and answer.
Input: prompt plus generated answer. Output: one embedding. The paper defines the task as a classifier that returns truthful or hallucinated for that pair. You now know what the detector looks at; next comes what changes it. Without any change, truthful and hallucinated embeddings overlap, which is why a plain classifier on them struggles.
Step 2: One steering vector is added at a hidden layer
The TSV is a single trainable vector with the same length as the model's hidden size. It is added to the hidden states at one intermediate layer l, and the paper states the update in its Eq. 2:
Here h is the hidden state, v is the steering vector and λ is a hyperparameter, a setting chosen by hand, that controls the strength of the steering. The same v is shared across all token positions. The shift then flows through every later layer, so the final embedding changes. Because it is applied after generation is complete, the model's original language ability and its weights are untouched.
Step 3: A few labeled exemplars pull the clusters apart
Stage 1 trains only v. The paper models final embeddings on a sphere of unit length, where truthful and hallucinated data each form distinct clusters. Training pulls each labeled embedding towards the prototype, the center, of its class, using a negative log-likelihood under a von Mises–Fisher distribution, a bell-shaped curve for directions on a sphere. The prototypes are updated by an exponential moving average, a running average that favors recent values.
Input: a small labeled set. Output: a vector v that gives compact, well-separated clusters. Park et al. (2025) reach their reported results with a small labeled exemplar set. You now know how the push is learned from few labels.
Step 4: Unlabeled answers are pseudo-labeled
Stage 2 adds data that costs no human effort. Deployed systems already produce unlabeled generations through user queries. The paper models them as a mixture: a share π are hallucinated and the rest are truthful. An optimal transport algorithm, a method that matches samples to classes at least total cost while respecting class sizes, assigns pseudo-labels and so copes with imbalance. A confidence filter keeps only the reliable ones, and TSV is trained again on the larger set.
Input: unlabeled answers. Output: a vector v trained on more data. This stage is why a few exemplars can be enough.
Step-by-step description
- The frozen model gives a last-token embedding.
- One vector is added at a hidden layer.
- Few labeled exemplars pull classes apart.
- Unlabeled answers retrain the vector.
- The detector reads the last-token embedding at the final layer.
- One steering vector is added at a hidden layer after generation.
- A few labeled exemplars train the vector to form two clusters.
- Unlabeled answers are pseudo-labeled to retrain the vector.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Worked example
The numbers below are a toy, not paper data. Four truthful and four hallucinated answers sit at overlapping angles in two dimensions. Truthful embeddings have length 2 and hallucinated ones length 1 (illustrative). The score of an answer is its cosine similarity with a truthful direction. The steering vector is (0, 1), added with strength λ.1
The metric is the area under the receiver operating characteristic curve (AUROC): the chance that a randomly chosen truthful answer scores higher than a randomly chosen hallucinated one, where 0.5 is a coin flip and 1 is perfect. With 16 truthful-hallucinated pairs, AUROC counts how many pairs are ordered correctly.1
| Steering strength λ (illustrative) | Mean score gap | Toy AUROC |
|---|---|---|
| 0 (no steering) | 0.0196 | 0.5625 |
| 0.5 | 0.1073 | 0.625 |
| 1 | 0.1431 | 0.75 |
The toy's gain comes only from the unequal lengths, 2 against 1: the shorter hallucinated vectors are pulled further towards the steering direction than the longer truthful ones, so their angles diverge.1 With equal lengths, a shift added at the scored layer leaves AUROC at 0.5625.1 The vector here is hand-picked. In TSV, v is learned, and the separation comes from the nonlinear layers after layer l, which this toy does not have. The paper steers an intermediate layer and the effect propagates through the network. On the TruthfulQA benchmark (Lin et al., 2022), a question-answering (QA) test of truthfulness, it reports 84.2% against 85.5% for a fully supervised upper bound.
For the unlabeled stage, suppose a deployed model yields 1,000 unlabeled answers and an assumed π of 0.3 (illustrative): about 300 are hallucinated and 700 truthful, an imbalance the pseudo-labeler must respect.1
Text description of the diagram
- Toy AUROC is 0.5625 with no steering.
- Toy AUROC is 0.75 at steering strength 1.
Trade-offs and edge cases
Steering is a detector, not a cure. The paper stresses that TSV reshapes the latent space for classifying hallucinated responses, a different objective from mitigating hallucinated generations. Earlier steering methods shift activations during generation, which aims at mitigation, as the related-work section of Park et al. (2025) describes; for that goal see LLM guardrails and the causes in why LLMs hallucinate.
Detectors fall into families, summarized below. In the taxonomy of Park et al. (2025), logit-based methods use token probabilities, verbalized methods ask the model to state its uncertainty, and consistency-based methods compare several sampled answers. Farquhar et al. (2024) use entropy-based uncertainty, computed over meaning rather than wording, to detect confabulations, a subset of hallucinations. Internal-state methods, which assume the model encodes truthfulness in its internal states, need access to the model's hidden layers, so they suit open-weight models and not a closed application programming interface (API).
Text description of the diagram
- Logit-based methods use token probabilities as an uncertainty score.
- Consistency-based methods compare several responses.
- Internal-state methods read hidden states and need model access.
Edge cases: the reported numbers are for specific benchmarks and models, so 84.2% is not a general accuracy. No independent replication was found, so treat the claims as the authors' own. A detector trained on one kind of question may not carry over to another; check on your own golden set and benchmark it as described in LLM benchmarks.
How to answer it in an interview
How would you detect hallucinations using a model's internals?
I'd read the last-token embedding at the final layer and train a classifier on it, but raw embeddings overlap because they're tuned for fluency. So I'd add a single learned steering vector at one hidden layer, after generation, which leaves the weights untouched and reshapes the space so truthful and hallucinated answers separate. It trains on a few labeled examples, then pseudo-labels unlabeled generations. The limit is that it only detects, needs open-weight access, and results are benchmark-specific.
The spoken structure: name the family, say what is trained and what is frozen, give the label cost, then the limit.
Common mistakes
- "Steering makes the model stop hallucinating." (wrong) The vector classifies answers after generation. (right) "It detects hallucinations; it does not change what the model says."
- "It needs fine-tuning the model." (wrong) Only one vector is trained and the parameters stay fixed. (right) "I train a single vector and keep the model frozen."
- "It needs thousands of human labels." (wrong) The paper reports a small labeled exemplar set plus unlabeled generations. (right) "A small labeled set, then pseudo-labels from unlabeled answers."
- "Hallucination detection is checking facts against a database." (wrong) That is retrieval-based checking, a different approach. (right) "This method classifies the model's internal state."
Follow-up questions
What is hallucination detection in LLMs?
Hallucination detection is the task of deciding whether a generated answer is truthful or hallucinated, usually as a score or a yes-or-no label. Pipelines such as Ragas measure faithfulness to the retrieved context in retrieval systems.
Does steering stop a model from hallucinating?
No. Steering here reshapes representations so a classifier can detect hallucinations; the authors call this a different objective from mitigating hallucinated generations.
How many labels does it need?
The paper reports a small labeled exemplar set, then adds unlabeled generations with pseudo-labels. The authors contrast this with supervised probes that need extensive labeling.
How is it different from semantic entropy?
Semantic entropy compares the meanings of several sampled answers, so it needs no internal access but needs several generations. Steering reads one answer's hidden states and needs model internals.
Why not just train a linear probe on the raw embeddings?
Raw last-token embeddings overlap, because they are optimized for linguistic coherence rather than factual accuracy, so a probe on them has little to separate. TSV reshapes the space first, and it needs only a small labeled set.
What does AUROC mean here?
AUROC is the chance a truthful answer scores above a hallucinated one; 0.5 is chance and 1 is perfect. It judges ranking quality and does not pick a threshold.
- Steering LLM latents adds one learned vector to hidden states so a classifier can separate truthful from hallucinated answers.
- It is applied after generation, trains one vector and leaves the model's weights untouched.
- It detects hallucinations; it does not prevent them.
- Stage 1 uses a few labeled exemplars; stage 2 pseudo-labels unlabeled generations.
- Reported results are benchmark-specific and the authors' own.
Sources
- Steer LLM Latents for Hallucination Detection (arXiv 2503.01917, ICML 2025) — arXiv (Park, Du, Yeh, Wang, Li); accessed 2026-10-26, 22 May 2025
- Steer LLM Latents for Hallucination Detection (arXiv abstract page) — arXiv; accessed 2026-10-26, 22 May 2025
- Detecting hallucinations in large language models using semantic entropy — Nature (Farquhar et al.); accessed 2026-10-26, 19 Jun 2024