HomeAlgorithms & AIAI Code Generation: Transformer Attention & Token Prediction Visualizer

🤖 AI Code Generation: Transformer Attention & Token Prediction Visualizer

Living simulation of how GitHub Copilot / Cursor / Code Llama predict the next token: multi-head self-attention lines, live candidate probabilities and a temperature control over softmax(QKᵀ/√d)·V.

Algorithms & AI3DModerate60 FPS
ai-code-generation-transformer-attention-token-prediction ↗ Open standalone
⚙ Under the hood

Watch a simplified transformer generate code token by token: multi-head self-attention lines connect the token being written to its context window while a live bar chart shows candidate token types competing for the next slot. Temperature reshapes that softmax(QKᵀ/√d)·V-driven distribution — the same mechanism behind GitHub Copilot, Cursor AI and Code Llama.

Three.jsAItransformerself-attentioncode generationLLMInstancedMesh

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)