Skip to content

ICLR papers

Search ICLR papers by title, author, or track. Open a paper’s abstract to read more.

Explore the ICLR analysis

Search results

181–200 of 274

  • ICLR · Workshop · Lifelong Agents: Learning, Aligning, Evolving

    FocusAgent: Simple Yet Effective Ways Of Trimming The Large Context of Web Agents

    Imene Kerboua, Sahar Shayegan, Xing Han Lu, Léo Boisvert, Megh Thakkar, Massimo Caccia, Jérémy Espinas, Alex Aussem, Véronique Eglin, Alexandre Lacoste

    Abstract

    Web agents powered by large language models (LLMs) must process lengthy web page observations to complete user goals, these pages often exceed tens of thousands of tokens. This saturates context limits and increases computational cost processing; moreover, processing full pages exposes agents to security risks such as prompt injection. Existing pruning strategies either discard relevant content or retain irrelevant context, leading to suboptimal action prediction. We introduce \textbf{FocusAgent}, a simple yet effective approach that leverages a lightweight LLM retriever to extract the most relevant lines from accessibility tree (AxTree) observations, guided by task goals. By pruning noisy and irrelevant content, FocusAgent enables efficient reasoning while reducing vulnerability to injection attacks. Experiments on WorkArena and WebArena benchmarks show that FocusAgent matches the performance of strong baselines, while reducing observation size by over 50%. Furthermore, a variant of FocusAgent significantly reduces the success rate of prompt-injection attacks, including banner and popup attacks, while maintaining task success performance in attack-free settings. Our results highlight that targeted LLM-based retrieval is a practical and robust strategy for building web agents that are efficient, effective, and secure.

    Abstract source
  • ICLR · Workshop · Lifelong Agents: Learning, Aligning, Evolving

    ACON: Optimizing Context Compression for Long-horizon LLM Agents

    Minki Kang, Wei-Ning Chen, Dongge Han, Huseyin Inan, Lukas Wutschitz, Yanzhi Chen, Robert Sim, Saravanakumar Rajmohan

    Abstract

    Large language models (LLMs) are increasingly deployed as agents in dynamic real-world environments, where success depends on maintaining precise records of actions and observations. However, the resulting unbounded context growth in long-horizon agentic tasks makes two critical bottlenecks: prohibitive inference memory costs and reasoning degradation due to irrelevant information. Existing compression methods fail to fully address this, often relying on brittle heuristics or requiring parameter updates impractical for proprietary or large-scale LLMs. We introduce Agent Context Optimization (ACON), a unified framework that optimally compresses both observations and history into concise, informative representations. Distinct from prior works, ACON employs an optimization in natural language space: it iteratively refines compression guidelines based on failure analysis of the agent, ensuring critical state information is preserved without model fine-tuning. To further minimize computational overhead, we distill the optimized compressor into smaller models. Experiments on AppWorld, OfficeBench, and Multi-objective QA demonstrate that ACON reduces peak token usage by 26-54% while maintaining task performance. Notably, it enables smaller LMs to function effectively as long-horizon agents, achieving up to 46% performance improvement by mitigating context distraction.

    Abstract source
  • ICLR · Workshop · Lifelong Agents: Learning, Aligning, Evolving

    Inherited Goal Drift: Contextual Pressure Can Undermine Agentic Goals

    Achyutha Menon, Magnus Saebo, Tyler Crosse, Spencer Gibson, Eyon Jang, Diogo Cruz

    Abstract

    The accelerating adoption of language models (LMs) as agents for deployment in long-context tasks motivates a thorough understanding of goal drift: agents' tendency to deviate from an original objective. While prior-generation language model agents have been shown to be susceptible to drift, the extent to which drift affects more recent models remains unclear. In this work, we provide an updated characterization of the extent and causes of goal drift. We investigate drift in state-of-the-art models within a simulated stock-trading environment. These models are largely shown to be robust even when subjected to adversarial pressure. We show, however, that this robustness is brittle: across multiple settings, the same models often inherit drift when conditioned on prefilled trajectories from weaker agents. The extent of conditioning-induced drift varies significantly by model family, with only GPT-5.1 maintaining consistent resilience among tested models. We find that drift behavior is inconsistent between prompt variations and correlates poorly with instruction hierarchy following behavior, with strong hierarchy following failing to reliably predict resistance to drift. Finally, we run analogous experiments in a new emergency room triage environment to show preliminary evidence for the transferability of our results across qualitatively different settings. Our findings underscore the continued vulnerability of modern LM agents to contextual pressures and the need for refined post-training techniques to mitigate this.

    Abstract source
  • ICLR · Workshop · Lifelong Agents: Learning, Aligning, Evolving

    Lifelong Contextual Safety Alignment at Test Time for Multi-Modal LLMs

    Ce Zhang, Jinxi He, Junyi He, Katia Sycara, Yaqi Xie

    Abstract

    Multi-modal Large Language Models (MLLMs) have achieved remarkable performance across a wide range of visual reasoning tasks, yet their vulnerability to safety risks remains a pressing concern. While prior research primarily focuses on jailbreak defenses that detect and refuse explicitly unsafe inputs, such approaches often overlook contextual safety, which requires models to distinguish subtle contextual differences between scenarios that may appear similar but diverge significantly in safety intent. In this work, we present MM-SafetyBench++, a carefully curated benchmark designed for contextual safety evaluation. Specifically, for each unsafe image–text pair, we construct a corresponding safe counterpart through minimal modifications that flip the user intent while preserving the underlying contextual meaning, enabling controlled evaluation of whether models can adapt their safety behaviors based on contextual understanding. Further, we introduce EchoSafe, a training-free framework that maintains a self-reflective memory bank to accumulate and retrieve safety insights from prior interactions. By integrating relevant past experiences into current prompts, EchoSafe enables context-aware reasoning and continual evolution of safety behavior during inference. Extensive experiments on various multi-modal safety benchmarks demonstrate that EchoSafe consistently achieves superior performance, establishing a strong baseline for advancing contextual safety in MLLMs.

    Abstract source
  • ICLR · Workshop · Lifelong Agents: Learning, Aligning, Evolving

    MemoryCD: Benchmarking Long-Context User Memory of LLM Agents for Lifelong Cross-Domain Personalization

    Weizhi Zhang, Xiaokai Wei, Wei-Chieh Huang, Zheng Hui, Chen Wang, Michelle Gong, Philip Yu

    Abstract

    Recent advancements in Large Language Models (LLMs) have expanded context windows to million-token scales, yet benchmarks for evaluating memory remain limited to single-session synthetic dialogues. We introduce MemoryCD, the first large-scale, user-centric, cross-domain memory benchmark derived from lifelong real-world behaviors in the Amazon Review dataset. Unlike existing memory datasets that rely on scripted personas to generate synthetic user data, MemoryCD tracks authentic user interactions across years and multiple domains. We construct a multi-faceted long-context memory evaluation pipeline of 14 state-of-the-art LLM base models with 6 memory method baselines on 4 distinct personalization tasks over 12 diverse domains to evaluate an agent's ability to simulate real user behaviors in both single and cross-domain settings. Our analysis reveals that existing memory methods are far from user satisfaction in various domains, offering the first testbed for cross-domain life-long personalization evaluation.

    Abstract source
  • ICLR · Workshop · ICLR 2026 Workshop on AI with Recursive Self-Improvement

    Contextual Drag: How Errors in the Context Affect LLM Reasoning

    Yun Cheng, Xingyu Zhu, Haoyu Zhao, Sanjeev Arora

    Abstract

    Central to many self-improvement pipelines for large language models (LLMs) is the assumption that models can improve by reflecting on past mistakes. We study a phenomenon termed contextual drag: the presence of failed attempts in the context biases subsequent generations toward structurally similar errors. Across evaluations of 11 proprietary and open-weight models on 8 reasoning tasks, contextual drag induces 10-20% performance drops, and iterative self-refinement in models with severe contextual drag can collapse into self-deterioration. Structural analysis using tree edit distance reveals that subsequent reasoning inherits structurally similar error patterns from the context. We demonstrate that neither external feedback nor successful self-verification suffices to eliminate this effect. While mitigation strategies such as fallback-behavior fine-tuning and context denoising yield partial improvements, they fail to fully restore baseline performance, positioning contextual drag as a persistent failure mode in current reasoning architectures.

    Abstract source
  • ICLR · Workshop · ICLR 2026 Workshop on AI with Recursive Self-Improvement

    Contextual Drag: How Errors in the Context Affect LLM Reasoning

    Yun Cheng, Xingyu Zhu, Haoyu Zhao, Sanjeev Arora

    Abstract

    Central to many self-improvement pipelines for large language models (LLMs) is the assumption that models can improve by reflecting on past mistakes. We study a phenomenon termed contextual drag: the presence of failed attempts in the context biases subsequent generations toward structurally similar errors. Across evaluations of 11 proprietary and open-weight models on 8 reasoning tasks, contextual drag induces 10-20% performance drops, and iterative self-refinement in models with severe contextual drag can collapse into self-deterioration. Structural analysis using tree edit distance reveals that subsequent reasoning inherits structurally similar error patterns from the context. We demonstrate that neither external feedback nor successful self-verification suffices to eliminate this effect. While mitigation strategies such as fallback-behavior fine-tuning and context denoising yield partial improvements, they fail to fully restore baseline performance, positioning contextual drag as a persistent failure mode in current reasoning architectures.

    Abstract source
  • ICLR · Workshop · ICLR 2026 Workshop on AI with Recursive Self-Improvement

    In-Context Adaptation

    Yongqiang Chen, Chenxi Liu, Qingyi Guo, Bo Han, Kun Zhang

    Abstract

    A defining characteristic of intelligence is reasoning – a capability of adapting learned knowledge to unfamiliar contexts. Although large language models (LLMs) exhibit strong reasoning capabilities in-context, it remains unclear whether they can perform human-like in-context reasoning under out-of-distribution (OOD) contexts. In this work, we introduce In-Context Adaptation (ICA), a paradigm that formalizes reasoning as the adaptive use of learned knowledge through a few demonstrations from new environments. Using a benchmark adapted from invariant learning, we show that transformers trained via next-token prediction are prone to spurious correlations and fail to reason effectively in OOD settings. To address this limitation, we propose Adaptive Context Engineering (ACE), a simple context reconstruction strategy that promotes adaptive exploitation of learned knowledge. Empirical results demonstrate significant improvements in in-context reasoning under distribution shifts, highlighting a path toward more human-like adaptive generalization in transformers.

    Abstract source
  • ICLR · Workshop · ICLR 2026 Workshop on AI with Recursive Self-Improvement

    Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models

    Qizheng Zhang, Changran Hu, Shubhangi Upasani, Boyuan Ma, Fenglu Hong, Vamsidhar Kamanuru, Jay Rainton, Chen Wu, Mengmeng Ji, Hanchen Li, Urmish Thakker, James Y Zou, Kunle Olukotun

    Abstract

    Large language model (LLM) applications such as agents and domain-specific reasoning increasingly rely on context adaptation: modifying inputs with instructions, strategies, or evidence, rather than weight updates. Prior approaches improve usability but often suffer from brevity bias, which drops domain insights for concise summaries, and from context collapse, where iterative rewriting erodes details over time. We introduce ACE (Agentic Context Engineering), a framework that treats contexts as evolving playbooks that accumulate, refine, and organize strategies through a modular process of generation, reflection, and curation. ACE prevents collapse with structured, incremental updates that preserve detailed knowledge and scale with long-context models. Across agent and domain-specific benchmarks, ACE optimizes contexts both offline (e.g. system prompts) and online (e.g. agent memory), consistently outperforming strong baselines: +10.6\% on agents and +8.6\% on finance, while significantly reducing adaptation latency and rollout cost. Notably, ACE could adapt effectively without labeled supervision and instead by leveraging natural execution feedback. On the AppWorld leaderboard, ACE matches the top-ranked production-level agent on the overall average and surpasses it on the harder test-challenge split, despite using a smaller open-source model. These results show that comprehensive, evolving contexts enable scalable, efficient, and self-improving LLM systems with low overhead.

    Abstract source
  • ICLR · Workshop · ICLR 2026 Workshop on AI with Recursive Self-Improvement

    Cross-Family Speculative Prefill: Training-Free Long-Context Compression with Small Draft Models

    Shubhangi Upasani, Guangtao Wang, Ravi Raju, Bo Li, Urmish Thakker, Mengmeng Ji, John Long, Chen Wu

    Abstract

    Prompt length is a major bottleneck in agentic large language model (LLM) workloads, where repeated inference steps and multi-call loops incur substantial prefill cost. Recent work on speculative prefill demonstrates that attention based token importance estimation can enable training-free prompt compression, but this assumes the existence of a draft model that shares the same tokenizer as the target model. In practice however, agentic pipelines frequently employ models without any smaller in-family draft model. In this work, we study cross-family speculative prefill, where a lightweight draft model from one model family is used to perform prompt compression for a target model from a different family. Using the same speculative prefill mechanism as prior work, we evaluate a range of cross-family draft–target combinations, including Qwen, LLaMA, and DeepSeek models. Across a broad diversity of tasks, we find that attention-based token importance estimation transfers reliably across different model families despite differences in model architectures and tokenizers between draft and target models. Cross-model prompt compression largely retains 90--100\% of full-prompt baseline performance and, in some cases, slightly improves accuracy due to denoising effects, while delivering substantial reductions in time-to-first-token (TTFT). These results suggest that speculative prefill depends mainly on task priors and semantic structure, thus serving as a generalizable prompt compression primitive. We discuss the implications of our findings for agentic systems, where repeated long-context inference and heterogeneous model stacks make cross-model prompt compression both necessary and practical.

    Abstract source
  • ICLR · Workshop · ICLR 2026 Workshop on AI with Recursive Self-Improvement

    Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?

    Thibaud Gloaguen, Niels Mündler, Mark Mueller, Veselin Raychev, Martin Vechev

    Abstract

    A widespread practice in software development is to tailor coding agents to repositories using context files, such as AGENTS.md, by either manually or automatically generating them. Although this practice is strongly encouraged by agent developers, there is currently no rigorous investigation into whether such context files are actually effective for real-world tasks. In this work, we study this question and evaluate coding agents' task completion performance in two complementary settings: established SWE-bench tasks from popular repositories, with LLM-generated context files following agent-developer recommendations, and a novel collection of issues from repositories with developer-committed context files. Across multiple coding agents and LLMs, we find that context files tend to reduce task success rates compared to providing no repository context, while also increasing inference cost by over 20\%. Behaviorally, both LLM-generated and developer-provided context files encourage broader exploration (e.g., more thorough testing and file traversal), and coding agents tend to respect their instructions. Ultimately, we conclude that unnecessary requirements from context files make tasks harder, and human-written context files should describe only minimal requirements.

    Abstract source
  • ICLR · Workshop · NFAM Workshop: New Frontiers in Associative Memories

    Towards Context-Based Retrieval in Associative Memories

    Moulik Choraria, Argyrios Gerogiannis, Vidhata Jayaraman, Ankur Mani, Lav R Varshney

    Abstract

    Hopfield networks and their generalizations have established deep connections between biological associative memories, statistical physics, and transformers. Yet most models treat retrieval as a fixed query-to-memory mapping, ignoring the role of external context in recall. In this work, we propose a two-stage associative memory architecture within the modular energy framework of hierarchical associative memories. Herein, a context-gate sub-circuit reshapes the retrieval energy landscape before and during recall. We demonstrate how this structure can increase inter-memory separation and exponentially improve retrieval, while actively inducing sparsity over the space of memories available for recall. Our framework offers a promising step towards a principled account of how external context can reshape retrieval dynamics.

    Abstract source
  • ICLR · Workshop · NFAM Workshop: New Frontiers in Associative Memories

    Extending LLM Context via Associative Recurrent Memory

    Gleb Kuzmin, Ivan Rodkin, Aydar Bulatov, Yuri Kuratov, Timothy Baldwin, Mikhail Burtsev, Artem Shelmanov

    Abstract

    Closed-source LLMs support context windows of up to 1M tokens and beyond, while smaller open-source models still have a limited window of 32K-128K tokens. However, for some tasks, it is necessary to use a small local LLM to avoid any data leaks; some of these tasks require domain-specific knowledge and long-context understanding. To address this gap, we introduce two domain-specific long-context datasets, ManyTypes-long and GovReport-long, and present a practical recipe for extending short-context LLMs using the Associative Recurrent Memory Transformer (ARMT) architecture. Finally, we analyze the associative memory in trained ARMT models and show that associative memory primarily benefits from representations in the middle and upper layers of the transformer, allowing us to reduce the size of the models by removing redundant associative memory from other layers. Our results demonstrate an effective approach to enabling long-context capabilities in small, privacy-preserving LLMs for domain specific tasks.

    Abstract source
  • ICLR · Workshop · NFAM Workshop: New Frontiers in Associative Memories

    Plan-Aware Automated Context Engineering

    Kamer Yuksel, Hassan Sawaf

    Abstract

    Associative memory has re-emerged as a central abstraction for understanding attention, retrieval, and state evolution in modern AI systems, particularly in memory-augmented and agent-based models. In large language model (LLM) agents, memory is instantiated as an evolving prompt context that includes plans, intermediate reasoning, tool outputs, retrieved documents, and instructions. As agents execute long-horizon workflows, this memory state grows rapidly, becoming noisy, unstable, and increasingly difficult to reason over. We introduce PAACE (Plan-Aware Automated Context Engineering), a framework that formulates context management as a problem of associative memory shaping. PAACE learns to selectively retain, rewrite, compress, or discard memory elements based on their associative relevance to upcoming plan steps, effectively stabilizing task-relevant memory states while suppressing irrelevant or distracting information. Unlike query-aware or single-step compression methods, PAACE explicitly conditions memory transformations on the next-k tasks in an agent's plan, enabling multi-step associative retrieval and long-horizon reasoning. PAACE consists of two components: (1) PAACE-Syn, a scalable generator of synthetic agent workflows with explicit plan structure and stepwise memory supervision, and (2) PAACE-FT, a family of compact, distilled associative memory operators trained to imitate successful teacher-guided memory transformations. Experiments on OfficeBench and multi-objective question answering demonstrate that PAACE improves agent accuracy while substantially reducing memory load and cumulative attention cost. We show that learned associative memory shaping not only improves efficiency but also acts as a form of regularization, stabilizing reasoning over extended interactions.

    Abstract source
  • ICLR · Workshop · NFAM Workshop: New Frontiers in Associative Memories

    GradMem: Learning to Write Context into Memory with Test-Time Gradient Descent

    Yuri Kuratov, Matvey Kairov, Aydar Bulatov, Ivan Rodkin, Mikhail Burtsev

    Abstract

    Transformers typically process long contexts by storing a large per-layer KV-cache of past activations. A desirable alternative is compressive memory: read a context once, store it in a compact state, and answer many queries from that state. We introduce GradMem, which writes context into memory via per-sample test-time optimization. Given a context, GradMem performs a few steps of gradient descent on a small set of prefix memory tokens while keeping model weights frozen. GradMem explicitly optimizes a model-level self-supervised context reconstruction loss, resulting in a loss-driven write operation with iterative error correction, unlike forward-only methods. On associative key-value retrieval, GradMem outperforms forward-only memory writers with the same memory size, and additional gradient steps scale capacity much more effectively than repeated forward writes.

    Abstract source
  • ICLR · Workshop · NFAM Workshop: New Frontiers in Associative Memories

    To Keep or to Forget: Toward Context-Sensitive Memory in Large Language Models

    Noor Zain, Ahsan Adeel

    Abstract

    While attention mechanisms share formal connections with associative retrieval, they lack core features of biological memory systems, particularly context-sensitive memory formation and recall. Inspired by recent cellular neurobiological evidence on pyramidal two-point neurons (TPNs), we propose a TPN-inspired memory mechanism for large language models (LLMs) that enables context-sensitive memory writing, reading, and updating through triadic modulation loops. In this framework, global contextual signals modulate local feedforward representations to selectively engage memory operations only when local evidence is coherent with the global internal state. Memory encoding and retrieval emerge from apical-amplification regimes, while memory updating is governed by apical-drive dynamics. This context-sensitive memory gating reduces interference between overlapping representations and enables more stable and coherent associative memory formation and retrieval during ongoing feedforward (FF) processing.

    Abstract source
  • ICLR · Workshop · Workshop on Logical Reasoning of Large Language Models

    Safe Context Switching for Agents in the Wild: Mitigating Subspace Interference via Orthogonal Adaptation

    Akash Das

    Abstract

    Most Large Language Models exhibit a fundamental tension between two sequential tasks ( say Logical Reasoning and Safety Alignment). The high-variance internal states needed for sophisticated Chain-of-Thought (CoT) deduction geometrically collide with the latent manifolds encoding safety constraints. We see this phenomenon as Sequential Subspace Interference, showing that normal fine- tuning on logical tasks (i.e., multi-step math or code generation) results in a huge 23.3% Interference Penalty on alignment benchmarks, fundamentally decoupling the model from its safety priors. This “Reasoning Drift” is not adequately captured in current adaptation methods since the gradients of logical tasks in practice are almost never orthogonal to safety objectives. To address this concern, we propose AURA (Adaptive Unique Residual Allocation), a spectral regularization framework that enforces Spectral Independence between reasoning and safety. By explicitly calculating the Null Space of the alignment manifold and limiting reasoning updates to its orthogonal complement, AURA enables models to maximize logical expressivity without jeopardizing safety guarantees. Empirically, AURA compensates +23.0% for the lost performance and preserves > 0.98 cosine fidelity to the safe state, demonstrating that sound reasoning and careful alignment can be effectively solved through geometric decoupling by using AURA.

    Abstract source
  • ICLR · Workshop · Workshop on Logical Reasoning of Large Language Models

    KV Cache as a Reasoning Primitive for Long Context Reasoning

    Rian Atri

    Abstract

    Large language models often produce inconsistent answers across multiple related questions when earlier premises are partially forgotten or distorted in long contexts. We argue this is not only a modeling issue but a working-memory issue: KV cache policy controls which premises remain accessible for attention and thus mediates logical consistency under finite memory. Current practice sits at two extremes: retain everything (wasteful) or evict uniformly (premise-destructive). This ignores decades of memory-hierarchy results on working sets and locality. We synthesize empirical evidence that attention working sets are sparse and structurally constrained (heavy hitters, attention sinks, layer heterogeneity), implying that premise-preserving retention is achievable. We provide a small proof-of-concept cache manager with content-aware retention and show favorable memory–quality tradeoffs on a premise-retrieval stress test (passkey retrieval). We then propose a “consistency bundle” evaluation protocol for measuring cross-question contra- dictions as a function of memory policy. Our conclusion is practical: memory policies should be designed and reported as reasoning controls, not just serving optimizations.

    Abstract source
  • ICLR · Workshop · Workshop on Logical Reasoning of Large Language Models

    When Long Contexts Break Logic: Separating Evidence Use and Decision Bias in Instruction-Tuned LLMs

    Pravish Sainath

    Abstract

    Large language models (LLMs) increasingly operate over long contexts, yet their logical reasoning remains brittle when many irrelevant tokens intervene between premises and query. A recurring challenge is \emph{diagnosis}: when an LLM answers incorrectly in a long context, is the failure due to (i) not using the relevant premises, (ii) failing to compose them into a valid inference, or (iii) a biased decision rule at the final Yes/No readout? We present a compact suite of probes that disentangle these failure modes using \emph{matched-prior subtraction}---a distractor-conditioned control prompt that preserves formatting and length while removing the content of the evidence. Across three open instruction-tuned models (Qwen2.5, Llama-3.2, Gemma-2) we find that evidence influence on the final decision is near-zero in early layers and rises sharply only in late layers on a ``needle-in-a-haystack'' variant of LogicBench. For synthetic multi-premise rules (modus tollens, disjunctive syllogism, etc.), we show that many ``oracle'' failures under naive scoring are actually decision-level miscalibration: simple calibrated decision rules raise oracle accuracy to $0.83$--$0.93$ on several rules. Finally, a \emph{local calibratability} analysis reveals that the required decision correction depends systematically on evidence placement (front/middle/end/interleaved), indicating multiple long-context bias regimes rather than a single global calibration.

    Abstract source
  • ICLR · Workshop · Workshop on Logical Reasoning of Large Language Models

    Single-Position Intervention Fails: Distributed Output Templates Drive In-Context Learning

    Bryan Cheng, Jasper Zhang

    Abstract

    Understanding how large language models encode task identity from few-shot demonstrations is a central open problem in mechanistic interpretability. Prior work uses linear probing to localize task representations, reporting high classification accuracy at specific layers. We reveal a striking dissociation: probing accuracy completely fails to predict causal importance. Single-position activation intervention achieves 0% task transfer across all 28 layers of Llama-3.2-3B—despite 100% probing accuracy at those same positions. This null result is itself a key finding, demonstrating that task encoding is fundamentally distributed. Multi-position intervention—replacing activations at all demonstration output tokens simultaneously—achieves up to 96% transfer (N=50, 95% CI: [87%, 99%]) at layer 8, pinpointing for the first time the causal locus of ICL task identity. We establish the generality of these findings across four models spanning three architecture families (LLaMA, Qwen, Gemma), discovering a universal intervention window at ∼30% network depth. Causal tracing uncovers an asymmetric architecture: the query position is strictly necessary (53–100% disruption) while no individual demonstration position is necessary (0% disruption)—resolving a key ambiguity in prior accounts. Crucially, transfer depends on internal representation compatibility, not surface similarity (r=−0.05 vs r=0.31), ruling out trivial explanations. These results establish the distributed template hypothesis: ICL task identity is encoded as output format templates distributed across demonstration tokens, fundamentally reshaping our understanding of how in-context learning operates.

    Abstract source