On the differences between BERT and MT encoder spaces and how to address them in translation tasks

Raúl Vázquez, Hande Çelikkanat, Mathias Creutz, Jörg Tiedemann

Abstract

Despite its dominance in Natural Language Processing (NLP), BERT cannot simply be "plugged in" as a replacement for Neural Machine Translation (NMT) encoders due to fundamental differences in how they structure information. This paper analyzes these geometric discrepancies and demonstrates that explicitly aligning BERT’s embedding space to match an NMT encoder's "style" significantly improves translation performance and training efficiency.

Introduction

In the world of NLP, BERT is a preeminent model for understanding language nuances. Given that NMT models also utilize the Transformer architecture, it is intuitive to assume BERT would serve as a perfect drop-in replacement for the encoder component of a translation system. However, empirical evidence suggests that BERT does not enhance NMT as much as expected.

Previous hypotheses attributed this to the difference between Masked Language Modeling (BERT's training objective) and generative translation, or to "catastrophic forgetting" during fine-tuning. This paper investigates a third possibility: the geometry of the representation spaces. The authors ask whether BERT "sees" words and sentences in a fundamentally different way than a dedicated translation encoder does.

Methods

The study employs a two-pronged approach: Analysis and Alignment.

1. Geometric Analysis

The authors compare a standard BERT model against a dedicated English-to-German NMT encoder using several metrics:

  • Isotropy (AvgSim): Measuring the distribution density of the embedding space.
  • Contextuality (SelfSim & IntraSim): Measuring how much a word's representation shifts based on its surrounding context.
  • Representational Similarity (RSA & PWCCA): Task-agnostic methods to determine if two different neural networks are processing information similarly.

2. Alignment Strategies

To address identified discrepancies, three setups are proposed:

  • M1 (Explicit Alignment): A supervised transformation forces BERT’s final layer to mathematically match the NMT encoder’s space using parallel data.
  • M2 (Implicit Alignment): Standard fine-tuning where BERT serves as the encoder in an NMT pipeline.
  • M3 (Hybrid): A combination of explicit alignment and fine-tuning.

Key Insights: The "U-Shape" vs. The "Slope"

A critical finding is the difference in how contextuality evolves across layers. NMT encoders typically exhibit a U-shaped similarity curve: they begin with high lexical similarity, drop in the middle during processing, and spike again at the final layer. In contrast, BERT shows a steady, monotonic increase in similarity and anisotropy across its layers.

Self-similarity and intra-sentence similarity across layers for BERT and MT encoders.

This suggests that NMT decoders require specific lexical information that NMT encoders preserve until the very last step. BERT, by becoming "too contextualized" too early, may obscure the word-level details the decoder needs to generate accurate translations. By explicitly aligning BERT to the NMT space (M1), the authors "reshape" BERT’s geometry to mirror the abrupt increase in similarity at the final layer that decoders prefer.

Key Results

The hybrid approach (M3) proved most effective, demonstrating that while BERT possesses the necessary linguistic knowledge, its default "format" is incompatible with standard NMT decoders.

RSA heatmaps comparing BERT and aligned models (M1, M2, M3) against the target MT encoder.
  • Performance: M3 achieved 34.1 BLEU on the MuST-C dataset, outperforming the standard MT baseline (29.9) and a state-of-the-art HuggingFace model (33.7).
  • Efficiency: M3 reached 85% of its peak performance within just 1% of the first training epoch (approximately 3,000 utterances), highlighting the power of proper representation alignment.

Limitations and Future Work

The study focused exclusively on English-to-German translation. Future research should explore different language pairs and the impact of aligning intermediate layers rather than just the final output. Additionally, investigating how decoder capacity interacts with BERT's abstract representations could provide further insights into optimizing these hybrid architectures.

Summary updated

BibTeX
@inproceedings{vazquez2021differences,
  author = {Raúl Vázquez and Hande Çelikkanat and Mathias Creutz and Jörg Tiedemann},
  title = {{On the differences between BERT and MT encoder spaces and how to address them in translation tasks}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-srw.35},
}
Figure