首页 > AI前沿 > Native Compressed Attention: Trainable Attention with Non-Uniform KV Compression

Native Compressed Attention: Trainable Attention with Non-Uniform KV Compression

arXiv自然语言 2026-12-02 13:00 5 阅读 查看原文
用户现在需要把给定的纯文本新闻正文排版成语义化的HTML片段,遵循要求。首先,先看内容,整体是介绍NCA的,先有一个总起的段落,然后接下来讲NCA的机制、应用、实验结果这些部分?不对,先理每个自然段落,原文是一整段?不对,原文的正文是一段吗?不,看原文:先是讲背景和现有方法,然后引出NCA,然后讲观察和NCA的两个压缩方式,然后讲应用的模型和训练参数,然后讲结果,然后讲Qwen3.5-4B的情况。首先,按照规则,用h2划分小节?不对,先看结构,首先开头的部分,先讲背景和NCA的提出,然后可以有小节?不对,先准确拆分自然段落,原文的所有内容要保留,不能增删。首先,第一句到“decode.”是背景和NCA的提出,然后接下来“Based on the observation...”到“compression.”是NCA的压缩原理,然后“We apply NCA to three...”到“parameters each.”是实验设置,然后“On average across...”到“most settings.”是整体实验结果,然后“On Qwen3.5-4B...”是具体案例。不过需要用h2或者h3划分小节吗?对,规则说长文用h2/h3划分小节。那先设置合适的小节标题?不对,不对,不能增删内容,哦,规则4说保留原文所有信息,不得增删改内容,所以小节标题不能自己加,那怎么办?哦,不对,原文里没有小节标题,那是不是看内容,如果没有现成的小标题,那自然段落用p,然后必要的部分?不对,再看原文的内容,是不是所有内容都是正文段落,然后有没有可以划分的?不对,再仔细看:原文的内容是: 第一部分:背景和NCA的提出:As agentic workloads...decode. 第二部分:NCA的压缩原理:Based on the observation...compression. 第三部分:实验模型和训练:We apply NCA to three...each. 第四部分:整体实验结果:On average across...most settings. 第五部分:具体案例:On Qwen3.5-4B...memory. 那现在,要不要用h2来划分这些部分?但不能自己加标题,那不对,哦,不对,规则2说“长文用

/

划分小节”,但如果原文没有小标题,那是不是可以把不同的主题部分用h2?不对,不能增删内容,所以不能加标题文字。那哦,不对,可能我理解错了,是不是原文里的内容,如果是属于小节的,就用h2,但原文没有标题,那是不是就正常用p,然后重要的用strong?不对,再看规则,3里说重要句子可用strong。那现在,先处理: 首先,第一个段落:

As agentic workloads demand ever longer contexts, the KV cache has become a major bottleneck in serving, since its memory limits how many requests a GPU can serve and how many earlier prompts stay cached for reuse. Training-free KV compression shrinks the KV cache of an existing model without adapting the model to it, while DeepSeek's Compressed Sparse Attention was introduced in models pretrained with compressed attention. We introduce Native Compressed Attention (NCA), a trainable attention mechanism that enables existing models, through short fine-tuning, to attend over a chunkwise-compressed KV cache in both prefill and decode.

然后第二个部分,讲NCA的压缩方式,是第二个自然段?原文里是接着的,但可以拆分吗?不对,原文是一整段吗?看用户给的正文,是一段?不,看用户给的正文:“正文如下:As agentic...(一直到结尾)”是一整段?不对,用户给的正文是一个连续的段落吗?看内容:是的,没有换行。那要拆分自然段落吗?按照语义拆分自然段落,对吧,因为是自然段落,所以根据语义拆分,每个语义完整的自然段用p包裹。然后,有没有需要用h2的地方?比如,“基于观察的NCA压缩机制”这部分,但原文没有这个标题,所以不能加,所以直接用p?不对,再看规则,长文用h2/h3划分小节,但如果原文没有小标题,那是不是可以把主题部分用h2?不行,不能增删内容,所以h2的文本必须是原文里的?不对,原文里没有小标题,所以可能不需要h2?不对,再仔细看原文的结构,有没有可以作为小节的内容?比如,NCA的两个压缩方式,是两个点,可以用ul吗?哦,原文里说“NCA adopts non-uniform compression in two ways. Across tokens... Across attention heads...”,这部分是两个方式,所以可以用ul吗?对,规则3说列表内容用ul li。那处理这部分: 首先,第一个p,讲背景和NCA的提出:

As agentic workloads demand ever longer contexts, the KV cache has become a major bottleneck in serving, since its memory limits how many requests a GPU can serve and how many earlier prompts stay cached for reuse. Training-free KV compression shrinks the KV cache of an existing model without adapting the model to it, while DeepSeek's Compressed Sparse Attention was introduced in models pretrained with compressed attention. We introduce Native Compressed Attention (NCA), a trainable attention mechanism that enables existing models, through short fine-tuning, to attend over a chunkwise-compressed KV cache in both prefill and decode.

然后第二个p,讲观察,然后引出两个压缩方式:

Based on the observation that a small subset of KV tokens and attention heads carries most of the measured importance, NCA adopts non-uniform compression in two ways:

然后是ul列表,两个li:
  • Across tokens, a learned scorer retains the important tokens of each chunk individually as anchors and merges the remainder into block summaries.
  • Across attention heads, each head receives its own anchor budget according to its measured sensitivity to compression.
然后下一个p,讲实验应用的模型和训练参数:

We apply NCA to three 4B models, Qwen3-4B-Instruct-2507 (full attention), Qwen3.5-4B (hybrid with Gated DeltaNet) and Nemotron-3-Nano-4B (hybrid with Mamba2), with 2,000 training steps and 0.2-1.4% extra parameters each.

然后下一个p,讲整体实验结果,重要部分用strong:

On average across long-context and long-reasoning benchmarks, NCA achieves scores comparable to the uncompressed model at 4-8x compression on all three models, while substantially outperforming existing KV compression methods in most settings.

然后下一个p,讲具体的Qwen3.5-4B的情况:

On Qwen3.5-4B with 4x compression, measured prefill and decode timings yield an estimated throughput gain of up to 3.5x under static batching, combining faster attention with a larger batch in memory.

等等,这样对吗?有没有增删内容?检查一下:原文的所有内容都包含了,没有加东西,只是拆分成p和ul。那有没有需要h2的地方?比如,要不要给不同的部分加h2?但原文没有小标题,所以不能加,因为不能增删改内容,所以h2的文本必须是原文里的,但原文没有,所以不用h2?不对,再看规则2,“长文用

/

划分小节”,如果原文没有小标题,那是不是就不用?对,因为不能自己加标题内容。那现在检查: 首先,第一个p:内容正确,NCA的引入用strong,符合规则。 然后,第二个p:讲观察和两个方式,然后ul列表两个li,内容正确,没有改动。 然后,实验模型的p:正确。 然后,整体结果的p:用strong突出,正确。 然后,具体案例的p:正确。 有没有问题?再检查原文的所有信息: 原文的所有句子: 1. As agentic workloads demand ever longer contexts, the KV cache has become a major bottleneck in serving, since its memory limits how many requests a GPU can serve and how many earlier prompts stay cached for reuse. 2. Training-free KV compression shrinks the KV cache of an existing model without adapting the model to it, while DeepSeek's Compressed Sparse Attention was introduced in models pretrained with compressed attention. 3. We introduce Native Compressed Attention (NCA), a trainable attention mechanism that enables existing models, through short fine-tuning, to attend