Two-Headed Monster and Crossed Co-Attention Networks

Yaoyiran Li, Jing Jiang

Abstract

Standard Transformer models for machine translation typically rely on a single encoder-decoder pipeline. This paper proposes the Two-Headed Monster (THM), a neural architecture that utilizes two symmetric encoder branches to capture more robust internal representations. By implementing Crossed Co-Attention Networks (CCNs), the model allows these parallel branches to exchange information. Experimental results on WMT benchmarks show modest BLEU score improvements and significantly more stable model selection, though at the cost of increased computational overhead.

Introduction

While the Transformer architecture has revolutionized machine translation, its single-stream processing can sometimes struggle with linguistic complexity or overfit to specific training patterns. The authors explore whether co-attention—a technique primarily used in multi-modal tasks like image captioning—can be adapted for single-modality text-to-text translation. The goal is to create a system where two parallel processing "heads" can analyze the same input from slightly different perspectives and collaborate to build a superior representation of the source text.

The Two-Headed Monster Architecture

The core of the proposed paradigm is the use of two identical encoder branches, designated as Left and Right. To ensure these branches learn complementary features rather than identical ones, the authors apply dropout and "input corruption" (randomly swapping sub-word tokens) to the embeddings of each branch. This effectively creates an internal ensemble within a single model.

High-level block diagram of the Two-Headed Monster (THM) architecture showing dual encoders and co-attention mechanisms.

Crossed Co-Attention Networks (CCNs)

The "secret sauce" of the THM is the Crossed Co-Attention mechanism. In a standard Transformer, the Query (Q), Key (K), and Value (V) vectors for self-attention are derived from the same source. In the CCN implementation, the branches swap queries: the Left encoder uses its own V and K but takes the Query (Q) from the Right encoder, and vice versa.

Detailed schematic of the Crossed Co-Attention Network (CCN) architecture, highlighting the multi-head attention crossing and the modified decoder.

The decoder is also modified to handle this dual-stream input. It attends to both encoder branches simultaneously, merging their information through concatenation and linear transformation before passing the result to the feed-forward layers. To manage the increased workload, the implementation utilizes FP16 (half-precision) training and synchronous distributed training.

Experimental Results

The model was evaluated on the WMT 2014 EN-DE (4.5M examples) and WMT 2016 EN-FI (2M examples) benchmarks using both "Base" and "Big" Transformer configurations.

Performance Gains

The CCN consistently outperformed the strong Transformer baseline across all tested scenarios:

  • EN-DE (German): Improvements of 0.74 BLEU (Base) and 0.51 BLEU (Big).
  • EN-FI (Finnish): Improvements of 0.47 BLEU (Base) and 0.17 BLEU (Big).

Robust Model Selection

Beyond raw accuracy, the THM models demonstrated remarkable reliability in model selection. There was a much higher correlation between validation (Dev) performance and final test performance compared to the baseline. In 75% of the experimental runs, the THM's top 3 models on the Dev set remained the top 3 on the Test set, a level of predictability not seen in the standard Transformer.

Discussion and Limitations

The primary trade-off for these gains is computational cost. Because the architecture effectively doubles the encoder parameters, training time per epoch increased by approximately 75% on average. For production environments, the modest BLEU gains may not always justify the significant increase in compute costs.

Furthermore, the authors note that they only explored one specific "crossing" logic for the attention gates. Future work may involve testing different connection patterns or applying the THM paradigm to multi-modal tasks, where the two heads would naturally receive disparate inputs (e.g., audio and video).

Conclusion

The Two-Headed Monster and its CCN implementation provide a robust framework for internal ensemble learning within a single model. While the computational overhead is significant, the improvements in translation quality and the stability of model selection make it a compelling architecture for tasks where reliability is paramount.

Summary based on research by Yaoyiran Li and Jing Jiang (2020).

Summary updated

BibTeX
@misc{li2019two,
  author = {Yaoyiran Li and Jing Jiang},
  title = {{Two-Headed Monster and Crossed Co-Attention Networks}},
  year = {2019},
  eprint = {1911.03897},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.03897},
}
Figure