À suivreGuide suivant
Fenêtres contextuelles
IA linguistique
GUIDE IA du langage
L'apprentissage en contexte utilise des informations ou des démonstrations dans une invite pour adapter la réponse d'un modèle de langage sans mettre à jour ses poids.
Écoutez ce guideNarré par l'IA · ~3 min
It provides a flexible way to show a task or format, while results depend on the model and prompt rather than a guaranteed learning threshold.
Ordinary fine-tuning updates a model's parameters through training. In-context learning instead puts information and demonstrations into the input supplied at inference. The model's weights remain fixed while its internal activations and predictions depend on that input. A zero-shot prompt gives no task demonstrations, a one-shot prompt gives one, and a few-shot prompt gives several. For example, demonstrations can show support messages paired with the labels refund and billing; a new message can then be presented using the same structure. The examples suggest the desired pattern without guaranteeing a correct classification. The GPT-3 paper evaluated task demonstrations supplied through text without gradient updates and reported improvements with scale across many tasks. That evidence does not establish a universal one-hundred-billion-parameter threshold below which in-context learning is impossible. Prompt design also matters. Lu and colleagues demonstrated sensitivity to the order of few-shot examples in their evaluated classification settings, so reordering identical examples can change results without changing model weights. Demonstrations can illustrate a format or task relationship, but they are still input tokens that must be processed. Adding more examples uses more of the supported context budget and can increase per-request work; it is not automatically a quality improvement. For a stable application, compare prompting and fine-tuning using task quality, training effort, request costs, and maintenance needs instead of assuming one method is always cheaper.
Donner à un chatbot trois exemples de tickets d'assistance et leurs catégories, puis lui demander de classer un nouveau ticket de la même manière
Affichage d'un modèle de deux paires avant/après de texte désordonné reformaté en JSON propre afin qu'il convertisse le reste
Coller quelques exemples de descriptions de produits dans le ton de votre marque afin que les nouvelles correspondent au style
Démontrer un problème mathématique délicat travaillé étape par étape afin que le modèle résolve des problèmes similaires avec le même format de raisonnement
Larger supported contexts make it possible to supply more examples, but they also create choices about relevance and request cost. Retrieval can help select examples appropriate to the current task. Evaluate the same representative requests under different prompt designs and compare those results with a fine-tuned alternative when relevant. A useful report states the model, examples, ordering, and evaluation task. Greater prompt length is a resource choice rather than a guarantee of learning, and few-shot behavior still needs checks on held-out inputs.
Newsletter gratuite
Trois histoires d'IA vérifiées chaque matin de la semaine, écrites dans un anglais simple. Gratuit pour toujours, sans publicité.
Un e-mail chaque jour de la semaine. Désabonnez-vous en un clic. Nous ne vendons ni ne partageons jamais votre adresse.
Testez-vous
Commentaires instantanés sur chaque réponse et un certificat partageable avec une pièce d'identité vérifiable une fois que vous avez réussi un cours.
Soutenez l’enseignement gratuit de l’IA. AI Understanding est une organisation à but non lucratif 501(c)(3) : pas de publicité, pas de paywall, jamais. Faire un don
In-context learning uses information or demonstrations in a prompt to adapt a language model's response without updating its weights. It provides a flexible way to show a task or format, while results depend on the model and prompt rather than a guaranteed learning threshold.
L'apprentissage en contexte se produit entièrement par inférence. Les exemples dans l'invite façonnent les activations du modèle et les prédictions du prochain jeton, mais aucune pondération n'est mise à jour.
The study reports task and model results, not a universal parameter threshold for in-context behavior.
The cited work distinguishes stronger findings in small attention-only models from preliminary or indirect broader evidence.
Stable high-volume use can motivate comparison, but costs and quality depend on the actual setup.
Demonstrations show a desired input-output pattern, while correctness still needs evaluation.
Continuez à apprendre
Plus de guides sélectionnés pour ce sujet
À suivreGuide suivant
Fenêtres contextuelles
IA linguistique