BigO(Bench): Can LLMs Generate Code with Controlled Time and Space Complexity?
Summary
Introduces BigO(Bench), a benchmark for evaluating LLMs on understanding and generating code with specified time/space complexity. Includes tooling to infer algorithmic complexity of any Python function from profiling, plus 3,105 coding problems and 1,190,250 solutions from Code Contests annotated with inferred complexity labels, runtime, and memory footprints across input sizes. Finds token-space reasoning models are unrivaled at code generation but not at complexity understanding, hinting they may not generalize to tasks with no training-time reward.
- Venue
- arXiv
- Source
- arxiv
- Access
- public
- Language
- en
- Added
- Sep 29, 2026
- Verified
- Sep 29, 2026
- Research status
- done
- Found via
- #random-papers
From the source
- Published
- Mar 19, 2025
- Last revised
- Sep 22, 2026
- arXiv categories
- cs.CL, cs.AI, cs.CC
- Citations
- 11
- References
- 0
Abstract (from arXiv)
We introduce BigO(Bench), a novel coding benchmark designed to evaluate the capabilities of generative language models in understanding and generating code with specified time and space complexities. This benchmark addresses the gap in current evaluations that often overlook the ability of models to comprehend and produce code constrained by computational complexity. BigO(Bench) includes tooling to infer the algorithmic complexity of any Python function from profiling measurements, including human- or LLM-generated solutions. BigO(Bench) also includes of set of 3,105 coding problems and 1,190,250 solutions from Code Contests annotated with inferred (synthetic) time and space complexity labels from the complexity framework, as well as corresponding runtime and memory footprint values for a large set of input sizes. We present results from evaluating multiple state-of-the-art language models on this benchmark, highlighting their strengths and weaknesses in handling complexity requirements. In particular, token-space reasoning models are unrivaled in code generation but not in complexity understanding, hinting that they may not generalize well to tasks for which no reward was given at training time.
Tags
Topics
code generation, complexity analysis, benchmarking
Research notes
- Discovery: shared by Pierre Chambon (@PierreChambon6, FAIR/Meta AI & INRIA) in an X thread on 2026-09-29 presenting 3 papers on code optimization: https://x.com/PierreChambon6/status/2104966972043657560
- Method: complexity inference tooling from profiling measurements; evaluation of SOTA models on complexity-constrained generation.
- Submitted 2025-03-19 (v1), revised 2026-09-22 (v3).
Similar entries
- Benchmark Astra vs. Fable 5.1 under a neutral Code quality panel | VulcanBench
- Paper AI4AI-Bench: Benchmarking LLM Agents in Algorithmic Design for Recursive Self-Improvement
- Paper AgentWorld: Benchmarking Long-Horizon Collaboration of Multi-agent LLMs
- Code AI4AI-Bench
- Paper ProgramDistill: From Interactive Web Apps to Verifiable Reference-Guided SWE Tasks
- Paper The Illusion of What If: Evaluating the Breakdown of Counterfactual Reasoning in LLMs