Week 09 · lesson
Lab: Compare Attention Allocations
Mission
Run the local Attention Allocation Lab. Apply two queries to the same three keys, reproduce softmax normalization, and export an Attention Allocation Record.
Guided start
- Select
Object query [1,0]and run attention. - Confirm that
robothas the largest weight. - Verify that all three weights sum to
1.000after displayed rounding. - Switch only the query to
Action query [0,1]. - Explain why
safelynow receives the largest weight.
Procedure
- Preserve the fixed keys and both query vectors.
- Predict the top-weighted token for each query.
- Run both calculations and preserve every dot product and exponential term.
- Verify normalization from the displayed denominator.
- Compare the allocations without inventing meanings for vector dimensions.
- Preserve your first explanation claim and write a bounded correction.
- Complete Observation, Measurement, Decision, and Limitation.
- Export the record and confirm it names
ai-for-beginners-attention-allocation-lab.
Success criteria and boundary
- both queries and all keys remain visible;
- each weight can be reproduced from its score and denominator;
- the displayed weights sum to 1 within rounding;
- the comparison changes only the query; and
- the limitation rejects probability, causal explanation, training, safety, and whole-model-performance claims.
Use only supplied vectors. The Lab contacts no transformer or external service.
Robotnix Lab · contract v1
Attention Allocation Lab
Calculate single-head attention weights under two queries and bound claims about transformer explanations.
Help and boundaries
A deterministic browser simulation uses invented two-dimensional vectors and contacts no model or service.
No personal data, private prompts, or API keys. This Lab makes no hidden remote writes and does not persist your work after the page session.
No result generates external text, inspects a live model, or authorizes action.
Lab draft is active for this page session only.
Objectives
- Calculate query-key dot products and softmax weights.
- Compare allocations while changing only the query.
- Separate attention allocation from probability, causal explanation, reasoning, and safety.
Procedure
Workbench
Calculate the allocation before interpreting attention.
Select a supplied query and run the deterministic attention calculation.
Boundary: These invented vectors simulate one simplified head. A weight is not a calibrated probability, causal explanation, proof of reasoning, safety judgment, or evidence about a trained transformer.
Text and static fallback
Every query, key, score, exponential term, denominator, weight, sum, and boundary appears in accessible text and tables.
Object query: robot about 0.425; action query: safely about 0.514; each unrounded allocation sums to one.
Evidence record
Record only the evidence requested. Do not enter names, personal information, private prompts, or credentials. This draft stays in memory only unless you explicitly export it.
Success criteria
- Both queries, all keys, and the teaching boundary are explicit.
- Every weight is reproducible from displayed operands.
- The correction follows supplied allocation evidence only.
- The limitation rejects unsupported probability, explanation, reasoning, safety, and performance claims.
Complete every procedure step and required evidence field before export.
Vocabulary lab
Flip the idea, not just the card
Explain the term before you reveal the back. Then compare your explanation with the definition, example, and warning.
Read all terms without animation
- dot-product score
- The sum of matching query-key component products. Example: Object dot robot equals 0.9. Do not confuse it with: It is unnormalized before softmax.
- attention weight
- A normalized allocation assigned to one position for one query and head. Example: Robot receives about 0.425 under the object query. Do not confuse it with: It is not a complete causal explanation.
- attention head
- One set of query, key, and value projections producing an attention result. Example: The Lab simulates one simplified head. Do not confuse it with: Real transformers commonly use multiple heads.
- normalization denominator
- The sum of all exponentiated scores used by softmax. Example: The object-query denominator is about 5.790. Do not confuse it with: It depends on every candidate position.
- Attention Allocation Record
- Evidence preserving vectors, calculations, comparison, claim repair, and limitation. Example: The Lab export. Do not confuse it with: It is not evidence from a trained transformer.