In-Context Learning
In-context Learning
A method that teaches an AI a new task by showing it examples directly in the prompt, without changing the model.
In Simple Terms
In-context learning is a method where you teach an AI how to do a new task just by including a few examples alongside your instructions. For instance, if you give a translation AI examples like "inu = dog, neko = cat, tori = ?" (Japanese words paired with their English translations), it will answer "bird" even without being explicitly told the rule. Since it works entirely through the conversation itself, without rewriting the AI's underlying system, it's used across many conversational AI tools to steer behavior on the fly.
Behind the Name
The name comes from the idea that the AI learns right there "in context" — inside the surrounding text of the prompt itself, rather than through any change to its underlying program. Because the examples are placed directly within the instructions you send the AI, it picks up a temporary, one-off skill just from reading that context.
Take a Closer Look!
In-context learning is a technique where you write a few examples directly into the prompt — the instructional text you give an AI — so it can temporarily pick up a new rule or task.
Normally, teaching an AI something new means rebuilding the underlying system using huge amounts of data, but this method lets you get results through nothing more than the text exchange itself.
Simply put, it's like showing a transfer student a few examples of "how things work in this class" and having them act accordingly right away.
AI is good at reading the flow of the text it's given — in other words, the context — so it can mimic the pattern in the examples within the prompt and work out the correct answer.
Because this method doesn't rewrite the AI's underlying system, whatever it "learned" disappears once that conversation ends.
Even so, it's a valuable technique because it lets you steer an AI toward the response you want without the trouble of modifying its program or the heavy computing costs that would involve — and it's used across a wide range of generative AI apps today.