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

BERTScore: Evaluating Text Generation with BERT

Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, Yoav Artzi

TL;DR

BERTScore is a next-generation evaluation metric for text generation that replaces simple string matching with semantic similarity. By leveraging contextual embeddings from pre-trained language models like BERT, it captures the underlying meaning of sentences far more accurately than traditional n-gram metrics like BLEU. This approach shows significantly higher correlation with human judgment and greater robustness to adversarial word-swapping.

The Problem with N-Gram Metrics

For nearly two decades, the "gold standard" for evaluating machine translation and image captioning has relied on metrics like BLEU and ROUGE. These metrics depend heavily on n-gram overlap—essentially counting how many sequences of words in a candidate sentence exactly match those in a reference sentence.

However, surface-form matching suffers from two major flaws:

  1. Paraphrase Blindness: It penalizes semantically identical sentences that use different vocabulary (e.g., "people like foreign cars" vs. "consumers prefer imported cars").
  2. Structural Fragility: It often fails to catch meaning-altering changes in word order (e.g., "A because B" vs. "B because A") if the local n-gram overlap remains high.

To bridge this gap, the authors propose BERTScore, which evaluates semantic equivalence rather than just lexical overlap.

Methods: How BERTScore Works

BERTScore represents sentences as sequences of contextual embeddings generated by a pre-trained model (such as BERT, RoBERTa, or XLNet). Unlike traditional static word embeddings (like Word2Vec), these vectors change dynamically based on the surrounding context of the sentence.

The BERTScore Pipeline

The calculation follows a straightforward process:

  1. Contextual Embedding: Both the reference and candidate sentences are passed through a pre-trained language model to extract a dense vector representation for every token.
  2. Pairwise Cosine Similarity: The metric computes the cosine similarity between all possible pairs of tokens across the two sentences.
  3. Maximum Similarity (Greedy Matching):
  4. Recall: Each token in the reference is matched to the most similar token in the candidate.
  5. Precision: Each token in the candidate is matched to the most similar token in the reference.
  6. F1 Score: These precision and recall scores are combined into a harmonic mean to produce the final evaluation score.

Novel Additions: * Importance Weighting (Optional): The authors optionally apply Inverse Document Frequency (IDF) weights to give more importance to rare, content-heavy words while down-weighting common function words. * Baseline Rescaling: Because the cosine similarities of BERT vectors often fall into a narrow, highly positive range (e.g., 0.7 to 0.9), the authors rescale the scores against a baseline of random sentence pairs to make the final metric more readable and discriminative.

Key Insights

  • Context is King: Because BERTScore uses contextual embeddings, it can easily distinguish between different meanings of the same word (polysemy) based on sentence structure—a feat BLEU simply cannot achieve.
  • Intermediate Layers are Best: A surprising finding is that the final layers of BERT are often less effective for evaluation. The authors found that intermediate layers (e.g., layer 9 out of 12 for BERT-base) capture the best general-purpose semantic representations.
  • Robustness to "Adversarial" Swaps: In tasks specifically designed to fool models with word-swapped sentences that have different meanings (like the PAWS dataset), traditional metrics often give high scores. BERTScore is significantly more robust, correctly identifying that the meaning has changed even if the exact word count remains identical.

Key Results

The authors conducted an exhaustive evaluation using outputs from 149 translation systems across 14 language pairs (WMT18), standard image captioning challenges (COCO 2015), and adversarial datasets.

Performance Comparison Table
  • Human Correlation: BERTScore consistently outperformed BLEU, METEOR, and ROUGE in correlating with human judgments across nearly all language pairs in the WMT18 benchmark.
  • Image Captioning: On the COCO dataset, BERTScore surpassed task-specific metrics like SPICE, despite being a general-purpose text metric.
  • Speed and Practicality: While slower than a simple n-gram counter, BERTScore remains highly practical. It can process ~192 candidate-reference pairs per second on a single GTX-1080Ti GPU, making it viable for routine model validation.
  • Model Selection: In "Hits@1" experiments (testing a metric's ability to correctly identify the best-performing model out of a lineup), BERTScore showed a clear advantage over n-gram baselines.

Limitations and Future Work

While a massive step forward, BERTScore is not without limitations:

  • Factual Errors: The metric still struggles with certain factual substitutions. For example, it might assign high similarity to a translation that swaps "Monday" for "Tuesday" because the contextual "vibe" and part-of-speech of the sentence remain highly similar.
  • Domain Sensitivity: While IDF weighting helps, the effectiveness of the metric can vary depending on the domain of the text and the specific pre-trained model utilized.
  • Differentiability: Because BERTScore is fully differentiable, the authors suggest an exciting avenue for future work: using it directly as a loss function to train text generation models, which could potentially reduce the "exposure bias" commonly seen with standard cross-entropy training.

Summary updated

BibTeX
@inproceedings{zhang2020bertscore,
  author = {Tianyi Zhang and Varsha Kishore and Felix Wu and Kilian Q. Weinberger and Yoav Artzi},
  title = {{BERTScore: Evaluating Text Generation with BERT}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure