Prompting Long Context
- Source
- anthropic.com
- Publisher
- Anthropic
- Author
- Anthropic News
- Date

Context
In a September 2023 study, Anthropic found that asking its model to pull out relevant quotes before answering helped it recall facts from very long documents. In its prompting case study, researchers built long inputs of roughly 70,000 to 95,000 by stitching together sections of a government publication, then tested multiple-choice questions about those sections, mainly on Claude Instant 1.2. Extracting quotes into a scratchpad helped in every head-to-head comparison. Adding examples of correctly answered questions drawn from the same document helped, and more examples helped more, while two generic general-knowledge examples did not seem to. Position mattered too: gains were substantial for answers at the beginning and middle of the input, but performance on answers at the very end could be degraded. The findings apply to these 2023 models and this constructed task, not to current models.
- Token — A piece of text, such as a word, part of a word or a punctuation mark, that a language model represents as numbers and handles as a unit.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
- Prompt — Information or instructions supplied to a model; in a chat, the request you type is often called your prompt.
- eval — A repeatable test for AI quality — a set of tasks plus scoring — used the way software teams use test suites, because model output is too variable to judge by eyeballing.






