cs.LGOct 26, 2026

MiRL: Error-Targeted Reinforcement Learning for Correcting Terminal Agent Misbehaviors

Authors: Runchu Tian, Zaid Khan, Zun Wang, Justin Chih-Yao Chen, Mohit Bansal

Organizations: Department of Computer Science, University of North Carolina at Chapel Hill

Abstract

Error-targeted learning gives a legible way to improve a model: identify specific weaknesses of the model, train the model to fix these weaknesses, and check whether the weaknesses are fixed. We study how to apply error-targeted learning to terminal agents, which solve long-horizon tasks specified in natural language by interacting with a command shell. Existing error-targeted methods are designed for single-turn tasks, and existing analyses of agent failures are used to evaluate and debug agents rather than to train them. We propose Misbehavior-driven RL (MiRL), which first profiles the errors of a policy to find generalizable misbehaviors: kinds of wrong steps that recur across many environments. MiRL then trains the policy with RL, starting rollouts at the steps where these misbehaviors occur and rewarding a rollout only if it passes the tests and avoids the misbehavior. On Qwen3.5-4B, eight misbehaviors account for 52.1% of wrong steps. After training with MiRL, the policy repeats the measured misbehaviors 43% to 57% less often on average on unseen prefixes. MiRL outperforms TMax-4B on Terminal-Bench Lite (51.8% vs. 47.4%) and matches it on Terminal-Bench 2.1 (21.3% vs. 20.6%), while using 35% of its rollouts. These results show that error-targeted learning can be applied to realistic, long-horizon terminal tasks.

Figures & tables

Appendix figures & tables7 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. ReTerm: Recovery Training for Self-Improving Terminal Agents

    Oct 13, 2026Wei Xie, Kaituo Feng, Shiming Fu +3LLM Agent TrainingSelf-Improving Agents

  2. T1: Terminal Agent Reinforcement Learning for Long-Horizon Tasks

    Sep 10, 2026Junyao Yang, Yucheng Shi, Zhongzhi Li +4RL for Tool UseLong-Horizon Agent Evaluation

  3. Learning Generalizable Behaviors for Terminal Agents

    Aug 23, 2026Yihang Yao, Bo Pang, Xuan Phi Nguyen +3Terminal AgentsGeneralization in RL