---
title: "Why a Language Model Is Not a Database"
source: https://bitvaria.com/en/keine-datenbank
---

27\. Aug. 2026 · Daniel Schleipfer · [AI](https://bitvaria.com/category/ai/)  · 6 min read

# Why a Language Model Is Not a Database

An extraction reliably pulls values out of contracts, until one field is missing. The same call still returns a number, cleanly formatted, just invented. Why a language model is not a database, and what that means for checking its output.

![An extraction reliably pulls values out of contracts, until one field is missing. The same call still returns a number, cleanly formatted, just invented. Why a language model is not a database, and what that means for checking its output.](https://bitvaria.com/_astro/keine-datenbank.NEfw5zCf.jpg)

> **Why doesn’t a language model always return the required answer form?**
> 
> Because no internal step checks the output against a schema. The model generates the statistically most likely next word, token by token, even when the result does not match the expected structure.

An extraction pulls the payment term out of contracts. For most documents, the number is right. One contract has no payment-term clause at all. The same call still returns a number. Cleanly formatted, in the expected shape. Just invented. Nobody caught it. The answer looked like it always does.

## An answer is not yet a checked answer

A database query returns a verified row, or an error. A language model doesn’t have that second case. On every call, it [continues word by word](https://bitvaria.com/en/sampling), always with the most likely next word. If a piece of information is missing from the text, that makes no difference to the model. “It’s in there” and “it sounds right” produce the same next step. That is why the call almost always returns an answer in the expected form. Nothing has been checked yet.

This stance has a name: the model as an unreliable function.

The series, and where this term sits

This term sits at "Mental Models" in the group "The Machine".

## Under the Hood

Looking under the hood shows why, not just that. A language model has no built-in check against reality. At every word, it computes a probability distribution over the entire vocabulary and draws [the next token](https://bitvaria.com/en/sampling) from it, regardless of whether the chosen token is actually supported by the context or just fits the pattern. Five observable failure classes follow directly from this one mechanism:

-   **Wrong type:** instead of the three required values, a full sentence comes back, because no internal step checks the output against a schema.
-   **Hallucination:** the model continues an invented but coherent-sounding fact, because “coherent” and “backed” produce the same signal for token generation.
-   **Ignored instruction:** a system directive loses out to a pattern that is more strongly represented elsewhere in the context.
-   **Leaking the instruction:** there is no hard boundary between instruction and text. Both are tokens in the same context window.
-   **Nondeterminism:** even at [temperature 0](https://bitvaria.com/en/sampling), the output stays only near-deterministic, because of floating-point rounding and GPU batching.

Each of these five classes is a direct consequence of how token generation works, not a fixable one-off bug.

## Where the Check Is Missing

Two of the five failure classes above have their own name and their own defense in production. A wrong type counts as malformed JSON output, and its defense is a combination of constrained decoding, schema validation, a repair loop, and a fallback chain. A hallucinated tool call counts as a weak contract, and its defense is verified tool contracts with argument validation and idempotency. Both are their own chapters in this series.

For German Mittelstand projects, there is a practical consequence on top. An invented number in an internal draft is annoying. The same invented number in a field that flows into an accounting or contract system becomes a claim with an implied source, without an actual source behind it. Audit-proof record-keeping requires that a value in the system can be traced back to where it came from. An unvalidated model call does not meet that bar, no matter how cleanly the output is formatted.

The fix is not a longer or more polite prompt. It is a check outside the model: a schema that enforces the shape, a comparison that holds the value against the source in the document, and for fields that carry real weight, a human who sees the flagged cases before they move on.

* * *

**A database returns a verified row, or an error. A language model almost always returns an answer in the expected form. That is not the same as checked.**

Next term: **continuous batching**. How a GPU picks up new requests mid-run instead of waiting for a full batch.

## Frequently Asked Questions

**Why doesn’t a language model always return the required answer form?** Because no internal step checks the output against a schema. The model generates the statistically most likely next word, token by token, even when the result does not match the expected structure.

**What is a hallucination in a language model?** An answer that sounds plausible but is not backed by any source in the context or the training data. For token generation, an invented fact feels exactly the same as a backed one.

**Why can a language model leak its own system instructions?** Because there is no hard boundary between instructions and other text. Both sit as tokens in the same context window.

**How can a language model’s answer be checked reliably?** Outside the model: a schema that enforces the shape, a check against the source in the document, and for fields that actually matter, a human who sees the flagged cases before they move downstream.

* * *

*Part of the series [AI Engineering Explained](https://bitvaria.com/en/ai-engineering-begriffe). Related: [Why the Same Model Almost Never Gives the Same Answer Twice](https://bitvaria.com/en/sampling) (Sampling) and [What Is a Token?](https://bitvaria.com/en/was-ist-ein-token) (Tokenization)*

-   [ki](https://bitvaria.com/tag/ki/)
-   [ai-engineering](https://bitvaria.com/tag/ai-engineering/)
-   [llm](https://bitvaria.com/tag/llm/)
-   [hallucination](https://bitvaria.com/tag/hallucination/)
-   [mental-models](https://bitvaria.com/tag/mental-models/)

Share:

[Back to Blog](https://bitvaria.com/blog/)

## Terms explained on this page

- **Hallucination**: An answer that sounds plausible but is not backed by any source in the context or the training data.
- **Leaking the instruction**: Prompt leakage. The model reveals parts of its own system instructions when asked cleverly enough.
