RIS-Kernel: A Model-Agnostic Architecture for Long-Context LLM Inference via Sparse Attention

📄 arXiv: 2607.21927v1 📥 PDF

作者: Anderson R. Santos

分类: cs.LG

发布日期: 2026-07-24

备注: 20 pages, 9 figures, 5 tables


💡 一句话要点

提出RIS-Kernel以解决长上下文LLM推理中的稀疏注意力问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 长上下文推理 稀疏注意力 模型无关架构 自然语言处理 计算效率

📋 核心要点

  1. 现有大型语言模型的自注意力机制复杂度高,限制了长上下文的处理能力,并需要高性能计算资源。
  2. 本文提出的RIS推理引擎通过稀疏随机几何技术,将自注意力复杂度降低至O(N log N),实现模型无关的长上下文推理。
  3. 实验结果显示,RIS在不同密度下的表现优于传统密集注意力,尤其在资源受限的环境中表现出色。

📝 摘要(中文)

在大型语言模型中,完整自注意力的复杂度为O(N^2),限制了长上下文文档分析至65,536个标记,并需要昂贵的GPU集群。本文提出的减少交互采样(RIS)推理引擎作为一种模型无关架构,利用稀疏随机几何将自注意力复杂度降低至O(N log N),从而适应普通内存限制。我们在Qwen2-1.5B-Instruct上验证了RIS的有效性,结果表明在32,768个标记的控制评估中,RIS-Stochastic在1%密度和70个集成种子下达到了75.00%的准确率,超越了原生密集基线(71.88%)。在65,536个标记的情况下,RIS在内存不足时仍能实现显著的检索增益,证明了在标准学术硬件上进行长上下文LLM推理的可行性。

🔬 方法详解

问题定义:现有大型语言模型在处理长上下文时,由于自注意力机制的复杂度为O(N^2),导致内存消耗过大,无法在普通硬件上高效运行。

核心思路:RIS推理引擎通过引入稀疏随机几何,降低自注意力的复杂度至O(N log N),从而在不修改模型权重的情况下,提升长上下文推理的效率。

技术框架:RIS的整体架构包括两个主要模块:RIS-Stochastic和RIS-Structural。RIS-Stochastic通过随机选择注意力权重来实现稀疏性,而RIS-Structural则通过结构化的方式进一步优化注意力计算。

关键创新:RIS的核心创新在于其模型无关性和稀疏注意力的有效性,能够在不依赖于高性能GPU的情况下,实现长上下文的推理,突破了传统方法的限制。

关键设计:在实验中,RIS-Stochastic在1%密度和70个种子下达到了75.00%的准确率,显示出低密度的稀疏注意力可以作为正则化器,有效过滤序列级噪声。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,在32,768个标记的控制评估中,RIS-Stochastic在1%密度下达到了75.00%的准确率,超越了原生密集基线的71.88%。在65,536个标记的情况下,RIS实现了相较于零上下文基线的14.06个百分点的显著提升,验证了其在资源受限环境下的有效性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、文本生成和长文档分析等。通过降低对高性能计算资源的依赖,RIS-Kernel可以使得更多的研究机构和企业能够在普通硬件上进行长上下文的语言模型推理,推动相关技术的普及与发展。

📄 摘要(原文)

Full self-attention in large language models scales as O(N^2), which limits long-context document analysis to 65,536 tokens and requires costly GPU clusters. The Reduced Interaction Sampling (RIS) inference engine addresses this constraint as a model-agnostic architecture. Without modifying weights, RIS reduces self-attention complexity to O(N log N) using sparse stochastic geometry that fits within commodity memory limits. We validate RIS on Qwen2-1.5B-Instruct across two regimes. In controlled evaluations at 32,768 tokens (where native dense attention serves as the upper bound), RIS-Stochastic at 1% density and 70 ensemble seeds achieves 75.00% accuracy, outperforming the native dense baseline (71.88%), while RIS-Stochastic at 5% density and 10 seeds matches it (71.88%). This demonstrates that sparse attention acts as a regularizer: low density (1%) over multiple seeds filters out sequence-level noise, whereas higher density (5%) reintroduces distractor noise. Under the tightest budget, RIS-Structural reaches 68.75% accuracy at 1% density with just 10 seeds, recovering 75% of the contextual gap relative to the zero-context floor (59.38%). At 65,536 tokens, where dense attention triggers out-of-memory faults, RIS yields retrieval gains of up to 14.06 percentage points over the zero-context floor (51.56%), which is confirmed as marginally significant under McNemar's paired test (p = 0.078 < 0.10). All evaluations run on commodity, unaccelerated CPU servers (16-128 GB of RAM), demonstrating that long-context LLM inference is feasible on standard academic hardware without GPU acceleration.