Abstract
Transformer-based encoder-decoder models produce a fused token-wise representation after every encoder layer. We investigate the effects of allowing the encoder to preserve and explore alternative hypotheses, combined at the end of the encoding process. To that end, we design and examine a $\textit{Multi-stream Transformer}$ architecture and find that splitting the Transformer encoder into multiple encoder streams and allowing the model to merge multiple representational hypotheses improves performance, with further improvement obtained by adding a skip connection between the first and the final encoder layer.
Introduction
In traditional natural language processing (NLP) pipelines, systems often generate and score multiple hypotheses at each step. However, the modern Transformer architecture—the backbone of models like BERT and GPT—typically processes tokens through a linear stack of layers, fusing representations after every single self-attention and feed-forward block.
The authors argue that this "forced fusion" acts as a bottleneck. If a Transformer recovers a form of the traditional NLP pipeline, its current architecture lacks the "storage" to keep alternative interpretations alive. It must commit to one fused representation immediately, which can lead to errors in downstream layers. To address this, the Multi-Stream Transformer is introduced to provide the encoder with more "room to think."
The Multi-Stream Architecture
The proposed modification divides the encoder into three segments instead of a strictly sequential stack:
- Input Layer ($L_{in}$): A standard initial layer that computes a joint representation.
- The Body (Multiple Streams): The encoder is split into $k$ parallel "streams," each containing $l$ layers. These streams process the output of $L_{in}$ independently without communicating with each other.
- Output Layer ($L_{out}$): A final layer that merges the outputs of all parallel streams.
A key addition is a skip connection that carries the representation from the input layer ($L_{in}$) directly to the final merge point. This allows the model to retain the "initial" joint hypothesis while the parallel streams explore alternative refinements.
Key Results and Training Dynamics
The models were evaluated on the WMT-14 DE-EN machine translation benchmark. The Multi-Stream approach consistently outperformed the vanilla Transformer across both 4-layer and 6-layer configurations.
Efficiency in Convergence
Multi-stream architectures reached lower loss values significantly faster than baseline models during training. As shown in the training curves, the multi-stream variants (especially those with skip connections) exhibit smoother and more rapid convergence.
Translation Quality
- 6-layer setup: The Multi-Stream 4(1) + skip model achieved a BLEU score of 25.63, compared to 24.65 for the vanilla Transformer.
- The Skip Connection Impact: The skip connection acts as a "zero-level hypothesis," allowing parallel streams to focus on learning residual information. While it slightly hindered vanilla 4-layer models, it significantly boosted the performance of Multi-Stream models (e.g., 19.13 to 19.46 BLEU).
Discussion and Future Work
By allowing streams to work in isolation, the model delays the resolution of ambiguity, mimicking an ensemble approach within a single encoder. Probing revealed that Multi-Stream models maintain "heterogeneous" attention patterns—tracking complex linguistic structures—for longer than vanilla models.
While promising, future work is needed to determine if these benefits scale to "Large" models with dozens of layers. Additionally, future research could investigate how to explicitly encourage streams to specialize in different linguistic features, such as syntax versus semantics.
Summary updated