Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda In-Context Learning Without Weight Updates | Few-Shot and In-Context Learning Mechanics
Zero-Shot and Few-Shot Generalization

bookIn-Context Learning Without Weight Updates

In-context learning is a remarkable capability of large language models (LLMs), allowing them to tackle new tasks simply by observing examples within a prompt. Instead of retraining or updating internal parameters, the model leverages the information provided in the input to generalize and produce relevant outputs. When you give an LLM a set of input-output pairs for a task it has never explicitly seen before, it can often infer the underlying pattern and respond accordingly, even if its weights remain unchanged throughout the process.

In-context adaptation vs. traditional learning
expand arrow

In traditional machine learning, a model's parameters are updated through gradient descent or similar optimization techniques as it is exposed to new data. This process, known as weight-based learning, gradually tunes the model to perform better on the task at hand. In contrast, in-context learning involves no such parameter updates. Instead, the model uses its fixed, pretrained weights to process the entire prompt — including any task instructions and examples — within a single forward pass. The adaptation happens "on the fly," using the context provided in the prompt rather than any internal change to the model itself.

Memory and attention mechanisms
expand arrow

In-context learning relies heavily on the model's attention mechanism, which enables it to focus selectively on relevant parts of the prompt. Unlike explicit memory modules or long-term storage, attention mechanisms allow the model to dynamically extract and combine information from the context window. This enables the LLM to "remember" and utilize the provided examples, instructions, or cues as it generates an output, effectively simulating a form of temporary working memory.

Note
Note

You can think of in-context learning as a kind of "learning to learn" that happens within a single forward pass of the model. Rather than updating weights, the LLM adapts its behavior by interpreting the examples and instructions in the prompt, showcasing a powerful form of meta-learning.

question mark

Which of the following statements correctly describes in-context learning in large language models?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 1

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you give an example of in-context learning in action?

What are some limitations of in-context learning?

How does in-context learning differ from traditional machine learning approaches?

bookIn-Context Learning Without Weight Updates

Deslize para mostrar o menu

In-context learning is a remarkable capability of large language models (LLMs), allowing them to tackle new tasks simply by observing examples within a prompt. Instead of retraining or updating internal parameters, the model leverages the information provided in the input to generalize and produce relevant outputs. When you give an LLM a set of input-output pairs for a task it has never explicitly seen before, it can often infer the underlying pattern and respond accordingly, even if its weights remain unchanged throughout the process.

In-context adaptation vs. traditional learning
expand arrow

In traditional machine learning, a model's parameters are updated through gradient descent or similar optimization techniques as it is exposed to new data. This process, known as weight-based learning, gradually tunes the model to perform better on the task at hand. In contrast, in-context learning involves no such parameter updates. Instead, the model uses its fixed, pretrained weights to process the entire prompt — including any task instructions and examples — within a single forward pass. The adaptation happens "on the fly," using the context provided in the prompt rather than any internal change to the model itself.

Memory and attention mechanisms
expand arrow

In-context learning relies heavily on the model's attention mechanism, which enables it to focus selectively on relevant parts of the prompt. Unlike explicit memory modules or long-term storage, attention mechanisms allow the model to dynamically extract and combine information from the context window. This enables the LLM to "remember" and utilize the provided examples, instructions, or cues as it generates an output, effectively simulating a form of temporary working memory.

Note
Note

You can think of in-context learning as a kind of "learning to learn" that happens within a single forward pass of the model. Rather than updating weights, the LLM adapts its behavior by interpreting the examples and instructions in the prompt, showcasing a powerful form of meta-learning.

question mark

Which of the following statements correctly describes in-context learning in large language models?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 1
some-alt