Inferensys

Glossary

BERTScore

An automatic evaluation metric that computes the semantic similarity between tokens in a candidate text and a reference text using contextual embeddings from models like BERT.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
SEMANTIC EVALUATION METRIC

What is BERTScore?

BERTScore is an automatic evaluation metric that computes the semantic similarity between tokens in a candidate text and a reference text using contextual embeddings from models like BERT.

BERTScore is an automatic evaluation metric for text generation that computes the semantic similarity between tokens in a candidate text and a reference text using contextual embeddings from pre-trained transformer models like BERT. Unlike n-gram overlap metrics such as BLEU or ROUGE, BERTScore aligns tokens via cosine similarity in embedding space, capturing paraphrases and semantically equivalent expressions that use different surface forms.

The metric computes precision, recall, and F1 scores by matching each token in the candidate to the most similar token in the reference, and vice versa. Greedy matching with importance weighting—optionally using inverse document frequency—ensures common words are downweighted. BERTScore correlates more strongly with human judgment than lexical metrics, making it a standard for evaluating tasks like abstractive summarization, machine translation, and image captioning where exact word matching fails.

SEMANTIC EVALUATION

Key Features of BERTScore

BERTScore is an automatic evaluation metric that computes the semantic similarity between tokens in a candidate text and a reference text using contextual embeddings from models like BERT. Unlike n-gram metrics, it captures synonymy and paraphrasing.

01

Contextual Embedding Alignment

BERTScore leverages contextual embeddings from pre-trained transformer models like BERT, RoBERTa, or DistilBERT. Each token in the candidate and reference text is represented as a vector that captures its meaning within the specific sentence context, not just its static dictionary definition. This allows the metric to recognize that 'automobile' and 'car' are highly similar in a given context.

  • Token Matching: Computes cosine similarity between every candidate token and every reference token.
  • Greedy Alignment: Each token in the candidate text is matched to the most similar token in the reference text, and vice versa, to compute precision, recall, and F1.
0.95+
Human Correlation
02

Precision, Recall, and F1 Calculation

BERTScore decomposes semantic similarity into three standard metrics, providing a nuanced view of generation quality. Recall measures how much of the reference content is captured by the candidate, penalizing omissions. Precision measures how much of the candidate content is relevant to the reference, penalizing hallucinations or extraneous information. F1 is the harmonic mean, providing a single balanced score.

  • Recall-Oriented: Critical for summarization tasks where coverage of key information is paramount.
  • Precision-Oriented: Critical for tasks where conciseness and factual accuracy are paramount.
03

Importance Weighting with IDF

To prevent common words from dominating the similarity score, BERTScore can incorporate Inverse Document Frequency (IDF) weighting. Tokens that appear frequently across a corpus (like 'the' or 'is') receive a lower weight, while rare, domain-specific terms receive a higher weight. This ensures the metric focuses on semantically meaningful words.

  • Optional Tuning: IDF weighting can be enabled or disabled based on the evaluation domain.
  • Corpus-Specific: Weights are computed from a representative background corpus, making the metric adaptable to specialized jargon.
04

Baseline Rescaling for Readability

Raw BERTScore values are often compressed into a narrow range (e.g., 0.95–1.0), making it difficult to distinguish between good and excellent systems. The metric applies a baseline rescaling technique that normalizes scores against a lower-bound baseline (e.g., random or constant outputs). This stretches the score distribution, making the final F1 value more interpretable and comparable to human judgment scales.

  • Linear Transformation: Maps raw scores to a more intuitive 0–1 range.
  • Improved Discriminability: Makes it easier to see meaningful performance differences between models.
05

Model Tier Selection

The performance of BERTScore is directly tied to the underlying embedding model. Using a larger, more sophisticated model like RoBERTa-large yields higher correlation with human judgments than a smaller model like DistilBERT. The metric allows practitioners to select the model tier that balances computational cost against evaluation accuracy.

  • DistilBERT: Fast, low-resource, good for rapid prototyping.
  • RoBERTa-large: State-of-the-art correlation, higher computational cost.
  • DeBERTa: Advanced model with disentangled attention, often achieving top human correlation scores.
06

Synonymy and Paraphrase Awareness

A core advantage over lexical metrics like BLEU or ROUGE is BERTScore's inherent understanding of synonymy and paraphrasing. Because it operates in a continuous semantic space, a candidate that uses different words to express the same meaning as the reference will receive a high score. This makes it ideal for evaluating abstractive summarization and creative text generation where rigid n-gram overlap fails.

  • Example: 'The cat sat on the mat' vs. 'A feline rested on the rug' would score poorly on BLEU but highly on BERTScore.
  • No Exact Match Required: Evaluates the underlying meaning, not the surface form.
EVALUATION METRIC COMPARISON

BERTScore vs. Traditional Metrics

How BERTScore compares to n-gram overlap metrics like BLEU and ROUGE for evaluating text generation quality

FeatureBERTScoreBLEUROUGE-L

Core mechanism

Contextual embedding similarity

Precision of n-gram overlap

Longest common subsequence

Handles synonyms/paraphrases

Requires tokenization matching

Captures semantic meaning

Correlates with human judgment

0.85-0.90

0.60-0.70

0.65-0.75

Sensitive to word order

Computational cost

High (GPU recommended)

Low (CPU only)

Low (CPU only)

Reference-free variant available

BERTSCORE EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about BERTScore, the semantic evaluation metric for text generation.

BERTScore is an automatic evaluation metric that computes the semantic similarity between a candidate text and a reference text using contextual embeddings from pre-trained transformer models like BERT. Unlike n-gram based metrics such as BLEU or ROUGE, BERTScore does not rely on exact token matches. Instead, it calculates the cosine similarity between each token's contextual embedding in the candidate and every token's embedding in the reference. It uses a greedy matching algorithm to align tokens, computing Precision (how well candidate tokens match reference tokens), Recall (how well reference tokens match candidate tokens), and their F1 score. An optional importance weighting scheme can be applied, often using Inverse Document Frequency (IDF), to emphasize rare, information-rich words over common stop words. This allows BERTScore to recognize paraphrases and semantically equivalent expressions, making it a core component of modern factual consistency scoring and faithfulness metric pipelines.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.