AI
New technique detects when AI models make up facts by analyzing internal attention patterns
Researchers propose a method that catches hallucinations in large language models by probing how attention flows across neural layers.
Hallucinations—instances where large language models generate plausible-sounding but false information—remain a critical obstacle to deploying LLMs reliably. A team of researchers has now introduced Cross-Layer Attention Probing (CLAP), a technique designed to identify when these models are likely producing unreliable text by examining the internal patterns of how information flows through the network.
How the technique works#
Rather than analyzing the final output alone, CLAP inspects the model's activations—the intermediate computational states—across all layers of the neural network. By treating these activations as a unified sequence across the residual stream (the pathway through which information flows in modern transformers), the method can distinguish between responses that are grounded in the model's training data and those that represent confabulated content.
Demonstrated effectiveness#
The researchers evaluated CLAP across five different language models and three separate tasks, showing consistent improvements over existing hallucination detection baselines. Notably, the technique works not only on deterministic outputs but also on responses generated with higher "temperature" settings—a parameter that increases randomness and variability. This means CLAP can fine-grained detection: distinguishing hallucinations from accurate statements even among multiple different responses to the same question.
Practical applications#
Building on these findings, the team proposes a detect-then-mitigate strategy. Rather than attempting to prevent hallucinations upfront, this approach first identifies when they occur, then applies targeted corrections. Testing shows this two-step process outperforms direct mitigation attempts at improving overall model reliability.
Robustness and generalization#
An important finding is that CLAP maintains its effectiveness when deployed on data the model has not seen during training (out-of-distribution scenarios), suggesting the method captures fundamental patterns in how hallucinations emerge rather than relying on dataset-specific artifacts.
The researchers have made their code publicly available to support further development and testing of the approach.

