Introduction
In Natural Language Processing (NLP), researchers evaluating tasks like Machine Translation (MT) or summarization often rely on aggregate metrics such as BLEU, ROUGE, or METEOR. While these metrics provide a convenient single-number summary of performance, they are fundamentally "opaque." A +1.0 BLEU gain indicates improvement but fails to explain why the improvement occurred. Is the model better at translating rare nouns, handling long sentences, or simply more accurate with punctuation?
compare-mt is an open-source Python tool designed to address this lack of interpretability. It provides a holistic, fine-grained comparison of language generation systems, allowing researchers to automatically identify specific areas where one model outperforms another.
Methodology and System Workflow
The tool operates by taking a reference file and the outputs of two competing systems as input. It then generates a comprehensive diagnostic report using several integrated techniques.
Key Analysis Techniques
- Aggregate Score Analysis with Significance Testing: Beyond standard metrics, the tool employs bootstrap resampling to calculate confidence intervals and perform pairwise significance tests. This ensures that observed gains are statistically significant rather than mere noise.
- Bucketed Analysis: This core feature categorizes words or sentences into "buckets" based on specific characteristics such as word frequency, sentence length, and confidence scores.
- N-gram Difference Analysis: Using a smoothed probability formula, the tool identifies specific n-grams where one system significantly outperforms the other, helping pinpoint vocabulary or alignment errors.
- Linguistic and Source-side Analysis: Users can incorporate external linguistic labels (e.g., POS tags) to analyze performance across grammatical categories. By utilizing alignments, the tool can also trace output errors back to specific source-language word types.
Case Study: PBMT vs. NMT
The utility of compare-mt is demonstrated through a comparison of a traditional Phrase-Based MT (PBMT) system and a Neural MT (NMT) system on a Slovak-English translation task.
Key Insights
The holistic analysis revealed several critical nuances that a single BLEU score would have missed:
- The Rare Word Trade-off: Although the NMT system achieved a higher overall BLEU score (24.03 vs. 22.43), the PBMT system proved more robust for low-frequency words (appearing fewer than 10 times in training).
- Length Bias: The analysis showed that the NMT system tended to generate shorter sentences than the reference, whereas the PBMT system was more consistent in length but produced more low-scoring sentences overall.
- Automated Error Discovery: N-gram analysis identified specific systematic errors, such as one system consistently misspelling words due to poor alignment—a detail invisible to aggregate metrics.
Conclusion and Future Directions
compare-mt standardizes the diagnostic process for language generation, reducing the time required for manual error analysis and mitigating "confirmation bias." While the current version provides powerful aggregate and bucketed views, future work aims to improve the integration between high-level reports and individual sentence examples. Planned updates include interactive features allowing users to navigate directly from statistical charts to the specific sentences driving those results, as well as support for newer evaluation metrics.
Summary updated