I built a browser tool to visualize how a small LLM picks its next word and see what it's attending to [P]
You give it a prompt, it generates one token at a time, and for each step you get the next-token candidates with probabilities, plus the attention from the current token back to the earlier ones drawn as links with the weights labeled.
Proof1 community thread
Key points
- I made a little thing that visualizes attention.
- It runs SmolLM2-135M fully in the browser (onnxruntime-web, int8, no server, works on my phone).
- You can click any word to see where its attention actually went, ranked.
- Thought it was a bug in my code, but after some digging it turned out to be the attention sink 😅
Sources (1)
- [1]I built a browser tool to visualize how a small LLM picks its next word and see what it's attending to [P]r/MachineLearning (top, daily) · Oct 11, 10:30 PM
You give it a prompt, it generates one token at a time, and for each step you get the next-token candidates with probabilities, plus the attention from the current token back to the earlier ones drawn as links with the weights labeled.
I made a little thing that visualizes attention.
Extractive summary: sentences quoted from the sources.
Before this
- Oct 11, 2026openai/openai-python v3.29.0
- Oct 11, 2026Agent Speedrun — Elizabeth Fuentes Leone & Sandhya Subramani, AWS
- Oct 8, 2026openai/codex rust-v0.162.0: 0.162.0
- Oct 8, 2026Microsoft Joins the Local AI Push
- Oct 8, 2026Understanding Jev, the new model everyone is talking about
- Oct 7, 2026[AINews] Claude Haiku 5.5 — better than GPT-6 Luna at the same pricing