Arithmetic Feature Interaction Is Necessary for Deep Tabular Learning

Yi Cheng, Renjun Hu, Haochao Ying, Xing Shi, Jian Wu, Wei Lin

Abstract

Despite the dominance of deep learning in computer vision and natural language processing, tabular data remains a domain where tree-based models, such as XGBoost, frequently outperform neural architectures. This paper identifies a critical deficiency in existing deep tabular models: the lack of explicit arithmetic feature interaction. We introduce AMFormer (Arithmetic-Modified Transformer), an architecture designed with the inductive bias necessary to perform additive and multiplicative feature engineering. By utilizing parallel arithmetic attention streams and a prompt-based optimization strategy, AMFormer achieves state-of-the-art performance across diverse benchmarks while significantly reducing computational complexity from $O(N^2)$ to $O(N)$.

Introduction

Tabular data—the structured rows and columns ubiquitous in finance, medicine, and marketing—has long been considered the "unconquered castle" of deep learning. While Gradient Boosted Decision Trees (GBDTs) excel at capturing non-linear relationships and specific feature combinations, standard neural networks often struggle to match their accuracy and efficiency.

The central premise of this research is that tabular tasks often require specific arithmetic operations—such as calculating Body Mass Index (BMI) from height and weight—that standard Transformers are not "wired" to perform efficiently. Without the proper inductive bias, these models must approximate arithmetic through complex, high-dimensional transformations, leading to overfitting and poor generalization. AMFormer addresses this by explicitly integrating arithmetic operations into the attention mechanism.

Methods: The AMFormer Architecture

AMFormer introduces three structural innovations to bridge the gap between deep learning and tabular logic:

1. Parallel Arithmetic Attention

Standard self-attention mechanisms are primarily designed to capture sparse representations. AMFormer augments this by using two parallel streams:

  • Additive Stream: Captures standard feature interactions.
  • Multiplicative Stream: Captures product-based interactions. To implement multiplication efficiently within a gradient-based framework, the authors employ a "log-space" trick. By transforming embeddings into log-space, multiplication is converted into addition ($\\log(a \\times b) = \\log(a) + \\log(b)$), which is then exponentiated back to the original scale.

2. Prompt-Based Optimization

A major bottleneck for Transformers in tabular settings is the $O(N^2)$ complexity relative to the number of features ($N$). AMFormer replaces traditional data-dependent queries with a fixed set of trainable prompt tokens. This shifts the computational burden to $O(N)$, allowing the model to scale to high-dimensional datasets with thousands of features without the typical memory and latency penalties.

3. Hard Top-k Sparsity

Tabular datasets often contain many features, but only a small subset typically interacts for any given prediction. AMFormer incorporates a "Top-k" selection mechanism that forces the model to attend only to the most relevant interactions. This sparsity acts as a regularizer, preventing the model from learning spurious correlations in noisy data.

Experimental Evaluation

The authors evaluated AMFormer against leading models including XGBoost, NODE, and FT-Transformer across several benchmarks:

  • Synthetic Benchmarks: Using a dataset where targets are deterministic mixtures of arithmetic combinations, the authors demonstrated that AMFormer maintains high accuracy as complexity increases, whereas standard Transformers and GBDTs struggle to recover the underlying arithmetic logic.
  • Real-World Datasets: The model was tested on high-dimensional physics data (Epsilon), financial risk assessment (Home Credit), forest cover prediction (Covtype), and web search ranking (MSLR-WEB10K).

Key Results

  • State-of-the-Art Accuracy: The AMF-F variant achieved the highest average rank across all real-world datasets, consistently outperforming both tree-based and deep learning baselines.
  • Computational Efficiency: On the Epsilon dataset (2,000 features), AMFormer reduced training time from 15 hours to just 3 hours compared to previous Transformer-based models. Overall, it proved to be approximately 7x faster and used 50% less GPU memory.
  • Data Efficiency: On synthetic tasks, AMFormer achieved the same accuracy with 40% of the training data that a standard Transformer required 100% of the data to reach.

Discussion and Limitations

While AMFormer represents a significant step forward, it introduces new hyperparameters—such as the number of prompt tokens and the sparsity factor ($k$)—that may require tuning for specific use cases. Furthermore, while the architecture is more structured than a standard Multi-Layer Perceptron (MLP), it does not yet provide the same level of "out-of-the-box" interpretability (e.g., feature importance scores) that makes GBDTs popular in regulated industries.

Conclusion

Arithmetic feature interaction is a vital component of tabular reasoning that has been largely overlooked in deep learning research. By explicitly modeling these interactions through parallel attention streams and optimizing for scale with prompt-based tokens, AMFormer provides a robust, efficient alternative to tree-based models. This work paves the way for potential "Foundation Models" in the tabular domain, where arithmetic inductive biases can be leveraged at scale.

Summary updated

BibTeX
@inproceedings{cheng2024arithmetic,
  author = {Yi Cheng and Renjun Hu and Haochao Ying and Xing Shi and Jian Wu and Wei Lin},
  title = {{Arithmetic Feature Interaction Is Necessary for Deep Tabular Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i10.29033},
}
Figure