Disambiguated Lexically Constrained Neural Machine Translation

Jinpeng Zhang, Nini Xiao, Ke Wang, Chuanqi Dong, Xiangyu Duan, Yuqi Zhang, Min Zhang · DOI

Abstract

Lexically constrained neural machine translation (LCNMT), which controls translation generation with pre-specified constraints, is vital for specialized domains. Current LCNMT approaches typically assume that pre-specified lexical constraints are contextually appropriate. However, this assumption fails in real-world scenarios where a source lexicon may correspond to multiple target constraints, requiring disambiguation. We propose D-LCNMT, a robust two-stage framework that first disambiguates constraints based on context and then integrates them into the NMT process. Experimental results demonstrate that D-LCNMT outperforms strong baselines on benchmark datasets and exhibits superior constraint disambiguation in ambiguous scenarios.

Introduction: The Challenge of Lexical Ambiguity

Lexically Constrained Neural Machine Translation (LCNMT) allows users or external dictionaries to enforce the inclusion of specific terminology in model outputs. This is essential for technical documentation, legal texts, or brand-specific content where consistency is non-negotiable.

Despite its utility, a significant gap exists between research assumptions and practical reality. Most existing LCNMT models assume the provided constraint is the "gold" (correct) translation. In practice, a single source word often maps to multiple valid translations depending on the semantic context. For instance, the English word "airway" might translate to "respiratory tract" in a medical context, but "airline" in a travel context.

Figure 1: An example of lexical ambiguity where the source word "airway" has multiple candidate translations in the target language.

Previous "implicit" methods attempted to teach models to handle this via data augmentation, but these often failed to accurately select the correct term when faced with high degrees of polysemy. D-LCNMT addresses this by introducing an explicit disambiguation step.

Methodology: The D-LCNMT Framework

The D-LCNMT framework operates in two distinct stages: explicit disambiguation followed by seamless integration.

Stage 1: Constraint Disambiguation

To select the most appropriate constraint, we utilize a dedicated neural architecture comprising a Context Encoder and a Constraint Encoder. The Context Encoder processes the source word within its surrounding sentence, while the Constraint Encoder evaluates the list of candidate translations.

Figure 5: The architecture of the Stage 1 Disambiguation module, which uses contrastive learning to align context and constraint representations.

We train this module using contrastive learning. This objective functions by "pulling" the representation of the contextually correct translation closer to the source context representation in a shared embedding space, while simultaneously "pushing" incorrect candidates away. This ensures the model learns to distinguish subtle semantic differences between candidates.

Stage 2: Integration into NMT

Once the optimal constraint is identified, it is integrated into the NMT model. We explored two primary integration strategies:

  1. VecConstNMT: A vector-based approach where constraints are injected into the model's internal hidden states. To prevent long, multi-word constraints from being fragmented during generation, we introduced a novel Integrity Loss and a Gated Decoding Algorithm (GDA).
  2. Template-based LCNMT: This method utilizes placeholders to "reserve" positions for constraints, ensuring 100% inclusion of the selected term.

Experimental Evaluation

We evaluated D-LCNMT on two major translation tasks: German-to-English (De-En) using the WMT2014 dataset and English-to-Chinese (En-Zh) using the WMT2021 terminology shared task data. To test robustness, we created specific "Ambiguous Constraint" test sets where each source lexicon was paired with multiple possible target constraints.

Key Results

  • Translation Quality: On the De-En task, D-LCNMT (Stage 1 + Template) achieved a 36.5 BLEU score, significantly outperforming the Vanilla Transformer (31.3) and the previous state-of-the-art data augmentation method, TermMind (35.4).
  • Disambiguation Accuracy: In the En-Zh task, our model reached a disambiguation accuracy of 79.2%, a substantial improvement over the 56.9% baseline achieved by simply selecting the most frequent translation from the training data.
  • Constraint Satisfaction: On ambiguous test sets, the model achieved an Exact-Match score of 71.23% for De-En, nearly doubling the performance of simpler vector-based baselines.

Discussion and Future Work

Our findings highlight that ambiguity is the norm rather than the exception; over 50% of constraints in our validation sets were ambiguous. Explicit disambiguation (Stage 1) proved far more effective than hoping an NMT model would learn these nuances implicitly through augmentation. Furthermore, the "Integrity Loss" was crucial for stabilizing the generation of multi-token constraints.

Future work will focus on handling complex morphology (e.g., ensuring a constrained verb is correctly conjugated for its target sentence) and improving robustness to cases where the correct translation is missing from the initial candidate dictionary. We also aim to integrate more diverse linguistic features into the encoders to further refine word sense disambiguation.

Summary updated

BibTeX
@inproceedings{zhang2023disambiguated,
  author = {Jinpeng Zhang and Nini Xiao and Ke Wang and Chuanqi Dong and Xiangyu Duan and Yuqi Zhang and Min Zhang},
  title = {{Disambiguated Lexically Constrained Neural Machine Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.673},
}
Figure