[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83903-en":3,"doc-seo-83903-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},83903,8796095461610,"Oliver","https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c",8,"Research & Report","From Failing to Passing Evolving Natural Language Prompt Optimization Rules for LLM Code Generation","Large language models are highly sensitive to how prompts are phrased, where small wording changes can significantly harm coding performance. This work explores whether such sensitivity can be leveraged to improve results by automatically searching for and evolving natural-language transformation rules with strong downstream effects. It introduces DUALFIX, a staged repair pipeline combining evolved transformations with execution-feedback repair. Evaluated on LiveCodeBench and APPS across three models, the method recovers up to 30% of baseline failures and transfers rules zero-shot between models.","From Failing to Passing: Evolving Natural Language Prompt Optimization Rules for LLM  \nCode Generation  \nAmal Akli  \nUniversity of Luxembourg Luxembourg [amal.akli@uni.lu](amal.akli@uni.lu)  \nMelissa Akli University of Toulouse  \nFrance  \n[melissa.akli@utoulouse.fr](melissa.akli@utoulouse.fr)  \nCedric Richter  \nUniversity of Luxembourg Luxembourg [cedric.richter@uni.lu](cedric.richter@uni.lu)  \narXiv :2607 .05 12 1v 1 [ cs . SE] 6 Jul 2026  \nMike Papadakis University of Luxembourg  \nLuxembourg [michail.papadakis@uni.lu](michail.papadakis@uni.lu)  \nYves Le Traon  \nUniversity of Luxembourg Luxembourg [Yves.LeTraon@uni.lu](Yves.LeTraon@uni.lu)  \nAbstract—Large language models are known to be sensitive to prompt formulation. Even minor variations in wording can substantially degrade performance. This sensitivity reveals an opportunity: if prompt phrasing can harm performance, can it be used to improve it? To investigate this question, we introduce a search-based approach that identifies and evolves a set of natural language transformation rules with strong downstream effects on coding performance. We then propose DUALFIX, a staged repair pipeline that combines the evolved transformation rules with execution-feedback repair, addressing both specification-level and implementation-level failures. A key strength of our approach lies in its generality: the evolved rules are error-agnostic, reusable across problems, and transferable across models. We evaluate DUALFIX against execution-feedback repair baselines across three models on two challenging benchmarks, LiveCodeBench and APPS. Our results show that the evolved transformations fix from 10-30% of failing cases, including 12–17% of failures that execution-based repair alone cannot resolve. Overall, DualFix recovers up to 30% of baseline failures and fixes 3–5 times more failing cases than Self-Fix across all evaluated settings. Furthermore, we also show that rules evolved on one model transfer zero-shot to other models, outperforming executionfeedback repair without any re-optimization.  \nIndex Terms—Automatic prompt optimization, SSBSE, LLM Code Generation  \nI. INTRODUCTION  \nLarge language models (LLMs) have become increasingly capable in code generation tasks, achieving strong performance on benchmarks such as HumanEval [8], APPS [13], and LiveCodeBench [16] . Despite these advances, the generated code is often incorrect, as it may fail to fully capture or adhere to the user’s intent [5] . Consequently, users must manually test and validate the produced code to ensure that the generated code meets its expectations. This raises an important question: how can we effectively and efficiently repair faults in LLMgenerated code?  \nA key challenge in repairing LLM-generated code is that existing approaches [9], [21], [29] are often ineffective at  \nfixing errors when relying on the original prompts and test failure signals. As a result, users must engage in multiple iterations of ad-hoc prompt rewriting to obtain acceptable solutions. Unfortunately, the question of automatic repair falls short given the inability of the LLMs to extrapolate correct implementations for challenging cases [23] . Indeed, our results indicate that performing up to three repair iterations based on the original prompts and test-execution (failure) feedback resolves just 10–19% of the failing cases.  \nThis suggests that if we can develop generic and effective methods to transform failing code into passing solutions without human intervention, we could significantly mitigate the practical limitations of automated code generation. Such approaches would enable generated code to more reliably conform to both the intended task specification and associated tests, thereby strengthening the effectiveness and applicability of so-called “vibe coding.”  \nExisting work on prompt optimization, such as Chainof-Thought prompting [33], MIPRO [26], and GEPA [1], has primarily been developed in the context of system-level prompti","cbCaijz3UKOjtE5t","https://ap.wps.com/l/cbCaijz3UKOjtE5t","pdf",1560321,3,1,13,"English","en",105,"# Introduction\n# Prompt Optimization for Code Generation\n## Rule-based and Error-based Rewriting\n# DUALFIX Method\n## Staged Repair Pipeline\n# Experimental Evaluation\n## Benchmarks and Results\n## Cross-Model Transfer","[{\"question\":\"Why do LLM prompt phrasing changes affect code generation quality?\",\"answer\":\"LLMs are sensitive to prompt formulation, and even minor wording variations can substantially degrade performance. This can lead generated code to fail to match the intended requirements.\"},{\"question\":\"What is DUALFIX and how does it repair failing code?\",\"answer\":\"DUALFIX is a staged repair pipeline that first applies error-based rewriting. If execution-feedback repair cannot resolve the failure, it falls back to rule-based rewriting using evolved natural-language transformation rules.\"},{\"question\":\"How effective is DUALFIX compared with execution-feedback repair baselines?\",\"answer\":\"Results show evolved transformations fix 10–30% of failing cases, including 12–17% that execution-based repair alone cannot resolve. Overall, DualFix recovers up to 30% of baseline failures and fixes 3–5 times more failing cases than Self-Fix.\"}]",1784191334,33,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"from-failing-to-passing-evolving-natural-language-prompt-optimization-rules-for-llm-code-generation","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/research-report/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/from-failing-to-passing-evolving-natural-language-prompt-optimization-rules-for-llm-code-generation/83903/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-26","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"Why do LLM prompt phrasing changes affect code generation quality?","Question",{"text":75,"@type":76},"LLMs are sensitive to prompt formulation, and even minor wording variations can substantially degrade performance. This can lead generated code to fail to match the intended requirements.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What is DUALFIX and how does it repair failing code?",{"text":80,"@type":76},"DUALFIX is a staged repair pipeline that first applies error-based rewriting. If execution-feedback repair cannot resolve the failure, it falls back to rule-based rewriting using evolved natural-language transformation rules.",{"name":82,"@type":73,"acceptedAnswer":83},"How effective is DUALFIX compared with execution-feedback repair baselines?",{"text":84,"@type":76},"Results show evolved transformations fix 10–30% of failing cases, including 12–17% that execution-based repair alone cannot resolve. Overall, DualFix recovers up to 30% of baseline failures and fixes 3–5 times more failing cases than Self-Fix.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]