Repository navigation
Transformer Concepts
This section bridges the gap between deep learning theory and TokenPrint's visualizations. It provides a beginner-friendly yet technically accurate explanation of every major component in a modern Transformer, alongside how TokenPrint brings that concept to life.
You cannot fully utilize TokenPrint as a visual debugger without understanding the underlying math and architecture. If you don't know what a KV Cache is, seeing it shrink and grow in the 3D scene won't mean anything to you.
TokenPrint takes abstract mathematical concepts (like dot products and element-wise additions) and maps them to concrete geometric properties:
- Vectors become Points.
- Operations become Distinct Sub-meshes.
- Tensors become Bounding Boxes.
- Magnitudes dictate Colors and Scales.
By reading through these concepts while stepping through the Walkthrough mode in the app, you will build a robust, intuitive understanding of language models.
- Tokenization: How text becomes numbers.
- Embeddings: How numbers become high-dimensional vectors.
- Positional Encoding: Giving the model a sense of order.
- RoPE: Rotary Positional Embeddings (used in Llama/Qwen).
- Multi-Head Attention: How tokens communicate.
- KV Cache: The memory system that makes generation fast.
- LayerNorm: Keeping activations stable (including RMSNorm).
- Feed Forward Network: Where the model "thinks" (including SwiGLU).
- Residual Connections: The main highway through the model.
- Logits: Raw output scores.
- Softmax: Converting scores to probabilities.
- Sampling: Picking the next word.
- Autoregressive Generation: The loop that generates text.
flowchart TD
Text[Text] --> Tok[Tokenization]
Tok --> Embed[Embeddings]
Embed --> Pos[Positional Encoding]
Pos --> Block[Transformer Block]
subgraph Transformer Block
MHA[Multi-Head Attention]
Norm1[Norm]
FFN[Feed Forward Network]
Norm2[Norm]
Res[Residual Connection]
end
Block --> Unembed[Unembedding]
Unembed --> Logits[Logits]
Logits --> Softmax[Softmax]
Softmax --> Sampling[Sampling]
Sampling --> NextTok[Next Token]
| Previous | Home | Next |
|---|---|---|
| Scene Navigation | Home | Tokenization |
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