Manuscript Offprint

arXiv:2609.31306

Benchmarking Attention for Tabular Foundation Models

Maximilian Schambach, Clemens Biehl, Sam Thelin

Abstract

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

1 Introduction

Tabular data accounts for the majority of data in enterprise machine learning applications [3]. While gradient-boosted decision trees have long been the dominant paradigm for tabular prediction [8], recent pretrained predictive in-context learners such as TabPFN [10], TabICL [14], Mitra [23], or ConTextTab [17] have demonstrated strong, often state-of-the-art performance on public benchmarks [7]. At their core, these models are transformer-based and most of them share a common architectural design: alternating row attention (attending across data samples) and column attention (attending across features), as full cross-cell attention would be prohibitively expensive due to the quadratic scaling of attention with sequence length. Alternatively, TabICL-like architectures such as TabICLv2 [15], TabPFN-3 [9], perform column- and rows-wise attention in a multi-stage approach.

Research on efficient attention, however, has been driven predominantly by the demands of large language models (LLMs). Implementations such as FlashAttention [5, 4, 16, 19] target long, one-dimensional sequences – often with causal masks for autoregressive decoding – and optimize memory access patterns accordingly. In parallel, inference-only solutions have emerged for LLM serving: vLLM [11] provides Triton-based attention kernels, and SageAttention [22, 20, 21] offers quantized approximate attention with high forward-pass throughput. These inference-only backends lack

Preprint.

backward-pass support, making them applicable to deployment but not for training. Tabular data, on the other hand, differs from language data in ways that directly affect attention performance. First, the sequence lengths for row and column attention are typically asymmetric: the number of columns or features is usually small (tens to low hundreds), while the number of rows can range from hundreds to tens of thousands, limited mostly by GPU memory constraints. Therefore, both are much smaller than sequences processed in LLMs. Second, the hidden dimension of current tabular models is relatively small (often in the low hundreds) compared to LLMs, which have hidden dimensions in the thousands, using additional tweaks such as grouped query attention. Third, tabular attention is bidirectional and non-causal, similar to encoder-only LLMs but unlike current state-of-the-art decoder-only architectures. And lastly, the standard five-dimensional tabular tensor layout (B,R,C,H,D)(B, R, C, H, D) – where B is the batch size, R the number of rows, C the number of columns, H the number of heads, and D the head dimension – means that column attention operates along a contiguous memory dimension, while row attention requires transposed views with either an explicit .contiguous() copy or a backend that supports strided tensors.

In this work, we provide a systematic characterization and benchmark of attention implementations for tabular data. Our key contributions are as follows: (1) We identify the unique characteristics of tabular data and their implications for attention performance. (2) We benchmark five training backends and two inference-only backends across a range of realistic shapes for row and column attention on three GPU generations (A100, H100, B200). (3) We analyze the results and provide actionable insights for practitioners building and deploying tabular foundation models. (4) We release our benchmark code to facilitate future research and development, in particular to encourage attention implementations that are tailored to the unique characteristics of tabular data. To highlight this potential, we perform an AI agent-based optimization of the FA4 kernel implementation on the B200.

References (45)