# Głowy indukcyjne i mechanizm uczenia w kontekście

EN: **Induction heads and in-context learning** · id `inductionheads` · aliases: induction heads, głowy indukcyjne, induction circuit

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Ewaluacja i interpretowalność](https://aiatlasgraph.com/t/evaluation.md) › [Interpretowalność](https://aiatlasgraph.com/t/explainability.md) › [Interpretowalność mechanistyczna](https://aiatlasgraph.com/t/mechinterp.md) › Głowy indukcyjne i mechanizm uczenia w kontekście

## Description

- PL: Obwód dwóch głów uwagi, który po wystąpieniu [A][B] przewiduje [B] przy ponownym [A]; proponowany jako główne źródło uczenia w kontekście.
- EN: A two-attention-head circuit that, after seeing [A][B], predicts [B] when [A] recurs; proposed as a main source of in-context learning.

## In one sentence

- PL: Prosty wewnętrzny mechanizm, dzięki któremu model zauważa powtórzony wzorzec w tekście i dopełnia go dalej.
- EN: A simple inner mechanism that lets a model notice a repeated pattern in text and continue it.

## Problem it solves

- PL: Model potrafi naśladować przykłady podane w poleceniu, ale z zewnątrz nie widać, jak to robi ani skąd bierze się ta umiejętność.
- EN: A model can imitate examples given in a prompt, but from outside it is unclear how it does so or where the skill comes from.

## What it does

- PL: Działa jak czytelnik, który raz zobaczył „zielona herbata”, więc przy kolejnym „zielona” spodziewa się słowa „herbata”.
- EN: It works like a reader who once saw “green tea” and so, at the next “green”, expects the word “tea”.

## Everyday example

- PL: Wklejasz listę kodów produktów z nazwami, a asystent przy kolejnym kodzie poprawnie podaje nazwę z wcześniejszej części listy.
- EN: You paste a list of product codes with names, and the assistant correctly gives a name from earlier in the list for a repeated code.

## This concerns you if you…

- PL: chcesz zrozumieć, czemu przykłady w poleceniu działają
- PL: uczysz się zaglądać do wnętrza modeli językowych
- EN: want to understand why examples in a prompt work
- EN: are learning to look inside language models

## Keywords

previous-token head · prefix matching · copying · in-context learning · phase change · attention-only transformers · QK and OV circuits

## How it works

- PL: Głowa poprzedniego tokenu zapisuje w każdej pozycji informację o tokenie poprzedzającym. Głowa indukcyjna szuka wcześniejszych wystąpień bieżącego tokenu i kopiuje token, który po nich nastąpił. Autorzy obserwują nagłe pojawienie się tych głów równolegle ze skokiem zdolności uczenia w kontekście.
- EN: A previous-token head writes, at each position, information about the preceding token. The induction head looks for earlier occurrences of the current token and copies the token that followed them. The authors observe these heads forming abruptly alongside a jump in in-context learning ability.

## Limits

- PL: Dowód jest przyczynowy tylko dla małych modeli z samą uwagą; dla większych modeli z warstwami MLP autorzy opisują go jako korelacyjny. Uczenie w kontekście w dużych modelach obejmuje też inne, bardziej abstrakcyjne mechanizmy.
- EN: Evidence is causal only for small attention-only models; for larger models with MLP layers the authors describe it as correlational. In-context learning in large models also involves other, more abstract mechanisms.

## Key terms

- PL: **głowa uwagi**: Jeden z równoległych podmechanizmów uwagi, patrzący na wybrane wcześniejsze tokeny.
- PL: **uczenie w kontekście**: Wykonywanie nowego zadania na podstawie przykładów w poleceniu, bez zmiany wag.
- PL: **przejście fazowe**: Nagła zmiana zachowania modelu w krótkim okresie treningu.
- EN: **attention head**: One parallel attention sub-mechanism looking at selected earlier tokens.
- EN: **in-context learning**: Doing a new task from prompt examples without changing weights.
- EN: **phase change**: An abrupt shift in model behaviour within a short span of training.

## Know first

- [Mechanizm self-attention (zapytania, klucze, wartości) (Self-attention (queries, keys, values))](https://aiatlasgraph.com/t/selfattention.md)
- [Przykłady w poleceniu (few-shot) (Few-shot prompting and in-context learning)](https://aiatlasgraph.com/t/fewshotprompting.md)

## Sources

- [In-context Learning and Induction Heads](<https://arxiv.org/abs/2209.11895>) `induction-heads-2022` · by Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen i in. (26 autorów, ostatni Chris Olah)

---

AI Atlas revision 130 (2026-11-06) · HTML: https://aiatlasgraph.com/t/inductionheads · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-11-06
