Repository navigation
Supported Models Llama
Llama (and its successors Llama 2 and Llama 3) by Meta established the dominant architectural paradigm for modern open-weights transformers. TokenPrint fully supports parsing and visualizing Llama-family models.
Llama deviated from the original GPT-2 architecture in several critical ways. To accurately represent a Llama model, a visualizer must account for these structural changes rather than falling back to generic transformer diagrams.
When TokenPrint detects architecture: "llama", it applies specific visual mappings:
- RMSNorm: Replaces standard LayerNorm. The 3D scene renders the normalization waists, and the HUD displays the root-mean-square formula.
- RoPE (Rotary Positional Embeddings): TokenPrint replaces additive absolute positional embeddings with RoPE, visualizing the frequency-based rotary twist applied to Queries and Keys.
-
SwiGLU: Replaces the standard GELU activation in the MLP. The 3D geometry renders two separate incoming prongs (the
gate_projandup_proj) that merge at an element-wise multiplication node before passing to thedown_proj. - GQA (Grouped Query Attention): Starting with Llama 2 (and prevalent in Llama 3), models use fewer KV heads than Query heads. TokenPrint visually clusters the Query blades around their shared KV blade in the 3D stack.
flowchart TD
Input[Residual Stream] --> RMSNorm1[RMSNorm]
RMSNorm1 --> Q[Query]
RMSNorm1 --> K[Key]
RMSNorm1 --> V[Value]
Q --> RoPE1[RoPE]
K --> RoPE2[RoPE]
RoPE1 --> Attn[Grouped Query Attention]
RoPE2 --> Attn
V --> Attn
Attn --> Add1[+]
Input --> Add1
Add1 --> RMSNorm2[RMSNorm]
RMSNorm2 --> Gate[Gate Proj]
RMSNorm2 --> Up[Up Proj]
Gate --> Swish[SiLU]
Swish --> Mult[*]
Up --> Mult
Mult --> Down[Down Proj]
Down --> Add2[+]
Add1 --> Add2
| Previous | Home | Next |
|---|---|---|
| HuggingFace | Home | Qwen |
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