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.

0

北京 – 刚刚,人工智能公司 DeepSeek 发布了一篇重磅论文,推出了一种名为 NSA(Native Sparse Attention)的全新注意力架构,旨在解决大型语言模型(LLM)在超长上下文处理中面临的效率瓶颈。消息一经发布,便迅速在社交媒体平台 𝕏 上引发热议,短时间内获得了数十万的浏览量,其关注度甚至超过了 OpenAI 的最新成果。

更引人注目的是,幻方科技、DeepSeek 创始人梁文锋亲自挂名,成为该论文的作者之一。这一举动无疑为这项研究增添了更多分量,也引发了业界对于 DeepSeek 在 AI 领域未来发展的更多期待。

论文标题: Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention

论文链接: https://arxiv.org/abs/2502.11089

长上下文建模:LLM 的关键能力

随着 LLM 在深度推理、代码生成、多轮对话等领域的广泛应用,长上下文建模能力变得至关重要。诸如 OpenAI 的 o 系列模型、DeepSeek-R1 和 Gemini 1.5 Pro 等最新模型,已经能够处理整个代码库、长文档,并在数千个 token 上保持连贯的对话。然而,传统的注意力机制在高序列长度下面临着巨大的计算复杂度挑战,成为影响模型效率的关键瓶颈。

据测算,在使用 softmax 架构进行 64k 长度上下文的解码时,注意力计算占总延迟的 70-80%。因此,开发更高效的注意力机制成为迫切需求。

NSA:硬件对齐与原生可训练的稀疏注意力

DeepSeek 的研究人员提出的 NSA 架构,正是为了解决这一难题。NSA 是一种本地可训练的稀疏注意力机制,具有超快长上下文训练和推断能力,并且与硬件高度对齐。

与现有的稀疏注意力方法相比,NSA 具有以下优势:

  • 硬件对齐的推理加速: 通过优化块状稀疏注意力,充分利用 Tensor Core 和内存访问,缓解内存访问和硬件调度瓶颈,实现理论计算减少到实际速度提升的转化。
  • 训练感知的设计: 通过可训练的操作符实现端到端计算,降低训练成本,同时保持模型性能。

NSA 的核心创新在于集成了分层 token 建模。它将键和值组织成时间块(temporal blocks),并通过三条注意力路径处理它们:压缩的粗粒度 token、选择性保留的细粒度 token 以及用于局部上下文信息的滑动窗口。

实验验证:性能与效率的双重提升

DeepSeek 的研究人员通过对现实世界语言语料库的综合实验,对 NSA 进行了评估。在具有 260B token 的 27B 参数 Transformer 骨干上进行预训练后,NSA 在通用语言评估、长上下文评估和链式推理评估中表现出色,实现了与 Full Attention 基线相当或更优的性能,同时优于现有的稀疏注意力方法。

此外,与 Full Attention 相比,NSA 在解码、前向和后向阶段均提供了明显的加速,且加速比随着序列长度的增加而增加。这些结果充分验证了分层稀疏注意力设计在平衡模型能力和计算效率方面的有效性。

未来展望:长上下文 LLM 的加速器

DeepSeek 的 NSA 架构为解决长上下文 LLM 的效率瓶颈提供了一种新的思路。通过硬件对齐和原生可训练的设计,NSA 有望在实际应用中实现更快的推理速度和更低的训练成本,从而推动 LLM 在更多领域的应用。

随着 LLM 的不断发展,长上下文建模能力将变得越来越重要。DeepSeek 的 NSA 架构有望成为长上下文 LLM 的加速器,为人工智能的未来发展注入新的动力。

参考文献:

(完)


>>> Read more <<<

Views: 0

0

发表回复

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