首页 > AI前沿 > Attention, Dynamic Wave and Hybrid Sequence Mixers in Language Models

Attention, Dynamic Wave and Hybrid Sequence Mixers in Language Models

arXiv自然语言 2026-10-29 19:33 5 阅读 查看原文
首先,任务是作为专业的新闻排版工程师,将给定的纯文本新闻正文排版成语义化的HTML片段。规则是: 1. 只输出HTML片段本身,不要Markdown围栏、不要解释。 2. 每个自然段落用

包裹,长文用

/

划分小节。 3. 列表内容用
  • ,引用用
    ,代码用
    ,重要句子可用。
    
    4. 保留原文所有信息,不得增删改内容。
    
    5. 不要输出//等文档级标签。
    
    现在,分析给定的正文内容。正文是:
    
    "Large Language Models (LLMs) rely on Multi-Head Attention (MHA) for sequence modeling, but scaling to long contexts is constrained by the quadratic cost of attention, motivating sub-quadratic recurrent alternatives. This paper formalizes a Dynamic Wave recurrent layer, based on input-dependent exponential damping and cosine phase modulation, and evaluates three 10.94M-parameter configurations (Pure Transformer, Pure Wave, and Hybrid Wave-Attention) on TinyStories under perplexity, latency, throughput and peak VRAM profiling up to 4096 tokens. The Hybrid configuration reaches the best perplexity, 5.95 on the full held-out split against 6.93 for the Transformer and 7.26 for Pure Wave. The efficiency picture, however, is governed by implementation rather than by architecture. Against an unfused attention baseline, Pure Wave uses 78.7% less peak VRAM at a 4096-token context (1404.3 MB vs. 6601.6 MB); against a fused scaled-dot-product attention kernel the same comparison yields no advantage at all (1404.3 MB vs. 1403.6 MB), and in training mode Pure Wave is 8.3% more expensive than the Transformer. Likewise, hoisting elementwise terms out of the recurrence loop speeds the layer up 2.53-fold with no custom kernel, reducing its latency gap to attention from 2.48-fold to 1.12-fold. A hybrid stack is found to inherit the cost of its more expensive mixer rather than the advantage of its cheaper one, its peak VRAM matching the Pure Transformer to within 0.1%. A closed-form memory model reproduces these measurements and predicts the context length beyond which attention overtakes the vocabulary projection. The findings indicate that reported efficiency gains for recurrent attention replacements must be stated relative to a named attention backend and a named implementation, and that hybridization is best justified on quality grounds."
    
    我需要将这个文本分解成语义化的HTML结构。
    
    首先,确定自然段落。文本看起来像是一个摘要或介绍,可能是一个连续的段落,但规则说“每个自然段落用

    包裹”。所以,我需要判断是否有多个段落。 阅读文本: - 开头部分讨论LLMs和MHA的问题。 - 然后介绍论文的内容。 - 接着描述实验结果。 - 最后是结论。 它似乎是一个完整的段落,但可能可以分成几个部分。规则说“长文用

    /

    划分小节”,所以对于长文本,我应该添加标题。 文本长度适中,但为了语义化,我可以添加一些小标题。 规则说:“长文用

    /

    划分小节”。所以,我应该识别小节。 分解文本: 1. 第一句:介绍问题:LLMs rely on MHA... motivating sub-quadratic recurrent alternatives. 2. 第二句:论文内容:This paper formalizes... profiling up to 4096 tokens. 3. 第三句:结果:The Hybrid configuration reaches... 7.26 for Pure Wave. 4. 第四句:效率方面:The efficiency picture... Transformer. 5. 第五句:优化:Likewise, hoisting elementwise terms... 1.12-fold. 6. 第六句:混合模型:A hybrid stack is found... within 0.1%. 7. 第七句:模型:A closed-form memory model... vocabulary projection. 8. 第八句:结论:The findings indicate... quality grounds. 这可以分成几个小节: - 问题背景 - 论文方法 - 实验结果 - 效率分析 - 结论 但规则说“长文用

    /

    划分小节”,所以我应该添加标题。 在HTML中,

    是二级标题,

    是三级标题。既然这是新闻正文,可能不需要太深的标题,但为了语义化,我可以添加。 文本中没有明确的列表或引用,但规则提到列表用
    • ,引用用
      ,代码用
      。
      
      检查文本:
      
      - 没有明显的列表。
      
      - 没有引用。
      
      - 没有代码。
      
      - 有重要句子:比如关键数据或结论。
      
      规则说“重要句子可用”,所以我可以加粗关键部分。
      
      例如,“The Hybrid configuration reaches the best perplexity, 5.95” 可以加粗。
      
      但规则是“重要句子可用”,不是必须,所以我可以选择性地加。
      
      现在,关于段落:文本似乎是连续的,但可能有隐含的段落。在新闻中,通常有多个段落。
      
      我可以这样分:
      
      - 第一段:问题和动机
      
      - 第二段:论文方法和实验设置
      
      - 第三段:主要结果
      
      - 第四段:效率分析
      
      - 第五段:优化和混合模型
      
      - 第六段:模型和预测
      
      - 第七段:结论
      
      但为了简单,我可以考虑整个文本作为一个段落,但规则说“每个自然段落用

      包裹”,所以如果有多个自然段落,我应该用

      。 在给定的文本中,它是一整段,没有换行。所以,可能它就是一个自然段落。 但规则也提到“长文用

      /

      划分小节”,所以我可以添加小标题来组织。 例如:

      Introduction

      ...

      Methodology

      ...

      等等。 文本内容: - "Large Language Models (LLMs) rely on Multi-Head Attention (MHA) for sequence modeling, but scaling to long contexts is constrained by the quadratic cost of attention, motivating sub-quadratic recurrent alternatives." — 这可以是引言。 - "This paper formalizes a Dynamic Wave recurrent layer, based on input-dependent exponential damping and cosine phase modulation, and evaluates three 10.94M-parameter configurations (Pure Transformer, Pure Wave, and Hybrid Wave-Attention) on TinyStories under perplexity, latency, throughput and peak VRAM profiling up to 4096 tokens." — 方法。 - "The Hybrid configuration reaches the best perplexity, 5.95 on the full held-out split against 6.93 for the Transformer and 7.26 for Pure Wave." — 结果。 - "The efficiency picture, however, is governed by implementation rather than by architecture. Against an unfused attention baseline, Pure Wave uses 78.7% less peak VRAM at a 4096-token context (1404.3 MB vs. 6601.6 MB); against a fused scaled-dot-product attention kernel the same comparison yields no advantage at all (1404.3 MB vs. 1403.6 MB), and in training mode Pure Wave is 8.3% more expensive than the Transformer." — 效率讨论。 - "Likewise, hoisting elementwise terms out of the recurrence loop speeds the layer up 2.53-fold with no custom kernel, reducing its latency gap to attention from 2.48-fold to 1.12-fold." — 优化。 - "A hybrid stack is found to inherit the cost of its more expensive mixer rather than the advantage of its cheaper one, its peak VRAM matching the Pure Transformer to within 0.1%." — 混合模型。 - "A closed-form memory model reproduces these measurements and predicts the context length beyond which attention overtakes the vocabulary projection." — 模型。 - "The findings indicate that reported efficiency gains for recurrent