CodeBERTScore: Evaluating Code Generation with Pretrained Models of Code
Not on the map. Why?
Abstract (arXiv)
Since the rise of neural natural-language-to-code models (NL->Code) that can generate long expressions and statements rather than a single next-token, one of the major problems has been reliably evaluating their generated output. In this paper, we propose CodeBERTScore: an evaluation metric for code generation, which builds on BERTScore (Zhang et al., 2020). Instead of encoding only the generated tokens as in BERTScore, CodeBERTScore also encodes the natural language input preceding the generated code, thus modeling the consistency between the generated code and its given natural language context as well. We perform an extensive evaluation of CodeBERTScore across four programming languages. We find that CodeBERTScore achieves a higher correlation with human preference and with functional correctness than all existing metrics. That is, generated code that receives a higher score by CodeBERTScore is more likely to be preferred by humans, as well as to function correctly when executed. We release five language-specific pretrained models to use with our publicly available code. Our language-specific models have been downloaded more than 1,000,000 times from the Huggingface Hub. Our code and data are available at https://github.com/neulab/code-bert-score
Key facts. Cited by 102 papers in the map (data through 14 Oct 2026). Builds on 28 of its 43 references that are in the map. First posted on arXiv 10 Feb 2023.
Builds on
28 of 43 references.
References · 28
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,218
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,059
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2022GLM-130B: An Open Bilingual Pre-trained Modelcited by 843
16 more
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 452
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
- 2023SantaCoder: don't reach for the stars!cited by 170
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 159
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 153
- 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 91
- 2022Out of the BLEU: how should we assess quality of the Code Generation models?cited by 65
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2022Execution-based Evaluation for Data Science Code Generation Modelscited by 32
- 2022T5Score: Discriminative Fine-tuning of Generative Evaluation Metricscited by 19
Built on by
Citing papers per year: 2023: 16; 2024: 29; 2025: 41; 2026: 16.
102 papers.
Sort:
By area:
- 2023InterCode: Standardizing and Benchmarking Interactive Coding with Execution Feedbackcited by 238
- 2024Agent-as-a-Judge: Evaluate Agents with Agentscited by 238
- 2025Large Language Model Agent: A Survey on Methodology, Applications and Challengescited by 205
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 189
- 2024OmniACT: A Dataset and Benchmark for Enabling Multimodal Generalist Autonomous Agents for Desktop and Webcited by 157
- 2023Learning Performance-Improving Code Editscited by 106
- 2024CPsyCoun: A Report-based Multi-turn Dialogue Reconstruction and Evaluation Framework for Chinese Psychological Counselingcited by 89
- 2025Can LLMs Replace Human Evaluators? An Empirical Study of LLM-as-a-Judge in Software Engineeringcited by 67
- 2023CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translationcited by 57
- 2023Bridging the Gap: A Survey on Integrating (Human) Feedback for Natural Language Generationcited by 55
- 2023ICE-Score: Instructing Large Language Models to Evaluate Codecited by 52
- 2025Evaluating the Diversity and Quality of LLM Generated Contentcited by 51
38 more
- 2024CodeJudge: Evaluating Code Generation with Large Language Modelscited by 44
- 2024Human-In-the-Loop Software Development Agentscited by 42
- 2024Code Comprehension then Auditing for Unsupervised LLM Evaluationcited by 32
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChaincited by 31
- 2023CodeFusion: A Pre-trained Diffusion Model for Code Generationcited by 31
- 2025Rubric Is All You Need: Enhancing LLM-based Code Evaluation With Question-Specific Rubricscited by 29
- 2025RECODE-H: A Benchmark for Research Code Development with Interactive Human Feedbackcited by 25
- 2024Unsupervised Evaluation of Code LLMs with Round-Trip Correctnesscited by 23
- 2023L2CEval: Evaluating Language-to-Code Generation Capabilities of Large Language Modelscited by 22
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2024Consistent Autoformalization for Constructing Mathematical Librariescited by 21
- 2024SyntheT2C: Generating Synthetic Data for Fine-Tuning Large Language Models on the Text2Cypher Taskcited by 19
- 2024CodeRosetta: Pushing the Boundaries of Unsupervised Code Translation for Parallel Programmingcited by 19
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluationcited by 18
- 2023Supersonic: Learning to Generate Source Code Optimizations in C/C++cited by 16
- 2024InterTrans: Leveraging Transitive Intermediate Translations to Enhance LLM-based Code Translationcited by 16
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2023Exploring Distributional Shifts in Large Language Models for Code Analysiscited by 14
- 2023Context Aware Query Rewriting for Text Rankers using LLMcited by 14
- 2024What can Large Language Models Capture about Code Functional Equivalence?cited by 14
- 2025AstroVisBench: A Code Benchmark for Scientific Computing and Visualization in Astronomycited by 13
- 2023QualEval: Qualitative Evaluation for Model Improvementcited by 11
- 2025How Diversely Can Language Models Solve Problems? Exploring the Algorithmic Diversity of Model-Generated Codecited by 11
- 2024Model Editing for LLMs4Code: How Far are We?cited by 10
- 2025From Large to Small: Transferring CUDA Optimization Expertise via Reasoning Graphcited by 10
- 2024Output Format Biases in the Evaluation of Large Language Models for Code Translationcited by 9
- 2025Ensemble Learning for Large Language Models in Text and Code Generation: A Surveycited by 9
- 2024CRScore: Grounding Automated Evaluation of Code Review Comments in Code Claims and Smellscited by 8
- 2025StatLLM: A Dataset for Evaluating the Performance of Large Language Models in Statistical Analysiscited by 8
- 2025Towards Formal Verification of LLM-Generated Code from Natural Language Promptscited by 8
- 2026DevBench: A Realistic, Developer-Informed Benchmark for Code Generation Modelscited by 8
- 2024Harnessing Business and Media Insights with Large Language Modelscited by 7
- 2024Efficient and Universal Watermarking for LLM-Generated Code Detectioncited by 6
- 2024On the Limitations of Embedding Based Methods for Measuring Functional Correctness for Code Generationcited by 6
- 2025Towards Better Understanding of Program-of-Thought Reasoning in Cross-Lingual and Multilingual Environmentscited by 6
- 2023AutoParLLM: GNN-guided Context Generation for Zero-Shot Code Parallelization using LLMscited by 5
- 2024A Transformer-Based Approach for Smart Invocation of Automatic Code Completioncited by 5
- 2025Improving LoRA with Variational Learningcited by 5
50 most cited of 102 All 102 (JSON)
- 2026Beyond Text Matching: Towards Reference-Free Evaluation for Human-Oriented Binary Reverse Engineering7 Aug 2026
- 2026Learning from 53.6K Real-World Developer Edits of AI-Generated Code27 Jul 2026
- 2026Decomposer: Learning to Decompile Symbolic Music to Programs2 Jul 2026
- 2026Repository-Level Solidity Code Generation with Large Language Models: From Prompting to Fine-Tuning18 Jun 2026
- 2026The ACUTE Protocol: Operationalizing Language Model Activations for Better Calibration, Utility, and Trust5 Jun 2026
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization13 May 2026
- 2026A Comprehensive Evaluation of Code Language Models for Security Patch Detection13 May 2026
- 2026Can Code Evaluation Metrics Detect Code Plagiarism?28 Apr 2026
- 2026Why Gaussian Diffusion Models Fail on Discrete Data and How to Prevent It?2 Apr 2026
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2026Rethinking Code Similarity for Automated Algorithm Design with LLMs3 Mar 2026
- 2026CRoCoDiL: Continuous and Robust Conditioned Diffusion for Language2 Mar 2026
38 more
- 2026Modeling Programming Skills with Source Code Embeddings for Context-aware Exercise Recommendation10 Feb 2026
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compiler17 Jan 2026
- 2026DevBench: A Realistic, Developer-Informed Benchmark for Code Generation Models17 Jan 2026
- 2026MPM-LLM4DSE: Reaching the Pareto Frontier in HLS with Multimodal Learning and LLM-Driven Exploration8 Jan 2026
- 2025Code2Doc: A Quality-First Curated Dataset for Code Documentation21 Dec 2025
- 2025Multicalibration for LLM-based Code Generation9 Dec 2025
- 2025Beyond Query-Level Comparison: Fine-Grained Reinforcement Learning for Text-to-SQL with Automated Interpretable Critiques27 Nov 2025
- 2025SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning24 Nov 2025
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Evaluating from Benign to Dynamic Adversarial: A Squid Game for Large Language Models12 Nov 2025
- 2025Software Defined Vehicle Code Generation: A Few-Shot Prompting Approach6 Nov 2025
- 2025MATCH: Task-Driven Code Evaluation through Contrastive Learning27 Oct 2025
- 2025Excision Score: Evaluating Edits with Surgical Precision24 Oct 2025
- 2025Wisdom and Delusion of LLM Ensembles for Code Generation and Repair24 Oct 2025
- 2025From Large to Small: Transferring CUDA Optimization Expertise via Reasoning Graph22 Oct 2025
- 2025Learning Bug Context for PyTorch-to-JAX Translation with LLMs10 Oct 2025
- 2025RECODE-H: A Benchmark for Research Code Development with Interactive Human Feedback7 Oct 2025
- 2025VisDocSketcher: Towards Scalable Visual Documentation with Agentic Systems15 Sep 2025
- 2025CM-Align: Consistency-based Multilingual Alignment for Large Language Models10 Sep 2025
- 2025Towards Formal Verification of LLM-Generated Code from Natural Language Prompts17 Jul 2025
- 2025Improving LoRA with Variational Learning17 Jun 2025
- 2025LLM-as-a-Judge for Reference-less Automatic Code Validation and Refinement for Natural Language to Bash in IT Automation12 Jun 2025
- 2025Measuring Data Science Automation: A Survey of Evaluation Tools for AI Assistants and Agents10 Jun 2025
- 2025AstroVisBench: A Code Benchmark for Scientific Computing and Visualization in Astronomy26 May 2025
- 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluation26 May 2025
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluation22 May 2025
- 2025A Qualitative Investigation into LLM-Generated Multilingual Code Comments and Automatic Evaluation Metrics21 May 2025
- 2025AKRMap: Adaptive Kernel Regression for Trustworthy Visualization of Cross-Modal Embeddings20 May 2025
- 2025Evaluate-and-Purify: Fortifying Code Language Models Against Adversarial Attacks Using LLM-as-a-Judge28 Apr 2025
- 2025Technical Challenges in Maintaining Tax Prep Software with Large Language Models25 Apr 2025
- 2025Evaluating Intermediate Reasoning of Code-Assisted Large Language Models for Mathematics24 Apr 2025
- 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Research22 Apr 2025
- 2025Evaluating the Diversity and Quality of LLM Generated Content16 Apr 2025
- 2025Rubric Is All You Need: Enhancing LLM-based Code Evaluation With Question-Specific Rubrics31 Mar 2025
- 2025Large Language Model Agent: A Survey on Methodology, Applications and Challenges27 Mar 2025
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar 2025
- 2025Ensemble Learning for Large Language Models in Text and Code Generation: A Survey13 Mar 2025
- 2025How Diversely Can Language Models Solve Problems? Exploring the Algorithmic Diversity of Model-Generated Code2 Mar 2025
50 newest of 102 All 102 (JSON)
- 2024Agent-as-a-Judge: Evaluate Agents with Agentscited by 238
- 2025Large Language Model Agent: A Survey on Methodology, Applications and Challengescited by 205
- 2024OmniACT: A Dataset and Benchmark for Enabling Multimodal Generalist Autonomous Agents for Desktop and Webcited by 157
- 2024Human-In-the-Loop Software Development Agentscited by 42
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025Measuring Data Science Automation: A Survey of Evaluation Tools for AI Assistants and Agentscited by 4
- 2025VisDocSketcher: Towards Scalable Visual Documentation with Agentic Systemscited by 1
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?cited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compiler17 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025VisDocSketcher: Towards Scalable Visual Documentation with Agentic Systems15 Sep 2025
- 2025Measuring Data Science Automation: A Survey of Evaluation Tools for AI Assistants and Agents10 Jun 2025
- 2025Large Language Model Agent: A Survey on Methodology, Applications and Challenges27 Mar 2025
- 2024Human-In-the-Loop Software Development Agents19 Nov 2024
- 2024Agent-as-a-Judge: Evaluate Agents with Agents14 Oct 2024
- 2024OmniACT: A Dataset and Benchmark for Enabling Multimodal Generalist Autonomous Agents for Desktop and Web27 Feb 2024
- 2025Evaluating the Diversity and Quality of LLM Generated Contentcited by 51
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChaincited by 31
- 2025From Large to Small: Transferring CUDA Optimization Expertise via Reasoning Graphcited by 10
- 2025Towards Better Understanding of Program-of-Thought Reasoning in Cross-Lingual and Multilingual Environmentscited by 6
- 2026Rethinking Code Similarity for Automated Algorithm Design with LLMscited by 3
- 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluationcited by 2
- 2025Evaluating Intermediate Reasoning of Code-Assisted Large Language Models for Mathematicscited by 1
- 2026Rethinking Code Similarity for Automated Algorithm Design with LLMs3 Mar 2026
- 2025From Large to Small: Transferring CUDA Optimization Expertise via Reasoning Graph22 Oct 2025
- 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluation26 May 2025
- 2025Evaluating Intermediate Reasoning of Code-Assisted Large Language Models for Mathematics24 Apr 2025
- 2025Evaluating the Diversity and Quality of LLM Generated Content16 Apr 2025
- 2025Towards Better Understanding of Program-of-Thought Reasoning in Cross-Lingual and Multilingual Environments25 Feb 2025
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain21 Oct 2023
- 2023Bridging the Gap: A Survey on Integrating (Human) Feedback for Natural Language Generationcited by 55
- 2025RECODE-H: A Benchmark for Research Code Development with Interactive Human Feedbackcited by 25
- 2024Aligning LLMs through Multi-perspective User Preference Ranking-based Feedback for Programming Question Answeringcited by 4
- 2025CM-Align: Consistency-based Multilingual Alignment for Large Language Modelscited by 2
- 2025Self-supervised Attribute-aware Dynamic Preference Ranking Alignmentcited by 0
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimizationcited by 0
- 2026Improving Code Translation with Syntax-Guided and Semantic-aware Preference Optimization13 May 2026
- 2025RECODE-H: A Benchmark for Research Code Development with Interactive Human Feedback7 Oct 2025
- 2025CM-Align: Consistency-based Multilingual Alignment for Large Language Models10 Sep 2025
- 2025Self-supervised Attribute-aware Dynamic Preference Ranking Alignment15 Feb 2025
- 2024Aligning LLMs through Multi-perspective User Preference Ranking-based Feedback for Programming Question Answering27 May 2024
- 2023Bridging the Gap: A Survey on Integrating (Human) Feedback for Natural Language Generation1 May 2023
- 2023InterCode: Standardizing and Benchmarking Interactive Coding with Execution Feedbackcited by 238
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 189
- 2023Learning Performance-Improving Code Editscited by 106
- 2024CPsyCoun: A Report-based Multi-turn Dialogue Reconstruction and Evaluation Framework for Chinese Psychological Counselingcited by 89
- 2025Can LLMs Replace Human Evaluators? An Empirical Study of LLM-as-a-Judge in Software Engineeringcited by 67
- 2023CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translationcited by 57
- 2023ICE-Score: Instructing Large Language Models to Evaluate Codecited by 52
- 2024CodeJudge: Evaluating Code Generation with Large Language Modelscited by 44
- 2024Code Comprehension then Auditing for Unsupervised LLM Evaluationcited by 32
- 2025Rubric Is All You Need: Enhancing LLM-based Code Evaluation With Question-Specific Rubricscited by 29
- 2024Unsupervised Evaluation of Code LLMs with Round-Trip Correctnesscited by 23
- 2023L2CEval: Evaluating Language-to-Code Generation Capabilities of Large Language Modelscited by 22
12 most cited of 71 All 71 (JSON)
- 2026Beyond Text Matching: Towards Reference-Free Evaluation for Human-Oriented Binary Reverse Engineering7 Aug 2026
- 2026Learning from 53.6K Real-World Developer Edits of AI-Generated Code27 Jul 2026
- 2026Decomposer: Learning to Decompile Symbolic Music to Programs2 Jul 2026
- 2026The ACUTE Protocol: Operationalizing Language Model Activations for Better Calibration, Utility, and Trust5 Jun 2026
- 2026A Comprehensive Evaluation of Code Language Models for Security Patch Detection13 May 2026
- 2026Can Code Evaluation Metrics Detect Code Plagiarism?28 Apr 2026
- 2026Modeling Programming Skills with Source Code Embeddings for Context-aware Exercise Recommendation10 Feb 2026
- 2026DevBench: A Realistic, Developer-Informed Benchmark for Code Generation Models17 Jan 2026
- 2026MPM-LLM4DSE: Reaching the Pareto Frontier in HLS with Multimodal Learning and LLM-Driven Exploration8 Jan 2026
- 2025Code2Doc: A Quality-First Curated Dataset for Code Documentation21 Dec 2025
- 2025Multicalibration for LLM-based Code Generation9 Dec 2025
- 2025SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning24 Nov 2025
12 newest of 71 All 71 (JSON)