Skip to content

Research

The Hallucination Problem Is a Design Problem

G6Solver Research Team

There is a quiet consensus forming in the AI industry about hallucination. The problem is acknowledged — large language models fabricate citations, invent statistics, confabulate historical events, and present fictional legal precedents with the same measured confidence they use for verifiable facts. And the consensus says: this is a bug. A serious one, certainly, but a bug nonetheless — something that better training, more careful reinforcement learning from human feedback, tighter guardrails, and retrieval-augmented generation will progressively reduce until it reaches acceptable levels.[1]

This framing is understandable. The engineering instinct, when confronted with a system producing incorrect outputs, is to treat those outputs as defects and seek fixes. And the fixes are real. RLHF has meaningfully reduced the frequency of blatant fabrications compared to earlier models.[2] Retrieval-augmented generation, which grounds model responses in actual documents, demonstrably improves factual accuracy in many domains.[3] Constitutional AI methods add another layer of self-correction.[4] Each intervention moves the needle. The trajectory looks encouraging.

The enterprise response follows logically from this framing. Organisations deploying LLMs in production invest in guardrail layers — output classifiers, fact-checking pipelines, human review queues, and citation-verification systems. The NIST AI Risk Management Framework treats accuracy as a governance concern, recommending continuous monitoring and human oversight to manage the risk of incorrect outputs.[5] The implicit promise is that with enough defensive engineering, the hallucination rate can be driven low enough that the remaining risk becomes manageable.

This is a reasonable position. It is also, in a fundamental sense, wrong.

The Mechanism, Not the Symptom

To understand why, you have to look at what a language model actually does when it generates text. At each step, the model produces a probability distribution over its vocabulary and samples the next token. The training objective — whether it is next-token prediction, masked language modelling, or a variant thereof — optimises for producing outputs that are statistically plausible given the input context and the training distribution. At no point in this process does the model consult a ground truth. There is no fact table. There is no verification step. There is only probability.[1]

This is not a subtle technical distinction. It is the generative mechanism itself. When a model produces a correct factual statement, it does so because the correct statement happens to be the most probable continuation. When it hallucinates, it does so for exactly the same reason — the hallucinated content is the most probable continuation given the model's internal representations. The model is not “making a mistake” in any meaningful sense. It is doing precisely what it was trained to do. It is completing patterns.[6]

Ji et al.'s comprehensive survey of hallucination in natural language generation identified this structural issue clearly: hallucination arises from the fundamental gap between the model's learned statistical regularities and the actual state of the world.[1] The model has no epistemic access to the world. It has access to patterns in text that was, at some point, about the world. These are profoundly different things.

Now consider what RLHF actually does in this context. It adjusts the probability distribution to favour outputs that human raters judge as helpful, harmless, and honest. This is genuine progress — it shifts the likelihood surface away from egregiously wrong outputs. But it does not change the fundamental architecture. The model is still sampling from a probability distribution. It has simply been taught to hallucinate less often, not to verify whether its outputs are true. The distinction matters enormously when you move from reducing average-case error rates to guaranteeing worst-case correctness — the kind of guarantee that medical, legal, and financial applications actually require.[2]

Retrieval-augmented generation (RAG) is a more serious intervention, because it introduces external grounding. Instead of relying solely on parametric memory, the model retrieves relevant documents and conditions its response on them. This demonstrably helps.[3] But RAG introduces its own failure modes that are often underappreciated. The retrieval step itself can fail — returning irrelevant documents, or relevant documents that contain outdated or incorrect information. Huang et al.'s survey documents what they term “retrieval hallucination”: cases where the model hallucinates despite having access to correct retrieved context, because the generative mechanism still prioritises fluency and coherence over fidelity to the source material.[6] There is also the problem of context poisoning — adversarial or simply noisy documents in the retrieval corpus that contaminate the generation process.[7]

The deeper issue is that RAG treats the language model as a reader and summariser of retrieved text. But the model's “reading” is itself a probabilistic process. It does not parse retrieved documents the way a human does — extracting claims, evaluating their evidential weight, and synthesising them into a coherent judgement. It processes them as additional context that influences the next-token distribution. The retrieved facts are inputs to the same fundamentally ungrounded generation process.

Prompt User intent Token Probability P(next | context) No truth table VERIFICATION GAP No grounding step No fact-checking Output Plausible, unverified The same mechanism produces truth and hallucination

Fig. 1 — The standard LLM generation pipeline contains no truth-verification step between probability sampling and user-facing output

There is a mathematical dimension to this that is worth stating plainly. Gödel's incompleteness theorems demonstrated that sufficiently powerful formal systems cannot verify all truths about themselves from within.[8] While language models are not formal logical systems in Gödel's sense, the underlying intuition transfers: a system that generates claims from internal representations alone cannot reliably distinguish its own correct outputs from its incorrect ones. Self-consistency checks — asking the model to verify its own output — are better than nothing, but they are fundamentally limited by the fact that the verifier shares the same biases and blind spots as the generator. You cannot pull yourself up by your own bootstraps.

This is why the framing of hallucination as a “bug” is misleading. Bugs are deviations from intended behaviour. Hallucination is not a deviation from how language models work; it is how they work. The same mechanism that produces brilliantly correct responses produces confidently wrong ones. Treating the outputs as defects and trying to filter them after the fact is like trying to fix a bridge's structural design by painting over the cracks.

The Limits of Post-Hoc Repair

To appreciate the depth of the problem, consider the taxonomy of current mitigation strategies. Each addresses a real symptom. None addresses the root cause.

Guardrail classifiers scan model outputs for known hallucination patterns — fabricated URLs, non-existent citations, internally contradictory claims. These catch some fraction of errors, but they are reactive and brittle. They cannot detect novel hallucinations that do not match known patterns, and adversarial inputs can often bypass them.[9]

Self-consistency methods generate multiple responses and check for agreement. If the model gives the same answer across several samples, it is more likely to be correct. This is a useful heuristic, but it conflates confidence with correctness. A model can consistently hallucinate the same wrong answer because the same statistical bias produces the same error across samples.[6]

Human review is the gold standard for catching errors, but it does not scale. In high-throughput production systems generating thousands of responses per minute, human review becomes a bottleneck that defeats the purpose of automation. And human reviewers themselves are susceptible to automation bias — the tendency to over-trust machine outputs, especially when those outputs are articulated fluently.[10]

Fine-tuning on curated data can reduce domain-specific hallucination rates, but it is expensive, time-consuming, and must be repeated as the target domain evolves. It also risks catastrophic forgetting — improving accuracy in one area while degrading it in others.[1]

The pattern across all these approaches is the same: they accept the fundamental architecture as given and try to compensate for its limitations through external mechanisms. This is understandable pragmatism. But it is not a solution. It is a coping strategy.

Separating Generation from Verification

If the hallucination problem is architectural rather than parametric, then the solution must also be architectural. And there is a design pattern — well-established in other engineering disciplines — that applies directly: separate the component that generates proposals from the component that verifies them.[11]

In formal verification, this principle is foundational. A program synthesiser generates candidate programs; a verifier checks them against a specification. The synthesiser is allowed to be creative, heuristic, even probabilistic. The verifier is not. The verifier operates against formal constraints and rejects anything that does not satisfy them. The power of the approach comes from the asymmetry: generation is cheap and can tolerate error; verification is rigorous and eliminates it.[12]

This is not a new idea. It is how compilers work — the parser generates an abstract syntax tree, the type checker verifies it. It is how scientific publishing works — researchers propose findings, peer reviewers scrutinise them. It is how the legal system works — prosecutors make claims, defence attorneys challenge them. In every domain where correctness matters, we separate the proposer from the checker.

Applied to language models, this means treating the LLM as what it actually is: a powerful, creative, unreliable proposal generator. The model's job is to produce candidate responses — hypotheses, if you will. A separate verification layer, operating on different principles, then evaluates those candidates against external grounding sources, logical consistency constraints, and domain-specific rules before anything reaches the user.[11]

Output

Verified Response

Grounded, checked, traceable

Verification Layer

Formal Grounding

Logical checks • Source verification • Constraint satisfaction

Generator

LLM Proposal Engine

Creative, probabilistic, fast

Fig. 2 — Separating generation from verification: the generator proposes, the verifier disposes

The verification layer does not need to be a single component. It can be a pipeline of checks, each operating at a different level of rigour. At the simplest level, syntactic checks catch formatting errors and structural inconsistencies. At the next level, retrieval-based verification cross-references claims against a curated knowledge base — not to augment generation, but to independently check its outputs. At the highest level, formal methods can verify logical consistency, mathematical correctness, and compliance with domain-specific constraints.[12]

This architecture has a crucial property: the generator and the verifier can improve independently. Advances in language models make the generator more creative and capable. Advances in formal methods, knowledge bases, and verification techniques make the checker more rigorous. Neither is a bottleneck for the other. And because the verifier operates on the output of the generator rather than trying to modify its internal representations, it does not require access to model weights or training data. It works with any generator, including proprietary models whose internals are opaque.

From Probability to Proof

The philosophical shift here is significant. The current paradigm asks: “How do we make the model hallucinate less?” The architectural paradigm asks: “How do we build a system that detects and corrects hallucination before it matters?” The first question accepts the model's output as the primary artifact and tries to improve its quality. The second treats the model's output as a draft and builds the editorial process around it.

This is not merely an academic distinction. It changes the failure mode of the system. In the current paradigm, failure is invisible — a hallucinated response looks exactly like a correct one, and the user may have no way to tell the difference. In the verification paradigm, failure is explicit. When the verifier cannot confirm a claim, it can flag it, request additional evidence, or withhold the response entirely. The system fails safely rather than silently.[5]

There are legitimate objections to this approach. Verification adds latency. Formal methods do not scale to all domains. Some claims are inherently unverifiable. These are real constraints, and any practical system must navigate them. But they are engineering challenges, not fundamental barriers. The question is not whether verification is always possible — it is whether a system that verifies when it can, and honestly signals uncertainty when it cannot, is better than a system that always projects confidence regardless of its epistemic state.

The answer seems clear. In domains where correctness matters — medicine, law, finance, engineering, scientific research — the cost of hallucination is not measured in user dissatisfaction. It is measured in misdiagnoses, invalid contracts, financial losses, and structural failures. These are domains where “usually right” is not good enough, and where the difference between a 95% accuracy rate and a 99.9% accuracy rate is the difference between an interesting demo and a deployable system.[13]

The Generator Proposes; the Verifier Disposes

There is an irony in the current discourse around hallucination. The AI industry spends enormous resources trying to make language models do something they were not designed to do — be reliably truthful — while neglecting the architectural pattern that could actually deliver reliability. The model does not need to be truthful. It needs to be useful as a generator of hypotheses within a system that has other components responsible for truth.

This reframing also clarifies the role of techniques like RAG, RLHF, and constitutional AI. These are not solutions to the hallucination problem; they are improvements to the generator. A better generator produces better hypotheses, which means the verifier has less work to do. But they do not eliminate the need for verification. They make the system more efficient, not more reliable. Reliability comes from the architecture, not the components.

The history of software engineering teaches this lesson repeatedly. Reliability does not come from writing perfect code. It comes from building systems that detect and handle failure — type systems, unit tests, integration tests, monitoring, circuit breakers, graceful degradation. The most reliable software in the world is not bug-free; it is bug-tolerant. It assumes failure and architects around it.[11]

AI systems need the same design philosophy. Not models that never hallucinate, but architectures where hallucination is caught, flagged, and corrected before it causes harm. The generator proposes. The verifier disposes. And the user receives only what survives the gauntlet.

This is not a call for conservatism or a retreat from the remarkable capabilities of large language models. It is the opposite. By freeing the generator from the impossible burden of being always right, we allow it to be more creative, more exploratory, more useful. And by placing the burden of correctness on a verification layer designed for that purpose, we get a system that is both more capable and more trustworthy than either component alone.

The hallucination problem is not a training problem. It is not a data problem. It is not a scale problem. It is a design problem. And like all design problems, it has a design solution — one that the engineering discipline has understood for decades, and that AI is only now beginning to apply.

References & Further Reading

  1. Ji, Z., Lee, N., Frieske, R., Yu, T., Su, D., Xu, Y., Ishii, E., Bang, Y. J., Madotto, A., & Fung, P. (2023). Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12), 1–38. — Comprehensive taxonomy of hallucination types, causes, and mitigation strategies across NLG systems.
  2. Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., Schulman, J., Hilton, J., Kelton, F., Miller, L., Simens, M., Askell, A., Welinder, P., Christiano, P., Leike, J., & Lowe, R. (2022). Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35. — The InstructGPT paper establishing RLHF as a method for aligning model outputs with human intent.
  3. Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Rocktäschel, T., Riedel, S., & Kiela, D. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33. — The foundational RAG paper demonstrating improved factual accuracy through retrieval grounding.
  4. Bai, Y., Kadavath, S., Kundu, S., Askell, A., Kernion, J., Jones, A., Chen, A., Goldie, A., Mirhoseini, A., McKinnon, C., Chen, C., Olsson, C., Olah, C., Hernandez, D., Drain, D., Ganguli, D., Li, D., Tran-Johnson, E., Perez, E., … Kaplan, J. (2022). Constitutional AI: Harmlessness from AI feedback. arXiv. — Self-supervision methods for reducing harmful and inaccurate outputs without human labelling at every step.
  5. National Institute of Standards and Technology. (2023). AI Risk Management Framework (AI RMF 1.0). U.S. Department of Commerce. — Federal guidance on managing AI risks including accuracy, reliability, and robustness in deployed systems.
  6. Huang, L., Yu, W., Ma, W., Zhong, W., Feng, Z., Wang, H., Chen, Q., Peng, W., Feng, X., Qin, B., & Liu, T. (2025). A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions. ACM Computing Surveys. — Distinguishes factuality and faithfulness hallucination; documents retrieval hallucination in RAG pipelines.
  7. Zou, A., Wang, Z., Kolter, J. Z., & Fredrikson, M. (2023). Universal and transferable adversarial attacks on aligned language models. arXiv. — Demonstrates that aligned models remain vulnerable to adversarial suffixes that bypass safety training.
  8. Gödel, K. (1931). Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I. Monatshefte für Mathematik und Physik, 38, 173–198. — The incompleteness theorems establishing fundamental limits on self-verification in formal systems.
  9. Rebedea, T., Dinu, R., Sreedhar, M., Parisien, C., & Cohen, J. (2023). NeMo Guardrails: A toolkit for controllable and safe LLM applications with programmable rails. arXiv. — Programmable guardrail architectures for constraining LLM outputs in production deployments.
  10. Parasuraman, R., & Manzey, D. H. (2010). Complacency and bias in human use of automation: An attentional integration. Human Factors, 52(3), 381–410. — On automation bias and the tendency of humans to over-trust automated system outputs.
  11. Nardi, D. (2023). Introduction to Intelligent Systems. Springer. — On multi-component system architectures that separate hypothesis generation from verification in AI pipelines.
  12. Solar-Lezama, A. (2008). Program synthesis by sketching. Ph.D. thesis, UC Berkeley. — The CEGIS paradigm: generate candidate programs, verify against specifications, refine iteratively.
  13. Singhal, K., Azizi, S., Tu, T., Mahdavi, S. S., Wei, J., Chung, H. W., Scales, N., Tanwani, A., Cole-Lewis, H., Pfohl, S., Payne, P., Seneviratne, M., Gamber, P., Kelly, C., Babiker, A., Schärli, N., Chowdhery, A., Mansfield, P., Demner-Fushman, D., … Natarajan, V. (2023). Large language models encode clinical knowledge. Nature, 620, 172–180. — Demonstrates both the remarkable clinical capability and the residual hallucination risk of LLMs in medical domains.