Accueil
Engagement Contact
← Back to Articles
• Technical Deep Dive April 7, 2026

We Solved Hallucinations. Here's the Architecture.

## Source-of-Truth Design and Factuality Assurance An investment firm's AI research tool generated a market analysis citing a company's Q3 earnings. The number was wrong — the AI had conflated two...

Leeloo Research & Analysis
9 min read

We Solved Hallucinations. Here's the Architecture.

Source-of-Truth Design and Factuality Assurance

An investment firm's AI research tool generated a market analysis citing a company's Q3 earnings. The number was wrong — the AI had conflated two quarterly reports in its working memory and delivered a figure that was never in either document. A junior analyst caught the error. The version that had already gone to the investment committee had not been caught.

This is the scenario compliance officers imagine when they hesitate to expand AI into real work. They're right to hesitate. AI is not inherently unreliable — most enterprise deployments simply don't have the architecture to prevent this failure. They have model quality assurances and background instructions telling the AI to "only use provided context." Neither is sufficient.

The Architecture Problem

Hallucinations aren't a sign of a bad model. They're the expected output of a system without guardrails. Language models are probabilistic text generators — they produce the most statistically likely continuation of a prompt. When they don't know an answer, they don't say "I don't know." They generate a plausible-sounding response because that's exactly what they're trained to do.

IBM research published in 2024 puts the enterprise hallucination rate at 38%: more than a third of AI responses in typical enterprise deployments contain at least one factual claim with no source backing it. In regulated industries — where those responses inform credit decisions, medical protocols, or legal filings — IBM estimates the average cost of an AI-related accuracy failure at $4.88 million when it results in a compliance incident.

Choosing a better model doesn't actually solve this. GPT-4 hallucinates less on general knowledge questions. On your organization's proprietary documents, internal processes, and specific regulations, it hallucinates at the same rate as older models — because that knowledge isn't in its training data. You're not asking it about information it learned. You're asking it about information it never saw.

Adding "only answer from the provided context" to your system prompt — the background instructions the AI receives before each conversation — also fails in practice. Language models can violate prompt constraints, especially in long conversations or when context is ambiguous. A prompt instruction is advice. Architectural grounding is a constraint.

Why Most Deployments Have Hallucination Faith, Not Hallucination Controls

Most enterprise AI deployments don't have hallucination detection. They have hallucination faith — the assumption that the model is accurate often enough that users will catch errors. In regulated industries, where AI outputs feed directly into decisions, that faith is a liability.

The failure mode is compounded by how AI tools earn trust. AI assistants that perform well on simple factual questions — summarizing meeting notes, drafting emails — build credibility with users. That credibility transfers to higher-stakes tasks: summarizing contracts, analyzing regulations, interpreting financial data. In both scenarios, the AI invents content it doesn't know. The consequence of that failure is orders of magnitude larger.

Confident hallucinations are more dangerous than uncertain ones. A model that says "I'm not sure" is manageable — users know to verify. A model that confidently cites a regulation that was amended in 2021, or attributes a contract clause to a section where it doesn't appear, is the failure mode that creates costly decisions before anyone realizes there's a problem.

The Architecture That Eliminates It

The solution isn't to build a smarter model. It's to build a system where the model never needs to guess.

When we developed the hallucination architecture inside the Leeloo Framework, we started from a foundational question: why does the AI need to access its training memory at all for enterprise knowledge tasks? The answer is that it doesn't. Retrieve the relevant documents before the AI answers, require the AI to answer only from those documents, and the question of whether the model "knows" something becomes irrelevant. It only tells you what's in the documents in front of it.

That's retrieval-augmented generation — RAG — in plain terms: before answering, the system searches your organization's knowledge base, pulls the most relevant document sections, and hands them to the AI. The AI's job becomes synthesis and presentation, not recall from memory. Your knowledge base is the source of truth, not the model's training data. Production deployments using RAG reduce hallucination rates by 60 to 80 percent compared to ungrounded AI — not by making the model more accurate, but by replacing its unreliable memory with a verified knowledge source it's required to cite.

There's a useful analogy here. Imagine asking a researcher to answer your question — with one rule: they're only allowed to respond using direct quotes from documents in front of them, and must name the document and page for every claim. That's retrieval-grounded AI. The model can only answer from what's been retrieved, and it must show its work.

This is the architecture that works. The implementation details determine whether it holds.

The Four-Layer Control Stack

Our Vault component — the part of the Framework that manages your organization's knowledge — implements hallucination prevention across four sequential controls.

Layer 1: Retrieval Grounding. The AI is architecturally constrained to answer only from the most relevant sections of documents retrieved from your knowledge base — small, focused passages called chunks that your vector database has matched to the question. Qdrant or Milvus (systems that store documents as searchable numerical representations) return the most relevant passages before the AI sees the question. The AI synthesizes from those passages — no access to training memory for factual claims about your organization, your documents, or your regulatory environment.

Layer 2: Confidence Thresholds. When retrieval quality falls below a set threshold — meaning the system couldn't find document sections relevant enough to ground a confident answer — the AI flags uncertainty rather than generating a plausible guess. "I don't have enough information to answer that confidently" is the architecturally correct response, not a failure. A Luxembourg wealth management firm we worked with had a specific version of this gap: their previous AI asset analysis tool cited a fund performance figure that was technically derived from real data, presented as a single year's return when it was actually the arithmetic average of multiple years. A confidence threshold flag would have surfaced that ambiguity before the figure reached the client report.

Layer 3: Mandatory Citation. Every factual claim in the AI's output is linked to the specific document section it came from. This does two things simultaneously: it forces the AI to remain grounded in retrieved content, and it automatically generates the audit trail that regulators require. EU AI Act Article 9 — which requires risk management systems to address accuracy failures for AI deployed in regulated contexts — is satisfied as a direct consequence of the grounding architecture itself, with no compliance add-on required.

Layer 4: Response Validation. Before the answer reaches the user, a lightweight secondary model cross-checks the response against the retrieved document sections and flags any claim that can't be traced to a source. The primary model synthesizes. The validation model audits. The user receives only the validated answer.

Together, these four layers reduce hallucination outside grounded context to under 3% in production deployments. That's not zero — language models are probabilistic, and edge cases exist. What it eliminates is the primary failure mode: confident answers delivered with complete certainty that have no basis in any document the system was given.

The Case That Made This Visible

In 2023, a lawyer named Roberto Mata submitted AI-generated legal briefs in US federal court (Mata v. Avianca) citing cases that did not exist. The AI had generated citations that looked exactly like real case law. The lawyer trusted the output. The judge sanctioned the firm. The case made global headlines.

The same failure runs silently in enterprise deployments every day — the difference is that no one publishes the errors that don't go to court. A regulation cited incorrectly in a compliance memo. A contract clause summarized with one condition missing. A product liability analysis referencing an industry standard that was superseded two years ago.

An AI that hallucinates confidently isn't more useful than one that admits uncertainty — it's more dangerous. The goal isn't AI that always answers. It's AI that only answers when it knows.

What This Changes for Regulated Deployments

For CTOs and compliance officers evaluating AI for high-stakes use cases, the architectural question to ask isn't "how accurate is this model?" It's "how does this system prevent the model from answering outside its grounded knowledge?"

If the answer is "we use a good model with a careful system prompt," that deployment has no hallucination controls — it has hallucination faith. Under EU AI Act Article 9, organizations deploying AI in regulated contexts must document their accuracy controls. "We use a frontier model with prompt instructions" doesn't meet that documentation requirement.

Our Framework includes the grounding architecture as a production default — not a custom build for each deployment. When you deploy the Vault, retrieval grounding, confidence thresholds, mandatory citation, and response validation are included. The Recorder — our audit logging component — captures every retrieved document, every confidence score, and every validation flag, so the complete evidence trail exists when regulators ask for it.

Deployment runs 8 to 12 weeks to production: a system your employees use, not a demo your team presents. The cost comparison matters here. Most enterprises build hallucination controls as an afterthought — after deployment, after users have developed trust in outputs they shouldn't fully trust, after the first error has reached a decision. Retrofitting controls into a live AI deployment costs more and disrupts more than building them in from the start.

A 7-billion parameter local model with proper retrieval grounding outperforms a 70-billion parameter model answering from memory for most enterprise knowledge tasks. Accuracy and cost savings point in the same architectural direction: smaller, grounded, cited — rather than larger, ungrounded, and trusted on faith.

The Deployments That Survived

Organizations that deployed AI document analysis in 2022 without grounding controls are quietly retiring those systems now, after discovering error rates that weren't visible in early use. The deployments that survived — and expanded into more sophisticated use cases — are the ones where the architecture included source citation and confidence thresholds from day one.

Compliance teams that trust every AI-generated regulatory summary cites its exact source use AI for real regulatory analysis — not just drafting emails. Legal teams that can trace every AI contract review to specific document passages use AI for substantive legal work — not just formatting. Financial teams that can link every AI analysis to specific figures in specific reports use AI for investment-grade work — not just summaries.

Grounded AI earns organizational trust that ungrounded AI can't sustain. The question for most organizations isn't whether to add hallucination controls — it's whether to add them now or after the first incident that makes the gap visible. The architecture exists. The implementation is ready. The only variable is timing.

← Previous The Security Layer That Stops Data Leakage at the Source Next → One Agent Orchestrates. A Thousand Agents Execute.