Large Language Models

LLM Attention: How Words Look at Words

Visualize self-attention as beams of light between tokens and feel how softmax(QKᵀ/√dk) decides which word "it" is looking at.

Prologue · 1/5

ことばの星座

7つの語が光の弧として浮かんでいます。視点が語から語へ移るたび、その語が文中のどこを「見ている」かが光の束として現れます。まずは流れを眺めて、語ごとに光の形が変わることを確かめてください。

スイープを眺めて、光が集中する語と散らばる語の違いを見つける。

softmax(QKᵀ/ √dk+ mask)·V
Attention weightsitcat 96%
The1%
cat96%
sat1%
because1%
it3%
was
tired
LLM Attention: How Words Look at Words - Luneidea