Code review automation is an important area of research given the time and effort required by traditional processes. Evaluating comment generation models requires automated metrics that quantify the similarity between generated and human-authored comments. Prior work has relied on lexical metrics like BLEU and ExactMatches, which fail to capture semantic differences when phrasing varies. Sentence embedding models offer a promising alternative; however, so far there has been no evidence of their superiority in capturing semantic similarity on code review data. In an empirical study with human subjects, we use OpenAI embeddings to assess semantic similarity in review comments. Our analyses show that the embedding-based metric aligns more closely with human annotations than BLEU. Furthermore, our method to support metric choices with empirical evidence may represent a significant advancement in the domain.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Empirical Analysis of OpenAI Embeddings for Semantic Code Review Comment Similarity

  • Robert Heumüller,
  • Theo Langer,
  • Frank Ortmeier

摘要

Code review automation is an important area of research given the time and effort required by traditional processes. Evaluating comment generation models requires automated metrics that quantify the similarity between generated and human-authored comments. Prior work has relied on lexical metrics like BLEU and ExactMatches, which fail to capture semantic differences when phrasing varies. Sentence embedding models offer a promising alternative; however, so far there has been no evidence of their superiority in capturing semantic similarity on code review data. In an empirical study with human subjects, we use OpenAI embeddings to assess semantic similarity in review comments. Our analyses show that the embedding-based metric aligns more closely with human annotations than BLEU. Furthermore, our method to support metric choices with empirical evidence may represent a significant advancement in the domain.