TextualRL: Textual Reinforcement Learning for Context Management

Tianyu Huai, Jie Zhou, Bo Mao, Qin Chen, Liang He +1 more
10/13/2026
cs.CLcs.AI
rl

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{huai2026textualrl,
  title  = {TextualRL: Textual Reinforcement Learning for Context Management},
  author = {Tianyu Huai and Jie Zhou and Bo Mao and Qin Chen and Liang He and Xipeng Qiu},
  year   = {2026},
  eprint = {2610.18216},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.18216v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.18216.svg)](https://codeofpaper.com/paper/2610.18216)

Discussion