Equivalence of Context and Parameter Updates in Modern Transformer Blocks
Adrian Goldwaser, Michael Munn, Xavi Gonzalvo, Benoit Dherin
Overview
This talk explores the theoretical and practical equivalence between processing information through a transformer's context window versus baking that information directly into its weight parameters. Presented at ICML by Adrian Goldwaser alongside co-authors Michael Munn, Xavi Gonzalvo, and Benoit Dherin, the research investigates how models utilize context and takes concrete steps toward bridging the gap between in-context learning and explicit parameter updates. By removing a subset of tokens from a context window and shifting that information into weight adjustments, the authors demonstrate that an unmodified transformer output can be mathematically preserved.

Key moments
- 0:00 Introduction and equivalence of context and parameter updates
- 1:30 Extending basic block updates to Gemma architecture
- 2:08 Input and output controllability framework
- 3:00 Inductive application to multi-layer transformer setups
- 4:00 Numerical stability challenges and token matching results
- 4:54 Stable updates and approximately inverting RMS norm
- 6:14 Summary of findings and future work directions
- 7:00 Audience questions and discussion
Equivalence of Context and Parameter Updates in Modern Transformer Blocks
Speakers: Adrian Goldwaser; Michael Munn; Xavi Gonzalvo; Benoit Dherin
Conference: ICML
YouTube: https://slideslive.com/39083735
Overview
This talk explores the theoretical and practical equivalence between processing information through a transformer's context window versus baking that information directly into its weight parameters. Presented at ICML by Adrian Goldwaser alongside co-authors Michael Munn, Xavi Gonzalvo, and Benoit Dherin, the research investigates how models utilize context and takes concrete steps toward bridging the gap between in-context learning and explicit parameter updates. By removing a subset of tokens from a context window and shifting that information into weight adjustments, the authors demonstrate that an unmodified transformer output can be mathematically preserved.
Understanding this duality matters deeply for both machine learning theory and systems engineering. As context windows scale to hundreds of thousands of tokens, managing key-value (KV) cache memory and quadratic attention costs becomes a major bottleneck. By proving that context can be dynamically translated into rank-one parameter updates across modern architectures—including gated MLP blocks and RMSNorm configurations found in models like Gemma—this work opens up novel pathways for memory consolidation, context compression, and specialized inference strategies.
The presentation addresses both the pristine mathematical formulations required for single- and multi-layer architectures and the harsh realities of numerical stability when translating these theories into lower-precision hardware like Bfloat16. Through clever analytical inversion and stable update formulations, the authors bridge the gap between abstract functional equivalence and practical, artifact-free execution.
Background
▶ Watch: Introduction and equivalence of context and parameter updates (0:00)
The intersection of in-context learning and parameter modification has long been a subject of fascination in the mechanistic interpretability and systems optimization communities. Historically, researchers have treated the context window and the weight matrices of a neural network as distinct computational mediums: the weights store static, long-term knowledge acquired during pre-training, while the context provides dynamic, temporary working memory processed via self-attention layers.
However, prior foundational work established a theoretical bridge for simple, single-layer vanilla transformers with biases, showing that context could be absorbed into weight updates via specific linear adjustments. Yet, modern open-weights and proprietary architectures have evolved far beyond basic vanilla blocks. Contemporary models incorporate architectural complexities such as Gemma-style blocks featuring gating mechanisms, RMSNorm (Root Mean Square Normalization), and the absence of traditional bias terms.
These architectural changes break the assumptions of earlier mathematical formulations. In the systems and ML theory space, this creates a significant roadblock: how can we reason about the interchangeability of context and parameters when modern models rely on aggressive normalization, non-linear gating functions, and post-norm topologies? This talk tackles that exact question, extending equivalence proofs to modern multi-layer blocks and addressing the numerical precision cliffs that emerge when these theoretical updates hit real-world hardware.
Key Findings
▶ Watch: Input and output controllability framework (2:08)
The primary contribution of this research is the generalization of context-to-parameter equivalence from toy models to modern, complex transformer architectures. The authors establish that any transformer MLP (Multi-Layer Perceptron) block adhering to specific controllability properties can absorb context reductions directly into its weight matrices without altering subsequent outputs.
Key findings and results include:
- Universal Block Compatibility: By defining input controllability and output controllability, the authors prove that virtually all modern transformer blocks—including Mixture of Experts (MoE) models and gated architectures—support exact mathematical equivalence between context tokens and weight updates.
- Multi-Layer Inductive Extension: The update mechanics scale inductively across depth. By sequentially updating blocks and maintaining corrected activations layer-by-layer, the exact output of the original full-context forward pass is preserved.
- The Precision Trap: In standard Bfloat16 precision, naive mathematical implementations of these updates suffer from severe numerical instability due to element-wise divisions by small activation values in $F$, leading to token generation drift and generation failure.
- Stable Update Resolution: Introducing a numerically stable update—which relies on approximately inverting the RMSNorm via an analytical method combined with binary search—achieves a roughly 10x increase in accuracy and ensures perfect token matching.
- Multimodal Context Absorption: The update mechanism is agnostic to the input modality abstracted by the attention block; entire prompts, images, or structured data (such as a Python dictionary) can be absorbed directly into the model parameters.
Technical Deep Dive
▶ Watch: Numerical stability challenges and token matching results (4:00)
The technical framework relies on abstracting the attention mechanism entirely, treating everything preceding the MLP block as a generalized function $A(C, X)$ (which could equally be standard multi-head attention or a State-Space Model like Mamba). The core technical machinery focuses exclusively on modifying the MLP weights to compensate for removing a context subset $Y$ from the broader context $C$.
Controllability Framework
To generalize beyond vanilla transformers, the authors introduce two fundamental systems properties:
- Input Controllability: The property wherein any arbitrary change in the input to a function can be completely absorbed by a corresponding weight update.
- Output Controllability: The property wherein any arbitrary change to the output of a function can be absorbed by subsequent weight or residual updates.
In a standard transformer block, the weight update to $F$ absorbs differences in the input, while adjustments to $G$ handle shifts jumping over the residual connection.
Addressing Gemma-Style Blocks
For architectures like Gemma (1B model evaluated in the talk), the absence of biases, the presence of gating, and the use of RMSNorm introduce element-wise division steps. When outputs in $F$ approach zero, these divisions cause numerical explosions.
To resolve this, the authors developed a stable update algorithm. Instead of naively updating the primary weight matrix $M$, the algorithm pushes the change backward through the MLP by identifying an optimal target point ($H_{\text{target}}$). Finding $H_{\text{target}}$ requires approximately inverting the RMSNorm layer, achieved efficiently via a combination of analytical estimation and binary search. Despite these complex internal shifts, the resulting weight modifications remain strictly rank-one, preserving minimal-norm properties established in prior literature.
Experimental Setup & Results
▶ Watch: Stable updates and approximately inverting RMS norm (4:54)
The empirical validation demonstrates the practical mechanics of context absorption using the Gemma 1B model.
- Evaluation Setup: The experiments test context absorption token-by-token. Given an initial prompt, previous context tokens are systematically absorbed into the model's weights, and the subsequent token generation is evaluated for exact match fidelity against the unperturbed baseline.
- Precision Impact: Naive implementations running in Bfloat16 or lower precisions accumulate numerical errors rapidly, resulting in corrupted generation paths.
- Error Reduction: By implementing the numerically stable update pipeline—utilizing the approximately inverted RMSNorm—log-scale error plots demonstrate a substantial, multi-fold drop in divergence. This guarantees perfect token matching across tested prompts.
- Modality Flexibility: Beyond text prompts, the evaluation confirms that non-textual data, such as complete images or structured data structures (e.g., absorbing an entire Python dictionary into weights for subsequent querying), can be successfully ingested into parameter updates.
(Note: As this talk focuses primarily on establishing theoretical equivalence and architectural generalization rather than large-scale pre-training benchmarks, standard dataset names and external training loss curves are not the primary focus of the empirical section.)
Practical Implications
▶ Watch: Audience questions and discussion (7:00)
For infrastructure teams, model builders, and deployers, this research offers a compelling theoretical lens with emerging practical applications:
- Memory-Computation Tradeoffs: Translating context into weights shifts the burden from KV-cache memory consumption (which scales linearly or quadratically with sequence length) to parameter-update compute overhead.
- Inference Optimization: While recomputing rank-one updates on every token currently introduces computational overhead, understanding that context and parameters are interconvertible inspires new designs for long-context handling, prompt caching, and persistent memory injection.
- Precision Awareness: Practitioners attempting weight-space editing or activation-to-weight conversions must account for numerical stability. Naive floating-point operations (especially in 16-bit formats like Bfloat16) will fail without stabilization techniques like norm-inversion.
- Multi-Modal Integration: The ability to bake structured data or visual context directly into model parameters opens up specialized architectures where static working memory is compiled into weights rather than re-attended to at every layer.
Key Takeaways
- Context-Parameter Duality: Processing information via context windows is mathematically equivalent to dynamic rank-one parameter updates in modern transformer blocks.
- Universal Applicability: The proposed input and output controllability framework applies to all modern architectures, including gated MLPs, post-norm layouts, and Mixture of Experts.
- The Numerical Stability Challenge: Naive implementations of these updates in standard precisions like Bfloat16 fail due to element-wise divisions near zero, causing generation drift.
- Stable Inversion Solutions: Approximately inverting RMSNorm layers via analytical methods and binary search resolves stability issues, yielding a 10x+ improvement in accuracy and perfect token matching.
- Beyond Text: The update mechanics are modality-agnostic, capable of absorbing complex inputs such as entire images or structured data dictionaries directly into model weights.
About the Speaker(s)
- Adrian Goldwaser: Adrian presented on the equivalence of context and parameter updates in modern transformer blocks, focusing on understanding in-context learning and how transformers use context.
Co-authors: Michael Munn, Xavi Gonzalvo, Benoit Dherin.
Reviews
→ Top-rated talks at International Conference on Machine Learning 2026
All talks from International Conference on Machine Learning 2026