Sub topic 4
Gaps in What the Model Has Learned
This chapter assumes you have used a chat assistant, can read short Python, and know the idea from earlier chapters that a model predicts the next token from patterns in its training text. Here we look at one cause of fabrication: the model never learned the fact being asked about, or learned it only weakly.
Knowledge is stored as statistics, not as records
A database stores a fact in a row and returns it exactly or not at all. A language model does not work that way. Training adjusts billions of numeric weights so that the model predicts text well. Facts end up spread across those weights as tendencies. The model can reproduce "Paris is the capital of France" because that pairing appeared in countless forms. It has no lookup table to consult, and it cannot tell "I stored this" from "this sounds right."
When a fact is missing or weak, the model does not return an empty result. It still has to produce a next token, and the most plausible-sounding continuation wins. A gap in knowledge therefore shows up as a fluent, specific, wrong answer.
The long tail of rare facts
Facts in text follow a long-tail distribution. A few facts (capitals, famous dates, popular APIs) appear thousands of times. A very large number of facts appear a handful of times or once. The model learns the head of this distribution well and the tail poorly.
Examples of tail content:
- The birthday of a mid-level academic.
- The parameters of a function in a small open-source library.
- The population of a village.
- A minor court case, a local regulation, or a niche product's specifications.
The same question can be easy or hard depending only on how often the answer appeared in training. Asking for the capital of Australia is safe. Asking for the second author of an obscure 2014 workshop paper is not, even though both are "just facts."
Some researchers argue that the share of facts that appear exactly once in training data gives a rough floor on how often a model errs on that kind of fact. The toy script below shows the calculation on invented counts.
mentions = {
"Marie Curie": 5000,
"Lise Meitner": 300,
"Regional poet": 2,
"Town mayor": 1,
"Small-town pharmacist": 1,
}
singletons = [name for name, count in mentions.items() if count == 1]
rate = len(singletons) / len(mentions)
print(singletons)
print(rate)It prints ['Town mayor', 'Small-town pharmacist'] and 0.4. In this made-up corpus, 40 percent of the entities were seen once. A question about one of those people has little to rely on. The numbers are illustrative. Real training sets are not public, so you cannot compute this for a real model.
Why rarity fails quietly
Weak knowledge does not make the model sound hesitant. The same machinery that writes about Marie Curie writes about the pharmacist, using the same grammar and confident tone. The model may also blend nearby facts. It might give the pharmacist the birthplace of a similarly named person, or an employer typical for people with that profession. The answer matches the pattern of a correct answer without being one.
Training cutoff and stale knowledge
A model's training data ends at a cutoff date. Anything that happened afterward is absent unless the system adds it through search or supplied documents. Three effects follow:
- Missing events. The model cannot know about releases, laws, or news after the cutoff.
- Stale "current" facts. Questions like "Who is the CEO of X?" or "What is the latest version of Y?" may be answered with whatever was true at training time.
- Thin recent coverage. Events shortly before the cutoff have had little time to be written about, so they are often represented more weakly than older events.
A model may not know its own cutoff accurately, so asking it "is this up to date?" is not a reliable check.
Data the model never saw
Some content is rarely or never in training data at all:
- Private documents, internal wikis, and emails.
- Paywalled or access-controlled material.
- Your own codebase, unless you paste it in.
- Very new or very local information.
- Content in languages or domains that are thinly represented online.
If you ask about your company's refund policy, the model has nothing real to draw on. It will often describe a typical refund policy and present it as yours. The question looks answerable, so the model answers it.
Partial and one-directional knowledge
Learning can be incomplete in subtler ways. A model may know a fact in one phrasing and fail in another. A well-documented finding is the reversal effect. A model trained on "A is B" may answer "Who is A?" correctly but fail on "Who is B?" even though the facts are equivalent. Retrieval depends on how the fact was expressed in text, not on a clean logical store.
Other partial gaps:
- Multi-step facts. The model knows each piece but fails to combine them, such as the birthplace of the director of a particular film.
- Exact strings. It knows what a document is about but cannot reproduce exact wording, page numbers, or identifiers.
- Conflicting sources. If training text disagrees, the model may reflect the more common claim, not the correct one.
- Common misconceptions. A widely repeated falsehood can be better represented than the less repeated truth.
Distinguishing a gap from other failures
A gap is one cause of hallucination. To diagnose, ask what the model would need to answer correctly:
| Symptom | Likely cause | Fix direction |
|---|---|---|
| Wrong on an obscure person, paper, or product | Rare fact in the long tail | Verify with a primary source |
| Outdated "latest" or "current" claim | Training cutoff | Use search or supply current text |
| Invents details of your internal system | Data never seen | Provide the documents |
| Right in one phrasing, wrong in another | Partial or directional learning | Rephrase and compare |
| Contradicts a document you pasted | Context failure, not a gap | Covered in a later chapter |
If the answer is in the prompt and the model still gets it wrong, the problem is not a knowledge gap. Check this before blaming the training data.
Predicting where gaps will bite
You cannot see inside the model, but you can estimate risk from the question:
- How famous is the subject? Widely discussed topics are safer than obscure ones.
- How specific is the detail? A general description of a topic is safer than a date, number, or name tied to it.
- How recent is it? Close to or after the cutoff means higher risk.
- Is it public? Private or internal subjects are almost always gaps.
- Does the answer need an exact string? Quotations, identifiers, and URLs are fragile.
A practical probe
You can test whether a model has a stable memory of something by asking about it in several ways and comparing the answers. If the model gives the same specific answer across rephrasings, the fact is probably well learned, though not guaranteed correct. If the specifics shift, such as a different year or a different co-author each time, you are likely looking at a gap. A later chapter develops this as a formal consistency check. For now, treat shifting details as a reason to look the fact up.
What a gap does not mean
Gaps are not a flaw that more careful prompting removes. You can ask the model to say when it does not know, and a later chapter covers how well that works. You cannot make it know something it never learned. The reliable remedies are to give it the information (grounding) or to check the output against an authoritative source.
Scale helps, but unevenly. Larger models learn more of the tail, yet the tail is effectively unbounded, so some gaps always remain.
Summary
Models store knowledge as statistical tendencies, and learning is strongest for frequent facts. Rare, recent, private, and oddly phrased facts are poorly covered. When coverage is poor, the next-token process still produces fluent text, so the gap appears as a confident error instead of a visible blank. Risk rises with obscurity, specificity, recency, and privacy.
Exercise
You ask an assistant for the exact publication year and second author of a 2013 paper from a small regional conference. It answers instantly with both. Name two reasons this is high risk for a knowledge gap, and one quick check you could run.
Show answer
First, the paper is obscure, so it likely appeared in training text only a few times or never, which puts it in the long tail. Second, the question asks for exact, specific details (a year and a name) that are easy to blend with similar papers. A quick check is to look the paper up in a primary source such as the conference proceedings or a scholarly index, or to rephrase the question several times and see whether the year and author stay the same.
Exercise
A model correctly says a well-known library function takes three arguments, but invents an argument for a function in a tiny, rarely used package. Explain this difference using the idea of frequency in training data, and say what you would supply to avoid the problem.
Show answer
The well-known function appeared in many consistent examples, so the model learned its signature as a strong pattern. The tiny package appeared rarely, so the model had little to go on and produced a plausible-looking continuation based on similar functions. To avoid the problem, paste the package's documentation or source into the prompt so the answer comes from the supplied text and not from memory.