🧭 Roadmap › 02 · Understand Context › Attention › Attention Simulator
← Attention

Attention Simulator

🔵 Build
Area02 · Understand Context
TopicAttention
Topic priority🔴 MUST
Subtopic13 of 13
Interactive Experiment · Live Simulation

Attention Simulator ✦

How does a token dynamically gather context from other words in a sentence? Type any sentence below, select a token to be the Query, and observe the live attention connections, softmax weights, and $N \times N$ attention matrix.

01 / Choose or edit sentence

02 / Attention connections (Query → Keys)

Select any token above. Arcs illustrate attention flow to all sequence tokens; brighter and thicker arcs indicate higher attention weights.

Choose a token to inspect its attention pattern.

03 / Softmax Attention Weights

04 / Attention Matrix

Each row represents the query token attending across all key columns. Each row sums to ~100%.

Decoder Causal Masking: In autoregressive models (GPT), tokens can only attend to previous and current positions, zeroing out future tokens.
Study this using 8 phases
🧠 01 Understand

What is Attention Simulator? Why does it exist? Where does it appear in Attention?

👁️ 02 Visualize

Draw or describe a visual model of Attention Simulator. What does it look like conceptually?

✏️ 03 Calculate

Work through a concrete manual example of Attention Simulator with real numbers or pseudocode.

💻 04 Code

Implement Attention Simulator from scratch in Python. Keep it minimal — just enough to see it work.

🔬 05 Experiment

Try Attention Simulator on a real example. Vary the inputs and observe what changes.

⚖️ 06 Compare

How is Attention Simulator different from related concepts in Attention? What are the trade-offs?

🗣️ 07 Explain

Explain Attention Simulator in plain language using an analogy. Could a non-expert follow it?

🔨 08 Build

Build a small project or demo that uses Attention Simulator as a core component.

← PREDICT → Better output
🧪
RASL Pull · S-04 Pulled because: state_tracker.py needs to weight recent failed actions
🔨 M-05 attention.py 🔁 attention pattern → state_tracker weighting → return to agent/state_tracker.py 📋 full plan →
↑ All subtopics in Attention
This page 0:00
This session 0:00
Total (all pages) 0:00
Today 0:00
▶ Running
📊 View all study stats →
0:00 studying