Skip to main content

Learning to Learn-at-Test-Time: Language Agents with Learnable Adaptation Policies

AuthorsZhanzhi Lou et al.
Year2026
HF Upvotes15
arXiv2604.00830
PDFDownload
HF PageView on Hugging Face

Abstract

Test-Time Learning (TTL) enables language agents to iteratively refine their performance through repeated interactions with the environment at inference time. At the core of TTL is an adaptation policy that updates the actor policy based on experience from previous episodes, thereby improving future behavior. Existing methods rely on fixed, hand-crafted adaptation policies rather than optimizing them for downstream improvement. We argue that optimal adaptation policies should be learned from task environments, not hand-engineered based on human intuition. To achieve this, we introduce Meta-TTL, a framework that formulates the discovery of effective adaptation policies as a bi-level optimization problem. Within this framework, the inner loop executes the standard TTL process, measuring how effectively a candidate adaptation policy helps an agent correct errors across sequential episodes. Guided by the agent's performance, the outer loop employs evolutionary search over a diverse distribution of training tasks to iteratively refine the adaptation policy. We evaluate Meta-TTL on Jericho and WebArena-Lite across both in-distribution (ID) and out-of-distribution (OOD) settings, using multiple meta-agent backbones. Results on both benchmarks show that Meta-TTL consistently outperforms hand-crafted baselines, suggesting that the optimized adaptation policy encodes transferable strategies that generalize beyond the training task distribution.


Engineering Breakdown

Plain English

This paper tackles the problem that language agents use fixed, hand-crafted adaptation policies during test-time learning (TTL) instead of optimizing them for actual task performance. The authors introduce Meta-TTL, a framework that learns optimal adaptation policies through bi-level optimization, where an inner loop runs standard TTL and an outer loop optimizes the policy itself based on downstream performance gains. The key insight is that adaptation policies should be learned from task environments rather than designed by humans, enabling agents to improve their behavior iteratively during inference through repeated environment interactions.

Core Technical Contribution

Meta-TTL's core novelty is formulating adaptation policy discovery as a bi-level optimization problem where the outer loop explicitly optimizes for policies that maximize downstream task improvement. Unlike existing TTL methods that rely on fixed update rules (e.g., simple gradient updates or hand-designed prompting strategies), Meta-TTL learns context-aware adaptation policies that understand which modifications to the actor policy will most effectively improve performance on unseen tasks. The framework separates policy optimization (outer loop) from policy execution (inner loop TTL process), allowing the learned adaptation policy to be task-aware and data-driven rather than universal and human-engineered.

How It Works

The bi-level optimization structure works as follows: the inner loop executes standard TTL, where an actor policy interacts with the environment, collects experience from previous episodes, and updates itself based on an adaptation policy. The adaptation policy is a learnable component that takes trajectories and performance metrics as input and outputs parameter updates or other modifications to improve the actor. The outer loop collects metrics on how much the actor improved after applying this adaptation policy across multiple tasks, then updates the adaptation policy itself via gradient-based optimization to maximize future improvement. During training, this happens over many task episodes; at inference time, the learned adaptation policy guides how the actor refines itself through environment interaction, enabling continuous performance improvement without retraining the base model.

Production Impact

Adopting Meta-TTL would change how language agent inference pipelines handle adaptation: instead of using fixed heuristics (temperature scaling, prompt engineering, or static gradient steps), agents would run learned adaptation policies that dynamically adjust based on observed performance. This enables production systems to improve accuracy on specialized tasks without redeployment or fine-tuning, providing a form of online personalization. The trade-offs are significant: inference requires multiple environment interactions and forward passes through both the actor and adaptation policy (increasing latency and compute cost), the framework requires collecting diverse task data during training to learn generalizable adaptation policies, and integration complexity increases since you need a trainable adaptation policy component alongside your base model. For tasks where test-time improvement matters (e.g., reasoning, structured prediction, interactive agents), this could deliver 5-10% accuracy gains at the cost of 2-5x inference compute.

Limitations and When Not to Use This

Meta-TTL assumes that the task distribution during meta-training is representative of deployment tasks—if your inference distribution differs significantly, the learned adaptation policy may not generalize effectively. The approach requires that the actor policy is differentiable and that you can efficiently collect experience during inference, which breaks down for discrete-action environments, non-differentiable components, or applications with strict latency constraints. The paper's results are shown only on the inner TTL loop completion (measuring improvement measurement), without full downstream task benchmarks or comparisons to simpler baselines, leaving open questions about real-world performance gains versus computational cost. Additionally, the method requires solving a nested optimization problem during training, which is computationally expensive and may be unstable; the paper does not address convergence guarantees or discuss how to handle meta-training failure modes.

Research Context

This work extends the test-time learning literature, which has focused on using environment feedback to improve agents at inference time without model retraining. It builds on prior TTL work (referenced implicitly) that uses fixed adaptation strategies, and connects to meta-learning research where outer loops optimize inner learning processes (similar to MAML and related algorithms). The contribution addresses a practical gap: existing TTL methods use hand-designed update rules, while this paper argues for learned, task-specific adaptation policies. This opens a research direction toward automated discovery of adaptation algorithms, with potential applications to in-context learning, few-shot adaptation, and continual learning in deployed agent systems.


:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::


Back to Research Lab → · Subscribe to AI Letters →

© 2026 EngineersOfAI. All rights reserved.