NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Aligning Offline Metrics and Human Judgments of Value for Code Generation Models

Victor Dibia, Adam Fourney, Gagan Bansal, Forough Poursabzi-Sangdeh, Han Liu, Saleema Amershi

Introduction

The evaluation of Large Language Models (LLMs) for code generation has traditionally relied on functional correctness, typically measured by the pass@k metric. While effective for verifying that code meets a specific specification, this binary metric fails to capture the nuanced utility of AI suggestions in real-world "Human-AI pair programming" contexts. A developer may find a suggestion highly valuable if it provides the correct logic or boilerplate, even if it contains a minor error that causes it to fail unit tests. This paper investigates the discrepancy between automated metrics and human perceptions of value.

Methodology

The researchers conducted a user study involving 49 professional programmers. Participants evaluated AI-generated solutions for 164 Python problems from the HumanEval dataset, produced by models such as CodeGen and OpenAI’s Codex. Each generation was rated on three dimensions: Accuracy (functional equivalence), Effort (work required to fix), and Value (likelihood of use as a starting point).

These human judgments were compared against several offline metrics:

  • PASS: Binary functional correctness.
  • EDIT-SIM: Syntactic similarity based on Levenshtein edit distance.
  • BLEU: Token-based overlap.
  • COMBINED: A proposed hybrid metric calculated as min(1.0, PASS + EDIT-SIM).
A code snippet failing functional tests but retaining high human value due to syntactic similarity.

Key Findings

The study revealed that "Effort Saved" is the primary driver of perceived value ($r = 0.94$). Notably, 42% of code snippets that failed all unit tests were still considered valuable by professional developers. This suggests that current leaderboards significantly underestimate the practical utility of many models.

Functional correctness acts as a high-precision but low-recall indicator. While passing code is almost always valuable (only 3% rated low-value), failing code is not necessarily worthless. Syntactic similarity (EDIT-SIM) provides complementary information by identifying "near-miss" solutions that are easy for a human to correct.

Results and Metric Alignment

The proposed COMBINED metric demonstrated a 14% improvement in correlation with human value judgments compared to the standard PASS metric ($r=0.70$ vs $r=0.61$). The hierarchy of correlation with human value was established as: COMBINED > PASS > EDIT-SIM > BLEU.

Correlation matrix showing the alignment between human judgments and automated metrics.

Conclusion and Future Work

By integrating syntactic similarity with functional correctness, the COMBINED metric offers a more human-centric evaluation of code generation models. Future research should address the limitations of reference-based similarity in complex, multi-file software environments and explore more sophisticated ways to automate the measurement of developer effort, potentially moving beyond simple edit distance to model-based effort prediction.

Summary updated

BibTeX
@inproceedings{dibia2023aligning,
  author = {Victor Dibia and Adam Fourney and Gagan Bansal and Forough Poursabzi-Sangdeh and Han Liu and Saleema Amershi},
  title = {{Aligning Offline Metrics and Human Judgments of Value for Code Generation Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.540},
}
Figure