TextualRL: Textual Reinforcement Learning for Context Management
Tianyu Huai, Jie Zhou, Bo Mao, Qin Chen, Liang He, Xipeng Qiu
Abstract
LLM agents can adapt to task feedback by revising the textual context that guides their behavior, without changing their model parameters. However, turning execution rewards into reusable context updates is challenging: individual trajectories offer limited comparative evidence about what to change, while task-specific fixes may overgeneralize when incorporated into a shared context. We introduce TextualRL, a gradient-free reinforcement learning framework that treats a group of rollouts from the same task under the same context, rather than an isolated trajectory, as the unit of policy critique. Groupwise Policy Critique contrasts successful and failed rollouts within a task; when outcomes are uniform, it draws on cross-task evidence to identify behaviors worth preserving or formulate repair hypotheses. Cross-Group Policy Update reviews the resulting proposals against evidence pooled across groups, including observations that yield no proposed edit, to refine their content and applicability. Reviewed proposals form a bounded textual patch, with adoption of the candidate context determined by held-out validation rewards. Together, these components establish a reward-driven policy optimization loop in which multiple attempts jointly inform reusable context updates. We evaluate TextualRL with five target agents on six benchmarks. Averaged over the six benchmarks, TextualRL improves test accuracy over the base model by 24.4 and 15.3 percentage points for GPT-5.5 and Qwen3.8-27B, respectively.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
Related papers
NORMCRAFT: Cultural Norm Generation for Context-Aware Language Model Alignment
Shared title terminologycs.CLTangyuan Zhang, Zhuang Li, Fatemeh Shiri et al.
Beyond Fixed-Context Likelihood: Zero-Shot AI-Generated Text Detection via Context Perturbation Discrepancy
Shared title terminologycs.CLYifan Tang, Jingran Li, Yihao Wang et al.
Avalon-M1: Reinforcement Learning from Collective Rewards
Shared title terminologycs.CLIliyan Zarov, Henry Course, Anthony Hartshorn et al.
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink
From Rewarding What Models Say to How They Think: Attention Process Reward Model for LLM Reinforcement Learning
Shared title terminologycs.CLKairong Han, Nuanqiao Shan, Ziyu Zhao et al.
Same Context, Different Agents: A Behavioral Study of Semantic Layers, Multi-Agent Orchestration and Memory Compaction in Data Agents
Shared title terminologycs.CLZhivar Sourati, Marianne Menglin Liu, Zheng Wang et al.