AnnCoder: A mti-Agent-Based Code Generation and Optimization Model

Read the full article See related articles

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

The rapid progress of LLMs has greatly improved natural language tasks like code generation, boosting developer productivity. However, challenges persist. Generated code often appears "pseudo-correct"—passing functional tests but plagued by inefficiency or redundant structures. Many models rely on outdated methods like greedy selection, which trap them in local optima, limiting their ability to explore better solutions. We propose AnnCoder, a multi-agent framework that mimics the human "try-fix-adapt" cycle through closed-loop optimization. By combining simulated annealing’s exploratory power with genetic algorithms’ targeted evolution, AnnCoder balances wide-ranging searches and local refinements, dramatically increasing the likelihood of finding globally optimal solutions.We speculate that traditional approaches may struggle due to narrow optimization focuses. AnnCoder addresses this by introducing dynamic multi-criteria scoring, weighing functional correctness, efficiency (e.g., runtime/memory), and readability. Its adaptive temperature control acts like a "smart thermostat": slowing cooling when solutions are diverse to encourage exploration, then accelerating convergence as they stabilize. This design elegantly avoids pitfalls of earlier models, much like navigating a maze with both a map and intuition.After conducting thorough experiments, with multiple LLMs analyses across four problem-solving and program synthesis benchmarks—AnnCoder show cases remarkable code generation capabilities—HumanEval 90.85%, MBPP 90.68%,HumanEval-ET 85.37%,EvalPlus 84.8% . AnnCoder has outstanding advantages in solving general programming problems.Moreover, our method consistently delivers superior perfor mance across various programming languages.

Article activity feed