R — Source Text (Reading)
Vendors adopt diverse inline citation formats: Claude Web uses Markdown anchor links (
[text](<citation:comment:{id}>)), GPT-4o file search uses【msg_idx:search_idx†source】, NotebookLM implements sentence-by-sentence citations plus paragraph indexing[i], Warp uses XML structure<citations><document>, and Meta AI implements entity tags【entity_hint-...】. Core patterns: inline markers, citation preservation rules, source-auditable responses.
I — Methodological Skeleton (Interpretation)
- Inline Marker Format: Source markers are embedded directly in the generated text, so users can locate the cited source without scrolling to the end of the document.
- Format Consistency: Strictly use one citation format throughout the system prompt; do not mix multiple marker syntaxes.
- Citation Preservation Rules: During secondary processing such as rewriting, summarizing, or translation, original citation markers must be preserved intact and must not be lost or altered.
- Source Auditability: Every factual claim must have a traceable citation, and external information (not from the system knowledge base) must be explicitly attributed.
- Entity Citation System: In addition to document citations, support can be extended to the tagging and linking of entities such as people, places, and organizations.
- Date Disambiguation: Resolve relative time expressions ("yesterday," "last week") into absolute dates to eliminate ambiguity.
A1 — Case Analysis (Past Application)
Case: GPT-4o File Search's Mandatory Citation Mechanism
- Problem: After a user uploads multiple documents and asks a question, the model may fabricate content not present in the documents or confuse the sources of content.
- Use of the Design Pattern: GPT-4o requires all document-based answers to include
【msg_idx:search_idx†source】format citations. Citations are not optional decoration but a mandatory component of the output. When no citation is found, it must not claim that the information comes from the documents. - Conclusion: Upgrading citations from a "recommended behavior" to a "mandatory constraint" significantly reduced the hallucination rate in document question answering.
Case: Warp's XML-Structured Citations
- Problem: In terminal command assistance scenarios, users need to know precisely the documentation source of command parameters, but traditional footnote formats have poor readability in the terminal.
- Use of the Design Pattern: Warp uses XML-structured
<citations><document>elements to isolate citations from tool names—citations point to the documentation itself rather than the tool invocation process, avoiding exposure of internal implementation. - Conclusion: The design of a citation system should adapt to the characteristics of the output medium, and citation targets should point to the information source rather than internal system processes.
A2 — Trigger Scenarios (Future Trigger) ★
In what situations do users need this?
- Building a document question answering system where users need to verify the source of each answer
- Designing a retrieval-augmented generation (RAG) system prompt that requires mandatory citation of retrieval results
- Developing code assistance tools requires linking suggestions to specific locations in the codebase
- Implementing a multi-source information integration system requires distinguishing the contributions of different sources
Language signals
- "Information sources need to be labeled"
- "Users should be able to trace the origin of every conclusion"
- "How to prevent the model from fabricating citations"
- "How should the citation format be designed"
- "Original citation markers need to be preserved"
Distinction from adjacent skills
- Difference from injection-defense : injection defense focuses on whether content is trustworthy/executable, while the citation system focuses on where content comes from and how it is labeled
- Difference from mobile-adaptation : mobile adaptation focuses on optimizing the display of citations on small screens, while the citation system focuses on citation format and preservation rules
E — Executable steps (Execution)
- Step 1: Define citation marker syntax - Completion criteria: Choose an inline marker format (bracketed labels such as
【source†Lline】, Markdown anchors, or XML elements), clearly define the meaning of each field (message index, search index, line number range), and write format examples. - Step 2: Write mandatory citation rules - Completion criteria: Declare in the system prompt that "all factual claims based on external sources must include citations," define fallback behavior when there is no citation (clearly state that the source cannot be confirmed), and prohibit fabricating nonexistent citations.
- Step 3: Design a citation preservation strategy - Completion criteria: Specify how original citation markers are preserved in secondary processing scenarios such as rewriting, summarizing, and translation—either retain the original markers directly or remap them to new context positions, ensuring the citation chain is not interrupted.
- Step 4: Implement external information labeling - Completion criteria: Define an explicit labeling method for "external information" (information not in the system knowledge base), such as NotebookLM requiring external information to be labeled "this information is not in the provided sources."
- Step 5: Add citation integrity validation - Completion criteria: Set self-check rules in the system prompt—before output, verify that all citation markers are correctly formatted, all factual claims have citations, and the indexes and line numbers in citations are within valid ranges.
B — Boundary ★
Do not use in the following situations
- Purely creative output (stories, poetry, creative writing), which does not require factual tracing
- Common-sense Q&A, where the information is public knowledge and does not need source labeling
- Lightweight interactions in real-time conversation scenarios where citations would seriously disrupt the communication rhythm
- Internal system logs or debugging information, intended for developers rather than end users
Common failure modes
- Fabricated citations: The model generates citation markers with correct formatting but pointing to nonexistent locations, requiring dual constraints of format validation and source existence
- Citation overload: Adding citations to every sentence leads to fragmented output and reduced readability; citations should be used only for factual claims
- Citation loss: Original citations are removed during summarization or rewriting in multi-turn conversations, requiring explicit preservation rules
- Format mixing: Multiple citation formats appear in the same system (such as footnotes and inline markers coexisting), increasing parsing complexity