# Terminal-RSI: Recursive Self-Improving Terminal Agents via Recursive Self-Rewrite and Policy-Refine

DevFeed: [Terminal-RSI: Recursive Self-Improving Terminal Agents via Recursive Self-Rewrite and Policy-Refine](<https://devfeed.tech/articles/terminal-rsi-recursive-self-improving-terminal-agents-via-recursive-self-rewrite-and-policy-refine-111938.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.22192>)

Author: Junyao Yang, Zongxia Li, Yucheng Shi, Zhongzhi Li, Ruhan Wang, Ruiwen Zhou, Haitao Mi, Shuicheng Yan, Leowei Liang

Published: 2026-11-02T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>)

Topics: [rlvr](<https://devfeed.tech/topics/rlvr.md>), [Reinforcement learning](<https://devfeed.tech/topics/reinforcement-learning.md>), [agentic workflows](<https://devfeed.tech/topics/agentic-workflows.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [learning](<https://devfeed.tech/tags/learning.md>), [model](<https://devfeed.tech/tags/model.md>), [policy](<https://devfeed.tech/tags/policy.md>), [process](<https://devfeed.tech/tags/process.md>), [progress](<https://devfeed.tech/tags/progress.md>), [qwen3-8-27b](<https://devfeed.tech/tags/qwen3-8-27b.md>), [reward](<https://devfeed.tech/tags/reward.md>), [rewrite](<https://devfeed.tech/tags/rewrite.md>), [rsi](<https://devfeed.tech/tags/rsi.md>), [semantic](<https://devfeed.tech/tags/semantic.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [stage](<https://devfeed.tech/tags/stage.md>), [terminal](<https://devfeed.tech/tags/terminal.md>), [terminal-agents](<https://devfeed.tech/tags/terminal-agents.md>), [terminal-bench](<https://devfeed.tech/tags/terminal-bench.md>), [verification](<https://devfeed.tech/tags/verification.md>)

## AI overview

Terminal-RSI alternates rewriting verified trajectories (RSR) with critic-inheriting policy refinement (RPR) to turn partial progress into verified task completion. Its methods include turn-boundary GAE, family-calibrated dense rewards, and rewards separating strict success from partial credit. Across five stages starting from Qwen3.8-27B, Terminal-RSI-27B reports 19.84% on Terminal-Bench 4.0, 86.52% on 2.1, 16.95% on 3.0, and 79.00% on Terminal-Bench Hard. On LHTB, process reward increased from 0.21 to 0.37 and strict completions from 0/46 to 5/46; SWR100 success rose from 3% to 6%. These results are reported for the described benchmarks; the supplied text is an abstract, not full-document evidence.

## Source excerpt

arXiv:2610.22192v3 Announce Type: replace Abstract: Converting verifier outcomes into useful policy updates and partial progress into complete task resolution is crucial for terminal agents. We present Terminal-RSI, which alternates Recursive Self-Rewrite (RSR) of verified trajectories with critic-inheriting Recursive Policy-Refine (RPR). We formulate Turn-Boundary Skip-Observation GAE (TB-GAE) to retain token-specific baselines while applying decay across interaction turns. Family Dense Reward (FDR) calibrates semantic progress across task families; Success-Prioritized Reward (SPR) separates strict success from bounded partial credit. A Warm-up Critic Model, recursive critic handoff, and stage-specific learning rates coordinate the two refinement phases. The five-stage sequence from Qwen3.8-27B base model through RSR-1, RPR-1, RSR-2, and RPR-2 yields Terminal-RSI-27B: 19.84% on Terminal-Bench 4.0, 86.52% on Terminal-Bench 2.1, 16.95% on Terminal-Bench 3.0, and 79.00% on Terminal-Bench Hard. On LHTB, process reward rises from 0.21 to 0.37 and strict completion from 0/46 to 5/46; SWR100 success doubles from 3.00% to 6.00%. By recursively coupling verified trajectory rewriting with critic-inheriting policy refinement, each retained stage consolidates discovered behaviors and progressively advances the agent from partial local repairs to strict terminal verification.