Reproduce “CodeScore: Evaluating Code Generation by Learning Code Execution” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Yihong Dong, Jiazheng Ding, Xue Jiang, Ge Li, Zhuo Li, Zhi Jin

Researchers from Peking University developed CodeScore, an LLM-based metric that estimates functional correctness and executability of generated code by explicitly learning code execution. The system achieved over 40% absolute improvement in correlation with ground-truth functional correctness compared to alternatives and is three orders of magnitude faster than execution-based methods.

Key insights

  • Large Language Models (LLMs) can be effectively fine-tuned to explicitly learn code execution behaviors, providing accurate predictions of functional correctness (PassRatio) and executability.
  • A unified learning framework that integrates generated code with various contextual inputs (reference code, natural language description, or both) and a multi-task objective enhances evaluation versatility and accuracy.
  • Evaluating code against its natural language description, rather than solely a reference code, provides crucial context and enables more robust assessment, especially where diverse correct solutions exist.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.