Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

90年代申花出租车司机夜晚在车内看文汇报90年代申花出租车司机夜晚在车内看文汇报
0

在深度学习领域,Transformer 架构凭借其注意力机制取得了显著的成果。然而,传统 Transformer 模型在处理长文本时,由于计算开销巨大而显得力不从心。近日,Mamba 的作者推出了一项创新性研究,成功将 Llama3 蒸馏成混合线性 RNN,实现了在长文本处理上的重大突破。

背景介绍

Transformer 模型在深度学习领域的成功离不开其注意力机制。注意力机制使模型能够关注输入序列中的相关部分,从而实现更好的上下文理解。然而,这种机制的计算复杂度较高,导致 Transformer 难以处理长文本。

Mamba 的出现

前不久,Mamba 的出现打破了这一局面。作为一种状态空间模型(SSM),Mamba 可以随上下文长度的增加实现线性扩展。在中小型规模上,Mamba 已经可以与 Transformer 相匹敌,甚至超越 Transformer,同时还能维持随序列长度的线性可扩展性。

Mamba 作者新作

最近,Mamba 的作者发表了一篇题为《The Mamba in the Llama: Distilling and Accelerating Hybrid Models》的论文。该研究通过重用注意力层的权重,成功将大型 Transformer 蒸馏成大型混合线性 RNN,只需最少的额外计算,同时保留了大部分生成质量。

研究方法

该研究采用了一种多级蒸馏方法,结合了渐进式蒸馏、监督微调和定向偏好优化。与普通蒸馏相比,这种方法可以获得更好的困惑度和下游评估结果。研究假设来自 Transformer 的知识主要保留在从原始模型迁移而来的 MLP 层中,并专注于蒸馏 LLM 的微调和对齐步骤。

线性 RNN 的优势

该研究认为线性 RNN 和注意力机制之间存在天然联系。通过删除 softmax 可以线性化注意力公式,但线性化注意力会导致模型能力退化。为了设计一个有效的蒸馏线性 RNN,研究团队尽可能接近原始 Transformer 参数化,同时以有效方式扩展线性 RNN 的容量。

实验及结果

实验中,研究团队使用两个 LLM 聊天模型进行测试:Zephyr-7B 和 Llama-3 Instruct 8B。结果显示,蒸馏后的混合 Mamba 模型在聊天基准测试中取得了与原始 Transformer 相当的性能,同时在一般基准测试中优于使用数万亿 token 从头开始训练的开源混合 Mamba 模型。

性能最佳模型

性能最佳模型是从 Llama3-8B-Instruct 中蒸馏出来的,在 AlpacaEval 2 上相对于 GPT-4 实现了 29.61 的长度控制胜率,在 MT-Bench 上实现了 7.35 的胜率,超越了最好的指令调整线性 RNN 模型。

总结

Mamba 作者的新作成功将 Llama3 蒸馏成混合线性 RNN,为长文本处理提供了新的解决方案。这一研究不仅为深度学习领域带来了新的突破,也为实际应用场景中的文本处理提供了更多可能性。


read more

Views: 1

0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注