Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen In-Context Learning Without Weight Updates | Few-Shot and In-Context Learning Mechanics
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
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

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 1

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

bookIn-Context Learning Without Weight Updates

Swipe um das Menü anzuzeigen

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

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 1
some-alt