Chapter 8 of 10
Context assembly, citations, and abstention
Evidence-to-answer boundary
About 4 minutes · includes examples, an exercise, and references
Chapter at a glance
- •Pack evidence against an answer coverage schema, not a single relevance score.
- •Distinguish primary source units from generated graph summaries in context.
- •Validate citation existence, authorization, and claim-level support.
Retrieval returns candidates; context assembly decides what the generator can actually use. This is a constrained optimization problem over relevance, directness, diversity, token cost, trust, authorization, and answer coverage. A high-recall retriever can still fail if packing removes qualifiers, separates a table cell from its headers, repeats one source, or fills the window with summaries rather than primary evidence.
Define a context item schema. It should include a stable identifier, artifact role, source unit, text or structured claim, document and section metadata, security label, observed and valid time, retrieval channels and scores, graph paths, and provenance. Present untrusted content inside a clear data boundary. Retrieved instructions do not gain authority because they appear near a system prompt.
Pack by evidence need. An answer schema for “owner, status, risk, and next action” can allocate space to each field. Local relationship questions need complete path evidence. Global findings need diverse community coverage plus representative source units. Use maximal marginal relevance or another diversity policy to reduce duplicates, but do not trade away the one passage that directly states the answer for several broadly different summaries.
Preserve local coherence. Include section headings, antecedents, units, and table headers needed to interpret a span. Neighbor expansion should be bounded and measured. Mark generated descriptions and community reports separately from quoted or structured source material. A generator should know which context is a navigation artifact and which is primary support.
Citations require stable targets and entailment rules. Sentence-level answer claims should map to one or more source-unit identifiers. A citation is correct only when the cited material supports the claim at the stated strength. A source that mentions the same entity but not the asserted relation is not support. Multi-hop conclusions should cite each edge and state that the conclusion is derived. Citation rendering can link to document, page, and highlighted span while the internal record retains immutable version identity.
Run support checking after generation. Decompose the answer into atomic claims, retrieve their cited units, and classify supported, contradicted, or not established. A model-based checker can help but must be calibrated on human-labeled examples and cannot serve as the only judge for high-stakes output. Deterministic checks can verify identifier existence, citation authorization, numeric agreement, and that cited spans were actually in context.
Abstention is an answer behavior, not a generic error. Reasons include no authorized evidence, ambiguous entity, conflicting sources, stale index, missing required field, exhausted budget, or unsupported generation. Return the reason and the next safe action: clarify the entity, broaden an approved date range, request access, or route to review. Do not hide retrieval failure behind vague language such as “it appears.”
Contradiction handling should present sources, dates, and authority rather than arbitrarily selecting the latest or most repeated claim. Policies can define precedence for particular fields, but the answer must disclose that a policy selected among conflicting evidence. Unknown and not applicable remain distinct states.
Prompt-injection defenses require architectural enforcement: least-privilege tools, instruction hierarchy, content labeling, output validation, and no execution of text-derived commands. A malicious source can also manipulate citations by supplying fabricated identifiers; all targets must resolve in the authorized index.
Evaluate packing and generation together and separately. Measure evidence recall before and after packing, redundancy, coverage of answer fields, citation precision and completeness, support strength, contradiction handling, abstention precision and recall, context tokens, and latency. Log a reproducible context manifest so any answer can be regenerated under the same model and decoding configuration.
Key points
- Pack evidence against an answer coverage schema, not a single relevance score.
- Distinguish primary source units from generated graph summaries in context.
- Validate citation existence, authorization, and claim-level support.
- Return typed abstention reasons and safe next actions.
An answer with atomic support
Read the expected behavior in the surrounding walkthrough, then copy and run this reference implementation.
{
"answer": "Atlas is paused pending a security review.",
"claims": [
{
"text": "Atlas is paused.",
"support": ["doc-17:v3:chars-880-1240"],
"status": "directly_supported"
},
{
"text": "The security review is the blocking condition.",
"support": ["ticket-91:v2:chars-110-310"],
"status": "directly_supported"
}
],
"indexRelease": "release-18",
"abstention": null
}Worked examples
Toy
Citation mentions but does not support
A passage names Vendor A but does not say Vendor A caused the delay.
The support checker marks the causal claim not established. The answer either removes causality or retrieves direct evidence; it cannot retain the claim with a topical citation.
- Atomic claim
- Entailment strength
- Revision action
System
Conflicting regulatory dates
Two authoritative documents list different effective dates.
The system shows both dates, document versions, and publication times, applies no hidden precedence, and routes the conflict for domain review.
- Conflict visibility
- Temporal metadata
- Abstention reason
Exercise
Build an evidence-packing and support suite
Create contexts and answers for direct, multi-hop, conflicting, and no-evidence questions.
- Define context item and answer schemas.
- Measure evidence loss during packing.
- Check every atomic answer claim.
- Implement at least four typed abstention reasons.
Success criteria
- Primary and generated evidence are visibly distinct.
- Citations support the exact claim strength.
- Unauthorized targets cannot resolve.
- Unsupported or conflicting claims produce a safe, informative outcome.
Reflect: Which fluent sentence would a user trust even though no packed item actually establishes it?
References and further reading
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksThe primary RAG paper combining parametric generation with retrieved non-parametric evidence.
- Not What You Have Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt InjectionThe primary paper demonstrating prompt injection delivered through untrusted content retrieved by LLM applications.
- Microsoft GraphRAG Index OutputsOfficial schemas and descriptions for GraphRAG documents, text units, entities, relationships, communities, and reports.