Towards Formality-Aware Neural Machine Translation by Leveraging Context Information

Dohee Kim, Yujin Baek, Soyoung Yang, Jaegul Choo

Abstract

In languages like Korean and Japanese, formality and honorifics are essential for natural communication. Standard Neural Machine Translation (NMT) models often struggle with "context sparsity," failing to identify subtle stylistic cues in surrounding sentences. This paper proposes a novel training strategy that utilizes a formality classifier to guide NMT models. By regularizing attention toward informative tokens and weighting loss for formality-salient words, the proposed method significantly improves translation consistency and naturalness.

Introduction: The Challenge of Formality in NMT

Natural speech in many East Asian languages depends heavily on the relationship between speakers, expressed through specific verb endings and pronouns. For example, translating "Do you have plans?" into Korean requires context to choose between informal and formal honorifics. While context-aware NMT models attempt to use previous sentences, formality-related clues are often sparse—just a few tokens in a long sequence. Standard models frequently fail to "pinpoint" these critical markers, leading to translations that are semantically accurate but stylistically inconsistent.

Methodology

The authors introduce a two-pronged approach to integrate a pre-trained formality classifier into the NMT training pipeline:

1. Instance-level Context Attention Regularization

Using the LIME algorithm on a formality classifier, the researchers identify which tokens in a context are most influential for determining formality. The NMT model's decoder attention is then regularized to align with this importance distribution. This "Attention Regularization" (AttnReg) directs the model to prioritize specific linguistic markers identified by the classifier.

Overview of the Attention Regularization framework, showing how a formality classifier guides the attention map of the NMT model.

2. Global-level Token Weighted Loss

The authors identify "salient formality tokens" across the entire training corpus. During training, the standard cross-entropy loss is modified to assign higher weights to these tokens (Weighted Loss, or WL). This encourages the model to be more precise when generating the decisive words that signal formality.

Experimental Setup and Datasets

The study evaluated English-to-Korean (En→Ko) and English-to-Japanese (En→Ja) translations:

  • En→Ko: Trained on AI-HUB (1.5M pairs) and OpenSubtitles2018.
  • En→Ja: Pre-trained on JParaCrawl (22M pairs) and fine-tuned on Business Scene Dialogue (BSD), AMI Meeting, and OpenSubtitles2018.

Key Results

The proposed model, combining Weighted Loss and Attention Regularization (WL+AttnReg), consistently outperformed strong baselines across all benchmarks.

BLEU score comparison across different datasets for English-to-Korean and English-to-Japanese translation tasks.

Beyond automated metrics, human evaluation revealed a strong preference for the proposed model. In tests for formality consistency, evaluators preferred the new model's translations 93% of the time. Furthermore, the model maintained high semantic fidelity, with 90% of translations judged as equal to or better than the baseline in meaning preservation.

Insights and Discussion

A key finding is that attention regularization makes the model's internal logic more human-like. The correlation between the model's attention weights and human perception of important tokens rose from 0.029 (standard) to 0.669 (proposed). By using a classifier to provide a "dense" signal for "sparse" features, the model learns to ignore contextual noise and focus on syntactic markers like the Korean verb ending "-요" or subject markers like "저" vs "나".

Conclusion and Future Work

While this approach significantly improves stylistic consistency, capturing extremely subtle nuances remains a challenge. Future work may focus on developing automatic metrics more sensitive to syntactic formality and reducing the dependency on high-quality pre-trained classifiers for low-resource languages.

Summary updated

BibTeX
@inproceedings{kim2023towards,
  author = {Dohee Kim and Yujin Baek and Soyoung Yang and Jaegul Choo},
  title = {{Towards Formality-Aware Neural Machine Translation by Leveraging Context Information}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.494},
}
Figure