Repository navigation
Transformer Concepts Autoregressive Generation
Sudharsan Selvaraj edited this page Jul 20, 2026
·
1 revision
Autoregressive Generation is the main loop of a language model. "Auto" meaning self, and "regressive" meaning predicting the next step from previous steps. The model predicts one token, appends it to the prompt, and runs the entire forward pass again to predict the next token.
This is why LLMs take time to generate paragraphs. It is a strictly sequential process. You cannot predict the 10th word until you have generated the 9th word.
The Live Inference mode is a literal visualization of the autoregressive loop.
- Prefill: The first pass through the 3D stack processes the whole prompt at once.
-
Decode Loop: Every subsequent pass through the 3D stack represents exactly one loop of the autoregressive engine. The
PlaybackEnginereaches the top of the stack, logs the chosen token on the Bottom Bar, resets the camera to the bottom, and starts climbing the stack again for the next token. - KV Cache Context: To prevent the visualization from implying that the model forgets the past, the KV Cache volume grows visually with each loop, proving that past context is retained without needing to be re-run through the whole stack.
flowchart TD
Start([Start]) --> Prompt[Input: 'The cat']
Prompt --> ForwardPass[Forward Pass]
ForwardPass --> TopToken[Generate: 'sat']
TopToken --> Check{EOS Token?}
Check -- No --> Append[Append to Input: 'The cat sat']
Append --> ForwardPass
Check -- Yes --> End([End Generation])
| Previous | Home | Next |
|---|---|---|
| Sampling | Home | None |
TokenPrint Wiki | Home | Getting Started | User Guide | Concepts | Architecture | API | GitHub
TokenPrint is an interactive 3D visualization platform for exploring transformer architectures, tensors, and real-time LLM inference.
- User Guide
- Architecture Explorer
- Live Inference
- Tensor Inspector
- Camera Controls
- HUD
- Timeline
- Scene Navigation
- Transformer Concepts
- Tokenization
- Embeddings
- Positional Encoding
- RoPE
- Multi-Head Attention
- KV Cache
- LayerNorm
- Feed Forward Network
- Residual Connections
- Logits
- Softmax
- Sampling
- Autoregressive Generation
- Visualization System
- Scene Graph
- Geometry
- Materials
- Animation System
- Color Mapping
- Camera System
- Interaction Model
- Architecture
- Overall Architecture
- Frontend
- Backend
- WebSocket Protocol
- Data Pipeline
- Renderer
- Event System