State Space Models for Language

Michael BrenndoerferNovember 17, 20262 min read
Language AI HandbookAll chapters
Part 19 of 67Alternative Sequence and Generative Architectures
Chapter 133State Space Models for Language
Reading section 1 of 13 · State Space Models for Language · 2 minSection 1 of 13 · 2 min

Section 1 of 13 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

When you generate the next token after a long document, a full causal attention layer can compare its query with the keys at every processed position. The layer keeps separate key and value vectors for those positions, so both the cache and the work to read from it grow with the prefix. At 100,000 positions, the same cache calculation that was cheap for a short prompt can dominate a memory budget.

A state space layer keeps a fixed-size state per sequence. Each new input updates that state, and a readout produces the layer's output. With the layer sizes and batch size fixed, the amount of recurrent state and the number of arithmetic operations for one recurrent update are independent of how many positions came before. A layer that needs to recall an old detail must recover it from the state its updates have retained. This chapter derives the update, computes a fixed system in two equivalent ways, then uses a small experiment to show how the history can fade when the update retains only a fraction of the previous state.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy