Hallucination Basins: A Dynamic Framework for Understanding and Controlling LLM Hallucinations
Organizations: Illinois Mathematics and Science Academy, Illinois, USA · AI Innovation Institute, Stony Brook University, New York, USA
Abstract
Large language models (LLMs) hallucinate: they produce fluent outputs that are factually incorrect. We present a geometric dynamical systems framework in which hallucinations arise from task-dependent basin structure in latent space. Using autoregressive hidden-state trajectories across multiple open-source models and benchmarks, we find that separability is strongly task-dependent rather than universal: factoid settings can show clearer basin separation, whereas summarization and misconception-heavy settings are typically less stable and often overlap. We formalize this behavior with task-complexity and multi-basin theorems, characterize basin emergence in L-layer transformers, and show that geometry-aware steering can reduce hallucination probability without retraining.
Figures & tables
| Symbol | Definition |
|---|---|
| Hidden state at layer | |
| Dimension of hidden states ( ) | |
| Reference/centroid state at layer (basin center) | |
| Basin of attraction: | |
| Jacobian at layer | |
| Spectral radius (largest eigenvalue magnitude) |
| Model | Dataset | Task Type | Basin Sep | |
|---|---|---|---|---|
| Factoid: Point Attractors ( ) | ||||
| Llama-1B | HaluEval QA | Factoid | 4.55 | 2.89 |
| Llama-1B | MuSiQue | Factoid | 10.00 | 3.40 |
| Qwen-1.5B | HaluEval QA | Factoid | 5.56 | 32.83 |
| Gemma-2B | HaluEval QA | Factoid | 1.82 | 58.91 |
| Summarization: High-Dimensional Manifolds ( ) | ||||
| Model | Data | Lay | Centroid (95% CI) | Maha (95% CI) | B? | |
|---|---|---|---|---|---|---|
| gemma-2-2b | FEVER | × | ||||
| gemma-2-2b | HaluEval_qa | ✓ | ||||
| gemma-2-2b | HaluEval_summ | × | ||||
| gemma-2-2b | MuSiQue | ✓ | ||||
| gemma-2-2b | TruthfulQA | × | ||||
| llama-3.2-1b | FEVER | × |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Setting |
|---|---|
| Random seed | 42 (NumPy, PyTorch, scikit–learn) |
| Determinism | Seeds fixed; some GPU ops may remain non-deterministic |
| Batch size (train / extraction) | 8 (training loaders); 4 (hidden-state extraction) |
| Generation batch size | Per experiment; demo runs use batch #prompts (typically 3) |
| Maximum sequence length | 512 tokens (truncation applied) |
| Tokenizer padding | pad_token eos_token ; left padding for decoder-only models |
| Category | Parameter | Setting |
| Detection | Evaluation layer | Middle layer ( ) |
| Covariance estimate | Ledoit–Wolf shrinkage | |
| Detection model | Logistic regression (L2) on standardized features | |
| Causality | Interpolation grid | |
| Control directions | Random + orthogonalized (Gram–Schmidt) | |
| Effect metric | Fold change |
Hallucination in Language Models
Hallucination in language models studies how systems produce unsupported or false claims and how to detect, explain, and reduce them.
See all 254 papers