What context can and cannot doCe que le contexte peut faire, et ce qu'il ne peut pas faire
TRA6008 To read for S3À lire pour la S3
What context can do
Usually, a model can already carry out a task to some extent, and instructions and examples in its context window context windowfenêtre contextuelle language modelsmodèles de langue "The amount of input (like text) that an AI system can process at one time during a task. Think of it as a model's short-term memory. A model can only consider so much text when generating its next response, and once the conversation exceeds its context window, the model starts 'forgetting' prior responses." (Stanford HAI).Quantité d'entrée (du texte, par exemple) qu'un système d'IA peut traiter à la fois pendant une tâche ; en quelque sorte, la mémoire à court terme du modèle. Un modèle ne peut considérer qu'une quantité limitée de texte pour générer sa prochaine réponse et, quand la conversation dépasse sa fenêtre contextuelle, il commence à « oublier » les réponses antérieures (d'après Stanford HAI, traduction libre). improve how well it does so. Where the model has no basis to start from, context helps much less (Figure 4figure 4).
- It shows the model what you want: what an input looks like, which answers are possible and what format an answer takes (see also the Zero-shot and few-shot prompting page) (voir aussi la page Requêtes sans exemple et avec quelques exemples).
- It supplies information the model can use, such as your terminology or the content of a document you attach (see also the context window page) (voir aussi la page La fenêtre contextuelle).
- More examples can help further. On many tasks, performance kept improving with hundreds or thousands of examples, well past the few of few-shot prompting few-shot promptingformulation de requête avec quelques exemples promptingrequêtes A prompting technique in which a small number of demonstrations, typically examples pairing an input with its desired output, are included in the prompt to show a language model how to perform a task.Technique de formulation de requêtes consistant à inclure dans la requête un petit nombre de démonstrations, typiquement des exemples associant une entrée à la sortie souhaitée, pour montrer à un modèle de langue comment accomplir une tâche. (Agarwal et al., 2024; Bertsch et al., 2025). For translation, the results are mixed: Agarwal et al. (2024) report gains for two low-resource languages, but in the tests of Zou et al. (2025), translation hardly improved as examples were added.The models tested in these studies date from 2023 and 2024.
- It does not give good performance where the model has no basis, in a field or a language it knows little about, even with a whole book of material.
What context cannot do
Context also has limits:
- It is not kept. Instructions and examples are gone in the next conversation, unless you or a feature such as memory supply them again (see also the Custom instructions, memory, projects and skills page, in the Using LLMs module) (voir aussi la page Instructions personnalisées, mémoire, projets et compétences, dans le module Utiliser les GML).
- It fades in long conversations. Instructions given at the start are followed less reliably as the conversation goes on (see also the System prompts page) (voir aussi la page Requêtes génératives système).
- It does not always override training. When the context contradicts what a model learned during training, the model does not always go with the context. Goyal et al. (2025) even found that the longer instruction tuning instruction tuningaffinage par instructions language modelsmodèles de langue A form of supervised fine-tuning in which a pretrained language model is trained further on examples pairing instructions or questions with appropriate responses.Forme d'affinage supervisé dans laquelle un modèle de langue préentraîné est entraîné davantage sur des exemples associant des instructions ou des questions à des réponses appropriées. went on, the less the models they tested relied on the context in such cases.Goyal et al. (2025) tested open models from the Llama, Mistral and Pythia families.
- It is not followed the same way every time, partly because the model’s answers are not deterministic deterministicdéterministe computinginformatique Describes a process, algorithm, or system that, under the same initial conditions and with the same input, always produces the same output.Se dit d'un processus, d'un algorithme ou d'un système qui, dans les mêmes conditions initiales et avec la même entrée, produit toujours la même sortie. (see also the LLMs are non-deterministic page) (voir aussi la page Les GML ne sont pas déterministes).
- It has a cost. All of it is sent again with every request, which makes each request slower and, on a service that charges per token, more expensive (see also the Counting in tokens page, in the Language as numbers module) (voir aussi la page Compter en jetons, dans le module Le langage en nombres).
Context is therefore well suited to adapting a model to one document, client or conversation. Behaviour that has to be the same across thousands of requests calls for changing the model itself, or for a check outside the model.
Ce que le contexte peut faire
En général, un modèle sait déjà accomplir une tâche dans une certaine mesure, et les instructions et les exemples présents dans sa fenêtre contextuelle context windowfenêtre contextuelle language modelsmodèles de langue "The amount of input (like text) that an AI system can process at one time during a task. Think of it as a model's short-term memory. A model can only consider so much text when generating its next response, and once the conversation exceeds its context window, the model starts 'forgetting' prior responses." (Stanford HAI).Quantité d'entrée (du texte, par exemple) qu'un système d'IA peut traiter à la fois pendant une tâche ; en quelque sorte, la mémoire à court terme du modèle. Un modèle ne peut considérer qu'une quantité limitée de texte pour générer sa prochaine réponse et, quand la conversation dépasse sa fenêtre contextuelle, il commence à « oublier » les réponses antérieures (d'après Stanford HAI, traduction libre). améliorent la manière dont il s’en acquitte. Quand le modèle n’a aucune base de départ, le contexte aide beaucoup moins (Figure 4figure 4).
- Il montre au modèle ce que vous voulez : à quoi ressemble une entrée, quelles réponses sont possibles et quelle forme prend une réponse (see also the Zero-shot and few-shot prompting page) (voir aussi la page Requêtes sans exemple et avec quelques exemples).
- Il fournit des informations que le modèle peut utiliser, comme votre terminologie ou le contenu d’un document que vous joignez (see also the context window page) (voir aussi la page La fenêtre contextuelle).
- Plus d’exemples peuvent aider davantage. Sur de nombreuses tâches, les résultats ont continué de s’améliorer avec des centaines ou des milliers d’exemples, bien au-delà des quelques exemples de la formulation de requête avec quelques exemples few-shot promptingformulation de requête avec quelques exemples promptingrequêtes A prompting technique in which a small number of demonstrations, typically examples pairing an input with its desired output, are included in the prompt to show a language model how to perform a task.Technique de formulation de requêtes consistant à inclure dans la requête un petit nombre de démonstrations, typiquement des exemples associant une entrée à la sortie souhaitée, pour montrer à un modèle de langue comment accomplir une tâche. (Agarwal et al., 2024 ; Bertsch et al., 2025). Pour la traduction, les résultats sont mitigés : Agarwal et al. (2024) font état de gains pour deux langues peu dotées, mais dans les tests de Zou et al. (2025), la traduction ne s’est guère améliorée à mesure qu’on ajoutait des exemples.Les modèles testés dans ces études datent de 2023 et de 2024.
- Il ne donne pas de bons résultats là où le modèle n’a aucune base, dans un domaine ou une langue qu’il connaît mal, même avec tout un livre de documentation.
Ce que le contexte ne peut pas faire
Le contexte a aussi ses limites :
- Il n’est pas conservé. Les instructions et les exemples disparaissent à la conversation suivante, à moins que vous ou une fonction comme la mémoire ne les fournissiez de nouveau (see also the Custom instructions, memory, projects and skills page, in the Using LLMs module) (voir aussi la page Instructions personnalisées, mémoire, projets et compétences, dans le module Utiliser les GML).
- Il s’estompe dans les longues conversations. Les instructions données au début sont suivies de moins en moins fidèlement à mesure que la conversation avance (see also the System prompts page) (voir aussi la page Requêtes génératives système).
- Il ne l’emporte pas toujours sur l’entraînement. Quand le contexte contredit ce qu’un modèle a appris pendant l’entraînement, le modèle ne suit pas toujours le contexte. Goyal et al. (2025) ont même constaté que plus l’affinage par instructions instruction tuningaffinage par instructions language modelsmodèles de langue A form of supervised fine-tuning in which a pretrained language model is trained further on examples pairing instructions or questions with appropriate responses.Forme d'affinage supervisé dans laquelle un modèle de langue préentraîné est entraîné davantage sur des exemples associant des instructions ou des questions à des réponses appropriées. se prolongeait, moins les modèles testés s’appuyaient sur le contexte dans ces cas.Goyal et al. (2025) ont testé des modèles ouverts des familles Llama, Mistral et Pythia.
- Il n’est pas suivi de la même manière chaque fois, en partie parce que les réponses du modèle ne sont pas déterministes deterministicdéterministe computinginformatique Describes a process, algorithm, or system that, under the same initial conditions and with the same input, always produces the same output.Se dit d'un processus, d'un algorithme ou d'un système qui, dans les mêmes conditions initiales et avec la même entrée, produit toujours la même sortie. (see also the LLMs are non-deterministic page) (voir aussi la page Les GML ne sont pas déterministes).
- Il a un coût. Tout ce contenu est renvoyé à chaque requête, ce qui rend chacune plus lente et, sur un service facturé au jeton, plus coûteuse (see also the Counting in tokens page, in the Language as numbers module) (voir aussi la page Compter en jetons, dans le module Le langage en nombres).
Le contexte convient donc bien pour adapter un modèle à un document, à un client ou à une conversation. Un comportement qui doit être identique sur des milliers de requêtes exige de modifier le modèle lui-même, ou d’ajouter une vérification en dehors du modèle.
Sources
- Agarwal, R., Singh, A., Zhang, L., Bohnet, B., Rosias, L., Chan, S., et al. (2024). Many-Shot In-Context Learning. Advances in Neural Information Processing Systems 37 (NeurIPS 2024). https://proceedings.neurips.cc/paper_files/paper/2024/hash/8cb564df771e9eacbfe9d72bd46a24a9-Abstract-Conference.html
- Aycock, S., Stap, D., Wu, D., Monz, C., & Sima'an, K. (2025). Can LLMs Really Learn to Translate a Low-Resource Language from One Grammar Book?. The Thirteenth International Conference on Learning Representations (ICLR 2025). https://proceedings.iclr.cc/paper_files/paper/2025/hash/20f44da80080d76bbc35bca0027f14e6-Abstract-Conference.html
- Bertsch, A., Ivgi, M., Xiao, E., Alon, U., Berant, J., Gormley, M. R., & Neubig, G. (2025). In-Context Learning with Long-Context Models: An In-Depth Exploration. Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics (NAACL 2025), 12119–12149. https://doi.org/10.18653/v1/2025.naacl-long.605
- Goyal, S., Baek, C., Kolter, J. Z., & Raghunathan, A. (2025). Context-Parametric Inversion: Why Instruction Finetuning May Not Actually Improve Context Reliance. The Thirteenth International Conference on Learning Representations (ICLR 2025). https://arxiv.org/abs/2410.10796
- Tanzer, G., Suzgun, M., Visser, E., Jurafsky, D., & Melas-Kyriazi, L. (2024). A Benchmark for Learning to Translate a New Language from One Grammar Book. Proceedings of the Twelfth International Conference on Learning Representations (ICLR 2024). https://proceedings.iclr.cc/paper_files/paper/2024/hash/52d63f9e4b81f866bf69fb3c834aad47-Abstract-Conference.html
- Zou, K., Khalifa, M., & Wang, L. (2025). On Many-Shot In-Context Learning for Long-Context Evaluation. Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL 2025), 25605–25639. https://doi.org/10.18653/v1/2025.acl-long.1245
Sources
- Agarwal, R., Singh, A., Zhang, L., Bohnet, B., Rosias, L., Chan, S., et al. (2024). Many-Shot In-Context Learning. Advances in Neural Information Processing Systems 37 (NeurIPS 2024). https://proceedings.neurips.cc/paper_files/paper/2024/hash/8cb564df771e9eacbfe9d72bd46a24a9-Abstract-Conference.html
- Aycock, S., Stap, D., Wu, D., Monz, C., & Sima'an, K. (2025). Can LLMs Really Learn to Translate a Low-Resource Language from One Grammar Book?. The Thirteenth International Conference on Learning Representations (ICLR 2025). https://proceedings.iclr.cc/paper_files/paper/2025/hash/20f44da80080d76bbc35bca0027f14e6-Abstract-Conference.html
- Bertsch, A., Ivgi, M., Xiao, E., Alon, U., Berant, J., Gormley, M. R., & Neubig, G. (2025). In-Context Learning with Long-Context Models: An In-Depth Exploration. Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics (NAACL 2025), 12119–12149. https://doi.org/10.18653/v1/2025.naacl-long.605
- Goyal, S., Baek, C., Kolter, J. Z., & Raghunathan, A. (2025). Context-Parametric Inversion: Why Instruction Finetuning May Not Actually Improve Context Reliance. The Thirteenth International Conference on Learning Representations (ICLR 2025). https://arxiv.org/abs/2410.10796
- Tanzer, G., Suzgun, M., Visser, E., Jurafsky, D., & Melas-Kyriazi, L. (2024). A Benchmark for Learning to Translate a New Language from One Grammar Book. Proceedings of the Twelfth International Conference on Learning Representations (ICLR 2024). https://proceedings.iclr.cc/paper_files/paper/2024/hash/52d63f9e4b81f866bf69fb3c834aad47-Abstract-Conference.html
- Zou, K., Khalifa, M., & Wang, L. (2025). On Many-Shot In-Context Learning for Long-Context Evaluation. Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL 2025), 25605–25639. https://doi.org/10.18653/v1/2025.acl-long.1245