Skip to content
NewA calmer, faster ZeroHour

Show HN: LLM Attention Visualization

Hacker News · AIby ifz ()3 min read
AI summary · glm-5.3-flashSummaries by Vani AI

A developer released a browser-based tool that visualizes which past tokens influence each LLM output token using aggregated, value-weighted attention scores.

A Show HN project presents a React application built on Transformers.js that renders per-token attention influence by aggregating attention weights scaled by value-vector magnitudes across all attention heads and layers. To expose internal tensors, the author instrumented the ONNX computation graph, hosted a modified model on Hugging Face, and pre-generated prompts to avoid long model downloads in the browser. Demos with a 600-million-parameter model show how verbatim copying draws heavily on source tokens and how single outputs blend information from multiple phrases.

Key facts
  • Attention weights scaled by value magnitude, aggregated across heads and layers
  • Instrumented ONNX model hosted on Hugging Face exposes internal generation values
  • Pre-generated prompts sidestep hundreds-of-megabytes model downloads in the browser
Explain this AI news with Vani AIWhat was announced, what is new and why it matters, in a new chat

From the original article

3 min read at ishamf.dev

One interesting thing about transformer-based large language models are that, during the generation phase, it is able to draw information from any of its previous tokens. But it needs to be selective; if every token affects the generation equally, it won't be very effective. This process needs a mechanism to decide how much a token affects the next token.

Hacker News · AI

By ifz · ishamf.dev

Read the full article at Hacker News · AI

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.