Taal AI-GIDS
In-context leren
In-context learning uses information or demonstrations in a prompt to adapt a language model's response without updating its weights.
Luister naar deze gidsAI-verteld · ~3 min
Op deze pagina3 minuten lezen
Overzicht
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.
Diepe duik
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.
Implementatie in de echte wereld
Geef een chatbot drie voorbeelden van supporttickets en hun categorieën, en laat hem vervolgens een nieuw ticket op dezelfde manier classificeren
Een model toont twee voor/na-paren rommelige tekst, opnieuw opgemaakt in schone JSON, zodat de rest wordt geconverteerd
Plak een paar voorbeeldproductbeschrijvingen in de toon van uw merk, zodat nieuwe bij de stijl passen
Het demonstreren van een lastig wiskundig woordprobleem werkte stap voor stap, zodat het model vergelijkbare problemen oplost met hetzelfde redeneerformaat
De toekomst van in-context leren
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.
Het in de praktijk brengen
Waarom het ertoe doet
- Snelheid en schaal. Taalworkflows kunnen sneller verlopen zonder dat dit ten koste gaat van de consistentie.
- Toegang en bereik. Het breidt de toegang uit naar meerdere talen en communicatiestijlen.
- Duidelijkere beslissingen. Teams kunnen meer tijd besteden aan beoordeling, terwijl automatisering de herhaling afhandelt.
Pas op voor
- Gehallucineerde feiten kunnen stilletjes rapporten binnendringen, stromen ondersteunen of onderzoeksresultaten opleveren.
- Gevoeligheid voor prompts kan inconsistente resultaten opleveren voor vergelijkbare verzoeken.
- Gevoelige tekstgegevens kunnen openbaar worden gemaakt als de toegangscontroles zwak zijn.
Volgende stappen
- Definieer het uitvoerformaat, de toon en de kwaliteitsnormen vóór de implementatie.
- Grondreacties met vertrouwde bronnen wanneer nauwkeurigheid belangrijk is.
- Houd een menselijk controlepunt bij voor resultaten met een hoge inzet.
- Houd faalpatronen bij en train prompts of workflows regelmatig opnieuw.
Blijf verkennen
Gratis nieuwsbrief
Ontvang de dagelijkse AI-briefing
Drie verifieerde AI-verhalen elke weekdagmorgen, geschreven in eenvoudig Engels. Gratis voor altijd, geen advertenties.
Eén e-mail elke weekdag. Afmelden met één klik. We verkopen of delen je adres nooit.
Test jezelf
Take the In-Context Learning quiz
Directe feedback op elke antwoord, en een deelbare certificaat met een verifieerbare ID zodra je een cursus hebt afgerond.
Ondersteun gratis AI-onderwijs. AI Understanding is een 501(c)(3) non-profit — geen advertenties, geen betaalmuur, nooit. Doe een donatie
Veelgestelde vragen
Wat is contextueel leren?
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.
Wat verandert er fundamenteel binnen het model tijdens in-context leren?
In-context leren gebeurt volledig op basis van gevolgtrekking. De voorbeelden in de prompt vormen de activeringen van het model en de voorspellingen voor de volgende token, maar er worden geen gewichten bijgewerkt.
What does GPT-3's reported improvement in few-shot performance with scale establish?
The study reports task and model results, not a universal parameter threshold for in-context behavior.
How should induction-head research be related to broad in-context learning?
The cited work distinguishes stronger findings in small attention-only models from preliminary or indirect broader evidence.
How should an application compare repeated few-shot prompting with fine-tuning?
Stable high-volume use can motivate comparison, but costs and quality depend on the actual setup.
A few-shot ticket prompt demonstrates only refund and billing labels. What do those examples provide for the next ticket?
Demonstrations show a desired input-output pattern, while correctness still needs evaluation.
Blijf leren
Gerelateerde gidsen
Er zijn meer handleidingen voor dit onderwerp geselecteerd