BigO(Bench) -- LLM이 제어된 시간 및 공간 복잡도를 가진 코드를 생성할 수 있는가?
BigO(Bench) -- Can LLMs Generate Code with Controlled Time and Space Complexity?
March 19, 2025
저자: Pierre Chambon, Baptiste Roziere, Benoit Sagot, Gabriel Synnaeve
cs.AI
초록
우리는 생성형 언어 모델이 지정된 시간 및 공간 복잡도를 이해하고 이를 반영한 코드를 생성하는 능력을 평가하기 위해 설계된 새로운 코딩 벤치마크인 BigO(Bench)를 소개합니다. 이 벤치마크는 현재의 평가 방식에서 종종 간과되는 모델의 계산 복잡도를 고려한 코드 이해 및 생성 능력의 격차를 해소합니다. BigO(Bench)는 프로파일링 측정값을 통해 Python 함수의 알고리즘 복잡도를 추론할 수 있는 도구를 포함하며, 이는 인간 또는 LLM(대형 언어 모델)이 생성한 솔루션 모두에 적용됩니다. 또한 BigO(Bench)는 Code Contests에서 수집된 3,105개의 코딩 문제와 1,190,250개의 솔루션을 포함하며, 이들은 복잡도 프레임워크를 통해 추론된 (합성된) 시간 및 공간 복잡도 레이블과 다양한 입력 크기에 대한 런타임 및 메모리 사용량 값을 함께 제공합니다. 우리는 이 벤치마크를 사용하여 여러 최신 언어 모델을 평가한 결과를 제시하며, 복잡도 요구 사항을 처리하는 데 있어 각 모델의 강점과 약점을 강조합니다. 특히, 토큰-공간 추론 모델들은 코드 생성에서는 탁월하지만 복잡도 이해에서는 그렇지 못해, 훈련 시 보상이 주어지지 않은 작업에는 잘 일반화되지 않을 가능성을 시사합니다.
English
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.Summary
AI-Generated Summary