Introduction: Beyond the Single-Row Paradigm
Tabular data prediction is a cornerstone of modern machine learning, powering critical applications like click-through rate (CTR) estimation, recommendation engines, and fraud detection. Traditionally, deep learning models for these tasks follow a "single-row-multi-column" approach. They treat each data sample in isolation, focusing on learning complex feature interactions within that specific row.
However, this approach overlooks a vital source of information: the broader context of the dataset. Drawing inspiration from the $k$-Nearest Neighbors ($k$-NN) algorithm, researchers argue that the features and labels of similar historical samples—cross-row patterns—offer a significant predictive signal. The primary hurdle has been efficiency; computing pairwise similarities across millions of rows is computationally prohibitive for real-time systems.
The Retrieval & Interaction Machine (RIM)
To overcome the efficiency bottleneck, the Retrieval & Interaction Machine (RIM) introduces a "multi-row-multi-column" framework that bridges deep learning with classic Information Retrieval (IR) techniques.
1. Retrieval Module
RIM treats each row in the dataset as a "document" and its categorical features as "terms," constructing an inverted index. For a target row prediction, its features serve as a query. A search engine mechanism then utilizes the BM25 ranking function to instantly retrieve the top-$K$ most similar historical rows. This use of an inverted index is a highly scalable solution to find similar samples in massive datasets without the $O(N^2)$ cost.
2. Aggregation Layer
Once retrieved, an attention mechanism aggregates these neighbor samples. Crucially, RIM aggregates both the features and the labels of these neighbors, assigning higher weights to the most relevant samples. The labels of neighbors act as a powerful local prior for the target sample.
3. Prediction Module
The model processes two distinct types of interactions:
- Intra-sample interactions: Relationships between features within the target row itself.
- Cross-sample interactions: Relationships between the target row's features and the aggregated features of its neighbors.
These interactions are processed through a Multi-Layer Perceptron (MLP). To ensure the label signal remains potent, the aggregated label representation is connected directly to the final output layer.
Key Insights
- Label Information is Vital: Ablation studies demonstrate that explicitly incorporating neighbor labels is crucial. Performance drops significantly if these labels are withheld, confirming they provide essential context.
- Global vs. Local Context: Retrieving similar rows from the entire dataset outperforms retrieving only from a specific user's history. This suggests RIM effectively captures collaborative filtering signals across the whole population.
- Efficiency through Rich Context: Because the retrieved samples provide such strong signals, simple inner-product feature interactions can match the performance of more complex architectures while being approximately 11% faster during inference.
Experimental Results
RIM was evaluated across 11 benchmark datasets covering classification, ranking, and regression. It consistently outperformed state-of-the-art baselines:
- CTR Prediction: On datasets like Avazu and Criteo, RIM achieved up to a 2.88% relative AUC improvement over models like xDeepFM. In sequential CTR (e.g., Tmall, Taobao), it improved AUC by up to 4.82% over retrieval-based baselines like SIM.
- Recommendation Ranking: On the MovieLens-1m dataset, the Hit Ratio (HR@10) increased from 0.2709 (SASRec) to 0.4014.
- Regression: RIM consistently lowered the Root Mean Square Error (RMSE) on rating prediction tasks compared to models like NeuMF and IPNN.
Conclusion and Future Directions
The Retrieval & Interaction Machine demonstrates that integrating cross-row context via efficient IR techniques significantly boosts tabular data prediction. While the retrieval step introduces some inference latency, the authors suggest offline caching as a viable strategy for production environments. Future work includes exploring learned retrieval functions and deploying RIM in large-scale real-world advertising systems.
Summary updated