Show HN tool visualizes attention weights behind LLM token generation
A hobbyist project lets users hover over tokens generated by a transformer language model to see which earlier tokens most influenced each output, by combining attention weights and value vector magnitudes across all heads and layers into a single opacity value. The demo highlights cases like verbatim copying of addresses or dates, showing the source text lighting up strongly when reproduced.
GoKawiil's interpretation of the reporting above, not reported fact.
This kind of visualization offers an intuitive, if simplified, window into how transformers decide what information to reuse, addressing a common confusion about how probabilistic token prediction can still copy text reliably. Tools like this could help researchers and curious users build better mental models of LLM internals without needing to parse raw attention matrices.
- The tool aggregates attention weights and value vector magnitude across heads and layers into one score per token.
- It visually explains how LLMs can copy text verbatim despite generating tokens probabilistically.
- The creator acknowledges the visualization is a simplification that discards significant information.
Build a Large Language Model (From Scratch)" by Sebastian Raschka — If watching attention weights light up across tokens made you curious how the machinery actually works, this book walks you through coding a transformer step by step, including the self-attention mechanism being visualized here. It's a hands-on path from tokenization to a working model you can inspect yourself.
See Build a Large Language Model (From Scratch)" by Sebastian Raschka on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.Source: ishamf.dev — Sep, 2026-09-08
Published there as: “Show HN: LLM Attention Visualization”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.