BERTScore operates by first encoding both the candidate and reference texts into token-level embeddings using a pre-trained Transformer model like BERT. It then computes a similarity matrix using cosine similarity between all token pairs, matching each token in the candidate to the most similar token in the reference and vice versa. The metric calculates precision, recall, and an F1 score, with optional importance weighting that can de-emphasize common stop words. This contextual matching allows BERTScore to recognize semantic equivalence even when surface forms differ, such as correctly matching 'attorney' to 'lawyer' in a legal summary.
Glossary
BERTScore

What is BERTScore?
BERTScore is an automatic evaluation metric for text generation that computes the semantic similarity between a candidate text and a reference text using contextual embeddings from a pre-trained BERT model, offering a stronger correlation with human judgment than traditional n-gram overlap metrics.
In legal text summarization pipelines, BERTScore serves as a critical component for evaluating abstractive summarization models where generated phrasing may diverge significantly from the reference while preserving meaning. Unlike ROUGE, which relies on exact n-gram overlap and penalizes legitimate paraphrasing, BERTScore's contextual embeddings capture synonymy and paraphrastic relationships. This makes it particularly valuable for assessing summaries of judicial opinions or contracts where factual consistency and semantic fidelity matter more than verbatim reproduction. The metric's scores range from 0 to 1, with higher values indicating stronger alignment with the reference text's meaning.
Key Features of BERTScore
BERTScore leverages deep contextual embeddings to evaluate text generation quality by computing token-level similarity between a candidate and reference text, moving beyond rigid n-gram overlap to capture semantic equivalence.
Contextual Embedding Matching
Unlike ROUGE or BLEU, which rely on exact token matches, BERTScore computes similarity using contextualized embeddings from pre-trained transformer models like BERT. Each token in the candidate summary is matched to the most similar token in the reference based on cosine similarity in embedding space. This allows the metric to recognize that 'attorney' and 'lawyer' are semantically equivalent, a critical capability for evaluating abstractive summarization where phrasing may differ entirely from the source.
Precision, Recall, and F1 Calculation
BERTScore decomposes evaluation into three standard metrics:
- Precision: Measures how many tokens in the candidate summary align with tokens in the reference, penalizing extraneous or irrelevant content.
- Recall: Measures how many tokens in the reference are captured by the candidate, penalizing omissions.
- F1 Score: The harmonic mean of precision and recall, providing a balanced overall quality measure. This decomposition is essential for legal text summarization, where both factual completeness (recall) and conciseness (precision) are paramount.
Importance Weighting via IDF
BERTScore optionally incorporates Inverse Document Frequency (IDF) weighting to emphasize rare, domain-specific tokens over common stop words. In legal texts, terms like 'estoppel', 'tortfeasor', or 'indemnification' carry significant semantic weight. IDF weighting ensures that correct usage of these specialized terms has a proportionally larger impact on the final score, aligning the metric more closely with human judgments of summary quality in high-stakes legal contexts.
Baseline Rescaling for Interpretability
Raw BERTScore values are difficult to interpret because cosine similarity between random embeddings is not zero. The metric applies baseline rescaling by computing the average cosine similarity of random token pairs and using it as a floor. The formula (score - baseline) / (1 - baseline) rescales values so that a score of 0 corresponds to random performance and 1 corresponds to perfect alignment. This makes scores more intuitive and comparable across different model architectures and datasets.
Model Tier Flexibility
BERTScore is not tied to a single model. Evaluators can select from a hierarchy of pre-trained transformer models depending on the required precision and computational budget:
- BERT Base: Standard 110M parameter model, suitable for general evaluation.
- RoBERTa Large: 355M parameter model with improved training dynamics, offering higher correlation with human judgment.
- DistilBERT: A lighter 66M parameter model for faster evaluation with minimal accuracy loss. This flexibility allows legal AI teams to balance evaluation fidelity against infrastructure cost.
Correlation with Human Judgment
Empirical studies demonstrate that BERTScore achieves significantly higher Pearson correlation with human evaluators than n-gram metrics like ROUGE-L or BLEU, particularly for abstractive summaries. In the legal domain, where paraphrasing and semantic preservation are critical, BERTScore's ability to recognize that 'the court held the defendant liable' and 'the defendant was found responsible by the tribunal' convey the same meaning makes it a more reliable proxy for human assessment of summary quality.
BERTScore vs. ROUGE vs. METEOR
A technical comparison of automatic evaluation metrics for legal text summarization, contrasting semantic similarity against surface-form overlap approaches.
| Feature | BERTScore | ROUGE | METEOR |
|---|---|---|---|
Core Mechanism | Contextual embedding cosine similarity | N-gram overlap between candidate and reference | Unigram precision/recall with stemming and synonymy |
Semantic Understanding | |||
Synonym Handling | |||
Requires Reference Summary | |||
Contextualized Representations | |||
Paraphrase Robustness | High | Low | Medium |
Typical Correlation with Human Judgment | 0.85-0.90 | 0.70-0.80 | 0.75-0.82 |
Computational Cost | High (GPU recommended) | Low (CPU sufficient) | Medium (CPU sufficient) |
Frequently Asked Questions
Clear, technical answers to the most common questions about using BERTScore for evaluating legal text summarization systems.
BERTScore is an automatic evaluation metric that computes the semantic similarity between a candidate summary and a reference summary by leveraging contextual embeddings from a pre-trained BERT model. Unlike n-gram overlap metrics such as ROUGE, BERTScore operates in a continuous embedding space. The algorithm first tokenizes both the candidate and reference texts, then passes each token through a BERT model to generate a context-dependent vector representation. It then computes a similarity matrix using cosine similarity between every token in the candidate and every token in the reference. Each token in the reference is matched to the most similar token in the candidate via greedy matching, and vice versa. The final score is the F1 measure of precision (how many candidate tokens are close to reference tokens) and recall (how many reference tokens are captured by candidate tokens). This approach captures paraphrases and synonyms that surface-level metrics miss, making it particularly valuable for evaluating abstractive summarization systems where generated text may use different words to express the same legal meaning.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
BERTScore does not operate in isolation. It is part of a broader toolkit for validating the quality, faithfulness, and precision of AI-generated legal summaries. These related concepts define the evaluation landscape.
ROUGE (Recall-Oriented Understudy for Gisting Evaluation)
The traditional benchmark for summarization evaluation. ROUGE measures lexical overlap by counting matching n-grams, word sequences, and word pairs between a candidate and reference summary. Unlike BERTScore, it operates on exact token matching and cannot recognize synonyms or paraphrases. In legal contexts, this limitation is critical: ROUGE penalizes a summary that correctly replaces 'the plaintiff was awarded damages' with 'the court granted relief to the claimant,' while BERTScore recognizes their semantic equivalence.
Factual Consistency
The degree to which a generated summary accurately reflects the stated facts of the source document without contradiction or fabrication. In legal AI, this is the non-negotiable requirement. A summary can achieve a high BERTScore by being semantically similar to a reference while still hallucinating a critical date or party name. Factual consistency is often verified using Natural Language Inference (NLI) models that check if each atomic claim in the summary is entailed by the source text.
Atomic Fact Decomposition
A granular evaluation method that breaks a generated summary into minimal, self-contained factual claims before verification. For example, 'The court dismissed the appeal on March 3, 2024, citing lack of standing' decomposes into:
- Claim 1: The court dismissed the appeal.
- Claim 2: The dismissal occurred on March 3, 2024.
- Claim 3: The reason was lack of standing. Each claim is individually checked against the source, providing a precise faithfulness score that BERTScore alone cannot guarantee.
Source Attribution
The technique of explicitly linking each factual statement in a generated summary back to its precise location in the source document. This transforms a summary from a black-box output into a verifiable artifact. In legal workflows, source attribution enables attorneys to rapidly validate AI-generated summaries by tracing claims to specific paragraphs, page numbers, or line references. Combined with BERTScore's semantic similarity scoring, it creates a complete evaluation pipeline: BERTScore measures quality, attribution ensures trust.
Natural Language Inference (NLI)
A foundational NLP task where a model determines the logical relationship between a premise (source text) and a hypothesis (summary claim). The three possible labels are:
- Entailment: The hypothesis is true given the premise.
- Contradiction: The hypothesis is false given the premise.
- Neutral: The premise does not confirm or deny the hypothesis. NLI models fine-tuned on legal corpora serve as automated fact-checkers, catching hallucinations that semantic similarity metrics like BERTScore may miss.
Chain-of-Density Summarization
An iterative prompting technique that generates increasingly dense and entity-rich summaries without increasing overall length. Starting from an initial sparse summary, the model repeatedly identifies missing salient entities and fuses them into the text. This produces summaries optimized for information density—a key requirement in legal contexts where every word carries weight. BERTScore is particularly well-suited to evaluate these dense summaries because its contextual embeddings capture nuanced entity relationships that n-gram metrics miss.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us