SONAR: New metric to evaluate AI-generated code summaries
MIT researchers propose SONAR, a reference-free framework to evaluate code summaries for AI agents, not humans.
Researchers Simantika Bhattacharjee Dristi and Matthew B. Dwyer from the University of Nebraska-Lincoln have introduced SONAR, a groundbreaking reference-free framework designed to evaluate source code summaries for their utility to LLM-based tools and agents in software engineering tasks. Traditional evaluation methods rely on human-written reference summaries or subjective preferences, which often fail to capture what makes a summary useful for an AI agent performing downstream tasks like code generation or bug fixing.
SONAR shifts this paradigm by introducing a task-aware evaluation approach that measures summaries across four key dimensions: Correctness, Abstraction, Conciseness, and Fluency. The framework leverages a novel code regeneration technique, where a summary is used to regenerate the original code. The quality of this reconstruction serves as an empirical signal of the summary's effectiveness, eliminating the need for human or LLM-based subjective judgments. The researchers found that Correctness and Abstraction significantly correlate with LLM performance, with Correctness demonstrating up to 14x higher correlation than existing baselines. Surprisingly, Conciseness and Fluency—traits highly valued by human developers—showed minimal impact on LLM performance, underscoring the task- and consumer-dependent nature of useful summaries.
- SONAR evaluates code summaries for AI agents, not humans, using a reference-free approach with four dimensions: Correctness, Abstraction, Conciseness, and Fluency.
- Correctness and Abstraction show up to 14x higher correlation with LLM performance than traditional baselines, while Conciseness and Fluency are less impactful.
- The framework uses a code regeneration technique to empirically assess summary quality without relying on human or LLM subjective judgments.
Why It Matters
SONAR provides a data-driven way to evaluate AI-generated code summaries, improving LLM performance in software engineering tasks by focusing on what actually matters to machines.