BERTS CORE : E VALUATING T EXT G ENERATION WITH BERT
A BSTRACT
We propose BERTS CORE , an automatic evaluation metric for text generation.
Analogously to common metrics, BERTS CORE computes a similarity score for each token in the candidate sentence with each token in the reference sentence.
However, instead of exact matches, we compute token similarity using contextual embeddings.
We evaluate using the outputs of 363 machine translation and image captioning systems.
BERTS CORE correlates better with human judgments and provides stronger model selection performance than existing metrics.
Finally, we use an adversarial paraphrase detection task to show that BERTS CORE is more robust to challenging examples when compared to existing metrics.
I NTRODUCTION
Automatic evaluation of natural language generation, for example in machine translation and caption generation, requires comparing candidate sentences to annotated references.
The goal is to evaluate semantic equivalence.
However, commonly used methods rely on surface-form similarity only.
For example, B LEU (Papineni et al., 2002), the most common machine translation metric, simply counts n -gram overlap between the candidate and the reference.
While this provides a simple and general measure, it fails to account for meaning-preserving lexical and compositional diversity.
In this paper, we introduce BERTS CORE , a language generation evaluation metric based on pretrained BERT contextual embeddings (Devlin et al., 2019).
BERTS CORE computes the similarity of two sentences as a sum of cosine similarities between their tokens’ embeddings.
BERTS CORE addresses two common pitfalls in n -gram-based metrics (Banerjee & Lavie, 2005).
First, such methods often fail to robustly match paraphrases.
For example, given the reference people like foreign cars , B LEU and M ETEOR (Banerjee & Lavie, 2005) incorrectly give a higher score to people like visiting places abroad compared to consumers prefer imported cars .
This leads to performance underestimation when semantically-correct phrases are penalized because they differ from the surface form of the reference.
In contrast to string matching (e.g., in B LEU ) or matching heuristics (e.g., in M ETEOR ), we compute similarity using contextualized token embeddings, which have been shown to be effective for paraphrase detection (Devlin et al., 2019).
Second, n -gram models fail to capture distant dependencies and penalize semantically-critical ordering changes (Isozaki et al., 2010).
For example, given a small window of size two, B LEU will only mildly penalize swapping of cause and effect clauses (e.g. A because B instead of B because A ), especially when the arguments A and B are long phrases.
In contrast, contextualized embeddings are trained to effectively capture distant dependencies and ordering.
We experiment with BERTS CORE on machine translation and image captioning tasks using the outputs of 363 systems by correlating BERTS CORE and related metrics to available human judgments.
Our experiments demonstrate that BERTS CORE correlates highly with human evaluations.
In machine translation, BERTS CORE shows stronger system-level and segment-level correlations with human judgments than existing metrics on multiple common benchmarks and demonstrates strong model selection performance compared to B LEU .
We also show that BERTS CORE is well-correlated with human annotators for image captioning, surpassing S PICE , a popular taskspecific metric (Anderson et al., 2016).
Finally, we test the robustness of BERTS CORE on the adversarial paraphrase dataset PAWS (Zhang et al., 2019), and show that it is more robust to adversarial examples than other metrics.
The code for BERTS CORE is available at https://github.com/Tiiiger/bert score .
P ROBLEM S TATEMENT AND P RIOR M ETRICS
Natural language text generation is commonly evaluated using annotated reference sentences.
Given a reference sentence x tokenized to k tokens ⟨ x 1 , . . .
, x k ⟩ and a candidate ˆ x tokenized to l tokens ⟨ ˆ x 1 , . . .
, ˆ x l ⟩ , a generation evaluation metric is a function f
( x, ˆ x ) ∈ R .
Better metrics have a higher correlation with human judgments.
Existing metrics can be broadly categorized into using n -gram matching, edit distance, embedding matching, or learned functions.
2. n - GRAM M ATCHING A PPROACHES
The most commonly used metrics for generation count the number of n -grams that occur in the reference x and candidate ˆ x .
The higher the n is, the more the metric is able to capture word order, but it also becomes more restrictive and constrained to the exact form of the reference.
Formally, let S nx and S n ˆ x be the lists of token n -grams ( n ∈ Z + ) in the reference x and candidate ˆ x sentences.
The number of matched n -grams is ∑ w ∈ S n ˆ x I [ w ∈ S nx ] , where I [ · ] is an indicator function.
The exact match precision (Exact-P n ) and recall (Exact-R n ) scores are: [Equation] and Exact
[Equation]
nx | . Several popular metrics build upon one or both of these exact matching scores.
B LEU
The most widely used metric in machine translation is B LEU (Papineni et al., 2002), which includes three modifications to Exact-P n .
First, each n -gram in the reference can be matched at most once.
Second, the number of exact matches is accumulated for all reference-candidate pairs in the corpus and divided by the total number of n -grams in all candidate sentences.
Finally, very short candidates are discouraged using a brevity penalty.
Typically, B LEU is computed for multiple values of n (e.g. n = 1 , 2 , 3 , 4 ) and the scores are averaged geometrically.
A smoothed variant, S ENTB LEU (Koehn et al., 2007) is computed at the sentence level.
In contrast to B LEU , BERTS CORE is not restricted to maximum n -gram length, but instead relies on contextualized embeddings that are able to capture dependencies of potentially unbounded length.
M ETEOR
M ETEOR (Banerjee & Lavie, 2005) computes Exact-P 1 and Exact-R 1 while allowing backing-off from exact unigram matching to matching word stems, synonyms, and paraphrases.
For example, running may match run if no exact match is possible.
Non-exact matching uses an external stemmer, a synonym lexicon, and a paraphrase table.
M ETEOR 1.5 (Denkowski & Lavie, 2014) weighs content and function words differently, and also applies importance weighting to different matching types.
The more recent M ETEOR ++ 2.0 (Guo & Hu, 2019) further incorporates a learned external paraphrase resource.
Because M ETEOR requires external resources, only five languages are supported with the full feature set, and eleven are partially supported.
Similar to M ETEOR ,
BERTS CORE allows relaxed matches, but relies on BERT embeddings that are trained on large amounts of raw text and are currently available for 104 languages.
BERTS CORE also supports importance weighting, which we estimate with simple corpus statistics.
Other Related Metrics
NIST (Doddington, 2002) is a revised version of B LEU that weighs each n -gram differently and uses an alternative brevity penalty.
∆ B LEU
(Galley et al., 2015) modifies multi-reference B LEU by including human annotated negative reference sentences.
CHR F (Popovi´c, 2015) compares character n -grams in the reference and candidate sentences.
CHR F++ (Popovi´c, 2017) extends CHR F to include word bigram matching.
R OUGE
(Lin, 2004) is a commonly used metric for summarization evaluation.
R OUGE - n (Lin, 2004) computes Exact-R n (usually n = 1 , 2 ), while R OUGE - L is a variant of Exact-R 1 with the numerator replaced by the length of the longest common subsequence.
CIDE R (Vedantam et al., 2015) is an image captioning metric that computes cosine similarity between tf – idf weighted n -grams.
We adopt a similar approach to weigh tokens differently.
Finally, Chaganty et al.
(2018) and Hashimoto et al.
(2019) combine automatic metrics with human judgments for text generation evaluation.
2. E DIT - DISTANCE - BASED M ETRICS
Several methods use word edit distance or word error rate (Levenshtein, 1966), which quantify similarity using the number of edit operations required to get from the candidate to the reference.
TER (Snover et al., 2006) normalizes edit distance by the number of reference words, and
ITER (Panja & Naskar, 2018) adds stem matching and better normalization.
PER (Tillmann et al., 1997) computes position independent error rate, CDER (Leusch et al., 2006) models block reordering as an edit operation.
C HARAC T ER (Wang et al., 2016) and EED (Stanchev et al., 2019) operate on the character level and achieve higher correlation with human judgements on some languages.
2. E MBEDDING - BASED M ETRICS
Word embeddings (Mikolov et al., 2013; Pennington et al., 2014; Grave et al., 2018;
Nguyen et al., 2017; Athiwaratkun et al., 2018) are learned dense token representations.
M EANT 2.0 (Lo, 2017) uses word embeddings and shallow semantic parses to compute lexical and structural similarity.
Y ISI -
(Lo et al., 2018) is similar to M EANT 2.0, but makes the use of semantic parses optional.
Both methods use a relatively simple similarity computation, which inspires our approach, including using greedy matching (Corley & Mihalcea, 2005) and experimenting with a similar importance weighting to Y ISI -1.
However, we use contextual embeddings, which capture the specific use of a token in a sentence, and potentially capture sequence information.
We do not use external tools to generate linguistic structures, which makes our approach relatively simple and portable to new languages.
Instead of greedy matching, WMD (Kusner et al., 2015), WMD O (Chow et al., 2019), and
SMS (Clark et al., 2019) propose to use optimal matching based on earth mover’s distance (Rubner et al., 1998).
The tradeoff 1 between greedy and optimal matching was studied by Rus & Lintean (2012).
Sharma et al.
(2018) compute similarity with sentence-level representations.
In contrast, our token-level computation allows us to weigh tokens differently according to their importance.
2. L EARNED M ETRICS
Various metrics are trained to optimize correlation with human judgments.
B EER (Stanojevi ´ c &
Sima’an, 2014) uses a regression model based on character n -grams and word bigrams.
B LEND (Ma et al., 2017) uses regression to combine 29 existing metrics.
R USE (Shimanaka et al., 2018) combines three pre-trained sentence embedding models.
All these methods require costly human judgments as supervision for each dataset, and risk poor generalization to new domains, even within a known language and task (Chaganty et al., 2018).
Cui et al.
(2018) and Lowe et al.
(2017) train a neural model to predict if the input text is human-generated.
This approach also has the risk of being optimized to existing data and generalizing poorly to new data.
In contrast, the model underlying
BERTS CORE is not optimized for any specific evaluation task.
BERTS CORE
Given a reference sentence x = ⟨ x 1 , . . .
, x k ⟩ and a candidate sentence ˆ x = ⟨ ˆ x 1 , . . .
, ˆ x l ⟩ , we use contextual embeddings to represent the tokens, and compute matching using cosine similarity, optionally weighted with inverse document frequency scores.
Figure 1 illustrates the computation.
Token Representation We use contextual embeddings to represent the tokens in the input sentences x and ˆ x .
In contrast to prior word embeddings (Mikolov et al., 2013; Pennington et al., 2014), contextual embeddings, such as BERT (Devlin et al., 2019) and ELM O (Peters et al., 2018), can generate different vector representations for the same word in different sentences depending on the surrounding words, which form the context of the target word.
The models used to generate these embeddings are most commonly trained using various language modeling objectives, such as masked word prediction (Devlin et al., 2019).
[Table]
[Figure]
We experiment with different models (Section 4), using the tokenizer provided with each model.
Given a tokenized reference sentence x = ⟨ x 1 , . . .
, x k ⟩ , the embedding model generates a sequence of vectors ⟨ x 1 , . . .
, x k ⟩ .
Similarly, the tokenized candidate ˆ x = ⟨ ˆ x 1 , . . .
, ˆ x m ⟩ is mapped to ⟨ ˆx 1 , . . .
, ˆx l ⟩ .
The main model we use is BERT, which tokenizes the input text into a sequence of word pieces (Wu et al., 2016), where unknown words are split into several commonly observed sequences of characters.
The representation for each word piece is computed with a Transformer encoder (Vaswani et al., 2017) by repeatedly applying self-attention and nonlinear transformations in an alternating fashion.
BERT embeddings have been shown to benefit various NLP tasks (Devlin et al., 2019; Liu, 2019; Huang et al., 2019;
Yang et al., 2019a).
Similarity Measure The vector representation allows for a soft measure of similarity instead of exact-string (Papineni et al., 2002) or heuristic (Banerjee & Lavie, 2005) matching.
The cosine similarity of a reference token x i and a candidate token ˆ x j is
[Equation]
We use pre-normalized vectors, which reduces this calculation to the inner product x ⊤ i ˆx j .
While this measure considers tokens in isolation, the contextual embeddings contain information from the rest of the sentence.
BERTS CORE
The complete score matches each token in x to a token in ˆ x to compute recall, and each token in ˆ x to a token in x to compute precision.
We use greedy matching to maximize the matching similarity score, 2 where each token is matched to the most similar token in the other sentence.
We combine precision and recall to compute an F1 measure.
For a reference x and candidate ˆ x , the recall, precision, and F1 scores are:
[Equation]
Importance Weighting Previous work on similarity measures demonstrated that rare words can be more indicative for sentence similarity than common words (Banerjee & Lavie, 2005; Vedantam et al., 2015).
BERTS CORE enables us to easily incorporate importance weighting.
We experiment with inverse document frequency ( idf ) scores computed from the test corpus.
Given M reference sentences { x ( i ) } Mi =1 , the idf score of a word-piece token w is
[Equation]
where I [ · ] is an indicator function.
We do not use the full tf - idf measure because we process single sentences, where the term frequency ( tf ) is likely 1.
For example, recall with idf weighting is
[Equation]
Because we use reference sentences to compute idf , the idf scores remain the same for all systems evaluated on a specific test set.
We apply plus-one smoothing to handle unknown word pieces.
Baseline Rescaling Because we use pre-normalized vectors, our computed scores have the same numerical range of cosine similarity (between − 1 and 1 ). However, in practice we observe scores in a more limited range, potentially because of the learned geometry of contextual embeddings. While this characteristic does not impact BERTS CORE ’s capability to rank text generation systems, it makes the actual score less readable. We address this by rescaling BERTS CORE with respect to its empirical lower bound b as a baseline.
We compute b using Common Crawl monolingual datasets.
For each language and contextual embedding model, we create 1 M candidate-reference pairs by grouping two random sentences.
Because of the random pairing and the corpus diversity, each pair has very low lexical and semantic overlapping.
4 We compute b by averaging BERTS CORE computed on these sentence pairs.
Equipped with baseline b , we rescale BERTS CORE linearly.
For example, the rescaled value ˆ R BERT of R BERT is:
[Equation]
After this operation ˆ R BERT is typically between 0 and 1 .
We apply the same rescaling procedure for P BERT and F BERT .
This method does not affect the ranking ability and human correlation of
BERTS CORE , and is intended solely to increase the score readability.
E XPERIMENTAL S ETUP
We evaluate our approach on machine translation and image captioning.
Contextual Embedding Models We evaluate twelve pre-trained contextual embedding models, including variants of BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019b),
XLNet (Yang et al., 2019b), and XLM (Lample & Conneau, 2019).
We present the best-performing models in Section 5.
We use the 24-layer RoBERTa large model 5 for English tasks, 12-layer BERT chinese model for Chinese tasks, and the 12-layer cased multilingual BERT multi model for other languages.
6 We show the performance of all other models in Appendix F. Contextual embedding models generate embedding representations at every layer in the encoder network.
Past work has shown that intermediate layers produce more effective representations for semantic tasks (Liu et al., 2019a).
We use the WMT dataset (Bojar et al., 2016) as a validation set to select the best layer of each model (Appendix B).
Machine Translation Our main evaluation corpus is the WMT18 metric evaluation dataset (Ma et al., 2018), which contains predictions of 149 translation systems across 14 language pairs, gold references, and two types of human judgment scores.
Segment-level human judgments assign a score to each reference-candidate pair.
System-level human judgments associate each system with a single score based on all pairs in the test set.
WMT18 includes translations from English to Czech, German,
Estonian, Finnish, Russian, and Turkish, and from the same set of languages to English.
We follow the WMT18 standard practice and use absolute Pearson correlation | ρ | and Kendall rank correlation τ to evaluate metric quality, and compute significance with the Williams test (Williams, 1959) for | ρ | and bootstrap re-sampling for τ as suggested by Graham & Baldwin (2014).
We compute systemlevel scores by averaging BERTS CORE for every reference-candidate pair.
We also experiment with hybrid systems by randomly sampling one candidate sentence from one of the available systems for each reference sentence (Graham & Liu, 2016).
This enables system-level experiments with a higher number of systems.
Human judgments of each hybrid system are created by averaging the WMT segment-level human judgments for the corresponding sentences in the sampled data.
We compare
BERTS CORE s to one canonical metric for each category introduced in Section 2, and include the comparison with all other participating metrics from WMT18 in Appendix F.
In addition to the standard evaluation, we design model selection experiments.
We use 10K hybrid systems super-sampled from WMT18.
We randomly select 100 out of 10K hybrid systems, and rank them using the automatic metrics.
We repeat this process 100K times.
We report the percentage of the metric ranking agreeing with the human ranking on the best system (Hits@1).
In Tables 23-28, [Table] [Table] we include two additional measures to the model selection study: (a) the mean reciprocal rank of the top metric-rated system according to the human ranking, and (b) the difference between the human score of the top human-rated system and that of the top metric-rated system.
Additionally, we report the same study on the WMT17 (Bojar et al., 2017) and the WMT16 (Bojar et al., 2016)
datasests in Appendix F.
This adds 202 systems to our evaluation.
Image Captioning We use the human judgments of twelve submission entries from the COCO 2015 Captioning Challenge.
Each participating system generates a caption for each image in the
COCO validation set (Lin et al., 2014), and each image has approximately five reference captions.
Following Cui et al.
(2018), we compute the Pearson correlation with two system-level metrics: the percentage of captions that are evaluated as better or equal to human captions (M1) and the percentage of captions that are indistinguishable from human captions (M2).
We compute
BERTS CORE with multiple references by scoring the candidate with each available reference and returning the highest score.
We compare with eight task-agnostic metrics: B LEU (Papineni et al., 2002), M ETEOR (Banerjee & Lavie, 2005), R OUGE -L
(Lin, 2004), CIDE R (Vedantam et al., 2015),
BEER (Stanojevi´c & Sima’an, 2014), EED (Stanchev et al., 2019), CHR F++ (Popovi´c, 2017), and
C HARAC TER
(Wang et al., 2016).
We also compare with two task-specific metrics: S PICE (Anderson et al., 2016) and L EIC (Cui et al., 2018).
S PICE is computed using the similarity of scene graphs parsed from the reference and candidate captions.
L EIC is trained to predict if a caption is written by a human given the image.
[Table]
each language pair and direction.
Metric en ↔ cs en ↔ de en ↔ et en ↔ fi en ↔ ru en ↔ tr en ↔ zh (5k/5k) (78k/ 20k) (57k/32k) (16k/10k) (10k/22k) (9k/1k) (33k/29k)
[Table]
[Table]
.144/ – RUSE .347/ – .498/ – .368/ – .273/ – .311/ – .259/ – .218/ –
[Table] [Table] [Table] [Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table] [Table] [Table] [Table]
R ESULTS
Machine Translation Tables 1–3 show system-level correlation to human judgements, correlations on hybrid systems, and model selection performance.
We observe that BERTS CORE is consistently a top performer.
In to-English results, RUSE (Shimanaka et al., 2018) shows competitive performance.
However, RUSE is a supervised method trained on WMT16 and WMT15 human judgment data.
In cases where RUSE models were not made available, such as for our from-English experiments, it is not possible to use RUSE without additional data and training.
Table 4 shows segment-level correlations.
We see that BERTS CORE exhibits significantly higher performance compared to the other metrics.
The large improvement over B LEU stands out, making BERTS CORE particularly suitable to analyze specific examples, where S ENT B LEU is less reliable.
In Appendix A, we provide qualitative examples to illustrate the segment-level performance difference between
S ENT B LEU and BERTS CORE .
At the segment-level, BERTS CORE even significantly outperforms
RUSE.
Overall, we find that applying importance weighting using idf at times provides small benefit, but in other cases does not help.
Understanding better when such importance weighting is likely to help is an important direction for future work, and likely depends on the domain of the text and the available test data.
We continue without idf weighting for the rest of our experiments.
While recall R BERT , precision P BERT , and F1 F BERT alternate as the best measure in different setting, F
F BERT performs reliably well across all the different settings.
Our overall recommendation is therefore to use F1.
We present additional results using the full set of 351 systems and evaluation metrics in Tables 12–28 in the appendix, including for experiments with idf importance weighting, different contextual embedding models, and model selection.
Image Captioning Table 5 shows correlation results for the COCO Captioning Challenge.
BERTS CORE outperforms all task-agnostic baselines by large margins.
Image captioning presents a challenging evaluation scenario, and metrics based on strict n -gram matching, including B LEU and
R OUGE , show weak correlations with human judgments.
idf importance weighting shows signifi-
[Table]
The M1 and M2 measures are described in Section 4.
L EIC uses images as additional inputs.
Numbers with ∗ are cited from Cui et al.
We bold the highest correlations of task-specific and task-agnostic metrics. [Table] cant benefit for this task, suggesting people attribute higher importance to content words.
Finally,
L EIC (Cui et al., 2018), a trained metric that takes images as additional inputs and is optimized specifically for the COCO data and this set of systems, outperforms all other methods.
Speed Despite the use of a large pre-trained model, computing BERTS CORE is relatively fast.
We are able to process 192.5 candidate-reference pairs/second using a GTX-1080Ti GPU.
The complete
WMT18 en-de test set, which includes 2,998 sentences, takes 15.6sec to process, compared to 5.4sec with SacreBLEU (Post, 2018), a common B LEU implementation.
Given the sizes of commonly used test and validation sets, the increase in processing time is relatively marginal, and BERTS CORE is a good fit for using during validation (e.g., for stopping) and testing, especially when compared to the time costs of other development stages.
R OBUSTNESS A NALYSIS
We test the robustness of BERTS CORE using adversarial paraphrase classification.
We use the
Quora Question Pair corpus (QQP; Iyer et al., 2017) and the adversarial paraphrases from the Paraphrase Adversaries from Word Scrambling dataset (PAWS; Zhang et al., 2019).
Both datasets contain pairs of sentences labeled to indicate whether they are paraphrases or not.
Positive examples in QQP are real duplicate questions, while negative examples are related, but different questions.
Sentence pairs in PAWS are generated through word swapping.
For example, in PAWS, Flights from
New York to Florida may be changed to Flights from Florida to New York and a good classifier should identify that these two sentences are not paraphrases.
PAWS includes two parts: PAWS QQP , which is based on the QQP data, and PAWS Wiki .
We use the PAWS QQP development set which contains 667 sentences.
For the automatic metrics, we use no paraphrase detection training data.
We expect that pairs with higher scores are more likely to be paraphrases.
To evaluate the automatic metrics on QQA, we use the first 5,000 sentences in the training set instead of the the test set because the test labels are not available.
We treat the first sentence as the reference and the second sentence as the candidate.
Table 6 reports the area under ROC curve (AUC) for existing models and automatic metrics.
We observe that supervised classifiers trained on QQP perform worse than random guess on PAWS QQP , which shows these models predict the adversarial examples are more likely to be paraphrases.
When adversarial examples are provided in training, state-of-the-art models like DIIN (Gong et al., 2018) and fine-tuned BERT are able to identify the adversarial examples but their performance still decreases significantly from their performance on QQP.
Most metrics have decent performance on
QQP, but show a significant performance drop on PAWS QQP , almost down to chance performance.
This suggests these metrics fail to to distinguish the harder adversarial examples.
In contrast, the performance of BERTS CORE drops only slightly, showing more robustness than the other metrics.
D ISCUSSION
We propose BERTS CORE , a new metric for evaluating generated text against gold standard references.
BERTS CORE is purposely designed to be simple, task agnostic, and easy to use.
Our analysis illustrates how BERTS CORE resolves some of the limitations of commonly used metrics, especially on challenging adversarial examples.
We conduct extensive experiments with various configuration choices for BERTS CORE , including the contextual embedding model used and the use of importance weighting.
Overall, our extensive experiments, including the ones in the appendix, show that
BERTS CORE achieves better correlation than common metrics, and is effective for model selection.
However, there is no one configuration of BERTS CORE that clearly outperforms all others.
While the differences between the top configurations are often small, it is important for the user to be aware of the different trade-offs, and consider the domain and languages when selecting the exact configuration to use.
In general, for machine translation evaluation, we suggest using F BERT , which we find the most reliable.
For evaluating text generation in English, we recommend using the 24layer RoBERTa large model to compute BERTS CORE .
For non-English language, the multilingual
BERT multi is a suitable choice although BERTS CORE computed with this model has less stable performance on low-resource languages.
We report the optimal hyperparameter for all models we experimented with in Appendix B
Briefly following our initial preprint publication, Zhao et al.
(2019) published a concurrently developed method related to ours, but with a focus on integrating contextual word embeddings with earth mover’s distance (EMD; Rubner et al., 1998) rather than our simple matching process.
They also propose various improvements compared to our use of contextualized embeddings.
We study these improvements in Appendix C and show that integrating them into BERTS CORE makes it equivalent or better than the EMD-based approach.
Largely though, the effect of the different improvements on BERTS CORE is more modest compared to their method.
Shortly after our initial publication,
YiSi-1 was updated to use BERT embeddings, showing improved performance (Lo, 2019).
This further corroborates our findings.
Other recent related work includes training a model on top of
BERT to maximize the correlation with human judgments (Mathur et al., 2019) and evaluating generation with a BERT model fine-tuned on paraphrasing (Yoshimura et al., 2019).
More recent work shows the potential of using BERTS CORE for training a summarization system (Li et al., 2019) and for domain-specific evaluation using SciBERT (Beltagy et al., 2019) to evaluate abstractive text summarization (Gabriel et al., 2019).
In future work, we look forward to designing new task-specific metrics that use BERTS CORE as a subroutine and accommodate task-specific needs, similar to how Wieting et al.
(2019) suggests to use semantic similarity for machine translation training.
Because BERTS CORE is fully differentiable, it also can be incorporated into a training procedure to compute a learning loss that reduces the mismatch between optimization and evaluation objectives. A CKNOWLEDGEMENT
This research is supported in part by grants from the National Science Foundation (III-1618134, III1526012, IIS1149882, IIS-1724282, TRIPODS-1740822, CAREER-1750499), the Office of Naval
Research DOD (N00014-17-1-2175), and the Bill and Melinda Gates Foundation, SAP, Zillow,
Workday, and Facebook Research.
We thank Graham Neubig and David Grangier for for their insightful comments. We thank the Cornell NLP community including but not limited to Claire Cardie, Tianze Shi, Alexandra Schofield, Gregory Yauney A Q UALITATIVE A NALYSIS
We study BERTS CORE and S ENT B LEU using WMT16 German-to-English (Bojar et al., 2016).
We rank all 560 candidate-reference pairs by human score, BERTS CORE , or S ENT B LEU from most similar to least similar.
Ideally, the ranking assigned by BERTS CORE and S ENT B LEU should be similar to the ranking assigned by the human score.
Table 7 first shows examples where BERTS CORE and S ENT B LEU scores disagree about the ranking for a candidate-reference pair by a large number.
We observe that BERTS CORE is effectively able to capture synonyms and changes in word order.
For example, the reference and candidate sentences in pair 3 are almost identical except that the candidate replaces opinion in Hungary with Hungarian view and switches the order of the quotation mark ( “ ) and a .
While BERTS CORE ranks the pair relatively high, S ENT B LEU judges the pair as dissimilar, because it cannot match synonyms and is sensitive to the small word order changes.
Pair 5 shows a set of changes that preserve the semantic meaning: replacing to cut with will reduce and swapping the order of 30,000 and jobs .
BERTS CORE ranks the candidate translation similar to the human judgment, whereas S ENT B LEU ranks it much lower.
We also see that S ENT B LEU potentially over-rewards n -gram overlap, even when phrases are used very differently.
In pair 6, both the candidate and the reference contain the human dignity of the man .
Yet the two sentences convey very different meaning.
BERTS CORE agrees with the human judgment and ranks the pair low.
In contrast, S ENT B LEU considers the pair as relatively similar because of the significant word overlap.
The bottom half of Table 7 shows examples where BERTS CORE and human judgments disagree about the ranking.
We observe that BERTS CORE finds it difficult to detect factual errors.
For example, BERTS CORE assigns high similarity to pair 11 when the translation replaces German language with English and pair 12 where the translation incorrectly outputs Tuesday when it is supposed to generate Monday .
BERTS CORE also fails to identify that 5ft 11in is equivalent with 1.80 metres in pair 18.
As a result, BERTS CORE assigns low similarity to the eighth pair in Table 7.
S ENT B LEU also suffers from these limitations.
Figure 2 visualizes the BERTS CORE matching of two pairs of candidate and reference sentences.
The figure illustrates how F BERT matches synonymous phrases, such as imported cars and foreign cars .
We also see that F BERT effectively matches words even given a high ordering distortion, for example the token people in the figure.
B R EPRESENTATION C HOICE
As suggested by previous works (Peters et al., 2018; Reimers & Gurevych, 2019), selecting a good layer or a good combination of layers from the BERT model is important.
In designing
BERTS CORE , we use WMT16 segment-level human judgment data as a development set to facilitate our representation choice.
For Chinese models, we tune with the WMT17 “en-zh” data because the language pair “en-zh” is not available in WMT16.
In Figure 3, we plot the change of human correlation of F BERT over different layers of BERT, RoBERTa, XLNet and XLM models.
Based on results from different models, we identify a common trend that F BERT computed with the intermediate representations tends to work better.
We tune the number of layer to use for a range of publicly available models.
8 Table 8 shows the results of our hyperparameter search.
[Table]
C A BLATION S TUDY OF M OVER S CORE
Word Mover’s Distance (WMD; Kusner et al., 2015) is a semantic similarity metric that relies on word embeddings and optimal transport.
M OVER S CORE (Zhao et al., 2019) combines contextual embeddings and WMD for text generation evaluation.
In contrast, BERTS CORE adopts a greedy approach to aggregate token-level information.
In addition to using WMD for generation evaluation, Zhao et al.
(2019) also introduce various other improvements.
We do a detailed ablation study to understand the benefit of each improvement, and to investigate whether it can be applied to
BERTS CORE .
We use a 12-layer uncased BERT model on the WMT17 to-English segment-level data, the same setting as Zhao et al.
We identify several differences between M OVER S CORE and BERTS CORE by analyzing the released source code.
We isolate each difference, and mark it with a bracketed tag for our ablation study:
[MNLI] Use a BERT model fine-tuned on MNLI (Williams et al., 2018).
[PMEANS] Apply power means (Rckl et al., 2018) to aggregate the information of different layers.3.
[IDF-L] For reference sentences, instead of computing the idf scores on the 560 sentences in the segment-level data ( [IDF-S] ), compute the idf scores on the 3,005 sentences in the system-level data.
[SEP]
For candidate sentences, recompute the idf scores on the candidate sentences.
The weighting of reference tokens are kept the same as in [IDF-S] 5.
[RM] Exclude punctuation marks and sub-word tokens except the first sub-word in each word from the matching.
We follow the setup of Zhao et al.
and use their released fine-tuned BERT model to conduct the experiments.
Table 9 shows the results of our ablation study.
We report correlations for the two variants of WMD Zhao et al.
(2019) study: unigrams (WMD1) and bigrams (WMD2).
Our F BERT corresponds to the vanilla setting and the importance weighted variant corresponds to the [IDF-S] setting.
The complete M OVER S CORE metric corresponds to [IDF-S] + [SEP] + [PMEANS] + [MNLI] + [RM] .
We make several observations.
First, for all language pairs except fi-en and lv-en, we can replicate the reported performance.
For these two language pairs, Zhao et al.
(2019) did not release their implementations at the time of publication.
Second, we confirm the effectiveness of [PMEANS] and [MNLI] .
In Appendix F, we study more pre-trained models and further corroborate this conclusion.
However, the contribution of other techniques, including [RM] and [SEP] , seems less stable.
Third, replacing greedy matching with
WMD does not lead to consistent improvement.
In fact, oftentimes BERTS CORE is the better metric when given the same setup.
In general, for any given language pair, BERTS CORE is always among the best performing ones.
Given the current results, it is not clear tht WMD is better than greedy matching for text generation evaluation.
[Table]
consistently improve BERTS CORE . [Table]
D A DDITIONAL E XPERIMENTS ON A BSTRACTIVE T EXT C OMPRESSION
We use the human judgments provided from the MSR Abstractive Text Compression Dataset (Toutanova et al., 2016) to illustrate the applicability of BERTS CORE to abstractive text compression evaluation. The data includes three types of human scores: (a) meaning: how well a compressed text preserve the meaning of the original text; (b) grammar: how grammatically correct a compressed text is; and (c) combined: the average of the meaning and the grammar scores.
We follow the experimental setup of Toutanova et al.
and report Pearson correlation between
BERTS CORE and the three types of human scores.
Table 10 shows that R BERT has the highest correlation with human meaning judgments, and P BERT correlates highly with human grammar judgments.
F BERT provides a balance between the two aspects.
[Table]
on unconfirmed WMT data version, ∗∗ : trained on WMT16 + ParaCrawl, ∗∗∗ : trained on WMT16, + : trained by us using fairseq.
Table 11 shows the B LEU scores and the BERTS CORE s of pre-trained machine translation models on WMT14 English-to-German, WMT14 English-to-French, IWSLT14 German-to-English task.
We used publicly available pre-trained models from fairseq (Ott et al., 2019).
Because a pretrained Transformer model on IWSLT is not released, we trained our own using the fairseq library.
We use multilingual cased BERT base 12 for English-to-German and English-to-French pairs, and
English uncased BERT base 13 for German-to-English pairs.
Interestingly, the gap between a DynamicConv (Wu et al., 2019) trained on only WMT16 and a Transformer (Ott et al., 2018) trained on WMT16 and ParaCrawl 14 (about 30 × more training data) becomes larger when evaluated with
BERTS CORE rather than B LEU .
F A DDITIONAL R ESULTS
In this section, we present additional experimental results:
Segment-level and system-level correlation studies on three years of WMT metric evaluation task (WMT16–18) 2.
Model selection study on WMT18 10K hybrid systems 3.
System-level correlation study on 2015 COCO captioning challenge 4.
Robustness study on PAWS-QQP.
Following BERT (Devlin et al., 2019), a variety of Transformer-based (Vaswani et al., 2017) pretrained contextual embeddings have been proposed and released.
We conduct additional experiments with four types of pre-trained embeddings: BERT, XLM (Lample & Conneau, 2019),
XLNet (Yang et al., 2019b), and RoBERTa (Liu et al., 2019b).
XLM (Cross-lingual Language Model) is a Transformer pre-trained on the translation language modeling of predicting masked tokens from a pair of sentence in two different languages and masked language modeling tasks using multi-lingual training data.
Yang et al.
(2019b) modify the Transformer architecture and pre-train it on a permutation language modeling task resulting in some improvement on top of the original BERT when fine-tuned on several downstream tasks.
Liu et al.
(2019b) introduce RoBERTa
(Robustly optimized BERT approach) and demonstrate that an optimized BERT model is comparable to or sometimes outperforms an XLNet on downstream tasks.
We perform a comprehensive study with the following pre-trained contextual embedding models:
• BERT models: bert-base-uncased , bert-large-uncased , bert-based-chinese , bert-base-multilingual-cased , and bert-base-cased-mrpc • RoBERTa models: roberta-base , roberta-large , and roberta-large-mnli • XLNet models: xlnet-base-cased and xlnet-base-large • XLM models: xlm-mlm-en-2048 and xlm-mlm-100-
S TUDY
Experimental setup Because of missing data in the released WMT16 dataset (Bojar et al., 2016), we are only able to experiment with to-English segment-level data, which contains the outputs of 50 different systems on 6 language pairs.
We use this data as the validation set for hyperparameter tuning (Appendix B).
Table 12 shows the Pearson correlations of all participating metrics and
BERTS CORE s computed with different pre-trained models.
Significance testing for this dataset does not include the baseline metrics because the released dataset does not contain the original outputs from the baseline metrics.
We conduct significance testing between BERTS CORE results only.
The WMT17 dataset (Bojar et al., 2017) contains outputs of 152 different translations on 14 language pairs.
We experiment on the segment-level and system-level data on both to-English and from-English language pairs.
We exclude fi-en data from the segment-level experiment due to an error in the released data.
We compare our results to all participating metrics and perform standard significance testing as done by Bojar et al.
Tables 13–16 show the results.
The WMT18 dataset (Ma et al., 2018) contains outputs of 159 translation systems on 14 language pairs.
In addition to the results in Tables 1–4, we complement the study with the correlations of all participating metrics in WMT18 and results from using different contextual models for
BERTS CORE .
Results Table 12–22 collectively showcase the effectiveness of BERTS CORE in correlating with human judgments.
The improvement of BERTS CORE is more pronounced on the segment-level than on the system-level.
We also see that more optimized or larger BERT models can produce better contextual representations (e.g., comparing F RoBERTa–Large and F BERT–Large ).
In contrast, the smaller
XLNet performs better than a large one.
Based on the evidence in Figure 8 and Tables 12–22, we hypothesize that the permutation language task, though leading to a good set of model weights for fine-tuning on downstream tasks, does not necessarily produce informative pre-trained embeddings for generation evaluation.
We also observe that fine-tuning pre-trained models on a related task, such as natural language inference (Williams et al., 2018), can lead to better human correlation in evaluating text generation.
Therefore, for evaluating English sentences, we recommend computing
BERTS CORE with a 24-layer RoBERTa model fine-tuned on the MNLI dataset.
For evaluating
Non-English sentences, both the multilingual BERT model and the XLM model trained onlanguages are suitable candidates.
We also recommend using domain- or language-specific contextual embeddings when possible, such as using BERT Chinese models for evaluating Chinese tasks.
In general, we advise users to consider the target domain and languages when selecting the exact configuration to use.
F. M ODEL S ELECTION S TUDY
Experimental setup Similar to Section 4, we use the 10K hybrid systems super-sampled from
WMT18.
We randomly select 100 out of 10K hybrid systems, rank them using automatic metrics, and repeat this process 100K times.
We add to the results in the main paper (Table 3) performance of all participating metrics in WMT18 and results from using different contextual embedding models for BERTS CORE .
We reuse the hybrid configuration and metric outputs released in WMT18.
In addition to the Hits@1 measure, we evaluate the metrics using (a) mean reciprocal rank (MRR) of the top metric-rated system in human rankings, and (b) the absolute human score difference (Diff) between the top metric- and human-rated systems.
Hits@1 captures a metric’s ability to select the best system.
The other two measures quantify the amount of error a metric makes in the selection process.
Tables 23–28 show the results from these experiments.
Results
The additional results further support our conclusion from Table 3: BERTS CORE demonstrates better model selection performance.
We also observe that the supervised metric RUSE displays strong model selection ability.
F. I MAGE C APTIONING ON COCO
We follow the experimental setup described in Section 4.
Table 29 shows the correlations of several pre-trained contextual embeddings.
We observe that precision-based methods such as B LEU and
P BERT are weakly correlated with human judgments on image captioning tasks.
We hypothesize that this is because human judges prefer captions that capture the main objects in a picture for image captioning.
In general, R BERT has a high correlation, even surpassing the task-specific metric
S PICE Anderson et al.
While the fine-tuned RoBERTa-Large model does not result in the highest correlation, it is one of the best metrics.
F. R OBUSTNESS A NALYSIS ON PAWS-QQP
We present the full results of the robustness study described in Section 6 in Table 30.
In general, we observe that BERTS CORE is more robust than other commonly used metrics.
BERTS CORE computed with the 24-layer RoBERTa model performs the best.
Fine-tuning RoBERTa-Large on
MNLI (Williams et al., 2018) can significantly improve the robustness against adversarial sentences.
However, a fine-tuned BERT on MRPC (Microsoft Research Paraphrasing Corpus) (Dolan & Brockett, 2005) performs worse than its counterpart. [Table] [Table]
[Table]
-Trained
[Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table] [Table]
[Table] [Table] [Table]
[Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table]
[Figure]