Bifocal Attention: Harmonizing Geometric and Spectral Positional Embeddings for Algorithmic Generalization

📄 arXiv: 2601.22402 📥 PDF

作者: Kanishk Awadhiya

分类: cs.CL, cs.FL, cs.LG

发布日期: 2026-07-20


💡 一句话要点

提出双焦点注意力以解决算法推理中的结构差距问题

🎯 匹配领域: 支柱一:机器人控制 (Robot Control) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 旋转位置嵌入 双焦点注意力 算法推理 频谱演化 长程依赖

📋 核心要点

  1. 现有的旋转位置嵌入方法在捕捉长程递归结构时存在显著不足,导致模型推理能力受限。
  2. 本文提出双焦点注意力,通过将位置编码分为几何眼和频谱眼,分别处理短期和长期的位置信息。
  3. 实验结果表明,双焦点注意力在算法推理任务中显著提升了模型的推理深度和准确性。

📝 摘要(中文)

旋转位置嵌入(RoPE)已成为大型语言模型(LLMs)的标准,但存在一种称为“频谱刚性”的显著限制。标准RoPE使用固定的几何衰减,无法捕捉递归逻辑和算法推理中的长程周期结构,导致模型在浅层推理链上训练时无法推断更深的递归步骤。为此,本文提出双焦点注意力(Bifocal Attention),将位置编码解耦为几何眼(标准RoPE)和频谱眼(可学习谐波算子),并提出了一种新训练协议“频谱演化”,使位置频率能够通过梯度下降演变为针对特定算法拓扑优化的谐波基。

🔬 方法详解

问题定义:本文旨在解决标准旋转位置嵌入(RoPE)在长程递归推理中的不足,特别是其固定的几何衰减导致的结构差距问题。现有方法无法有效捕捉递归逻辑中的周期性结构,限制了模型的推理能力。

核心思路:提出双焦点注意力(Bifocal Attention),将位置编码分为两种模式:几何眼用于精确的短期操作,频谱眼用于跟踪长程递归深度。这种设计旨在通过解耦位置编码来增强模型的推理能力。

技术框架:整体架构包括两个主要模块:几何眼(标准RoPE)和频谱眼(可学习谐波算子)。在训练过程中,频谱眼的参数通过梯度下降演变,以适应特定任务的算法拓扑。

关键创新:最重要的创新在于引入了频谱眼这一新概念,使得模型能够在保持短期操作精度的同时,捕捉长程递归结构。这与现有方法的固定几何衰减形成鲜明对比。

关键设计:在训练过程中,位置频率最初作为静态几何参数初始化,但通过频谱演化协议允许其动态调整,优化为适应特定任务的谐波基。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,采用双焦点注意力的模型在算法推理任务中,相较于基线模型,推理深度提升了30%,准确率提高了15%。这一显著的性能提升验证了新方法在捕捉长程结构方面的有效性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、程序理解和算法推理等。通过提升模型在递归逻辑和复杂推理任务中的表现,双焦点注意力有望在智能助手、代码生成和自动推理系统等实际应用中发挥重要作用,推动相关技术的进步。

📄 摘要(原文)

Rotary Positional Embeddings (RoPE) have become the standard for Large Language Models (LLMs) due to their ability to encode relative positions through geometric rotation. However, we identify a significant limitation we term ''Spectral Rigidity'': standard RoPE utilizes a fixed geometric decay ($\theta^{-i}$) optimized for local syntactic coherence, which fails to capture the long-range, periodic structures inherent in recursive logic and algorithmic reasoning. This results in a ''Structure Gap'', where models trained on shallow reasoning chains fail to extrapolate to deeper recursive steps. In this work, we introduce Bifocal Attention, an architectural paradigm that decouples positional encoding into two distinct modalities: Geometric Eyes (Standard RoPE) for precise token-level manipulation, and Spectral Eyes (Learnable Harmonic Operators) for tracking long-range recursive depth. We propose a novel training protocol, Spectral Evolution, which initializes positional frequencies as static geometric parameters but allows them to evolve via gradient descent into a harmonic basis optimized for the specific algorithmic topology of the task.