C.W.K.
Stream
Lesson 03 of 05 · published

Attention Sinks and Sticky Starts

~24 min · attention-sinks, system-prompt, prefix

Level 0Window Watcher
0 XP0/50 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

The beginning is weirdly powerful

Research on attention sinks (Xiao et al. 2023, Efficient Streaming Language Models with Attention Sinks) shows that the first few tokens of a sequence can receive disproportionate attention even when they carry no semantic relevance. Softmax attention forces probabilities to sum to 1; when no other token is particularly relevant, the model dumps that mass on the first few tokens, which become information-free anchors.

Why this matters in practice

The system prompt's position matters as much as its content. The first tokens carry outsized weight; use them deliberately. A clean system prompt and stable project rules benefit from the prefix. A noisy timestamp, random banner, or stale rule at the top can also become sticky — the model keeps half-attending to the wrong thing.

Protect the prefix

The prefix should contain durable rules and stable structure. Put variable, per-turn noise later. This improves both attention behavior and prompt caching — and the two effects reinforce each other.

The start of the context is valuable real estate. Do not rent it to noise.

Code

Prefix hygiene·yaml
prefix:
  keep:
    - durable instructions
    - tool schemas
    - stable examples
  avoid:
    - timestamps
    - request ids
    - stale TODOs
    - random server banners
    - rotating welcome messages
Bad vs good first 200 tokens·markdown
BAD (cache-busting + sink-poisoning):
  Request 7e3a-2026-05-03T19:56:04Z processed by node-12.
  Welcome back, user! Session started 4321ms ago.
  Today is Saturday. Random tip: be careful.
  ...rules below...

GOOD (stable, sink-friendly):
  You are an AI assistant for the cwkPippa project.
  Always use the existing dev server. Do not run git push.
  Tool schemas:
  ...stable rules continue...

External links

Exercise

Audit a system prompt or project instruction file. Identify one thing that belongs at the top and one thing that should move out. Move it. Re-test.
Hint
Stable policy goes high. Volatile status belongs lower or in a separate handoff message.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.