LLM Attention Visualization - Interactive tool to see token influence

LLM Attention Visualization is an interactive web app that reveals how transformer-based language models decide which past tokens influence each generated token. By hovering over or tapping any output token, you can see the source tokens that contributed to it, with opacity indicating influence strength. This tool makes the attention mechanism tangible, helping users understand why LLMs are good at copying data and how they combine information from multiple phrases. It includes pre-generated examples and a browser-based generation feature using an instrumented ONNX model, with code available on GitHub.

This addresses one thing that I've previously found unintuitive about LLMs. If they work by predicting the next tokens probabilistically, why are they somehow so good at copy-pasting stuff? Won't they eventually make a mistake just by random chance? But with this mechanism, you can see that it doesn't predict the entire sequence from some limited internal states.
  1. MCP123

    This is great, thank you. I have to teach this stuff on Friday so perfect timing. It's hard to explain the attention mechanism in a way that becomes intuitive because the weighting scheme does not help much with the intuition. Having a visualization like this helps a lot. Don't move that page please since I'll link to it!

  2. fuddle

    This is great, I've read multiple books and watched videos about the attention mechanism. Now that I understand it, this is the clearest example I've seen on how attention works.

  3. fermlon30000

    INSANE

More from this day

2026-09-08