Transformer Attention Visualizer

Visualize self-attention weights, step through attention heads, and explore Q/K/V matrices

Attention Heatmap

Head 1/4
Self-Attention (Head 1)0.21Low0.19Low0.13Low0.11Low0.27Low0.08Low0.12Low0.17Low0.14Low0.16Low0.23Low0.16Low0.18Low0.20Low0.12Low0.17Low0.20Low0.13Low0.19Low0.14Low0.19Low0.19Low0.10Low0.18Low0.19Low0.10Low0.38Medium0.13Low0.11Low0.09Low0.19Low0.14Low0.19Low0.17Low0.19Low0.11LowTheThecatcatsatsatononthethematmatKeyQuery0.000.250.500.751.00

Transformer Block Diagram

Input Embedding
Multi-Head Attention
Add & Norm
Feed Forward
Add & Norm
Output

Input

0: The1: cat2: sat3: on4: the5: mat

Attention Heads

Q / K / V Matrices

Query (Q)

The:[0.0, 0.7, 0.4, 0.1]
cat:[0.3, 0.0, 0.7, 0.4]
sat:[0.6, 0.3, 0.0, 0.7]
on:[0.9, 0.6, 0.3, 0.0]
the:[0.2, 0.9, 0.6, 0.3]
mat:[0.5, 0.2, 0.9, 0.6]

Key (K)

The:[0.0, 0.3, 0.6, 0.9]
cat:[0.5, 0.8, 0.1, 0.4]
sat:[0.0, 0.3, 0.6, 0.9]
on:[0.5, 0.8, 0.1, 0.4]
the:[0.0, 0.3, 0.6, 0.9]
mat:[0.5, 0.8, 0.1, 0.4]

Value (V)

The:[0.0, 0.5, 0.0, 0.5]
cat:[0.7, 0.2, 0.7, 0.2]
sat:[0.4, 0.9, 0.4, 0.9]
on:[0.1, 0.6, 0.1, 0.6]
the:[0.8, 0.3, 0.8, 0.3]
mat:[0.5, 0.0, 0.5, 0.0]

How it works

Self-Attention: Each token computes a weighted sum over all other tokens based on relevance.

Q/K/V: Queries, Keys, and Values are linear projections used to compute attention scores.

Heads: Multiple attention heads capture different types of relationships in parallel.

Heatmap: Darker orange = higher attention weight between token pairs.

What is Transformer Attention Visualizer?

Transformer Attention Visualizer is a free online tool for students and developers learning AI — handy for seeing how self-attention links tokens inside a transformer. It runs fully in your browser: fast, private and free forever, with no account needed.

How to use Transformer Attention Visualizer?

Step 1: Use the live controls in the tool above — it runs on this page. Step 2: Add your data or settings as the screen prompts. Step 3: Run the tool, then copy or download the result. Everything happens locally in your browser, so large inputs stay private.

Frequently Asked Questions — Transformer Attention Visualizer

Is Transformer Attention Visualizer free to use?

Yes — Transformer Attention Visualizer is a free online tool by DSWallah. No signup, no install, no limits for normal use. It runs entirely in your browser.

Do I need to install anything for Transformer Attention Visualizer?

No. Transformer Attention Visualizer works online in Chrome, Edge, Firefox or Safari on mobile and desktop. Your data never leaves your device.

Who should use Transformer Attention Visualizer?

Transformer Attention Visualizer is built for students and developers learning AI — useful for seeing how self-attention links tokens inside a transformer. DSWallah students use it daily in our AI Course and Gen AI Course batches.

Learn the skill behind the tool: AI Course in Lucknow · Gen AI Course

Related free tools: Ai Chat · Ai Code Explainer · Ai Python Quiz · Backpropagation Visualizer

Popular courses: Data Science Course in Lucknow · AI Course in Lucknow · Python Course in Lucknow · Power BI Course · Data Analytics Course