P

Million Token Context: Definition and Examples

Capacity of a language model to process up to a million tokens in a single request, enabling analysis of very large documents, entire codebases, or long conversations without loss of information.

Full definition

The Million Token Context refers to the ability of an artificial intelligence model to accept and process approximately one million tokens within its context window. With an average token representing 3 to 4 characters in French, this equates to about 750,000 words, or the equivalent of several complete books or a large-scale codebase.

This technical advancement represents a major qualitative leap compared to early language models, whose context windows were limited to a few thousand tokens. With a context of one million tokens, it becomes possible to submit a 500-page legal document, a complete code repository, or an entire conversation spanning several months without having to split or summarize the information beforehand.

The main benefit lies in preserving overall coherence. When a model can 'see' an entire document or project at once, it establishes connections between distant sections, detects subtle inconsistencies, and produces responses that take into account the entirety of the provided context.

However, a larger context does not automatically mean better performance. The quality of the model's attention can vary depending on the position of the information within the window, and the computational cost increases significantly. Good prompt engineering remains essential to guide the model toward the relevant parts of the context.

Etymology

The term combines 'million' (order of magnitude), 'token' (unit of text segmentation used by language models), and 'context' (window of information accessible to the model when processing a request). It emerged in 2024 with the launch of Gemini 1.5 Pro by Google, the first mass-market model to offer this capability, followed by Anthropic's Claude.

Concrete examples

Analysis of a complete codebase

Here is the complete source code of our application (450 files). Identify all potential security flaws, particularly SQL injections and XSS vulnerabilities, and propose fixes for each.

Review of a legal document corpus

I submit to you the 12 contracts signed with our suppliers this year. Compare the liability clauses across all contracts and flag those that present conditions less favorable than average.

Summary of a long conversation history

Here is the complete 6-month history of our product team's discussions. Extract the key decisions made, recurring unresolved topics, and generate a structured summary report by theme.

Practical usage

In prompt engineering, the million token context allows replacing complex strategies of splitting and summarizing with direct submission of the complete document. It is recommended to place key instructions at the beginning and end of the prompt, and to structure large documents with clear tags or headings to facilitate the model's navigation of the context.

Related concepts

Context WindowTokenizationRAG (Retrieval-Augmented Generation)Needle in a Haystack Test

FAQ

How many pages does a million tokens represent?
Approximately 2,500 to 3,000 pages of standard French text. That's equivalent to 4 or 5 complete novels, or a code repository of several hundred files. In practice, it's enough to analyze most professional projects in a single request.
Does the model really retain everything in such a long context?
Modern models have made enormous progress, but studies show that attention quality can vary depending on the position of the information. The phenomenon known as 'lost in the middle' has been largely mitigated in the latest generations of models, but it still remains relevant to structure your context with clear markers for optimal results.
Should I always use the maximum available context?
No. A larger context incurs higher financial and computational costs, as well as longer response times. It is better to include only the truly relevant information for the task. The million token context is a safety net for cases where the volume of information is inherently large, not an invitation to overload every request.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.