AnthropicBenchmark
Prompting Claude's long context window
Summary
An evaluation of Claude’s 100,000-token context window tests prompting techniques for recalling specific information from long documents. Researchers built randomized collages from sections of a July 13 government document, using Claude-generated multiple-choice questions and filtering out questions it could not answer from the source passage alone. They compared a baseline with unrelated examples, dynamically selected contextual examples, and two or five examples, each with or without a scratchpad that instructed Claude Instant 1.2 to extract relevant quotes across roughly 70K and 95K token contexts. Scratchpads and contextual examples generally improved performance, with more examples performing better, although recall could decline when the answer passage was at the end. For Claude 2, the best prompting strategy raised performance from 0.939 to 0.961, a reported 36% reduction in errors; reproducible code was released in the Anthropic Cookbook.
Context
The evaluation addresses how to improve Claude’s recall of specific information from very long documents. The researchers note that Claude Instant needs more prompting assistance than Claude 2, making it easier to measure improvements, and that long-context questions must identify their source passage explicitly.
Approach / What changed
The experiment used randomized collages assembled from sections of a July 13 government document, with Claude-generated multiple-choice questions. It compared baseline, unrelated-example, and contextual-example prompts with two or five examples, with and without a scratchpad for extracting relevant quotes, across roughly 70K and 95K token documents and different answer locations.
Takeaways
A scratchpad that directs Claude to pull relevant quotes improved recall in head-to-head comparisons, with a small latency cost.
Examples drawn from other sections of the same context helped on both 70K and 95K documents, and five examples performed better than two.
Prompt additions could degrade recall when the relevant passage was at the end, because they increased the distance between that passage and the answer step.
Source and freshness
- Source
- anthropic.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.