arXiv:2601.21526cs.AIcs.CL2026-01被引 8

让程序自动生成与优化形成闭环,持续改进代码质量。

KAPSO: A Knowledge-grounded framework for Autonomous Program Synthesis and Optimization

  • 以自然语言为目标,通过迭代生成、执行与评估优化代码。
  • 在两个基准上实现端到端性能,解决调试失败与知识复用问题。
  • 适合需要长期优化和专家经验积累的自动化编程场景。

我们提出KAPSO,一个用于自主程序合成与优化的模块化框架。给定自然语言目标与评估方法,KAPSO通过迭代进行构思、代码生成与编辑、执行、评估与学习,逐步优化可运行的代码以达成可量化的目标。不同于将生成视为终点,KAPSO将生成作为长周期优化循环中的操作符,进展由评估结果定义。为应对编码代理中常见的长期失败问题,如实验状态丢失、脆弱的调试和领域知识复用不足,KAPSO集成三个紧密耦合组件:首先,一个原生Git的实验引擎将每次尝试隔离为分支,确保可重现性并保留溯源信息;其次,一个知识系统整合异构源,包括代码仓库、内部手册及经筛选的外部资源(如文档、论文、网页搜索结果),将其结构化表示,支持对工作流、实现和环境约束的检索;第三,认知记忆层协调检索并维护从实验轨迹(运行日志、差异、评估反馈)中提炼出的可复用经验存档,减少重复错误模式,加速收敛。我们在MLE-Bench(Kaggle式机器学习竞赛)和ALE-Bench(AtCoder启发式优化)上评估了KAPSO,并报告端到端性能。代码已开源:https://github.com/Leeroo-AI/kapso

原文摘要 · Abstract (English)

We introduce KAPSO, a modular framework for autonomous program synthesis and optimization. Given a natural language goal and an evaluation method, KAPSO iteratively performs ideation, code synthesis and editing, execution, evaluation, and learning to improve a runnable artifact toward measurable objectives. Rather than treating synthesis as the endpoint, KAPSO uses synthesis as an operator within a long-horizon optimization loop, where progress is defined by evaluator outcomes. KAPSO targets long-horizon failures common in coding agents, including lost experimental state, brittle debugging, and weak reuse of domain expertise, by integrating three tightly coupled components. First, a git-native experimentation engine isolates each attempt as a branch, producing reproducible artifacts and preserving provenance across iterations. Second, a knowledge system ingests heterogeneous sources, including repositories, internal playbooks, and curated external resources such as documentation, scientific papers, and web search results, and organizes them into a structured representation that supports retrieval over workflows, implementations, and environment constraints. Third, a cognitive memory layer coordinates retrieval and maintains an episodic store of reusable lessons distilled from experiment traces (run logs, diffs, and evaluator feedback), reducing repeated error modes and accelerating convergence. We evaluated KAPSO on MLE-Bench (Kaggle-style ML competitions) and ALE-Bench (AtCoder heuristic optimization), and report end-to-end performance. Code Available at: https://github.com/Leeroo-AI/kapso

程序合成自动优化知识增强闭环系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。