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

📅 2026-01-29
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work proposes a modular autonomous programming framework to address key challenges in long-horizon coding tasks, including fragile debugging, frequent loss of experimental state, and insufficient reuse of domain knowledge. The framework embeds program synthesis within a long-term optimization loop structured around the “conceive–generate–execute–evaluate–learn” cycle. It innovatively integrates a Git-native experimentation engine, a structured multi-source knowledge system encompassing code, documentation, and research papers, and a cognitive memory layer grounded in execution logs. This integration enables end-to-end optimization that is reproducible, knowledge-driven, and capable of accumulating experiential learning. Experiments on MLE-Bench and ALE-Bench demonstrate that the approach significantly reduces recurrent errors, accelerates convergence, and enhances overall performance.

Technology Category

Natural Language Processing: Code Generation / Program Synthesis from Natural LanguageSearch and Optimization: Learning to SearchPlanning, Routing, and Scheduling: Learning for Planning and Scheduling

Application Category

Semantics and Knowledge: Methods to enhance, augment, integrate or synergize semantic models such as knowledge graphs and LLMsSearch and Retrieval-Augmented AI: Web learning to rank, online learning, and counterfactual learning for rankingEconomics, Online Markets and Human Computation: Cost models of using LLMs in production systems
📝 Abstract
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
Problem

Research questions and friction points this paper is trying to address.

autonomous program synthesis
long-horizon failures
domain expertise reuse
experimental state preservation
brittle debugging
Innovation

Methods, ideas, or system contributions that make the work stand out.

autonomous program synthesis
knowledge-grounded optimization
git-native experimentation
cognitive memory
structured knowledge retrieval
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
A
Alireza Nadaf
Leeroo Team
A
Alireza Mohammadshahi
Leeroo Team
Majid Yazdani
Majid Yazdani
Leeroo
AIMachine LearningNatural Language Processing