Understanding and Improving the Robustness of Terminology Constraints in Neural Machine Translation

Huaao Zhang, Qiang Wang, Bo Qin, Zelin Shi, Haibo Wang, Ming ChenACL 2023

Abstract

Neural Machine Translation (NMT) systems often struggle to adhere to terminology constraints, particularly in specialized domains or when multiple constraints are present. Traditional methods like placeholders (PH) and code-switching (CS) present a trade-off between constraint accuracy and translation fluency. This paper introduces Robust Terminology Translation (RTT), a novel approach that combines the strengths of both methods. RTT decouples the prediction of term labels from their semantic representation by appending target-language terminology directly to the decoding sequence. Evaluated on a new, high-difficulty benchmark, RTT demonstrates superior performance in both translation quality and constraint adherence, maintaining high accuracy even as the number of constraints increases.

Introduction

While NMT has achieved remarkable success, it remains prone to errors when translating rare entities or domain-specific jargon. To address this, Terminology Constraints (TC) are employed to force the inclusion of specific translations. However, existing approaches are often fragile. Placeholder-based (PH) methods, which replace terms with generic labels, often result in incoherent translations because the model lacks access to the term's semantics. Conversely, Code-Switching (CS) methods, which inject target terms into the source, tend to "forget" constraints as their density or length increases. The authors identify that current benchmarks often mask these issues by featuring only a few short constraints per sentence.

The Robust Terminology Translation (RTT) Method

The authors propose RTT to bridge the gap between PH and CS. RTT functions as a hybrid: it predicts a term label (e.g., $T_1$) to ensure structural adherence, but immediately follows it with the actual target terminology text in the decoding sequence. This allows the model to leverage the semantic content of the constraint for subsequent word generation, effectively combining the precision of placeholders with the contextual awareness of code-switching.

Comparison of terminology constraint strategies: Placeholder (PH), Code-Switching (CS), and RTT.

Key technical innovations in RTT include:

  • Term Embeddings: Learnable embeddings track the number of constraints generated to prevent repetitive loops.
  • Loss Masking: During training, the model is penalized for incorrect term labels but "blinded" to the specific tokens within the constraint, forcing it to focus on placement.
  • Source Enhancement (SE): Keeping the original source term alongside the label in the source sequence is found to be essential for maintaining overall sentence meaning.

Experimental Evaluation

The study introduces a challenging English-German benchmark featuring an average of 6.1 constraints per sentence, significantly higher than standard datasets like IATE or Wiktionary (~1.1–1.7).

On this difficult test set, RTT achieved a Sentence-level Constraint Accuracy (SCA) of 91.9%, outperforming Code-Switching (71.9%). While pure Placeholder methods reached 94.4% accuracy, they suffered in translation quality (BLEU/COMET). RTT secured the highest BLEU (40.2) and COMET (0.4866) scores.

Sentence-level Constraint Accuracy (SCA) vs. number of constraints ($T_i$).

As shown in the figure above, RTT maintains high SCA even as the number of terms ($T_i$) increases, whereas the performance of Code-Switching methods degrades significantly under high constraint density.

Conclusion

RTT offers a robust solution for terminology-constrained NMT by decoupling constraint prediction from semantic context. It effectively addresses the "disobedience" of code-switching and the "incoherence" of placeholders. Future work will focus on making the system "morphology-aware" to handle languages where constraints may require grammatical inflection.

Summary updated

BibTeX
@inproceedings{zhang2023understanding,
  author = {Huaao Zhang and Qiang Wang and Bo Qin and Zelin Shi and Haibo Wang and Ming Chen},
  title = {{Understanding and Improving the Robustness of Terminology Constraints in Neural Machine Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.332},
}
Figure