Introduction
Large-scale pre-trained generative models, such as BART and T5, have set new benchmarks across various natural language processing (NLP) tasks. However, their deployment in real-time applications or on resource-constrained edge devices is often prohibited by their massive parameter counts and high computational costs. While model compression techniques like quantization and knowledge distillation have been successful for encoder-only models (e.g., BERT), applying them to sequence-to-sequence (seq2seq) architectures remains a significant challenge.
DQ-BART addresses this gap by introducing a joint framework that combines Distillation-Aware Quantization and layer reduction. By training the model to be robust to low-precision representations through teacher-student guidance, the authors achieve up to a 16.5x reduction in model size with negligible performance loss, and up to 27.7x compression for extreme use cases.
The Challenge of Seq2Seq Compression
The primary obstacle in compressing generative models is "quantization error accumulation." In autoregressive decoding, the model generates text token by token, using previously generated tokens as input for the next step. When weights or activations are quantized to low precision, small errors introduced at the beginning of a sequence compound over time. In many cases, this leads to a total breakdown in linguistic coherence, where the model produces gibberish despite having high-precision training.
The DQ-BART Framework
DQ-BART utilizes a multi-pronged approach to mitigate these errors and maintain generative quality:
1. Distillation-Aware Quantization
Rather than quantizing a pre-trained model post-hoc, DQ-BART employs Quantization-Aware Training (QAT). During the forward pass, weights are mapped to ultra-low precision (specifically 2-bit ternary weights), while the backward pass maintains full-precision gradients. This allows the model to iteratively adjust its weights to find configurations that are inherently robust to low-bit math. To maintain numerical stability, activations are kept at 8-bit precision.
2. Triple-Level Distillation
To stabilize the learning process, a full-precision "Teacher" model guides the low-precision "Student." The student is trained to minimize the divergence from the teacher across three dimensions:
- Logits: Matching the final probability distribution over the vocabulary.
- Attention Scores: Ensuring the student captures the same contextual relationships between words as the teacher.
- Hidden States: Aligning the internal mathematical representations of the text.
3. Structural Compression
In addition to bit-width reduction, the framework supports layer reduction. For example, a standard BART-base model can be pruned from a 6-layer encoder/decoder structure to a 3-layer or even a 1-layer configuration, further reducing the memory footprint.
Experimental Results
The authors evaluated DQ-BART on several demanding benchmarks, including CNN/DailyMail (summarization), XSUM (extreme summarization), ELI5 (long-form QA), and WMT16 (machine translation).
Compression vs. Performance
- 16.5x Compression: By using 2-bit weights and a 6-layer encoder/3-layer decoder, DQ-BART achieved performance nearly identical to the full-precision BART-base on the CNN/DailyMail task.
- 27.7x Compression: For extreme constraints, the model was reduced to a 1-layer encoder and 1-layer decoder, shrinking the storage requirement from 531MB to just 19MB. While this led to performance drops on precision-heavy tasks like XSUM, the model remained remarkably effective for long-form question answering (ELI5).
- Efficiency Gains: The joint approach (Distill + Quantize) consistently outperformed models of equivalent size that relied solely on distillation (layer removal). This suggests that reducing bit-width is a more parameter-efficient way to compress seq2seq models than simply removing entire layers.
Key Insights
- The Guidance Effect: Distillation acts as a vital stabilizer. By forcing the quantized student to mimic the teacher’s internal logic, the student learns to navigate the noisy landscape created by 2-bit quantization.
- Over-parameterization: The fact that 8-bit models showed almost no performance loss—and 2-bit models remained competitive—indicates that standard seq2seq models are significantly over-parameterized for many downstream tasks.
- Task Sensitivity: The impact of compression varies by task. Creative or long-form generation (ELI5) appears more resilient to extreme compression than tasks requiring high factual precision (XSUM).
Limitations and Future Directions
While DQ-BART represents a significant step forward, challenges remain. When applied to much deeper models like mBART-large (24 layers), the 2-bit quantization error became more difficult to manage, suggesting that deeper decoders are more susceptible to error accumulation. Furthermore, while the model footprint is drastically reduced, achieving actual wall-clock speedups requires specialized hardware kernels optimized for 2-bit arithmetic.
Future work may involve combining DQ-BART with other techniques such as attention head pruning or sequence-level distillation to further optimize the trade-off between model size and generative quality.
Summary updated