Modular framework improves AI coding agent performance on new tasks

ModularRSI: Modular and Generalizable Recursive Harness Self-Improvement

Computation and Language

Summary

Improving AI agents so they can get better at coding and complex tasks on their own is hard because changes often only work for specific problems. The authors created ModularRSI, a system that breaks an AI agent's work into five parts and improves each separately by comparing successes and failures across many different tasks. This approach helps the AI agent learn improvements that work well on new, unseen problems and even with different underlying AI models. The result is a more adaptable and better-performing AI agent harness for long, complicated tasks.

What this means in practice

  • For software development teams: Create AI coding assistants that improve themselves on a wide range of programming tasks beyond their initial training sets.
  • For enterprise ai operations teams: Manage and evolve AI agents' execution mechanisms modularly to maintain and improve performance across changing task requirements and models.

Authors

Siwei Wu, Jincheng Ren, Yizhi Li, Haau-Sing Li, Chengran Yang, Yuxuan Zhang, Weicheng Gu, Jian Yang, Riza Batista-Navarro, Chuanyi Zhang, Xianglong Liu, Ming Zhou, Bryan Dai, Chenghua Lin

Abstract

Recent work extends recursive self-improvement (RSI) to agent harnesses for long-horizon coding and terminal tasks, enabling agents to improve execution mechanisms from experience. However, generalizable harness RSI remains challenging. First, evolving harnesses on evaluation benchmarks or their subsets makes it difficult to distinguish reusable improvements from benchmark-specific adaptation. Second, single-trajectory updates can conflate systematic harness deficiencies with instance-specific reasoning and solution details, producing modifications that transfer poorly to unseen tasks. Third, localizing recurring behavioral deficiencies within monolithic harnesses is difficult, while whole-harness optimization can entangle unrelated mechanisms and complicate attribution and validation. We propose ModularRSI, a benchmark-disjoint, contrastive, and modular framework for generalizable harness evolution. ModularRSI contrasts successful and failed trajectories for the same task and aggregates evidence across tasks to identify recurring behavioral deficiencies. It decomposes the evolvable harness into five functional modules: Agent Loop, Tool Use, Observation Management, Context Management, and Task Completion Detection. Each module evolves independently within a restricted modification scope, followed by an integration stage that combines the evolved modules into a unified harness and resolves potential conflicts. To support benchmark-disjoint evolution, we curate 2,000 executable evolution tasks from external sources that are disjoint from downstream evaluation benchmarks. Experiments on TB2.0 and SWE-Bench Verified show consistent improvements on unseen in-domain and cross-domain tasks, with the evolved harness also transferring across different foundation models.