Contents
  1. Token identities and contextual representations
  2. Queries, keys, values and information mixing
  3. Visibility and attention masks
  4. Order and positional information
  5. Multiple heads and residual blocks
  6. Encoders, decoders and cross-attention
  7. Vocabulary readout and autoregressive generation
  8. Shifted targets and parallel sequence training
  9. Connectivity, computational work and storage
  10. Context access and demonstrated behavior
  11. Check understanding
  12. Open questions
  13. Selected talks
  14. References
  15. Talk library
← All topics

Transformers and Attention

A transformer builds representations whose contents depend on other visible positions in a sequence. Attention determines how information moves between positions; feature transformations revise what each position represents. A language model adds vocabulary prediction and repeated token selection. Understanding these separate operations explains both the architecture’s flexibility and the limits of what access to context can accomplish.

Token identities and contextual representations

A forward pass applies the model’s operations once: token IDs become vectors, transformer blocks update them, and an output head converts the resulting representations into task scores. A contextual representation is a vector influenced by other visible positions. Text generation adds a surrounding selection-and-repeat process.

A token occurrence is a vocabulary ID at a sequence position; Tokenization explains how text becomes these IDs. An embedding table stores one learned vector—a list of numerical coordinates—per vocabulary entry. The ID selects a row. Its magnitude does not measure meaning.

From IDs to task scores

Representations change before the output head scores a task.

A GPT-style forward pass maps IDs to positioned vectors, updates them through blocks, and produces vocabulary scores. Token selection happens afterward.
Read the diagram as text
  • Token IDs.
  • Token + position vectors.
  • Transformer blocks.
  • Final normalization + head.
  • Vocabulary scores.
  • Token IDsToken + position vectors: lookup + position.
  • Token + position vectorsTransformer blocks: sequence states.
  • Transformer blocksFinal normalization + head: contextual states.
  • Final normalization + headVocabulary scores: projection.
ObjectShapeMeaning
Embedding table EU × dU vocabulary entries, each with d coordinates.
Input IDsNN occurrences, including possible repetitions.
Sequence matrix XN × dStacked lookup vectors; d is the model width.

Repeated IDs select the same initial row. Position and surrounding tokens can then produce different hidden states: the intermediate vectors carried through the model. These coordinates need not have individually named human meanings. Broader questions about representation geometry belong in Embeddings and Representation Learning.

Parameters are fitted numerical values; activations are representations computed for the current input. Ordinary inference changes activations without updating parameters. Changing a prompt can therefore change behavior without teaching the checkpoint new weights. Training, fitted state, and inference develops this distinction.

Queries, keys, values and information mixing

Attention forms an input-dependent weighted mixture. A destination’s query scores candidate sources; each source’s key supplies matching features, and its value supplies contributed information. Several sources can contribute simultaneously. The output combines numerical vectors, not token IDs or copied text fragments. These roles are formalized in attention pooling.

Q=XWQ,K=XWK,V=XWV.Q=XW_Q,\qquad K=XW_K,\qquad V=XW_V. Learned projections recombine features: WQ,WKRd×dkW_Q,W_K\in\mathbb{R}^{d\times d_k}, WVRd×dvW_V\in\mathbb{R}^{d\times d_v}. Q, K and V vary with X; projection parameters stay fixed.

Addressing and contributed content

Keys determine weights; values supply the mixture.

Query–key comparisons determine normalized weights. Values enter separately, weighted by those coefficients.
Read the diagram as text
  • Query.
  • Source keys.
  • Source values.
  • Compatibility scores.
  • Normalized weights.
  • Mixed output vector.
  • QueryCompatibility scores: compare.
  • Source keysCompatibility scores: compare.
  • Compatibility scoresNormalized weights: normalize.
  • Normalized weightsMixed output vector: coefficients.
  • Source valuesMixed output vector: weighted sum.
QuantitySingle-head self-attention shape
Queries Q; keys KN × d_k each
Values VN × d_v
Scores; weights AN × N each
Output ON × d_v

qikj=rqirkjrq_i\cdot k_j=\sum_r q_{ir}k_{jr} sums coordinatewise products: destination i scores source j. Dividing by dk\sqrt{d_k} moderates score growth with key width.

S=QKT/dk+M,A=softmaxsources(S),O=AV.S=QK^{\mathsf T}/\sqrt{d_k}+M,\qquad A=\operatorname{softmax}_{\text{sources}}(S),\qquad O=AV. M restricts visibility.

Softmax exponentiates scores and divides by their row sum, producing nonnegative weights totaling one. Subtracting the row maximum before exponentiation preserves the result while reducing overflow risk. Normalization couples the source scores; attention cannot generally be rearranged into a simple product that bypasses that operation.

For a constructed example, scaled scores [0, 0] give weights [0.5, 0.5]. Values [2, 0] and [0, 4] therefore produce [1, 2]. The result is a mixed value vector, not a vocabulary distribution.

Visibility and attention masks

An attention mask restricts permitted destination–source pairs. A causal mask permits the current input position and earlier positions, excluding later ones. Including the diagonal is correct: the state at position i predicts the token at i+1. Bidirectional attention permits information from both directions.

Padding inserts artificial entries to batch unequal sequence lengths. Excluding padding sources and excluding future sources solve different problems. Teacher forcing, used during training, supplies recorded predecessors rather than generated choices; padding is not one of those meaningful predecessors.

Visibility

Example

Masks restrict access.

Unrestricted

All sources visible.

Scroll sideways if the figure extends beyond the screen.

-0.50.51.52.53.5-0.50.51.52.53.5Source (index)Destination (index)Allowed
  • 1. Allowed
Read coordinates and regions as data

X: -0.53.5 index; Y: -0.53.5 index, increasing down. Equal scale on both axes.

Allowed (points)

(0, 0); (1, 0); (2, 0); (3, 0); (0, 1); (1, 1); (2, 1); (3, 1); (0, 2); (1, 2); (2, 2); (3, 2); (0, 3); (1, 3); (2, 3); (3, 3)

Causal

Current/earlier sources visible.

Scroll sideways if the figure extends beyond the screen.

-0.50.51.52.53.5-0.50.51.52.53.5Source (index)Destination (index)Allowed
  • 1. Allowed
Read coordinates and regions as data

X: -0.53.5 index; Y: -0.53.5 index, increasing down. Equal scale on both axes.

Allowed (points)

(0, 0); (0, 1); (1, 1); (0, 2); (1, 2); (2, 2); (0, 3); (1, 3); (2, 3); (3, 3)

Causal + padding

Source 3 padded and excluded; query 3 active.

Scroll sideways if the figure extends beyond the screen.

-0.50.51.52.53.5-0.50.51.52.53.5Source (index)Destination (index)Allowed
  • 1. Allowed
Read coordinates and regions as data

X: -0.53.5 index; Y: -0.53.5 index, increasing down. Equal scale on both axes.

Allowed (points)

(0, 0); (0, 1); (1, 1); (0, 2); (1, 2); (2, 2); (0, 3); (1, 3); (2, 3)

Dots permit access; blanks forbid it.
RestrictionAllowed informationPurpose
Causal visibilityCurrent and preceding inputsPrevent future-target access.
Padding exclusionReal source entriesExclude artificial batching content.
Packed-sequence isolationSources from the same original sequenceKeep concatenated examples independent.

In the SDPA convention, Boolean True means allowed. Forbidden scores become negative infinity before softmax. Every illustrated query has an allowed source. Excluding the example’s second source changes its output to [2, 0].

A normalized row can still leak future information if the wrong entries remain visible. Removing a future token’s loss does not remove it from attention. Causality here describes prediction-time access; it establishes neither factual correctness nor a causal effect in the statistical sense.

Order and positional information

Unrestricted self-attention without positional signals is permutation-equivariant: rearranging input rows rearranges the corresponding output rows. If [A, B, C] becomes [C, A, B], the outputs follow that rearrangement. This differs from invariance, where the output stays unchanged. A fixed causal mask breaks this unrestricted symmetry by changing which sources each row can access.

MechanismWhere position entersRepresentation
Learned absolute positionsAdded to token statesA learned vector indexed by sequence position.
Sinusoidal positionsAdded to token statesFixed sine/cosine signals at different frequencies.
Relative position biasAdded to attention scoresA learned scalar selected by source–destination offset; T5 groups offsets into buckets.
Rotary position embeddings, or RoPEApplied to projected queries and keysPosition-dependent rotations of coordinate pairs make dot products depend on relative displacement.

A common positional shift

Example

Relative orientation survives a common rotation.

Before

Q points right; K points upward and right.

Scroll sideways if the figure extends beyond the screen.

-1.3-0.6500.651.3-1.3-0.6500.651.3Coordinate 1 (dimensionless)Coordinate 2 (dimensionless)Query QKey K
  • 1. Query Q
  • 2. Key K
Read coordinates and regions as data

X: -1.31.3 dimensionless; Y: -1.31.3 dimensionless, increasing up. Equal scale on both axes.

Query Q (polyline)

(0, 0); (1, 0)

Key K (polyline)

(0, 0); (0.6, 0.8)

Both positions shifted

Both arrows turn counterclockwise together, preserving their separation angle.

Scroll sideways if the figure extends beyond the screen.

-1.3-0.6500.651.3-1.3-0.6500.651.3Coordinate 1 (dimensionless)Coordinate 2 (dimensionless)Query QKey K
  • 1. Query Q
  • 2. Key K
Read coordinates and regions as data

X: -1.31.3 dimensionless; Y: -1.31.3 dimensionless, increasing up. Equal scale on both axes.

Query Q (polyline)

(0, 0); (0, 1)

Key K (polyline)

(0, 0); (-0.8, 0.6)

One unit-length coordinate pair rotates by 90°: Q·K remains 0.6. Different pairs can have different rotation rates. This geometric property does not guarantee length extrapolation.

A relative offset is the difference between two position indices. T5’s bias assigns some offsets the same bucket, deliberately sharing their positional contribution. RoPE changes vector directions instead. Neither mechanism should be confused with deciding whether a source is visible.

Multiple heads and residual blocks

Each attention head learns separate projections. H mixtures N×dvN\times d_v concatenate to N×(Hdv)N\times(Hd_v); a learned (Hdv)×d(Hd_v)\times d output projection restores model width.

Multiple heads permit different mixtures, but do not guarantee indispensable specialists. Ablation studies removed many heads with little change on their tested tasks, while some encoder–decoder layers relied more strongly on multiple heads. Removing heads after training also differs from training a smaller-head model.

Pre-normalization residual paths

Normalization changes branch inputs, not the identity path.

Attention and FFN contributions join the accumulated state through separate additions. Both branches execute.
Read the diagram as text
  • Input x.
  • LayerNorm.
  • Multi-head attention.
  • Add → u.
  • LayerNorm.
  • Position-wise FFN.
  • Add → y.
  • Input xLayerNorm: branch.
  • LayerNormMulti-head attention: normalized.
  • Multi-head attentionAdd → u: contribution.
  • Input xAdd → u: identity.
  • Add → uLayerNorm: branch.
  • LayerNormPosition-wise FFN: normalized.
  • Position-wise FFNAdd → y: contribution.
  • Add → uAdd → y: identity.
y=x+F(x).y=x+F(x). A residual connection adds a transformed branch F(x) to its input x. Matching shapes permit elementwise addition.

The residual connection provides an identity path, letting the branch learn a correction rather than the complete mapping. This supports optimization; it does not guarantee later recovery of every input detail. Both paths still participate in computation.

A pre-normalization block uses u=x+Attention(LayerNorm(x)),u=x+\operatorname{Attention}(\operatorname{LayerNorm}(x)), y=u+FFN(LayerNorm(u)).y=u+\operatorname{FFN}(\operatorname{LayerNorm}(u)). The residual states x, u and y retain shape N × d.
OperationRole
LayerNormCenters and rescales coordinates within each token vector, then applies learned scale and bias.
RMSNormRescales using the square root of the mean squared coordinate, with learned gains but no mean subtraction.
Position-wise FFN / MLPApplies learned feature transformations and a nonlinearity separately at each position.

The feed-forward network, also called a multilayer perceptron or MLP, commonly expands width and projects back: ddffdd\rightarrow d_{\mathrm{ff}}\rightarrow d. Affine transformations—weighted combinations plus biases—surround a nonlinearity. Parameters are shared across positions. Attention mixes positions; this network transforms features within each position.

Pre-normalization normalizes branch inputs; post-normalization normalizes after residual addition. Neither arrangement defines every transformer. Stacked blocks repeat the operation pattern with their own learned parameters, progressively revising the sequence’s representations.

Encoders, decoders and cross-attention

An encoder builds representations of a supplied input. A causal decoder builds representations suitable for predicting a continuation. Conditioning means making predictions depend on supplied information. A decoder-only language model consumes its prompt directly; it does not require a separate source encoder.

StructureInformation pathOutput role
Encoder-onlyBidirectional input representationsAn attached head can produce vectors or task scores.
Decoder-onlyCausal attention over prompt and continuationNext-token prediction without a separate source encoder.
Encoder–decoderEncoded source conditions a causal target sequenceSource-conditioned generation.

Two sequences, separate roles

Cross-attention updates destinations using source information.

Original Transformer decoder order; residual and normalization paths omitted.
Read the diagram as text
  • Encoded source.
  • Target states.
  • Masked self-attention.
  • Cross-attention.
  • FFN.
  • Target statesMasked self-attention: target data.
  • Masked self-attentionCross-attention: derive Q.
  • Encoded sourceCross-attention: derive K, V.
  • Cross-attentionFFN: updated targets.

Cross-attention uses destination queries and separate-source keys/values. L destinations and S sources yield L×SL\times S weights and L×dvL\times d_v outputs; two targets can attend to five sources.

The input need not be text. A vision transformer projects image patches into token vectors and attaches a classification head. Its transformer produces representations; the input representation and output head determine the task. Architectural decoding is likewise separate from a tokenizer’s conversion of IDs back into text.

Vocabulary readout and autoregressive generation

A language-model head projects a final contextual vector into one logit, or unnormalized score, per vocabulary entry. Final normalization precedes this projection in the illustrated GPT-style architecture. The last input position supplies the distribution for continuing the prefix; the hidden vector itself is not a selected token.

z=hWU,pj=ezjv=1Uezv.z=hW_U,\qquad p_j=\frac{e^{z_j}}{\sum_{v=1}^{U}e^{z_v}}. Here h has width d, the vocabulary projection W_U has shape d × U, and p_j is the probability assigned to vocabulary entry j.

Selected IDs extend the prefix

Example

The next distribution depends on the preceding selection.

1 / 4 · Predict

Compute from [A].

A, B and C denote token IDs. Each selected ID enters the next prefix; model parameters remain fixed.
Read the diagram as text
  • Fixed model.
  • Prefix [A].
  • Distribution after [A].
  • Selected ID B.
  • Prefix [A, B].
  • Distribution after [A, B].
  • Selected ID C.
  • Prefix [A, B, C].
  • Fixed modelDistribution after [A]: parameters.
  • Prefix [A]Distribution after [A]: condition.
  • Distribution after [A]Selected ID B: select.
  • Prefix [A]Prefix [A, B]: retain.
  • Selected ID BPrefix [A, B]: append.
  • Fixed modelDistribution after [A, B]: parameters.
  • Prefix [A, B]Distribution after [A, B]: condition.
  • Distribution after [A, B]Selected ID C: select.
  • Prefix [A, B]Prefix [A, B, C]: retain.
  • Selected ID CPrefix [A, B, C]: append.
  1. Predict. Compute from [A]. Active: Fixed model, Prefix [A], Distribution after [A]. New: Fixed model, Prefix [A], Distribution after [A].
  2. Extend. Select B and append it. Active: Fixed model, Prefix [A], Distribution after [A], Selected ID B, Prefix [A, B]. New: Selected ID B, Prefix [A, B].
  3. Predict again. The new prefix conditions another distribution. Active: Fixed model, Prefix [A], Distribution after [A], Selected ID B, Prefix [A, B], Distribution after [A, B]. New: Distribution after [A, B].
  4. Extend again. Select C; retain the earlier prefix. Active: Fixed model, Prefix [A], Distribution after [A], Selected ID B, Prefix [A, B], Distribution after [A, B], Selected ID C, Prefix [A, B, C]. New: Selected ID C, Prefix [A, B, C].
NormalizationAxisResult used for
Attention softmaxVisible source positionsMixing value vectors.
Vocabulary softmaxVocabulary entriesSelecting the next token.

Autoregressive generation predicts from the available prefix, selects a token, appends its ID, and predicts again. Later predictions depend on earlier selections. The model’s parameters remain fixed; the sequence and its computed representations change. One forward pass and a complete response are therefore different units of work.

Greedy selection chooses a highest-scoring token; sampling permits alternatives according to a selection distribution. The choice changes subsequent prefixes. LLM Inference covers sampling controls; Decoding and text preservation explains the separate task of reconstructing text from IDs.

  • Model-associated endingAn end-of-sequence token, or EOS, can signal termination when configured as a stopping token.
  • External endingA length limit, stop string or other stopping criterion can end generation. A length cutoff may return an incomplete answer; an output budget is an upper bound, not a completion guarantee.

Shifted targets and parallel sequence training

A training target states what should be predicted; loss measures prediction error, as explained in Supervision, baselines, and loss. For next-token training, each position’s target is the following recorded token. Cross-entropy penalizes assigning that target insufficient probability.

Recorded sequence: [A, B, C, D].
Input positionInput IDVisible prefixTarget ID
0AAB
1BA BC
2CA B CD

Known inputs, restricted dependencies

Example

Recorded inputs can be available together without revealing targets.

Arrows show permitted prefix dependencies across the causal stack, not target inputs. B is unavailable to the prediction at A.
Read the diagram as text
  • Recorded A.
  • Recorded B.
  • Recorded C.
  • Prediction targeting B.
  • Prediction targeting C.
  • Prediction targeting D.
  • Recorded APrediction targeting B: visible.
  • Recorded APrediction targeting C: visible.
  • Recorded BPrediction targeting C: visible.
  • Recorded APrediction targeting D: visible.
  • Recorded BPrediction targeting D: visible.
  • Recorded CPrediction targeting D: visible.

Teacher forcing uses recorded predecessors as decoder inputs. The prediction for C receives recorded B even if the model’s prediction for B was wrong. Generation instead feeds back its own selections. The causal mask, rather than the data loader alone, prevents a training prediction from accessing its answer.

Known inputs let positions be processed together within a layer; successive layers still depend on preceding layers. Generation cannot ordinarily select all future inputs together because those inputs depend on earlier choices. Parallel position evaluation is compatible with causal visibility.

  • Visibility controls informationAttention masking determines which inputs can influence a prediction.
  • Loss eligibility controls supervisionInstruction tuning can keep a prompt visible while training only against response tokens. Omitting prompt losses does not hide the prompt.
  • Learning changes shared transformationsTraining adjusts embeddings, attention projections and other fitted components. Their outputs still depend on each input. Corpus choices and training schedules belong in Pretraining and Midtraining.

Connectivity, computational work and storage

N queries×N keys=N2 pairs;(2N)2=4N2.N\text{ queries}\times N\text{ keys}=N^2\text{ pairs};\qquad (2N)^2=4N^2. At fixed head widths, doubling sequence length roughly quadruples dense pairwise attention arithmetic. This is not a total-runtime prediction.

A conceptual N × N score matrix need not be stored in full. FlashAttention preserves dense attention while reducing additional storage, retaining quadratic pairwise arithmetic. Floating-point results can differ slightly. Avoiding materialization changes execution; removing source connections changes the attention operation.

Local mixing, later global communication

Example

Restricted layers can communicate through a later global layer.

Two disjoint local regions produce separate representations. A subsequent global attention stage can combine both. Edges show available paths, not measured influence.
Read the diagram as text
  • Region A inputs.
  • Region B inputs.
  • Region A local states.
  • Region B local states.
  • Later global attention.
  • Updated sequence states.
  • Region A inputsRegion A local states: local mixing.
  • Region B inputsRegion B local states: local mixing.
  • Region A local statesLater global attention: region A data.
  • Region B local statesLater global attention: region B data.
  • Later global attentionUpdated sequence states: global mixing.
Design choiceWhat changesWhat remains
Avoid full attention-matrix storageIntermediate storageDense source connectivity and quadratic pairwise work.
Local attention windowsDirect source connectivityDistant information needs other paths, such as later shifted windows.
More layersRepeated representation transformationsEach layer still carries its own computation and parameters.
Longer sequencesAttention and non-attention allocationsMLPs and loss calculations can also create large buffers.

Local attention limits nearby mixing; periodic global layers reconnect distant regions. ModernBERT illustrates this combination. Such a pattern can reduce local-layer work while preserving later communication, but a possible multi-layer path does not establish that the model will use it successfully.

Tokenwise projections and MLPs process each position, with work also depending on feature widths. Dense pair count captures only one component. In vision, doubling both image dimensions at fixed patch size yields four times as many patches and sixteen times as many pairs, without implying sixteen times the total latency.

  • Reuse preserves earlier causal workWith unchanged prefix, model and compatible position/mask state, appended tokens cannot change earlier causal representations. A KV cache retains their derived keys and values. Processing a newly selected token computes its own Q, K and V; the selected ID is not itself a cached vector.
  • Reuse does not remove history accessOrdinary full-context decoding still attends over retained history. Cache layout, prompt processing and serving measurements belong in LLM Inference.
  • Checkpoint fidelity constrains substitutionsA replacement computation must match the behavior expected by the fitted checkpoint. A locally attractive numerical change can interact with other differences; reference agreement matters when reproducing a model.

Context access and demonstrated behavior

ClaimWhat establishes itRemaining limitation
The request fitsThe configured model and runtime accept its sequence length.Allocating more cache slots does not extend positional support.
The model encountered these positions during learningIts training configuration and examples.Training-length exposure differs from reliable extrapolation beyond that range.
The model uses distant informationTask performance at specified lengths, positions and difficulty.Effective context depends on the task, scoring rule and acceptance threshold.

A controlled evidence-position test moves the same answer-bearing passage while keeping the desired answer fixed. Vary distractors and length separately. Historical studies found position-sensitive performance in several tested models; this motivates measurement, not a universal beginning-or-end placement rule. Failure analysis and competing explanations covers how to distinguish possible causes.

Simple retrieval can succeed while aggregation or multi-step tracing deteriorates. RULER explicitly separates these task demands. A successful needle-in-a-haystack test—finding one requested item among distractors—therefore supports a narrower claim than reliable reasoning across the entire accepted context.

  • ParametersFitted transformations stored in the checkpoint.
  • Current representationsActivations computed from the present input. Context Engineering concerns what information enters that computation.
  • Persistent recordsApplication history stored outside the invocation. A session log can supply selected slices later; persistence alone does not place every record in current context. Agent Memory develops that lifecycle.

An attention map shows one set of mixing coefficients, not the complete explanation of an answer. Value vectors determine what those coefficients combine. Different weight patterns can sometimes produce the same mixture because their differences cancel against the values. Other heads, residual paths and later transformations further separate one map from final behavior.

A high next-token probability does not establish factual support. If an incorrect token is selected, it joins the prefix and can influence later predictions. Fluent continuation and supported answers require different evidence.

Open questions

  1. Separating positional design from training exposure remains difficult when extending usable context. Both affect long-input behavior, while task difficulty can hide regressions. Progress requires matched training conditions and tests spanning short inputs, distant evidence, distractors and multi-step use—not acceptance of longer sequences alone.

  2. Determining necessary head diversity remains task-dependent. Redundant heads and non-unique attention mixtures complicate explanations of individual roles. Progress would identify interventions whose effects reproduce across prompts and tasks while distinguishing post-training pruning from training fewer heads initially.

  3. Choosing restricted connectivity that preserves distant reasoning remains an architectural tradeoff. Shifted windows create indirect paths, but path existence does not establish useful information transfer. Progress would demonstrate matched-budget accuracy across local tasks and tasks requiring several distant pieces of evidence.

Follow the curated reading path through the speakers and demonstrations behind this entry.

172 min

AI Engineer World's Fair 2024 · 2024

Low Level Technicals of LLMs

Daniel Han

Cited in this entry

Numerical normalization and checkpoint-reproduction discussions explain why mathematically plausible substitutions still require reference checks.

Watch talk

Explore more talks

The rest of the library, beyond the curated path. Cited talks support this entry; reviewed transcripts were processed in full. Metadata candidates have not been reviewed as sources or verified as topic members.

11 matching talks

TalkSpeakerEventYear
Ishan AnandAI Engineer World's Fair 20242024
Daniel HanAI Engineer World's Fair 20242024
Phoebe KlettAI Engineer World's Fair 20242024
Diego CarpenteroAI Engineer Europe 20262026
Filip MakraduliAI Engineer World's Fair 20252025
Mark MoyouAI Engineer World's Fair 20242024
Rémi LoufAI Engineer World's Fair 20242024
Devendra Chaplot, Devendra Singh ChaplotAI Engineer World's Fair 20242024
Nupur SharmaAI Engineer Europe 20262026
Leo PekelisAI Engineer World's Fair 20242024
Gagan Bhat, Isabella Kai HeAI Engineer World's Fair 20262026

References

Coverage and source review
Processed transcripts
16 processed in full · 5 in the curated path
Automated source review
Passed
Metadata candidates
0 unreviewed; not verified topic membership
Corpus version
1bd8e407b26a07b33815594e1b2db5f41827119a2b3cb6fbf240f9fc571fc767

Automated review checks source support; it is not publication approval.

A synthesis of selected conference talks and technical references. Citations link to the source material; they do not imply that every talk on this subject is included.

  1. PyTorch scaled_dot_product_attention

    Documented equivalent computation and tensor shapes, with dropout disabled and at least one allowed source per query. Example is arithmetic derived from the specification, not an executed result.

  2. RoFormer: Enhanced Transformer with Rotary Position Embedding

    Sections 3.1–3.2, equations 11–16; mechanism and plain-language definition of RoPE.

  3. Training an LLM from Scratch, Locally

    The workshop forward pass combines token and positional embeddings, processes transformer blocks and normalization, then produces LM-head logits and a training loss.

  4. How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

    Autoregressive generation repeatedly appends a predicted token to the input and predicts again.

  5. PyTorch Embedding

    Embedding definition, weight shape and input/output shape contract; ordinary lookup with max_norm unset.

  6. How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

    The demonstrated GPT-2 implementation obtains a token embedding by selecting the corresponding row of the learned model_wte matrix.

  7. How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

    Attention lets context influence token representations, while the demonstrated decoder attention matrix prevents influence from future positions.

  8. Optimizing LLMs for Speed and Memory

    Section 1, Lower Precision, especially weights versus input vectors; section on key-value caching. RAG mapping is an application inference.

  9. Attention Pooling by Similarity — Dive into Deep Learning

    Attention pooling mechanism; this source does not establish implementation-specific KV layout or serving costs.

  10. Attention Is All You Need

    Primary paper version 7, sections 3.1–3.5; embeddings, attention, residual paths, feed-forward layers, and vocabulary output.

  11. Attention Is All You Need: attention and token representations

    Sections 3.1, 3.2.1–3.2.3, and 3.4; equation 1 and decoder masking.

  12. Low Level Technicals of LLMs

    The discussion identifies row-maximum subtraction as a numerical safeguard and row-wise softmax normalization as an obstacle to directly rearranging attention matrix products.

  13. Spreadsheets-are-all-you-need: Decoding the Decoder LLM without de code

    The demonstrated attention head distributes attention over available earlier positions, with future positions excluded; some patterns are interpretable, but not every head has an obvious linguistic explanation.

  14. nanoGPT train.py

    get_batch; exact input-target alignment, with an illustrative symbolic sequence rather than actual tokenizer output.

  15. Transformers T5 documentation: Training

    Training section and tokenizer padding-token definition; historical versioned documentation used for stable terminology.

  16. Low Level Technicals of LLMs

    A causal decoder must predict from preceding tokens without access to future target information.

  17. $1 AI Guardrails: The Unreasonable Effectiveness of Finetuned ModernBERTs – Diego Carpentero

    Unpadding, sequence packing, and FlashAttention address different sources of overhead: meaningless padding work and expensive attention-memory traffic.

  18. Decoding Mistral AI's Large Language Models

    Instruction tuning uses prompt-response pairs and trains next-token prediction on the response while masking the prompt.

  19. Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks

    Sections 2.1 and 3.1, equations 6–8 and Property 1; supports the order explanation for unrestricted attention without positional signals.

  20. nanoGPT model.py

    CausalSelfAttention, MLP, Block, GPT.forward and GPT.generate; inspected upstream implementation, not locally executed.

  21. Attention Is All You Need

    Section 3.5; explicit sinusoidal construction and addition to embeddings.

  22. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer

    Section 2.1; relative position mechanism and the paper's specific bucket configuration.

  23. Are Sixteen Heads Really Better than One?

    Sections 3.1–3.3; test-time ablations on the paper's translation and MultiNLI configurations.

  24. Deep Residual Learning for Image Recognition

    Sections 3.1–3.2 and equations 1–2; authoritative definition and bounded optimization motivation.

  25. On Layer Normalization in the Transformer Architecture

    Section 3.1 and Table 1; explicit pre-LN versus post-LN computation and feature-wise normalization.

  26. Root Mean Square Layer Normalization

    Sections 3–4, especially equations 2–4; first-use distinction between LayerNorm and RMSNorm.

  27. Training an LLM from Scratch, Locally

    Each transformer block has its own weights, attention, normalization, and MLP, also called an FFN.

  28. Improving Language Understanding by Generative Pre-Training

    Primary paper sections 3.1 and 4.1, including equations and explicit decoder-only model specification.

  29. The Small Model Infrastructure Nobody Built (So We Did) — Filip Makraduli, Superlinked

    Supporting BERT, Qwen, and ModernBERT requires accounting for architecture-specific forward-pass behavior rather than assuming identical attention and position handling.

  30. The Small Model Infrastructure Nobody Built (So We Did) — Filip Makraduli, Superlinked

    Retrieval models have different output contracts: ColBERT emits multiple vectors, while cross encoders and rerankers can emit scores.

  31. Attention Is All You Need

    Sections 3.2.1–3.2.3; scaled dot-product equation 1 and multi-head construction.

  32. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale

    Sections 3.1–3.2 and Appendix A, equations 5–7; scaling counts are algebraic consequences.

  33. Spreadsheets-are-all-you-need: Decoding the Decoder LLM without de code

    The language head applies LayerNorm and an unembedding matrix to produce logits, then the spreadsheet selects the highest-ranked token for its temperature-zero output.

  34. How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

    The demonstrated language head scores vocabulary tokens using the token embedding matrix, then chooses the largest score for deterministic comparison with another GPT-2 implementation.

  35. Training an LLM from Scratch, Locally

    For the creative-text exercise, sample from token probabilities rather than always choosing the highest-scoring token, and use top-k to restrict the candidate set.

  36. Transformers GenerationConfig: stopping and output budgets

    GenerationConfig: output-length controls, generation strategy, special tokens; generate stopping_criteria.

  37. Training an LLM from Scratch, Locally

    The workshop trains a character-based Shakespeare model using sequences paired with targets shifted by one token.

  38. Low Level Technicals of LLMs

    Causal masked attention lets a shifted training sequence represent prefix-conditioned predictions while preventing access to future tokens.

  39. How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

    Learning extends beyond MLP weights and biases to embeddings, attention parameters, and normalization parameters.

  40. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness

    Sections 2.2–3.1 and Theorem 1; only the distinction between pairwise work and materialized storage.

  41. How Transformers Finally Ate Vision

    Swin restricts attention to local windows, then shifts those windows between layers to enable interactions across prior window boundaries.

  42. How LLMs work for Web Devs: GPT in 600 lines of Vanilla JS

    GPT-2 Small repeats the same block operations twelve times, but each block has its own parameters.

  43. Road to 5 Million Tokens: Breaking Barriers in Long Context Training — Max Ryabinin, Together AI

    Loss and MLP computations can require large sequence-length buffers even after attention memory is reduced.

  44. $1 AI Guardrails: The Unreasonable Effectiveness of Finetuned ModernBERTs – Diego Carpentero

    ModernBERT's alternating attention is presented as a way to capture localized attack signals while retaining broader context without using global attention in every layer.

  45. How Transformers Finally Ate Vision

    With fixed-size image patches, global attention has fourth-power scaling in image side length for its pairwise attention computation.

  46. Transformers: why causal KV caching works

    Caching introduction; Attention matrices; Cache class.

  47. Low Level Technicals of LLMs

    For reproducing Gemma, the stated decision was to match the original implementation even when another combination appeared to reduce an individual error.

  48. Transformers: cache allocation versus retained history

    Default cache; Fixed-size cache; Cache offloading; Quantized cache.

  49. Lost in the Middle: How Language Models Use Long Contexts

    Sections 2.1–2.3, 3.1–3.2 and 4.1–4.2; Figures 5, 7–9.

  50. RULER: What's the Real Context Size of Your Long-Context Language Models?

    Introduction and benchmark task definitions; complements the supplied evidence-position notes with controlled task complexity and distractors.

  51. Lost in the Middle: How Language Models Use Long Contexts

    Primary paper sections 2–4 and controlled experiment descriptions inspected.

  52. Anthropic's Applied AI team on the Evolution of Agentic Surfaces

    Treat the durable session history and the model's current context window as separate resources.

  53. On Identifiability in Transformers

    Sections 3.2–3.4; non-identifiability and effective attention, with sequence length greater than value dimension plus one sufficient for the probability-constrained construction.

  54. Text generation — Hugging Face Transformers

    Text generation introduction; Generate text; Generation configuration; Pitfalls—Output length and Decoding strategy. Formula expresses the documented sequential mechanism.

  55. Attention Is All You Need

    Sections 3.1 and 3.2.3 establish the sublayers and query/key/value origins.

  56. Attention Is All You Need — Figure 1 decoder architecture

    Figure 1 on printed page 3, zero-based PDF page 2, right-hand decoder stack and connecting arrows. Direct visual inspection of the original architecture in arXiv:1706.03762v7.

  57. Road to 5 Million Tokens: Breaking Barriers in Long Context Training — Max Ryabinin, Together AI

    The talk distinguishes quadratic attention computation from linearly growing sequence-dependent memory; solving one does not eliminate the other.