Repository navigation
Visualization System Materials
In 3D graphics, Materials define how light interacts with Geometry to produce color, reflections, and glow. TokenPrint uses materials to encode activation strength and operation types.
While Geometry shows you the structure of the model, Materials show you the activity. Highlighting an active block during Live Inference is the primary way TokenPrint directs user attention to the current mathematical operation.
TokenPrint relies primarily on MeshStandardMaterial for lit objects and MeshBasicMaterial (or emission properties) for objects that glow.
During a Live Inference trace, the backend streams layer_stats, which are mean absolute values of the activations at each layer.
- The frontend receives an array of 25 values (one per layer).
- It normalizes these values relative to the maximum activation in that step.
- It updates the
emissiveIntensityof the Material for that specific block.
A bright block means the activation tensor for that layer had a high magnitude; a dim block means the signal was weak.
The TensorCloud uses a custom ShaderMaterial to handle depth-coloring efficiently on the GPU, avoiding the need to compute vertex colors for millions of points in Javascript.
flowchart TD
Stats[Streamed layer_stats] --> Norm[Normalize [0, 1]]
Norm --> Store[Zustand Store]
Store --> R3F[React: update material]
R3F --> Mat[MeshStandardMaterial]
Mat --> Color[color = op_color]
Mat --> Glow[emissiveIntensity = Normalized Stat]
| Previous | Home | Next |
|---|---|---|
| Geometry | Home | Animation System |
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