Introduction
While BERT has revolutionized Natural Language Understanding (NLU), its application to Natural Language Generation (NLG)—particularly sequence-to-sequence tasks like machine translation—has remained challenging. The primary obstacles include "catastrophic forgetting" during fine-tuning, architectural mismatches between BERT's bidirectional nature and standard autoregressive generation, and the high computational cost of fine-tuning massive pre-trained models.
This paper introduces AB-Net (Adapter-Bert Network), a framework that repurposes pre-trained BERT models for high-quality, high-speed text generation. By utilizing lightweight adapter modules and a parallel decoding strategy, AB-Net achieves state-of-the-art translation quality while significantly reducing inference latency.
Architecture and Methodology
AB-Net treats two frozen BERT models as an encoder-decoder pair. The core innovation lies in the insertion of trainable "adapter" modules between the fixed BERT layers, allowing the model to adapt to new tasks without losing its pre-trained knowledge.
Lightweight Adapters
Instead of updating BERT's millions of parameters, AB-Net freezes them entirely.
- Encoder Adapters: These consist of two feed-forward networks placed after the BERT layers.
- Decoder Adapters: These introduce a multi-head cross-attention mechanism. This is crucial because standard BERT layers lack the ability to attend to source-side information from an encoder.
Parallel Decoding via Mask-Predict
To bridge the gap between BERT’s bidirectional pre-training and the requirements of sequence generation, AB-Net employs the Mask-Predict algorithm. Rather than generating text word-by-word (autoregressively), the model starts with a sequence of [MASK] tokens and iteratively refines them in parallel. This approach aligns with BERT's original Masked Language Modeling (MLM) objective and enables significantly faster inference.
Experimental Results
The framework was evaluated on standard benchmarks including IWSLT14 (German-English), WMT14 (English-German/French), and WMT16 (Romanian-English).
Performance and Efficiency
AB-Net demonstrates superior performance across multiple metrics. On the IWSLT14 (De-En) task, it achieved a BLEU score of 36.49, outperforming the Transformer-Base baseline (33.59). Notably, despite the large underlying BERT models, the number of trained parameters in AB-Net (67M) is actually lower than in a standard Transformer-Base (74M).
Inference Speedup
One of the most significant advantages of AB-Net is its speed. By utilizing parallel decoding, the model reduces per-sentence latency to 327ms, compared to 778ms for the autoregressive Transformer-Base—a speedup of approximately 2.4x.
Key Insights
- Decoupling Knowledge: Freezing BERT preserves general linguistic knowledge, while adapters learn task-specific mappings, effectively preventing catastrophic forgetting.
- BERT as a Decoder: This work proves that BERT can serve as a powerful decoder when augmented with cross-attention adapters and paired with non-autoregressive decoding schemes.
- Robustness in Low-Resource Settings: The model showed remarkable gains in low-resource language pairs (e.g., English-Italian), indicating that BERT's pre-trained knowledge is a powerful asset when training data is limited.
Conclusion and Future Work
AB-Net successfully bridges the gap between pre-trained NLU models and sequence generation tasks. While it offers significant speed and quality improvements, it does introduce a memory overhead due to the requirement of loading two full BERT models. Future research may explore hybrid architectures, such as combining BERT encoders with GPT-style decoders, to further optimize the balance between pre-training objectives and generation efficiency.
Summary updated