The context windowLa fenêtre contextuelle
TRA6008 To read for S3À lire pour la S3
What is in the context window?
When you paste a ten-page text into your prompt and ask for a summary, the text is not stored anywhere separately. It is added to the context window, together with everything else the model receives (Figure 2figure 2): the system prompt system promptrequête générative système promptingrequêtes An instruction supplied to a language model before or alongside the user's input that establishes the model's role, task, behavioural rules, tone, or other context for the interaction.Instruction fournie à un modèle de langue avant l'entrée de l'utilisateur, ou en parallèle, qui établit le rôle du modèle, sa tâche, ses règles de conduite, son ton ou d'autres éléments de contexte pour l'interaction. , any saved instructions and memory, the conversation so far, your prompt promptrequête promptingrequêtes Input given to a generative AI system to specify a task, provide context, or otherwise guide its output.Entrée fournie à un système d'IA générative pour préciser une tâche, donner du contexte ou orienter la sortie. , and the answer as it is being written. The model has no memory outside that space.
A file you attach does not always go into the context window whole. Depending on the product and on the size of the file, a service may add all of its text, or search the file and add only the passages that seem relevant to your question, in which case the model never sees the rest. Anthropic, for example, switches to searching the documents in a project once they approach the size of the context window.Claude Help Center, RAG for Projects, read 14 September 2026.
A separate token limit for the answer
Not all of the advertised context window is available for your text. Providers publish a separate, much smaller maximum for the answer. At the time of writing, Anthropic’s Claude Fable 5.1 has a context window of 1,000,000 tokens and OpenAI’s GPT-6 Astra one of 1,050,000, and both can write at most 128,000 tokens in a single answer (Figure 3figure 3).Read 14 September 2026 on the providers’ model pages: Anthropic, OpenAI.
This limit can explain why a very long answer gets cut off. Sometimes the cut is abrupt, and the answer simply stops, even in the middle of a sentence. Sometimes it is less visible: when you ask for the translation of a long document, the model may stop at a natural break and end with something like “This is the translation of the first five pages. Do you want me to continue with the next pages?”, possibly as a way of staying within the limit.
Long inputs and long conversations
Context windows have grown enormously, as shown in Figure 4figure 4.
A large window is not used evenly
A model does not use everything in a large context window equally well. On tasks where the answer cannot be found by matching words from the question, models do clearly worse on long inputs than on short ones, even well within the size they advertise (Modarressi et al., 2025). It also matters where in the context window a relevant passage appears: material at the beginning and at the end of a long input tends to be used more reliably than material in the middle, although the pattern differs from one model to another (Liu et al., 2024).
Long conversations drift
The same happens over the course of a conversation. Instructions given at the start are followed less and less as the conversation goes on (Li et al., 2024). The authors trace it to attention attention mechanismmécanisme d'attention deep learningapprentissage profond A "method in neural networks that helps a model focus on the most relevant parts of the input when producing an output. For example, when translating a sentence, it 'pays attention' to the words that matter most for the next translated word, which improves accuracy and handling of long sequences." (Stanford HAI).Méthode utilisée dans les réseaux de neurones pour aider un modèle à se concentrer sur les parties les plus pertinentes de l'entrée au moment de produire une sortie. Par exemple, lors de la traduction d'une phrase, le modèle « prête attention » aux mots qui comptent le plus pour le prochain mot traduit, ce qui améliore la précision et le traitement des longues séquences (d'après Stanford HAI, traduction libre). : the longer the conversation, the less weight the model gives to the text at its start (see also the Attention page, in the Language as numbers module) (voir aussi la page L'attention, dans le module Le langage en nombres).The studies cited in this section tested models from 2024 and 2025. Models have changed since, and a great deal of research goes into making them use long contexts better, but as of 14 September 2026 there is no evidence that the problem has been solved.
When the window is full
A conversation that keeps going eventually fills the context window, and something then has to give. Depending on the service:
- the oldest turns are dropped;
- the earlier turns are replaced by a summary;
- the service refuses to continue.
Anthropic, for example, summarizes the earlier messages of a conversation in Claude when it approaches the limit, so that the conversation can go on.Claude Help Center, How do usage and length limits work?, read 14 September 2026. The page adds that the full history stays available for Claude to look things up in.
A summary is shorter than what it replaces, so some details can be lost, and you are usually not told which. What you may notice is a model that seems to have forgotten a decision you made earlier in the conversation.
What this means for your work
An advertised context window is a limit, not a promise. For the best results, try not to clutter the context window (see also the Correcting the model or starting over page, in the Using LLMs module) (voir aussi la page Corriger le modèle ou recommencer, dans le module Utiliser les GML).
Que contient la fenêtre contextuelle ?
Quand vous collez un texte de dix pages dans votre requête et demandez un résumé, ce texte n’est stocké nulle part à part. Il est ajouté à la fenêtre contextuelle, avec tout ce que le modèle reçoit par ailleurs (Figure 2figure 2) : la requête générative système system promptrequête générative système promptingrequêtes An instruction supplied to a language model before or alongside the user's input that establishes the model's role, task, behavioural rules, tone, or other context for the interaction.Instruction fournie à un modèle de langue avant l'entrée de l'utilisateur, ou en parallèle, qui établit le rôle du modèle, sa tâche, ses règles de conduite, son ton ou d'autres éléments de contexte pour l'interaction. , les éventuelles instructions enregistrées et la mémoire, la conversation jusqu’ici, votre requête promptrequête promptingrequêtes Input given to a generative AI system to specify a task, provide context, or otherwise guide its output.Entrée fournie à un système d'IA générative pour préciser une tâche, donner du contexte ou orienter la sortie. et la réponse en cours de rédaction. Le modèle n’a aucune mémoire en dehors de cet espace.
Un fichier joint n’entre pas toujours tel quel dans la fenêtre contextuelle. Selon le produit et la taille du fichier, un service peut en ajouter tout le texte, ou y faire une recherche et n’ajouter que les passages qui semblent pertinents pour votre question, auquel cas le modèle ne voit jamais le reste. Anthropic, par exemple, passe à une recherche dans les documents d’un projet dès que ceux-ci approchent de la taille de la fenêtre contextuelle.Claude Help Center, RAG for Projects, consulté le 14 septembre 2026.
Une limite de jetons distincte pour la réponse
Toute la fenêtre contextuelle annoncée n’est pas disponible pour votre texte. Les fournisseurs publient un maximum distinct, et beaucoup plus petit, pour la réponse. Au moment d’écrire ces lignes, Claude Fable 5.1, d’Anthropic, a une fenêtre contextuelle de 1 000 000 de jetons et GPT-6 Astra, d’OpenAI, une fenêtre de 1 050 000 jetons, et tous deux peuvent écrire au plus 128 000 jetons dans une même réponse (Figure 3figure 3).Consulté le 14 septembre 2026 sur les pages des modèles des fournisseurs : Anthropic, OpenAI.
Cette limite peut expliquer pourquoi une très longue réponse est coupée. Parfois la coupure est brutale et la réponse s’arrête net, parfois même au milieu d’une phrase. Parfois elle est moins visible : quand vous demandez la traduction d’un long document, le modèle peut s’arrêter à un endroit naturel et terminer par quelque chose comme « Voici la traduction des cinq premières pages. Voulez-vous que je continue avec les pages suivantes ? », peut-être pour rester dans la limite.
Longues entrées et longues conversations
Les fenêtres contextuelles se sont considérablement agrandies, comme le montre la Figure 4figure 4.
Une grande fenêtre n’est pas utilisée uniformément
Un modèle n’utilise pas aussi bien tout ce que contient une grande fenêtre contextuelle. Sur des tâches où la réponse ne peut pas être trouvée en repérant des mots de la question, les modèles obtiennent des résultats nettement moins bons sur de longues entrées que sur de courtes, même bien en deçà de la taille qu’ils annoncent (Modarressi et al., 2025). La position d’un passage pertinent dans la fenêtre compte aussi : ce qui se trouve au début et à la fin d’une longue entrée tend à être utilisé de façon plus fiable que ce qui se trouve au milieu, même si ce schéma varie d’un modèle à l’autre (Liu et al., 2024).
Les longues conversations dérivent
Il en va de même au fil d’une conversation. Les consignes données au début sont de moins en moins suivies à mesure que la conversation avance (Li et al., 2024). Les auteurs l’attribuent au mécanisme d’attention attention mechanismmécanisme d'attention deep learningapprentissage profond A "method in neural networks that helps a model focus on the most relevant parts of the input when producing an output. For example, when translating a sentence, it 'pays attention' to the words that matter most for the next translated word, which improves accuracy and handling of long sequences." (Stanford HAI).Méthode utilisée dans les réseaux de neurones pour aider un modèle à se concentrer sur les parties les plus pertinentes de l'entrée au moment de produire une sortie. Par exemple, lors de la traduction d'une phrase, le modèle « prête attention » aux mots qui comptent le plus pour le prochain mot traduit, ce qui améliore la précision et le traitement des longues séquences (d'après Stanford HAI, traduction libre). : plus la conversation est longue, moins le modèle accorde de poids au texte du début (see also the Attention page, in the Language as numbers module) (voir aussi la page L'attention, dans le module Le langage en nombres).Les études citées dans cette section ont testé des modèles de 2024 et de 2025. Les modèles ont changé depuis, et beaucoup de recherches visent à leur faire mieux utiliser les longs contextes, mais au 14 septembre 2026, rien n’indique que le problème soit résolu.
Quand la fenêtre est pleine
Une conversation qui se prolonge finit par remplir la fenêtre contextuelle, et il faut alors sacrifier quelque chose. Selon le service :
- les échanges les plus anciens sont supprimés ;
- les échanges antérieurs sont remplacés par un résumé ;
- le service refuse de continuer.
Anthropic, par exemple, résume les messages antérieurs d’une conversation dans Claude quand celle-ci approche de la limite, pour que la conversation puisse se poursuivre.Claude Help Center, How do usage and length limits work?, consulté le 14 septembre 2026. La page précise que l’historique complet reste accessible à Claude, qui peut y rechercher des informations.
Un résumé est plus court que ce qu’il remplace, si bien que certains détails peuvent se perdre, et on ne vous dit généralement pas lesquels. Vous remarquerez peut-être que le modèle semble avoir oublié une décision prise plus tôt dans la conversation.
Ce que cela signifie pour votre travail
La taille annoncée d’une fenêtre contextuelle est une limite, pas une promesse. Pour obtenir les meilleurs résultats, évitez d’encombrer la fenêtre contextuelle (see also the Correcting the model or starting over page, in the Using LLMs module) (voir aussi la page Corriger le modèle ou recommencer, dans le module Utiliser les GML).
Sources
- Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., et al. (2020). Language Models are Few-Shot Learners. Advances in Neural Information Processing Systems 33 (NeurIPS 2020). https://proceedings.neurips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html
- Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). https://doi.org/10.18653/v1/N19-1423
- Grattafiori, A., Dubey, A., Jauhri, A., Pandey, A., Kadian, A., et al. (2024). The Llama 3 Herd of Models. arXiv:2407.21783 (preprint). https://arxiv.org/abs/2407.21783
- Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
- Li, K., Liu, T., Bashkansky, N., Bau, D., Viégas, F., Pfister, H., & Wattenberg, M. (2024). Measuring and Controlling Instruction (In)Stability in Language Model Dialogs. First Conference on Language Modeling (COLM 2024). https://openreview.net/forum?id=60a1SAtH4e
- Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the Middle: How Language Models Use Long Contexts. Transactions of the Association for Computational Linguistics, 12, 157–173. https://doi.org/10.1162/tacl_a_00638
- Modarressi, A., Deilamsalehy, H., Dernoncourt, F., Bui, T., Rossi, R. A., Yoon, S., & Schütze, H. (2025). NoLiMa: Long-Context Evaluation Beyond Literal Matching. Proceedings of the 42nd International Conference on Machine Learning, PMLR 267, 44554–44570. https://proceedings.mlr.press/v267/modarressi25a.html
Sources
- Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., et al. (2020). Language Models are Few-Shot Learners. Advances in Neural Information Processing Systems 33 (NeurIPS 2020). https://proceedings.neurips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html
- Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). https://doi.org/10.18653/v1/N19-1423
- Grattafiori, A., Dubey, A., Jauhri, A., Pandey, A., Kadian, A., et al. (2024). The Llama 3 Herd of Models. arXiv:2407.21783 (preprint). https://arxiv.org/abs/2407.21783
- Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
- Li, K., Liu, T., Bashkansky, N., Bau, D., Viégas, F., Pfister, H., & Wattenberg, M. (2024). Measuring and Controlling Instruction (In)Stability in Language Model Dialogs. First Conference on Language Modeling (COLM 2024). https://openreview.net/forum?id=60a1SAtH4e
- Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the Middle: How Language Models Use Long Contexts. Transactions of the Association for Computational Linguistics, 12, 157–173. https://doi.org/10.1162/tacl_a_00638
- Modarressi, A., Deilamsalehy, H., Dernoncourt, F., Bui, T., Rossi, R. A., Yoon, S., & Schütze, H. (2025). NoLiMa: Long-Context Evaluation Beyond Literal Matching. Proceedings of the 42nd International Conference on Machine Learning, PMLR 267, 44554–44570. https://proceedings.mlr.press/v267/modarressi25a.html