KAPSO:基于知识的自主程序综合与优化框架
KAPSO: A Knowledge-grounded framework for Autonomous Program Synthesis and Optimization
January 29, 2026
作者: Alireza Nadaf, Alireza Mohammadshahi, Majid Yazdani
cs.AI
摘要
我们推出KAPSO——一个用于自主程序合成与优化的模块化框架。给定自然语言目标和评估方法后,KAPSO通过迭代执行构思、代码合成与编辑、运行、评估及学习等步骤,持续改进可运行成果以达成可量化目标。该框架将程序合成视为长期优化循环中的操作符而非终点,其进展由评估器结果动态定义。
KAPSO通过三个紧密耦合的组件,针对性解决编程智能体常见的长期性故障:实验状态丢失、脆弱调试机制及领域知识复用能力薄弱。首先,基于git的实验引擎将每次尝试隔离为独立分支,生成可复现成果并保留迭代溯源信息;其次,知识系统整合代码库、内部手册、文档、科研论文及网络搜索结果等异构资源,将其组织成支持工作流、实现方案和环境约束检索的结构化表征;第三,认知记忆层协调检索过程,并维护从实验轨迹(运行日志、差异比较、评估反馈)提炼的可复用经验库,有效减少重复错误模式并加速收敛。
我们在MLE-Bench(Kaggle式机器学习竞赛)和ALE-Bench(AtCoder启发式优化)上评估KAPSO,并报告端到端性能表现。
代码地址:https://github.com/Leeroo-AI/kapso
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