# Hidden State

- **Canonical URL:** https://getaimath.com/dictionary/hidden-state/
- **Topics:** [Transformer Architecture](https://getaimath.com/dictionary/category/transformer-architecture/)
- **Last updated:** 2026-11-25

## What is Hidden State?

**In one sentence:** A hidden state is the list of numbers representing a token at some point inside the model.

As a token travels up through the layers, its hidden state keeps changing, collecting more context and meaning. The final hidden state is used to predict the next token. "Hidden" just means it is internal, not shown to users.

![Transformers & Attention: The Smart Highlighter — Simple cartoon diagram showing how a Transformer reads a whole sentence at once and shines a bright highlighter beam from the word "IT" back to "trophy" so it knows what "IT" means.](https://getaimath.com/diagrams/transformer-architecture.png)
*Napkin Diagram (Transformer Architecture): Older AI read word-by-word and often lost track of earlier words; a Transformer highlights which words connect to which.*

## What is an example of Hidden State?

The hidden state for "bank" changes in later layers depending on whether nearby words are about rivers or money.

## Why does Hidden State matter?

Hidden states are where a model's understanding actually lives during processing.

## Related Concepts

- [Hidden Dimension](https://getaimath.com/dictionary/hidden-dimension/): The hidden dimension is the number of values used to represent each token inside the model.
- [Intermediate Dimension](https://getaimath.com/dictionary/intermediate-dimension/): The intermediate dimension is the larger size that the feed-forward network expands each token to before shrinking it back.
- [Transformer Block](https://getaimath.com/dictionary/transformer-block/): A Transformer block is one repeated layer of a Transformer, usually made of attention, a feed-forward network, normalization and residual connections.
- [Model Depth](https://getaimath.com/dictionary/model-depth/): Model depth is how many layers, or Transformer blocks, a model has stacked on top of each other.
- [Residual Connection](https://getaimath.com/dictionary/residual-connection/): A residual connection lets a layer's input skip ahead and be added to its output, creating a shortcut through the network.
- [Model Width](https://getaimath.com/dictionary/model-width/): Model width is how big each layer is, mostly set by the hidden dimension and number of attention heads.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/hidden-state/)
