AI EncyclopediaAIMore concepts 1

In-context learning

인컨텍스트 학습

The ability to do a new task by looking only at examples placed in the input, without retraining the model.

Overview

In-context learning is the ability to give an answer in the same way by looking only at a few examples put in with the question, without retraining the model. With no examples, the model has to understand the task from the instructions alone, and with examples, it follows their pattern to fit its result. The key difference from fine-tuning is that the values inside the model do not change.

As large language models grew, this ability was clearly observed, and it became a way to try a new task without separate training. The need to cut training cost and time and to experiment quickly made this concept widely used.

How it works

The model reads the examples and the question in the input all at once, and uses the language patterns it learned in training to predict the answer that comes next. During this process, the model's weights stay fixed.

The clearer the format, order and answer marking of the examples, the better the model tends to follow the rule. That is why choosing which examples to use becomes an important step in the work.

Where it is used

It is used by showing a few examples of a classification standard and having the model sort a new sentence by the same standard, or by showing a translation format through examples. It suits situations where tasks change often and training data is hard to prepare.

The input length has a limit, so as examples grow, you must pick them so they do not go over the context window. If the quality of the examples is low, the results will wobble too, so it is better to use examples whose answers are certain.

Limits and misconceptions

Putting in many examples does not mean the model gains new knowledge for good. When the conversation ends, the effect of those examples disappears, and the model itself stays the same.

A common misunderstanding is to think that in-context learning is the same as training. For complex expert knowledge or large amounts of new data, fine-tuning or retrieval-augmented generation can still be more suitable.

An everyday example

It is like opening a cookbook, first showing two or three similar dishes, and then asking someone to make a new dish the same way. They do not have to learn a new recipe. They can follow the examples in front of them.

Why it matters

Even with the same model, results change with the examples you put in the input, so knowing this principle helps a lot when you write prompts or design an AI service. You also need to tell it apart from fine-tuning to judge costs correctly.

Sources and further reading

Also calledICL

See it on LastAI

These concept articles were written by AI and checked again for accuracy before publishing. The English edition is translated from the Korean articles. They leave out things that change quickly, such as prices and rankings. Tell us if something is wrong. Report an errorLast updated

You