Teaching an LLM to Flag Questions Past Its Knowledge Horizon
Machine LearningModel answerLast updated
Design a way for a language model to spot questions that need information newer than its training data and to tell the user clearly where its knowledge stops.
You are building a conversational language model. Users sometimes ask about events, releases or facts that appeared after the data the model was trained on. Instead of inventing an answer, the assistant should recognize the situation and say something like: "My training data ends around a certain date, so I may not know about this."
Describe how you would build this behavior end to end.
Assumptions
- You own the whole pipeline: the pretraining corpus (most documents carry a timestamp), the later fine-tuning stages, and the serving stack.
- The model is retrained on a regular schedule, so the knowledge horizon moves with every release.
Points to clarify before designing
- Should the model decline completely, or give what it knew as of its horizon along with a caveat?
- Can the product call retrieval or web search, which might make declining unnecessary?
- Is the current date passed to the model at inference time?
- Which error hurts more here: refusing something it could have answered, or confidently giving stale information?
What to cover
- How the model knows its own horizon, how it knows today's date, and how it decides a question is time-sensitive.
- How you would build training and evaluation data, including cases where the model should simply answer.
- Where the logic should live (system prompt, fine-tuning, a separate classifier, retrieval) and the trade-offs.
- How you would measure both failure directions.
- How the behavior stays correct after the next retraining.
Hints
Hint 1
Split the problem in three: what the model knows about its own horizon, what it knows about the current date, and whether the question depends on facts that could have changed since then.
Hint 2
Most questions are not time-sensitive. Your training mix needs many normal-answer examples, otherwise the model will over-refuse. Think about how document timestamps help you build positive and negative examples.
Hint 3
Evaluate both directions separately (stale or hallucinated answers versus unnecessary refusals), and make the horizon a parameter you can change rather than something baked into the weights.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Framing
Three separate things are involved, and mixing them up is the most common mistake:
- Horizon awareness: the model knows roughly where its data ends.
- Date awareness: the model knows today's date (or knows that it does not).
- Time-sensitivity detection: the model judges whether a given question depends on information that may have changed after the horizon.
The desired behavior is: if the question is time-sensitive and plausibly concerns the period after the horizon, say so, and either answer with a caveat or defer to a tool. Otherwise, answer normally.
I would first settle the product choices from the clarifying questions. My default is to answer with a caveat ("As of my training data, which ends around X, ...") rather than refuse outright, and to prefer retrieval when available. The caveat form is more useful and lowers the cost of false positives.
Horizon and date awareness
- Horizon: models tend to underestimate their own cutoff because the last months before it are thinly represented on the web (commentary and write-ups keep accumulating for years). Estimate the horizon empirically from timestamped documents, for example by looking at where document volume per month falls off, and then state a slightly later date than the apparent drop-off. Teach the model this value through fine-tuning examples and also provide it in the system prompt.
- Current date: the model cannot infer it. Inject it at inference time (system prompt or metadata). Without it, the model should assume that substantial time, often a year or more, has passed since its horizon, because deployed models are used long after release.
Training data construction
Use document timestamps from pretraining to build fine-tuning (SFT) and preference data.
Positive examples (should caveat):
- Questions about "latest", "current", "this year", "who is the current X", "newest version of Y".
- Questions about specific events or products dated after the horizon, generated from a held-out newer corpus or written by annotators.
- Questions whose answers have a short shelf life (prices, rankings, office holders, software versions, sports results).
Negative examples (should answer normally):
- Timeless facts (math, definitions, historical events well before the horizon).
- Questions about the past with stable answers, even if phrased with dates ("What happened in 2015?").
- Coding, writing and reasoning tasks.
Negatives should be the majority, and they should include hard negatives that look time-sensitive but are not ("What is the latest you can arrive?", "Explain the 2008 financial crisis"). Also include contrastive pairs: the same template with a pre-horizon and a post-horizon entity.
Targets are written with the horizon as a variable and the current date, if provided, in the context. The ideal response states the horizon, gives the best pre-horizon information, and suggests how to get fresh information. A preference or RLHF stage can then penalize both confident stale answers and needless disclaimers.
Where the logic lives
| Option | Pros | Cons |
|---|---|---|
| System prompt only | Trivial, horizon is easy to update | Weak on subtle cases, can be overridden, costs tokens |
| Fine-tuning | Natural, low latency, handles nuance | Needs data per release, risk of over-refusal |
| Separate classifier (time-sensitivity) | Cheap, inspectable, tunable threshold | Another component to maintain, can disagree with the model |
| Retrieval or search | Actually answers the question | Latency, cost, source quality, not always allowed |
My design is layered. A lightweight classifier or the model itself flags time-sensitive queries. If search is enabled, route to retrieval and answer from the results. If not, the fine-tuned model produces the caveated answer, with the horizon and current date supplied through the system prompt. Fine-tuning teaches the behavior, while the prompt supplies the values.
Evaluation
Measure both failure directions on separate sets:
- Stale-answer rate: on post-horizon questions, the fraction answered confidently without a caveat or with fabricated facts. This needs a held-out set built from events after the horizon, checked by humans or a grader model.
- Over-refusal rate: on timeless and pre-horizon questions, the fraction that get an unnecessary caveat or refusal. Include the hard negatives.
- Precision and recall of the time-sensitivity decision, with a threshold chosen according to the product's cost asymmetry (for a news or finance assistant, favor recall; for a coding assistant, favor precision).
- Horizon accuracy: whether the stated date is within a few months of the true value.
- Quality side effects: general benchmark regressions, and human ratings of helpfulness for caveated answers.
- Online: user complaints, thumbs-down on disclaimers, and the rate at which retrieval is triggered.
Surviving retraining
- Keep the horizon as data, not a constant in the weights: it goes into the system prompt and the SFT templates are generated from it.
- Regenerate the positive and negative sets for each release using the new horizon. Events that were post-horizon in the old model become pre-horizon, so labels must be recomputed from timestamps.
- Keep a regression suite with dated questions, and run it before every release.
- Monitor drift: as the deployment ages, the share of questions that fall after the horizon grows, so the caveat rate should rise, and that is expected.
Common mistakes
- Giving the model a hard-coded year and no current date, so it assumes it is still that year.
- Training only on positives, producing a model that refuses anything containing "recent" or a year.
- Trusting the model's own sense of its horizon without checking it against data.
- Measuring only refusal rate, which hides hallucination.
- Refusing when retrieval is available and could answer the question.