# Warstwy z modelem w stanie ukrytym

EN: **Test-time training layers** · id `tttlayers` · aliases: TTT-Linear, TTT-MLP

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Trenowanie i dostrajanie](https://aiatlasgraph.com/t/training.md) › [Uczenie w czasie testu](https://aiatlasgraph.com/t/testtimeadapt.md) › Warstwy z modelem w stanie ukrytym

## Description

- PL: Warstwa sekwencyjna, której stan ukryty jest modelem uczonym krokiem samonadzoru także na teście.
- EN: A sequence layer whose hidden state is a model updated by a self-supervised step also at test time.

## In one sentence

- PL: Wewnętrzna pamięć warstwy jest małym modelem, który uczy się na bieżącej sekwencji.
- EN: A layer's internal memory is a small model that learns on the current sequence.

## Problem it solves

- PL: Długa sekwencja sprawia, że pełna uwaga jest kosztowna, a model potrzebuje pamięci o liniowym koszcie względem długości.
- EN: A long sequence makes full attention costly, while the model needs memory with linear cost in sequence length.

## What it does

- PL: Każdy nowy fragment jest ćwiczeniem dla małego modelu w środku warstwy, a odczyt jest jego przewidywaniem.
- EN: Each new fragment is an exercise for the small model inside the layer, and the readout is its prediction.

## Everyday example

- PL: Przy długiej umowie warstwa dopisuje kolejne klauzule do wewnętrznego modelu, zamiast trzymać cały tekst w uwadze.
- EN: On a long contract, the layer writes later clauses into an internal model instead of holding the whole text in attention.

## This concerns you if you…

- PL: czytasz bardzo długie dokumenty
- PL: pamięć uwagi jest za droga
- PL: chcesz trzymać szczegóły z daleka
- EN: read very long documents
- EN: attention memory is too costly
- EN: want to keep details from far back

## Keywords

TTT-Linear · TTT-MLP · linear complexity · hidden state as model · long context · self-supervised update · inner-loop learner

## How it works

- PL: Stan to wagi modelu liniowego albo małej sieci. Krok aktualizacji dopasowuje je do par z bieżącego fragmentu, a odczyt liczy się w nowym punkcie. Złożoność względem długości jest liniowa. Warianty to model liniowy i dwuwarstwowa sieć.
- EN: The state is the weights of a linear model or a small network. An update step fits them to pairs from the current fragment, and the readout is evaluated at a new point. Cost in sequence length is linear. Variants use a linear model or a two-layer network.

## Limits

- PL: Model przechowywany w stanie ukrytym zwiększa koszt pamięci i transferu. Korzyść zależy od długości kontekstu; wariant z małą siecią nadal ma ograniczenia wejścia i wyjścia pamięci.
- EN: Keeping a model in the hidden state increases memory and transfer costs. Benefits depend on context length; the small-network variant still faces memory I/O limitations.

## Key terms

- PL: **stan jako model**: Pamięć warstwy, która sama jest małym uczonym modelem.
- PL: **krok wewnętrzny**: Jedna aktualizacja tego małego modelu na bieżącym fragmencie.
- EN: **state as a model**: Layer memory that is itself a small learned model.
- EN: **inner step**: One update of that small model on the current fragment.

## Know first

- [Modele przestrzeni stanów (Mamba) (State-space models (Mamba))](https://aiatlasgraph.com/t/ssm.md)
- [Transformery i attention (Transformers and attention)](https://aiatlasgraph.com/t/transformers.md)

## Related topics

Untyped, symmetric "see also" links.

- [Modele przestrzeni stanów (Mamba) (State-space models (Mamba))](https://aiatlasgraph.com/t/ssm.md)
- [Pętle głębokości i myśli ukryte (Recurrent depth and latent thoughts)](https://aiatlasgraph.com/t/latentloops.md)

## Sources

- [Learning to (Learn at Test Time): RNNs with Expressive Hidden States](<https://arxiv.org/abs/2407.04620>) `sun-tttlayers-2024` · by Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/tttlayers · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
