[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-496932-105":59,"doc-detail-496932-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","refactorbench-evaluating-stateful-reasoning-in-language-agents-through-code","REFACTORBENCH - Evaluating Stateful Reasoning in Language Agents Through Code","","Recent advances in language model (LM) agents and function calling enable autonomous, feedback-driven problem solving across digital domains. RefactorBench is introduced as a benchmark with 100 large, handcrafted multi-file refactoring tasks in popular open-source repositories. Tasks require exploring cross-file dependencies and following three mutually exclusive natural-language instruction sets. Baselines show LM agents achieve 22% on base instructions versus 87% for human developers, with trajectory analysis revealing distinct failure modes and state tracking issues. Conditioning on state representations improves success by 43.9%.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/refactorbench-evaluating-stateful-reasoning-in-language-agents-through-code/496932/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/refactorbench-evaluating-stateful-reasoning-in-language-agents-through-code/496932.png","ImageObject",300,407,{"name":92,"@type":93},"lugxt","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-15","2026-10-02",true,{"@type":102,"interactionType":103,"userInteractionCount":44},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is RefactorBench, and what tasks does it benchmark?","Question",{"text":112,"@type":113},"RefactorBench is a benchmark of 100 large, handcrafted multi-file code refactoring tasks in popular open-source repositories. Each task must be solved with reasoning across dependencies in multiple files.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do baseline language model agents perform on RefactorBench?",{"text":117,"@type":113},"Baseline LM agents solve only 22% of tasks with base instructions, while a human developer with short time constraints solves 87%. The evaluations also reveal multiple unique failure modes.",{"name":119,"@type":110,"acceptedAnswer":120},"How does the state-aware approach improve performance?",{"text":121,"@type":113},"By adapting a baseline agent to condition on representations of state, the work reports a 43.9% improvement in solving RefactorBench tasks, indicating benefits from better state tracking.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},496932,1791427353,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":44,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":145,"preview_page_count":19,"preview_urls":146},3985747862600,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","REFACTORBENCH: EVALUATING STATEFUL REASONING IN LANGUAGE AGENTS THROUGH CODE  \nDhruv Gautam 1 ∗ Spandan Garg2 Jinu Jang2 Neel Sundaresan2 Roshanak Zilouchian Moghaddam2  \n1UC Berkeley 2Microsoft  \nABSTRACT  \nRecent advances in language model (LM) agents and function calling have enabled autonomous, feedback-driven systems to solve problems across various digital domains. To better understand the unique limitations of LM agents, we introduce RefactorBench, a benchmark consisting of 100 large handcrafted multi-file refactoring tasks in popular open-source repositories. Solving tasks within RefactorBench requires thorough exploration of dependencies across multiple files and strong adherence to relevant instructions. Every task is defined by 3 natural language instructions of varying specificity and is mutually exclusive, allowing for the creation of longer combined tasks on the same repository. Baselines on RefactorBench reveal that current LM agents struggle with simple compositional tasks, solving only 22% of tasks with base instructions, in contrast to a human developer with short time constraints solving 87% . Through trajectory analysis, we identify various unique failure modes of LM agents, and further explore the failure mode of tracking past actions. By adapting a baseline agent to condition on representations of state, we achieve a 43.9% improvement in solving RefactorBench tasks.  \nWe further extend our state-aware approach to encompass entire digital environments and outline potential directions for future research. RefactorBench aims to support the study of LM agents by providing a set of real-world, multi-hop tasks within the realm of code.1  \n1 INTRODUCTION  \n“Repetition is the root of all software evil” —Martin Fowler  \nLarge language models (LLMs) have been quickly acquiring new capabilities (Bubeck et al., 2023), leading towards adoption of AI-powered systems in various formats and domains. The increasing usage of LLM powered tools like Github Copilot have greatly improved the capability of developers in software development tasks (Peng et al., 2023) . More recently, an emphasis on multi-step execution through LLM feedback loops has unlocked the ability to solve harder problems within a variety of fields (Reed et al., 2022 ; Sumers et al., 2024 ; Yao & Narasimhan, 2023), including parts of software engineering.  \nThis new paradigm of solving larger software tasks has led to the construction of a variety of new automated software engineering (ASE) systems, most being structured as LM agents (Wang et al., 2024c; [Cognition.ai](Cognition.ai), 2024; AWS Q Developer, 2024; Gauthier, 2024; [Aide.dev](Aide.dev), 2024; ¨Orwall, 2024 ; Yang et al., 2024 ; Tufano et al., 2024 ; Wang et al., 2024d ; Chen et al., 2024a ; Zhang et al., 2024b ; Arora et al., 2024 ; Xia et al., 2024 ; Zhang et al., 2024a) . Evaluations for such systems are currently largely comprised from real world data on Github (Jimenez et al., 2024 ; LaBash et al., 2024) . While being the strongest open-source signal for software engineering tasks at scale, Github is inherently noisy through its snapshot nature, also requiring strong filtration and validation testing for reliable evaluations (Chowdhury et al., 2024 ; Bowman & Dahl, 2021) . We find that the filtration causes skewed task styles, creating a necessity for new data to diversify coding benchmarks.  \n∗Work done during internship at Microsoft. [Correspondence to dhruvgautam@berkeley.edu](Correspondence to dhruvgautam@berkeley.edu)[ ](Correspondence to dhruvgautam@berkeley.edu)1Data available at: [https://github.com/microsoft/RefactorBench](https://github.com/microsoft/RefactorBench)  \nFigure 1: RefactorBench task instances are multi-file refactors verified by custom AST unit testing. Tasks are split over popular open-source Python repositories and reference solutions are withheld to prevent overfitting to the task.  \nTo address these challenges, we present RefactorBench, a benchmark designed to ev","cbCaipKXX6V3Hywm","https://ap.wps.com/l/cbCaipKXX6V3Hywm","pdf",1563875,32,"English","# Abstract\n# Introduction\n## Background and motivation\n## RefactorBench benchmark design\n## Evaluation results and failure modes\n## State-aware interfaces and improvements","[{\"question\":\"What is RefactorBench, and what tasks does it benchmark?\",\"answer\":\"RefactorBench is a benchmark of 100 large, handcrafted multi-file code refactoring tasks in popular open-source repositories. Each task must be solved with reasoning across dependencies in multiple files.\"},{\"question\":\"How do baseline language model agents perform on RefactorBench?\",\"answer\":\"Baseline LM agents solve only 22% of tasks with base instructions, while a human developer with short time constraints solves 87%. The evaluations also reveal multiple unique failure modes.\"},{\"question\":\"How does the state-aware approach improve performance?\",\"answer\":\"By adapting a baseline agent to condition on representations of state, the work reports a 43.9% improvement in solving RefactorBench tasks, indicating benefits from better state tracking.\"}]","REFACTORBENCH - Evaluating Stateful Reasoning in Language Agents Through Code | PDF",1790944186,81,[147,151,155,159],{"page_no":8,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/28d016540fbc3b9eac1e509db9937f1e.webp",983,1272,{"page_no":14,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/b3f6a3818d0cda40f124672204033354.webp",982,1270,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/619511332f3f964aa87b7bfde9ab8f60.webp",981,1269,{"page_no":19,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/87c179b40601105c2faa17ea6661c26c.webp",980,1268]