Repository navigation
Supported Models Gemma
Sudharsan Selvaraj edited this page Jul 20, 2026
·
1 revision
Gemma is a family of lightweight, state-of-the-art open models built by Google DeepMind, based on the Gemini architecture.
While structurally similar to Llama/Qwen, Gemma introduces a few distinct architectural choices that TokenPrint must account for, primarily around normalization and vocabulary size.
When TokenPrint detects architecture: "gemma" (or gemma2), it adapts to its specific quirks:
-
RMSNorm Variants: Gemma uses a slightly different formulation of RMSNorm where the learnable weight parameter
$w$ is added to$1.0$ (i.e.,$w = 1 + w_offset$ ) before multiplying. TokenPrint's HUD formulas update to reflect this. - GeGLU Activation: Instead of SwiGLU, Gemma uses GeGLU (GELU gating). TokenPrint updates the HUD formulas and geometry labeling accordingly.
- Massive Vocabulary: Like Qwen, Gemma features a massive 256k vocabulary. TokenPrint scales the Unembedding block proportionally.
- Logit Soft-Capping (Gemma 2): Gemma 2 introduces soft-capping on logits to prevent extreme values. TokenPrint's formulas capture this when detected.
flowchart TD
Input[Residual Stream] --> RMS[Gemma RMSNorm: w = 1+w']
RMS --> MLP
subgraph GeGLU
MLP --> Gate[Gate Proj]
MLP --> Up[Up Proj]
Gate --> GELU[GELU]
GELU --> Mult[*]
Up --> Mult
Mult --> Down[Down Proj]
end
| Previous | Home | Next |
|---|---|---|
| Qwen | Home | Phi |
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