<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Attention on SciDraft | A Hugo Theme</title><link>https://www.zhumengyao.com/scidraft/tags/attention/</link><description>Recent content in Attention on SciDraft | A Hugo Theme</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 22 Sep 2026 07:10:00 +0900</lastBuildDate><atom:link href="https://www.zhumengyao.com/scidraft/tags/attention/index.xml" rel="self" type="application/rss+xml"/><item><title>Causal Multi-Head Attention in Python (intermediate)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-causal-attention-python/</link><pubDate>Tue, 22 Sep 2026 07:10:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-causal-attention-python/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Attention is the one place in a transformer where tokens exchange information:
every other block — the projections, the activations, the normalisations —
treats positions independently. That makes attention mostly shape bookkeeping,
and the shapes alone decide which products are legal.&lt;/p&gt;</description></item><item><title>Attention with Two Tokens (example)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-example-attention-two-tokens/</link><pubDate>Tue, 22 Sep 2026 07:05:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-example-attention-two-tokens/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;The smallest interesting attention example has two positions and one head, which is
enough for a full calculation with no matrix product larger than two by two.&lt;/p&gt;
&lt;p&gt;Working it at this size makes the two roles visible: the score decides how much the output
at position two borrows from position one, and the value vectors set what is borrowed. With
a causal mask, the first row has nothing to attend to but itself.&lt;/p&gt;</description></item><item><title>Attention Mechanism: Pseudocode</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-attention-pseudocode/</link><pubDate>Mon, 21 Sep 2026 15:32:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-attention-pseudocode/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Attention lets a model decide, for each position it is processing, which
other positions to draw information from. This note states the &lt;strong&gt;scaled
dot-product&lt;/strong&gt; form as an algorithm rather than as an equation, so the
sequence of operations — and the shape of each intermediate result — is
explicit.&lt;/p&gt;</description></item><item><title>Masked Softmax Attention (algorithm)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-algorithm-masked-attention/</link><pubDate>Mon, 21 Sep 2026 14:52:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-algorithm-masked-attention/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;An algorithm is a procedure with a specification, and this one says how the attention
definition is executed on a machine: scale the scores, remove the positions that are not
allowed, normalise and mix.&lt;/p&gt;</description></item><item><title>The KV Cache Is Exact (claim)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-claim-kv-cache-exact/</link><pubDate>Mon, 21 Sep 2026 14:22:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-claim-kv-cache-exact/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Caching keys and values is standard practice, and the claim that justifies it is strong:
incremental decoding gives exactly the same outputs as recomputing attention over the whole
sequence, not an approximation of them.&lt;/p&gt;</description></item><item><title>Attention Variants by Cost and Cache (quadrant chart)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-mermaid-quadrant-attention/</link><pubDate>Mon, 21 Sep 2026 14:21:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-mermaid-quadrant-attention/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Choosing an attention variant is a two-constraint problem rather than a ranking:
the score cost decides how long a sequence can be trained on, and the per-token
cache decides how long a sequence can be served, and the two orderings of the
variants are not the same.&lt;/p&gt;</description></item><item><title>Attention Entropy Falls with Depth (observation)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-observation-attention-entropy/</link><pubDate>Mon, 21 Sep 2026 11:02:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-observation-attention-entropy/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Entropy is a convenient scalar summary of an attention row, and the observation reported
here is that its average falls as one moves up the layers: early heads spread their weight
widely, later heads concentrate it.&lt;/p&gt;</description></item><item><title>Attention Outputs Are Convex Combinations (proposition)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-proposition-attention-convex/</link><pubDate>Mon, 21 Sep 2026 10:22:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-proposition-attention-convex/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Attention is often drawn as a lookup, and the proposition below says what kind of lookup
it is: a convex combination of the value vectors, with weights that are non-negative and
sum to one because they came out of a softmax.&lt;/p&gt;</description></item><item><title>Proof: Attention Outputs Lie in the Convex Hull (proof)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-proof-attention-convex/</link><pubDate>Mon, 21 Sep 2026 09:52:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-proof-attention-convex/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;The statement that attention outputs are convex combinations follows from two facts
about the softmax and one line of the triangle inequality, and the proof shows exactly
where each is used.&lt;/p&gt;</description></item><item><title>Families of Attention (mindmap)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-mermaid-mindmap-attention/</link><pubDate>Mon, 21 Sep 2026 09:44:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-mermaid-mindmap-attention/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;The variants of attention that appear in long-context work are easier to keep
apart by what they replace than by their names: each one gives up the full score
matrix and puts something else in its place, and the something else is what the
family is called.&lt;/p&gt;</description></item><item><title>Scaled Dot-Product Attention (definition)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-definition-attention/</link><pubDate>Mon, 21 Sep 2026 09:12:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-definition-attention/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Definitions in this subject fix notation rather than prove anything, and attention is
the clearest case: three projections, one score matrix, one weighted average. Every
implementation, diagram and proof in the rest of the literature is written against this
one paragraph of notation.&lt;/p&gt;</description></item><item><title>Attention Variants for Long Contexts (striped table)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-attention-variants-table/</link><pubDate>Mon, 21 Sep 2026 07:32:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-attention-variants-table/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Long-context attention is usually chosen on cost rather than on quality. What
decides whether a variant is usable at a given sequence length is how the score
cost and the per-token cache grow with \(T\), and both are easiest to compare
side by side in one table rather than across several paragraphs.&lt;/p&gt;</description></item><item><title>Notation for Multi-Head Attention (academic table)</title><link>https://www.zhumengyao.com/scidraft/notes/demo-note-attention-notation-table/</link><pubDate>Mon, 21 Sep 2026 07:12:00 +0900</pubDate><guid>https://www.zhumengyao.com/scidraft/notes/demo-note-attention-notation-table/</guid><description>&lt;p&gt;&lt;strong&gt;Demo note.&lt;/strong&gt; This note demonstrates what the &lt;strong&gt;SciDraft&lt;/strong&gt; Hugo theme can do
for academic and scientific publishing — for research institutions, researchers
and students. Its content is demonstration material only: readers should ignore
whether the demo content is correct.&lt;/p&gt;
&lt;p&gt;Multi-head attention reads better as shape bookkeeping than as prose: every
symbol below is a tensor, and the shapes alone decide which products are legal,
which is why papers about attention variants usually open with a notation table
before showing a single result.&lt;/p&gt;</description></item></channel></rss>