AlgoBench: Benchmarking Algorithmic Adaptation in Code Generation
Abstract
High pass rates on established programming benchmarks such as HumanEval and LiveCodeBench do not always show whether a model can reason about algorithms. Many fixed benchmarks eventually become part of the public training ecosystem through released problem statements, editorials, and generated solutions, allowing later models to improve partly by exposure rather than by stronger algorithmic ability. We introduce ALGOBENCH, a framework that automatically builds novel algorithmic problems from known competitive-programming problems through structured constraint-shifting transformations. Each accepted ALGOBENCH variant is traceable to a source problem, but must make the original reference algorithm fail. Beyond pass@, we introduce complexity-aware metrics -- including OPTT, OPTS, TRAPRATE, GAPT, and CONSENS -- to test whether a solution is not only functionally correct but also asymptotically suitable for the generated problem. Experiments across multiple LLMs and prompting strategies show that performance drops sharply on ALGOBENCH variants, retrieval can increase reuse of the old algorithm, and many correct-looking solutions fail to meet the required complexity. Error analysis shows that failures are mainly algorithmic rather than implementation-level, suggesting that ALGOBENCH evaluates adaptation beyond functional correctness.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI, cs.PL
- Comments
- Under Review
Related papers
Benchmarking Web API Integration Code Generation
Shared title terminologycs.SEDaniel Maninger, Leon Chemnitz, Amir Molzam Sharifloo et al.
RealBench: A Repo-Level Code Generation Benchmark Aligned with Real-World Software Development Practices
Shared title terminologycs.SEJia Li, Hongyi Deng, Yiran Zhang et al.
Benchmarking Code Improvement with Progressive, Adaptive, and Interactive Feedback
Shared title terminologycs.SECuong Chi Le, Aashish Yadavally, Minh Le-Anh et al.
fx(hash): Salvaging The Source Code of 28k Generative Artworks
Shared title terminologycs.SEBenoit Baudry, Valeriia Bezklynska, Martin Monperrus
Micro Operational Robustness of LLMs on Code Generation
Shared title terminologycs.SEDebalina Ghosh Paul, Hong Zhu, Ian Bayley
From Observation to Explanation: Mechanistic Interpretability of LLM-Generated Code for Principled Repair
Shared title terminologycs.SEMusfiqur Rahman