将解码器模型转为编码器-解码器结构,提升效率与性能平衡。
Encoder-Decoder Gemma: Improving the Quality-Efficiency Trade-Off via Adaptation
- 用预训练解码器模型适配编码器-解码器架构,减少重训计算量。
- 相同推理开销下,微调性能比原解码器高7%以上,大模型组合更优。
- 适合追求高效与高性能兼顾的工业应用或资源受限场景。
尽管仅解码器的大语言模型表现优异,但编码器-解码器模型因推理效率高、编码表示丰富,仍在实际应用中广泛使用。本文研究如何将预训练的仅解码器模型适配为编码器-解码器结构,以融合两者优势,实现更优的质量-效率权衡。我们论证该适配不仅继承解码器模型能力,还显著降低计算需求,无需从头预训练。通过在Gemma 2(2B和9B)及新预训练的mT5级模型(最大1.6B)上开展大量实验,验证了适配的有效性与编码器-解码器架构的优势。在相近推理预算下,编码器-解码器模型的预训练性能相当甚至更优,微调性能显著提升:例如,Gemma 2B-2B经指令微调后优于Gemma 2B约7%;而Gemma 9B-2B相较Gemma 2B-2B性能提升超过3%。适配后的编码表示在SuperGLUE任务上也取得更好结果。相关检查点将公开,以促进后续研究。
原文摘要 · Abstract (English)
While decoder-only large language models (LLMs) have shown impressive results, encoder-decoder models are still widely adopted in real-world applications for their inference efficiency and richer encoder representation. In this paper, we study a novel problem: adapting pretrained decoder-only LLMs to encoder-decoder, with the goal of leveraging the strengths of both approaches to achieve a more favorable quality-efficiency trade-off. We argue that adaptation not only enables inheriting the capability of decoder-only LLMs but also reduces the demand for computation compared to pretraining from scratch. We rigorously explore different pretraining objectives and parameter initialization/optimization techniques. Through extensive experiments based on Gemma 2 (2B and 9B) and a suite of newly pretrained mT5-sized models (up to 1.6B), we demonstrate the effectiveness of adaptation and the advantage of encoder-decoder LLMs. Under similar inference budget, encoder-decoder LLMs achieve comparable (often better) pretraining performance but substantially better finetuning performance than their decoder-only counterpart. For example, Gemma 2B-2B outperforms Gemma 2B by $\sim$7\% after instruction tuning. Encoder-decoder adaptation also allows for flexible combination of different-sized models, where Gemma 9B-2B significantly surpasses Gemma 2B-2B by $>$3\%. The adapted encoder representation also yields better results on SuperGLUE. We will release our checkpoints to facilitate future research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。