hallucination-proof AI architecture
Kepler architects LLM systems where models plan but deterministic code retrieves all numbers AI EngineerTL;DW
- Hallucination is a feature, not a bug—it's alpha. The real problem is structural: models lack access to your firm's internal data and can't be held accountable for wrong outputs.
- Three sources of wrong numbers: retrieving wrong documents, extracting wrong numbers from right documents, and poor arithmetic. Each requires different architectural fixes.
- Models should plan and retrieve but never generate numbers directly. Use deterministic tools and code to compute—don't rely on token prediction for math.
- Pre-process unstructured data into structured stores with pointers to facts. Models dereference these pointers; if a pointer doesn't exist, the number cannot be generated.
- Combine ANN + BM25 retrieval, reciprocal ranking, and cross-encoders to search wide across 200 candidate documents, then narrow—LLMs naturally do expensive depth-first search instead.
- Security-critical: scope searches by tenant, prevent impersonation, validate document freshness, enforce allowlists, and populate indexes. Missing these causes cross-firm data leaks.
- Post-processing verification checks each citation at search time, correcting or refusing it. Refusals dropped drastically when models couldn't dereference pointers.
- Ask vendors: Does the model write pointers? Can you click a number to verify source? Are all citations and arithmetic checked? What happens to facts from nowhere?
- 80% of finance execs trust AI-generated numbers, but 31% find errors—trust requires accountability and verifiable sources, not just RAG platforms.
- Wall Street adoption stalled because tools format PowerPoints, not build end-to-end DCFs. Verification infrastructure unlocks real AI value in finance.
TL;DW
- Hallucination is a feature, not a bug—it's alpha. The real problem is structural: models lack access to your firm's internal data and can't be held accountable for wrong outputs.
- Three sources of wrong numbers: retrieving wrong documents, extracting wrong numbers from right documents, and poor arithmetic. Each requires different architectural fixes.
- Models should plan and retrieve but never generate numbers directly. Use deterministic tools and code to compute—don't rely on token prediction for math.
- Pre-process unstructured data into structured stores with pointers to facts. Models dereference these pointers; if a pointer doesn't exist, the number cannot be generated.
- Combine ANN + BM25 retrieval, reciprocal ranking, and cross-encoders to search wide across 200 candidate documents, then narrow—LLMs naturally do expensive depth-first search instead.
- Security-critical: scope searches by tenant, prevent impersonation, validate document freshness, enforce allowlists, and populate indexes. Missing these causes cross-firm data leaks.
- Post-processing verification checks each citation at search time, correcting or refusing it. Refusals dropped drastically when models couldn't dereference pointers.
- Ask vendors: Does the model write pointers? Can you click a number to verify source? Are all citations and arithmetic checked? What happens to facts from nowhere?
- 80% of finance execs trust AI-generated numbers, but 31% find errors—trust requires accountability and verifiable sources, not just RAG platforms.
- Wall Street adoption stalled because tools format PowerPoints, not build end-to-end DCFs. Verification infrastructure unlocks real AI value in finance.
Hallucination is structural: probabilistic models will fabricate plausible numbers. Kepler's fix forbids models from generating numeric values directly — models identify pointer references to structured data stores, deterministic code dereferences them, and post-processing rejects any number without a traceable source. Covers tenant isolation and three retrieval failure modes.
