Benchmarking Attention for Tabular Foundation Models

📄 arXiv: 2609.31306v1 📥 PDF

作者: Maximilian Schambach, Clemens Biehl, Sam Thelin

分类: cs.LG

发布日期: 2026-09-25

🔗 代码/项目: GITHUB


💡 一句话要点

提出基准测试以优化表格基础模型的注意力机制

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

关键词: 表格数据 注意力机制 基准测试 深度学习 GPU优化 机器学习模型 性能评估

📋 核心要点

  1. 现有的表格模型在处理二维数据时,注意力机制的效率和性能尚未得到充分研究,尤其是与一维序列相比。
  2. 论文提出了一种可重复的基准测试框架,专注于评估不同后端在表格注意力中的表现,涵盖多种GPU架构。
  3. 实验结果表明,FlashAttention在大多数情况下表现最佳,但在特定条件下,CuDNN和SageAttention也展现了竞争力。

📝 摘要(中文)

表格上下文学习者如TabPFN、Mitra和ConTextTab依赖于对潜在嵌入的二维序列进行行和列的交替注意力。这些注意力模式与语言模型中的一维情况显著不同:行注意力涉及较长的序列,而列注意力则处理较短的序列,表格数据的跨步内存布局使得生成连续张量的成本较高。此外,当前模型使用的隐藏维度相较于最近的语言模型较小。然而,现有的高效注意力研究主要集中在一维序列上,二维表格设置尚未得到充分探索。为此,我们创建了一个可重复的基准测试设置,研究了不同后端下表格注意力的独特特性,并在三代GPU(A100、H100、B200)上测量了前向和反向吞吐量。我们发现,最佳后端选择在列和行注意力之间有所不同,并且随硬件和模型特性而变化。

🔬 方法详解

问题定义:本论文旨在解决表格数据中注意力机制的效率问题,现有方法在处理二维序列时面临性能瓶颈,尤其是在长序列的情况下。

核心思路:通过创建一个可重复的基准测试框架,论文评估了不同后端在表格注意力中的表现,旨在找出最优的实现方式。

技术框架:整体架构包括数据预处理、模型训练和评估三个主要模块,采用不同的后端(如Torch SDPA、FlashAttention等)进行性能比较。

关键创新:论文的创新在于首次系统性地评估了二维表格注意力的性能,揭示了行和列注意力在不同硬件和模型设置下的表现差异。

关键设计:在实验中,设置了多种参数,包括头维度和序列长度,特别关注了在长序列情况下的性能变化,确保了评估的全面性和准确性。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

实验结果显示,FlashAttention在大多数情况下表现最佳,但在处理长序列的列注意力时,CuDNN在特定条件下表现优越。此外,SageAttention在处理超过16k行的长序列时也展现了良好的性能,提供了新的优化思路。

🎯 应用场景

该研究为表格数据处理中的注意力机制优化提供了理论基础和实践指导,具有广泛的应用潜力,尤其是在数据分析、机器学习模型训练和智能决策支持系统中。未来,优化的注意力机制可能会显著提升表格数据处理的效率和准确性。

📄 摘要(原文)

Tabular in-context learners such as TabPFN, Mitra, or ConTextTab rely on alternating row and column attention over 2D sequences of latent embeddings. These attention patterns differ markedly from the one-dimensional case in language models: row attention involves longer sequences while column attention operates on much shorter ones, and the strided memory layout of tabular data makes producing contiguous tensors costly. Moreover, the hidden dimensions used in current models are small compared to recent language models. Yet efficient attention has been studied mostly for one-dimensional sequences, leaving the two-dimensional tabular setting unexplored. To this end, we create a reproducible benchmarking setup and study the unique characteristics of tabular attention across several backends -- Torch SDPA (efficient and cuDNN), FlashAttention-2/3/4, and the inference-only backends vLLM and SageAttention -- measuring forward and backward throughput across realistic tabular shapes on three GPU generations (A100, H100, B200). We find that the optimal backend choice differs between column and row attention and varies across hardware as well as model specifics: While the FlashAttention implementations tailored for each GPU generation perform overall best, they are at times outperformed by CuDNN in the case of column attention at longer sequences with cross-over points depending on the head dimension. Among inference-only backends, SageAttention performs well for row attention and large sequences beyond 16\,k rows. Our reproducible benchmark lays the foundation for future improvements to table-native attention. The self-contained benchmarking and evaluation code is openly available at: https://github.com/SAP-samples/tabular-attention-benchmark