Why an LLM Cannot Reliably Answer Questions About Your Documents
An LLM can generate a convincing answer without having the evidence to support it. Explore the difference between model knowledge and document access, why better prompts cannot solve every information problem, and how to choose between direct prompting, search, RAG, and external tools.
Table of Contents
- Introduction
- 1. What Does an LLM Actually Know?
- 2. Model Knowledge Is Not Document Access
- 3. Why a Better Prompt Is Not Always the Answer
- 4. The Context Window Is Not a Database
- 5. Why Document Questions Are Harder Than They Look
- 6. Four Different Ways to Give a Model Information
- 7. How Do We Know Which Approach to Use?
- 8. Designing a Better Contract Analysis System
- Summary
Introduction
Imagine that you upload a contract to an AI assistant and ask:
Can the customer terminate this agreement without cause, and what financial consequences would follow?
The model immediately produces a clear, confident answer.
It explains the termination conditions, mentions a notice period, and summarizes the potential financial consequences.
There is only one problem.
The contract does not contain the notice period the model described.
Perhaps the model has seen similar agreements during training. Perhaps it has inferred what a typical contract might say. Perhaps it has combined fragments of familiar legal language into a plausible explanation.
Whatever the reason, the answer is unsupported by the document you supplied.
This is one of the most important distinctions in AI application engineering:
A model's ability to generate a plausible answer does not mean it has access to the evidence required to answer a specific question correctly.
In the previous article, we built the conceptual foundation of an AI application using a contract analysis assistant. We saw that a production system needs more than an LLM call: it needs document processing, validation, access control, and evaluation.
Now we will investigate the information problem more closely.
Before introducing Retrieval-Augmented Generation (RAG), we need to understand why models struggle with private, changing, lengthy, or highly specific documents — and why adding more instructions to a prompt is not always enough.
1. What Does an LLM Actually Know?
A large language model learns statistical patterns from training data. During inference, it uses those learned patterns and the information in its current context to generate a response.
A simplified view looks like this:
flowchart TD
TRAIN[Training Data] --> MODEL[Trained Model]
MODEL --> PARAMS[Learned Parameters]
PROMPT[System Instructions and User Input] --> CONTEXT[Current Context]
PARAMS --> INFERENCE[Inference]
CONTEXT --> INFERENCE
INFERENCE --> OUTPUT[Generated Response]The model's learned parameters encode information and patterns acquired during training. The current context provides the specific information available during a particular request.
These are different sources of information.
Suppose we ask:
What is a typical termination clause in a commercial contract?
A model may be able to explain common termination provisions based on patterns it learned during training.
Now suppose we ask:
Under Section 12.4 of the contract I signed yesterday, can the customer terminate without cause?
The second question requires access to a particular document and its exact wording.
General knowledge about contracts is not a substitute for that evidence.
Even if the model has encountered similar clauses, it cannot reliably infer the contents of this particular agreement from general patterns.
This distinction becomes more important when documents contain:
- Negotiated exceptions to standard terms.
- Amendments that override earlier provisions.
- Confidential information that was never part of training data.
- Recent revisions that postdate the model's training.
- Company-specific policies and procedures.
A model may know how contracts generally work while having no knowledge of the contract currently being analyzed.
Knowledge is not the same as access
It is useful to distinguish three concepts:
| Concept | Meaning |
|---|---|
| Model knowledge | Information and patterns encoded through training |
| Request context | Instructions and content supplied to the model for the current inference |
| External information access | Data that an application retrieves from files, databases, APIs, or other systems |
A model can use all the information available in its context, but it cannot automatically inspect a private database or read a file stored on your server.
Those capabilities must be provided by the surrounding application, whether by including the relevant content in the request or by enabling an explicit retrieval or tool-use mechanism.
This leads to our first design principle:
If an answer depends on a specific source, the system must provide access to that source and preserve enough evidence to verify the answer.
2. Model Knowledge Is Not Document Access
Let's return to our contract analysis system.
Suppose a company stores 10,000 contracts in private storage. Each contract may contain payment terms, liability provisions, termination conditions, and amendments.
A user asks:
Which active contracts allow termination without cause with less than 30 days' notice?
A basic LLM API call does not automatically know:
- Which contracts exist.
- Which contracts the user is authorized to access.
- Which versions are active.
- Where the termination clauses are located.
- Whether an amendment changes the original clause.
- Which contracts meet the requested condition.
The application must obtain that information from the relevant data sources.
Consider the following architecture:
flowchart TD
USER[User Question] --> API[Application API]
API --> AUTH[Authorization Check]
AUTH --> DATA[Contract Storage]
DATA --> PREP[Document Processing]
PREP --> CONTEXT[Relevant Document Content]
CONTEXT --> LLM[Language Model]
USER --> LLM
LLM --> VALIDATE[Validate Findings]
VALIDATE --> RESPONSE[Answer with Evidence]The diagram describes a simple approach in which the application obtains document content and supplies it to the model.
For a small number of short contracts, this may be sufficient.
For 10,000 contracts, however, loading every document for every question would be inefficient. It would increase processing costs, create unnecessary latency, and make it harder to select the right evidence.
The application needs a way to find the relevant contracts and clauses before asking the model to analyze them.
That is an information retrieval problem.
And it is important to recognize that information retrieval is not the same task as text generation.
A model can explain the meaning of a clause extremely well once the relevant text is available. But if the application never provides the clause, the model may have nothing reliable to analyze.
The authorization problem
There is another important concern.
Imagine that two customers use the same contract analysis platform. Customer A uploads a confidential agreement, and Customer B asks a question about it.
Even a perfect retrieval algorithm would be unacceptable if it returned Customer A's document to Customer B.
The system must enforce authorization before providing documents or retrieved passages to the model.
This is not something we should leave to prompt instructions such as:
Only answer using documents the user is allowed to access.
The model should not be responsible for deciding whether a user has permission to read a document. The application must enforce that policy through its trusted authorization layer.
In other words, retrieval quality and access control are separate requirements. A system must satisfy both.
3. Why a Better Prompt Is Not Always the Answer
When an AI application produces a poor answer, a common first response is to improve the prompt.
We might add instructions such as:
- Be precise.
- Never hallucinate.
- Read the entire document carefully.
- Use only the provided evidence.
- Do not make assumptions.
- Admit when you do not know the answer.
These instructions can help establish desired behavior. They are often worth trying.
However, they cannot compensate for information that was never provided.
Consider this prompt:
You are an expert contract analyst.
Answer the user's question using the contract.
Never hallucinate.
If the contract does not contain the answer, say so.
Question:
Can the customer terminate without cause?The prompt contains no contract.
No wording can make the model reliably identify the termination conditions in a private agreement it cannot access.
We can improve the prompt, but the underlying information problem remains unsolved.
What if we provide the contract?
Now consider a second prompt:
You are an expert contract analyst.
Use only the contract below.
Cite the relevant section for every finding.
If the evidence is insufficient, say so.
Contract:
[Full contract text]
Question:
Can the customer terminate without cause?This is much better because the model has access to the source material.
Yet the system can still fail.
The relevant provision may be buried in a long document. An amendment may conflict with the original text. The model may overlook an exception or incorrectly combine two clauses.
Prompting can influence how a model processes the available information. It does not guarantee that every relevant passage will be identified or interpreted correctly.
We should therefore distinguish two categories of failure:
| Failure | Appropriate direction to investigate |
|---|---|
| The source information is missing | Improve data access or retrieval |
| The relevant passage is present but overlooked | Investigate context construction and model behavior |
| The passage is retrieved but misunderstood | Improve generation, context structure, or validation |
| The answer is correct but its citation is wrong | Improve evidence tracking and citation validation |
| The answer violates access policy | Fix application authorization and security controls |
These categories can overlap, but they should not be treated as the same problem.
If retrieval never provides the correct clause, rewriting the generation prompt may have little effect. If the correct clause is already present, improving retrieval may not solve an interpretation problem.
The first step in debugging an AI system is to identify where the failure occurs.
4. The Context Window Is Not a Database
Modern language models can support large context windows, which makes it possible to include substantial amounts of text in a single request.
This capability is useful. It also creates a common misconception:
If the entire document fits into the context window, we do not need retrieval.
Sometimes that is true.
For a short contract, including the full text can be simpler and more reliable than building a retrieval pipeline. It avoids indexing complexity and lets the model inspect the entire supplied document.
But context capacity is not the same as reliable information access.
4.1 Context has practical limits
The usable context must accommodate more than the source document.
A request may include:
- System instructions.
- User questions.
- Conversation history.
- Document text.
- Retrieved evidence.
- Tool results.
- The expected response.
The total must fit within the model's applicable input and output limits.
Even when a document technically fits, sending large amounts of irrelevant text can increase latency and cost without improving answer quality.
The correct question is not simply whether a document fits.
It is whether supplying the entire document is effective for the task.
4.2 More context does not guarantee better answers
Suppose a contract contains 200 pages, but the user's question concerns a single termination provision.
Providing all 200 pages might work, depending on the model and the document. However, it also requires the model to identify the relevant sections among a large amount of information.
Relevant information can be overlooked, especially when important conditions are separated across the document or surrounded by unrelated material.
This does not mean that models always fail on long contexts. Performance depends on the model, task, document structure, and position of relevant information.
The important point is that context capacity alone does not establish retrieval quality or answer correctness.
4.3 Context is temporary; a document collection is persistent
A context window represents information supplied for an inference request. It is not, by itself, a persistent, searchable document repository.
If the user asks about another contract tomorrow, the application still needs a way to locate that contract and prepare the relevant information.
A real document system must address storage, indexing, access permissions, updates, versioning, and retrieval.
The model context is where selected information is presented to the model. It is not a replacement for the infrastructure that manages that information.
A practical comparison
flowchart TD
Q[User Question] --> DECIDE{How much information is needed?}
DECIDE -->|Small, known document| FULL[Load Full Document]
DECIDE -->|Large or numerous documents| RETRIEVE[Search for Relevant Evidence]
FULL --> CONTEXT[Construct Model Context]
RETRIEVE --> CONTEXT
CONTEXT --> LLM[LLM]
LLM --> CHECK[Validate Answer and Evidence]
CHECK --> RESPONSE[Return Result]This is a simplified decision model, not a universal rule. Some systems use a hybrid approach: retrieve likely relevant passages, then load surrounding sections or additional documents before generating an answer.
The architecture should reflect the information requirements of the task rather than assume that one approach is always best.
5. Why Document Questions Are Harder Than They Look
Finding a paragraph that resembles a question is not the same as finding enough evidence to answer it correctly.
Contract analysis makes this distinction especially clear.
5.1 Exact wording matters
Consider these two provisions:
Either party may terminate this agreement upon 30 days' written notice.
And:
Either party may terminate this agreement upon 30 days' written notice following an uncured material breach.
The wording is similar, but the termination conditions differ substantially.
A system that retrieves the second clause but ignores the breach condition may produce an incorrect conclusion.
Semantic similarity can help locate relevant text, but similarity is not proof that two passages have the same legal meaning.
5.2 Evidence can be distributed across sections
Suppose the contract contains the following provisions:
- Section 4.2 defines the delivery deadline.
- Section 8.1 specifies late-delivery penalties.
- Section 8.4 limits penalties under certain circumstances.
- Appendix B defines an exception for force majeure events.
A question about the financial consequences of delayed delivery may require evidence from all four locations.
Retrieving the single most similar paragraph is not necessarily sufficient.
The system must identify enough evidence to answer the question, including relevant exceptions and dependencies.
5.3 Amendments can change the meaning of the original document
A contract may be modified by an amendment signed several months after the original agreement.
If the application retrieves only the original termination clause, it may return an answer that was once correct but is no longer applicable.
This is not simply a language problem. It requires document metadata, version relationships, and rules for determining which provisions are currently effective.
The application must understand which sources should be considered authoritative before the model reasons over them.
5.4 Absence of evidence is not always evidence of absence
Suppose the system searches a contract and fails to find a clause about automatic renewal.
Can it conclude that the contract has no automatic renewal provision?
Not necessarily.
The relevant clause may be phrased differently, hidden in an appendix, omitted during extraction, or located in a separate document.
A search that returns no result establishes only that the search did not find the information under its current configuration.
It does not automatically establish that the information does not exist.
This distinction should influence how the system responds.
Instead of confidently claiming that a provision is absent, the application may need to state that it could not find sufficient evidence, particularly when document completeness has not been established.
5.5 Retrieved evidence can still be interpreted incorrectly
Even when the correct passages are available, the model can misunderstand them.
For example, a clause may impose liability only when a particular condition is met. The model might identify the liability language but omit the condition in its summary.
That failure happens after retrieval.
A robust system must therefore evaluate both whether the correct evidence was found and whether the final answer faithfully reflects it.
These challenges explain why document-grounded AI requires more than a prompt that asks the model to be careful.
It requires an information pipeline and a way to evaluate the result.
6. Four Different Ways to Give a Model Information
We now have a better understanding of the underlying problem. The next question is how to provide information to a model.
There are several approaches, each with different trade-offs.
6.1 Put the information directly in the prompt
The simplest approach is to include the source text in the request.
Instructions
+
User Question
+
Contract Text
|
v
LLM
|
v
AnswerThis works well when the source is short, already available, and relevant to the question.
It has low architectural complexity and is often the right baseline for an initial implementation.
Its limitations appear when documents become large, the collection grows, or only a small part of the source is relevant.
6.2 Use conventional search
The application can search a database or document index using keywords, exact phrases, filters, and metadata.
For example, a user asks about termination without cause. A full-text search system locates clauses containing relevant terms and returns their source locations.
This can be highly effective when the vocabulary is predictable, the documents are well structured, and exact terminology matters.
However, the wording of the query and the document may differ. A clause describing the right to end an agreement may never use the word "terminate."
Keyword search alone can miss semantically relevant passages.
6.3 Use vector search and RAG
Vector search represents text as embeddings and retrieves passages based on semantic similarity.
This can help locate relevant information even when the query and the source use different wording.
A basic RAG pipeline looks like this:
flowchart TD
DOC[Contract Documents] --> CHUNK[Split into Chunks]
CHUNK --> EMBED[Generate Embeddings]
EMBED --> INDEX[Vector Index]
Q[User Question] --> QEMBED[Embed Question]
QEMBED --> SEARCH[Retrieve Similar Chunks]
INDEX --> SEARCH
SEARCH --> CONTEXT[Build Context]
CONTEXT --> LLM[Generate Answer]
LLM --> RESPONSE[Answer with Evidence]RAG combines retrieval with generation: the application retrieves relevant external information and supplies it to the model when generating an answer.
However, vector search is not automatically the best retrieval method for every document question. Exact identifiers, clause numbers, dates, and legal terms may benefit from keyword search or structured filters.
For that reason, production systems often evaluate hybrid approaches that combine lexical and semantic retrieval.
RAG also introduces its own failure modes. The correct clause may not be retrieved, the selected passages may lack important context, or the model may misinterpret the evidence it receives.
Retrieval makes information access more manageable. It does not eliminate the need for evaluation.
6.4 Use tools to access external systems
Sometimes the information is not stored in a static collection of documents.
It may live in a contract management system, a database, or an internal API.
The application can expose a tool that retrieves authorized contract metadata or fetches a specific document.
For example, a tool might support a request like:
interface ContractLookup {
getContract(input: {
contractId: string;
}): Promise<{
id: string;
version: string;
status: "active" | "expired" | "draft";
text: string;
} | null>;
}This interface is illustrative. A real implementation must enforce authorization and tenant isolation before returning the document.
Tool access can make information available on demand, but it does not necessarily require an AI agent. A conventional workflow can call a known tool in a fixed sequence.
An agent becomes relevant when the model must dynamically decide which tools to use, in what order, or whether further actions are necessary.
This distinction will matter later in the series.
Comparing the approaches
| Approach | Best suited for | Main trade-off |
|---|---|---|
| Direct prompt context | Short, known source material | Simplicity versus context size |
| Conventional search | Exact terms, identifiers, structured collections | Precision versus vocabulary mismatch |
| Vector search and RAG | Large collections and semantically phrased queries | Flexible retrieval versus indexing and ranking complexity |
| External tools | Live or structured information in other systems | Flexible access versus integration and permission management |
These methods can be combined. A contract analyzer might filter documents by tenant and status, use hybrid search to find clauses, fetch the surrounding sections, and then pass selected evidence to an LLM.
The design should be driven by the information the task actually requires.
7. How Do We Know Which Approach to Use?
We should not select RAG simply because the application is described as an AI knowledge assistant.
Nor should we assume that direct prompting will always be sufficient because the chosen model has a large context window.
The correct approach depends on measurable requirements.
Consider four questions.
How large is the information source?
If the application processes one short document at a time, passing the full text may be sufficient. If it must search thousands of documents, retrieving relevant passages becomes much more important.
How precisely must the answer reference the source?
A general summary may tolerate approximate source selection. A contract risk report needs traceable evidence, accurate section references, and careful handling of exceptions.
How frequently does the source change?
If documents are updated frequently, the application needs a reliable way to ensure that answers use the correct version. Updating a retrieval index and preserving document versions become important operational concerns.
What does failure cost?
A casual knowledge assistant and a system used to review contractual obligations have different risk profiles. The latter requires stronger evaluation, access control, auditability, and human review.
We can turn these questions into a practical decision process:
flowchart TD
START[Define the Information Requirement] --> SMALL{Small, Known Source?}
SMALL -->|Yes| FULL[Try Full-Context Prompting]
SMALL -->|No| SEARCH[Evaluate Search and Retrieval]
FULL --> TEST[Build Representative Evaluation Cases]
SEARCH --> TEST
TEST --> PASS{Meets Quality, Cost, and Latency Targets?}
PASS -->|Yes| DEPLOY[Use the Simplest Suitable Design]
PASS -->|No| DEBUG[Identify the Failure Stage]
DEBUG --> MISSING{Information Missing or Irrelevant?}
MISSING -->|Yes| RETRIEVAL[Improve Retrieval or Data Access]
MISSING -->|No| GENERATION[Investigate Context, Model, and Validation]
RETRIEVAL --> TEST
GENERATION --> TESTThe decision process deliberately includes evaluation before and after architectural changes.
A more complex system should justify its additional cost through better outcomes, stronger reliability, or capabilities the simpler system cannot provide.
8. Designing a Better Contract Analysis System
Let's translate these ideas into an implementation strategy for our running example.
We should not immediately build a large multi-agent architecture. Instead, we can develop the system incrementally.
Step 1: Define the source of truth
Every answer should be grounded in identifiable contract content.
We need to know:
- Which contract was analyzed.
- Which version was used.
- Where each relevant passage came from.
- Whether the document was processed successfully.
- Whether the user was authorized to access it.
This metadata is part of the system's correctness, not merely administrative information.
Step 2: Establish a direct-context baseline
Start with a small collection of representative contracts.
For each question, supply the complete extracted text when it fits comfortably within the model's context budget. Ask the model to identify relevant clauses and return structured findings.
This gives us a baseline against which retrieval-based approaches can be compared.
Step 3: Create a golden dataset
Record representative questions, expected evidence, and evaluation criteria.
Include cases involving:
- Exact clause references.
- Different wording for similar concepts.
- Multiple clauses that must be considered together.
- Exceptions and amendments.
- Questions whose answers are absent from the source.
- Documents with incomplete or failed extraction.
The dataset should include ordinary cases and difficult edge cases.
Otherwise, we risk optimizing for examples that are too easy to represent actual usage.
Step 4: Identify the dominant failure
Suppose the baseline misses termination provisions in long contracts.
Before changing the architecture, inspect the execution path.
Did text extraction omit the relevant page? Was the full document truncated? Did the model receive the clause but overlook it? Was the question ambiguous?
Different causes require different fixes.
If the document was truncated, retrieval may help. If extraction failed, improving document processing is more appropriate. If the clause was present but misunderstood, the generation and evaluation strategy needs attention.
Step 5: Introduce retrieval only where justified
For larger collections, we can build an indexing pipeline that preserves document identifiers, versions, section headings, and source locations.
At query time, the system can retrieve candidate passages, apply relevant metadata filters, optionally rerank the candidates, and assemble a context for the model.
The system should preserve source references throughout the pipeline so that generated findings can be traced back to the original document.
Step 6: Evaluate the entire pipeline
We should measure whether retrieval returns the expected evidence, whether the model answers correctly, whether citations are accurate, and whether the system handles insufficient evidence appropriately.
We should also measure latency, cost, and operational failure rates.
The result should be a clear comparison between the baseline and the improved architecture, using the same representative evaluation cases.
The goal is not to prove that RAG is superior to prompting in general.
The goal is to establish whether retrieval improves this particular application enough to justify its complexity.
Summary
A language model can be highly capable at understanding and generating text while still lacking access to the specific information required by a task.
That is not a contradiction. It is a distinction between model capability and application design.
We have seen that:
- General model knowledge cannot substitute for a private source document.
- Prompt instructions cannot recover information that was never provided.
- A large context window does not guarantee that relevant evidence will be found or interpreted correctly.
- Document questions often require evidence from multiple sections, versions, or external systems.
- Direct prompting, conventional search, RAG, and tools solve different information-access problems.
- Evaluation helps identify which component needs improvement and whether the added complexity is justified.
This leads to a principle that will guide the rest of the series:
Do not choose an AI architecture because it sounds advanced. Choose it because it addresses a demonstrated failure or satisfies a concrete requirement.
We now understand why an LLM alone may not be enough. The next step is to investigate the architecture that connects a language model to external knowledge.
In the next article, we will compare prompting, RAG, and fine-tuning — three techniques that are often discussed together, despite solving fundamentally different problems.
The question will not be which technique is the most powerful.
It will be which technique is appropriate for the problem we are trying to solve.
- LLM limitations
- RAG architecture
- AI hallucinations
- context windows
- document retrieval
- AI knowledge systems
- Prompt engineering