Yihao Yang
Author directory2026
CodeGrep: An RL-Trained Retrieval Agent for LLM Coding Agents
Wuya Chen | Yihao Yang | Yang Cao | Yue Lin
Proceedings of the Second Workshop for REsearch on Agent Language Models (REALM 2026)
Wuya Chen | Yihao Yang | Yang Cao | Yue Lin
Proceedings of the Second Workshop for REsearch on Agent Language Models (REALM 2026)
Modern LLM coding agents—Claude Code, OpenHands—share a common inefficiency: they spend most of their token budget finding the file to patch, not patching it. On SWE-Bench Verified, a 30B OpenHands agent averages 23 rounds and 631K tokens per resolved issue, dominated by grep, glob, and view_file calls. No open, systematically-studied agent-style code retriever exists at scale to shorten this phase. We introduce CodeGrep, a 14B retrieval agent trained end-to-end with GRPO to issue multi-turn parallel grep/glob/read tool calls and return candidate files to a frozen downstream coding agent.
On all 500 SWE-Bench Verified instances, CodeGrep preserves the downstream resolve rate (25.8% → 27.0%, +1.2pp) while delivering a much larger efficiency gain (−15% rounds, −19% tokens on resolved instances). Across three retrievers, downstream utility follows a precision threshold: BM25 (precision 0.375) degrades the agent, Jina (0.445) is neutral, and only CodeGrep (0.677) crosses the threshold at which retrieval begins to buy efficiency. To enable this study, we mine supervision from 67K open-source agent trajectories (CATM) and build a Git-worktree environment for multi-turn agent RL. In our setting, applying the efficiency signal at the advantage layer, rather than the reward layer, holds KL drift to one-third and translates cleanly into downstream efficiency. We will release the model, training pipeline, RL environment, and evaluation harnesses.
On all 500 SWE-Bench Verified instances, CodeGrep preserves the downstream resolve rate (25.8% → 27.0%, +1.2pp) while delivering a much larger efficiency gain (−15% rounds, −19% tokens on resolved instances). Across three retrievers, downstream utility follows a precision threshold: BM25 (precision 0.375) degrades the agent, Jina (0.445) is neutral, and only CodeGrep (0.677) crosses the threshold at which retrieval begins to buy efficiency. To enable this study, we mine supervision from 67K open-source agent trajectories (CATM) and build a Git-worktree environment for multi-turn agent RL. In our setting, applying the efficiency signal at the advantage layer, rather than the reward layer, holds KL drift to one-third and translates cleanly into downstream efficiency. We will release the model, training pipeline, RL environment, and evaluation harnesses.
CoT-Edit: Reinforcement Learning of Chain-of-Thought Reasoning for Code Edit Suggestion
Wuya Chen | Yihao Yang | Yue Lin
Findings of the Association for Computational Linguistics: ACL 2026
Wuya Chen | Yihao Yang | Yue Lin
Findings of the Association for Computational Linguistics: ACL 2026
Code edit suggestion, which encompasses modifying, refactoring, and maintaining existing code, represents the most frequent software development activity and has become a focal point for AI-powered tools. Traditional methods translate explicit natural language instructions into code edits, while pattern-based approaches learn from users’ historical editing patterns to provide style-consistent and more accurate suggestions. However, these pattern-based methods still face two critical challenges: (1) difficulty handling edits that demand deep contextual reasoning, and (2) lack of interpretability in editing decisions. To tackle this, we propose CoT-Edit, a reinforcement learning framework that guides LLMs to discover chain-of-thought (CoT) reasoning paths for code editing without requiring human-annotated CoT data. Specifically, we design multi-step reasoning framework that enable: (1) analysis-guided code editing, and (2) seamless switching between CoT and non-CoT inference modes. Building on this, we introduce Edit-Aware Reward Modeling (EARM), a fine-grained diff-based reward approach for effective learning. Furthermore, we discover a LoRA merging strategy that enhances model generalization. Evaluations on an industrial dataset show that our approach achieves 60.2% edit accuracy, outperforming all strong baselines. Online A/B tests further confirm its effectiveness in production. Code is available at https://github.com/202230483077yyh/CoT-Edit.
2025
CODEMENV: Benchmarking Large Language Models on Code Migration
Keyuan Cheng | Xudong Shen | Yihao Yang | Tengyue Wang | Yang Cao | Muhammad Asif Ali | Hanbin Wang | Lijie Hu | Di Wang
Findings of the Association for Computational Linguistics: ACL 2025
Keyuan Cheng | Xudong Shen | Yihao Yang | Tengyue Wang | Yang Cao | Muhammad Asif Ali | Hanbin Wang | Lijie Hu | Di Wang
Findings of the Association for Computational Linguistics: ACL 2025
Large language models (LLMs) have demonstrated remarkable proficiency in handling a wide range of tasks within the software engineering domain, but their ability to perform code migration—adapting code to different environments—remains underexplored. In this work, we propose a novel benchmark, : Code Migration Across Environment, designed to evaluate LLMs’ performance in handling code migration tasks. The benchmark comprises 922 data points across 19 Python and Java packages, offering three tasks to systematically evaluate code migration: identifying version-incompatible functions, determining function changes, and adapting code to target environments. Experimental evaluation of across seven LLMs revealed an average pass@1 rate of 26.50%, with GPT-4o performing best at 43.84%. We highlight our key findings as follows: (i) LLMs are more familiar with newer function versions, making them better at migrating legacy code, and (ii) a logical inconsistency where LLMs sometimes identify irrelevant function changes for the target migration environment.