KCoEvo: A Knowledge Graph Augmented Framework for Evolutionary Code Generation
- URL: http://arxiv.org/abs/2603.07581v1
- Date: Sun, 08 Mar 2026 10:39:48 GMT
- Title: KCoEvo: A Knowledge Graph Augmented Framework for Evolutionary Code Generation
- Abstract summary: We propose a knowledge graph-augmented framework that decomposes the migration task into two synergistic stages: evolution path retrieval and path-informed code generation.<n>Our approach constructs static and dynamic API graphs to model intra-version structures and cross-version transitions, enabling structured reasoning over API evolution.
- Score: 25.38402999279553
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Code evolution is inevitable in modern software development. Changes to third-party APIs frequently break existing code and complicate maintenance, posing practical challenges for developers. While large language models (LLMs) have shown promise in code generation, they struggle to reason without a structured representation of these evolving relationships, often leading them to produce outdated APIs or invalid outputs. In this work, we propose a knowledge graph-augmented framework that decomposes the migration task into two synergistic stages: evolution path retrieval and path-informed code generation. Our approach constructs static and dynamic API graphs to model intra-version structures and cross-version transitions, enabling structured reasoning over API evolution. Both modules are trained with synthetic supervision automatically derived from real-world API diffs, ensuring scalability and minimal human effort. Extensive experiments across single-package and multi-package benchmarks demonstrate that our framework significantly improves migration accuracy, controllability, and execution success over standard LLM baselines. The source code and datasets are available at: https://github.com/kangjz1203/KCoEvo.
Related papers
- Towards Knowledge Alignment in Code LLMs: Contrastive Unlearning for Evolving APIs [1.4228421209315671]
CURE is a contrastive unlearning approach that shifts unlearning from purely suppressing outdated knowledge to explicitly promoting correct API replacements.<n>Experiments show that CURE not only reduces deprecated API usage but also improves correct API replacement, while preserving general code generation performance.
arXiv Detail & Related papers (2026-06-29T18:34:55Z) - LibEvoBench: Probing Temporal Knowledge Stratification in Code Generation Models [12.441288958152931]
Large software projects often depend on older versions of libraries, even as APIs continue to evolve across releases.<n>This creates a challenge for LLMs: they must maintain knowledge of multiple API versions, not merely the latest or most common one.<n>We introduce LibEvoBench, a benchmark spanning multiple versions of Python libraries, along with a new metric, the Software Evolution Understanding Score (SEUS), to measure models' consistency when working with evolving APIs.
arXiv Detail & Related papers (2026-06-24T04:58:28Z) - RealBench: A Repo-Level Code Generation Benchmark Aligned with Real-World Software Development Practices [54.956760584923295]
Researchers have made substantial progress using Large Language Models (LLMs) for code generation.<n>However, developers typically write code based on structured designs or specifications rather than raw natural language descriptions.<n>This gap between existing benchmarks and real industry development practices means that current benchmark scores may not accurately reflect how much code generation can help automate development tasks.
arXiv Detail & Related papers (2026-04-24T15:35:54Z) - Learning to Commit: Generating Organic Pull Requests via Online Repository Memory [11.042326503752756]
Large language model (LLM)-based coding agents achieve impressive results on controlled benchmarks yet routinely produce pull requests that real maintainers reject.<n>We introduce Learning to Commit, a framework that closes this gap through Online Repository Memory.
arXiv Detail & Related papers (2026-03-27T17:58:56Z) - His2Trans: A Skeleton First Framework for Self Evolving C to Rust Translation with Historical Retrieval [45.246293154277886]
His2Trans is a framework that combines a deterministic, build-aware skeleton with self-evolving knowledge extraction to support stable, incremental migration.<n> Experiments on industrial OpenHarmony modules show that His2Trans reaches a 99.75% incremental compilation pass rate.
arXiv Detail & Related papers (2026-03-03T05:42:08Z) - CARD: Towards Conditional Design of Multi-agent Topological Structures [83.18278008173746]
CARD (Conditional Agentic Graph Designer) is a conditional graph-generation framework that instantiates AMACP, a protocol for adaptive multi-agent communication.<n> CARD produces communication structures that are both effective and resilient to shifts in model capability or resource availability.
arXiv Detail & Related papers (2026-03-01T13:02:36Z) - Framework-Aware Code Generation with API Knowledge Graph-Constructed Data: A Study on HarmonyOS [52.483888557864326]
APIKG4SYN is a framework designed to exploit API knowledge graphs for the construction of API-oriented question-code pairs.<n>We build the first benchmark for HarmonyOS code generation using APIKG4SYN.
arXiv Detail & Related papers (2025-11-29T08:13:54Z) - EvoGraph: Hybrid Directed Graph Evolution toward Software 3.0 [0.0]
We introduce **EvoGraph**, a framework that enables software systems to evolve their own source code, build pipelines, documentation, and tickets.<n>EvoGraph fixes 83% of known security vulnerabilities, translates to Java with 93% functional equivalence, and maintains documentation freshness within two minutes.<n>We extend our approach to **evoGraph**, leveraging language-specific SLMs for modernizing.NET, Lisp, CGI, ColdFusion, legacy Python, and Cs.
arXiv Detail & Related papers (2025-08-07T09:36:30Z) - LLM-Driven Collaborative Model for Untangling Commits via Explicit and Implicit Dependency Reasoning [15.20947984949809]
We propose ColaUntangle, a new collaborative consultation framework for commit untangling.<n>ColaUntangle integrates Large Language Model (LLM)-driven agents in a multi-agent architecture.<n>We evaluate ColaUntangle on two widely-used datasets (1,612 C# and 14k Java tangled commits)
arXiv Detail & Related papers (2025-07-22T09:42:13Z) - EvoGit: Decentralized Code Evolution via Git-Based Multi-Agent Collaboration [24.264076742680984]
EvoGit is a decentralized multi-agent framework for software development driven by autonomous code evolution.<n>All coordination emerges through a Git-based phylogenetic graph that tracks the full version lineage.<n>Human involvement is minimal but strategic: users define high-level goals, periodically review the graph, and provide lightweight feedback.
arXiv Detail & Related papers (2025-06-01T05:20:42Z) - ExploraCoder: Advancing code generation for multiple unseen APIs via planning and chained exploration [70.26807758443675]
ExploraCoder is a training-free framework that empowers large language models to invoke unseen APIs in code solution.<n> Experimental results demonstrate that ExploraCoder significantly improves performance for models lacking prior API knowledge.
arXiv Detail & Related papers (2024-12-06T19:00:15Z) - CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databases [13.733229886643041]
Large Language Models (LLMs) excel in stand-alone code tasks like HumanEval and MBPP, but struggle with handling entire code repositories.
Similarity-based retrieval often has low recall in complex tasks, while manual tools and APIs are typically task-specific and require expert knowledge.
We introduce CodexGraph, a system that integrates LLM agents with graph database interfaces extracted from code repositories.
arXiv Detail & Related papers (2024-08-07T17:13:59Z) - VersiCode: Towards Version-controllable Code Generation [58.82709231906735]
Large Language Models (LLMs) have made tremendous strides in code generation, but existing research fails to account for the dynamic nature of software development.
We propose two novel tasks aimed at bridging this gap: version-specific code completion (VSCC) and version-aware code migration (VACM)
We conduct an extensive evaluation on VersiCode, which reveals that version-controllable code generation is indeed a significant challenge.
arXiv Detail & Related papers (2024-06-11T16:15:06Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.