← Latest papers
🤖 machine learning

Localized TabICLv2: Scaling Tabular In-Context Learning through k-NN

This paper introduces Localized TabICLv2, a method that significantly reduces the inference cost and improves scalability of the state-of-the-art TabICLv2 model for tabular data by retrieving only the k-nearest training neighbors for each query, achieving substantial speedups while retaining over 98% of the original model's accuracy.

Original authors: Beimnet Bekele Guta

Published 2026-08-18
📖 6 min read🧠 Deep dive

Original authors: Beimnet Bekele Guta

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the world of data, information often arrives in neat, rectangular grids: rows of customers, columns of transactions, and cells filled with numbers or categories. For decades, the most reliable way to find patterns in these grids was to use a specific type of computer program known as a gradient-boosted decision tree. These programs are like a team of experts who ask a series of simple yes-or-no questions to sort through the data, building a complex decision-making structure piece by piece. They are incredibly effective, but they have a significant limitation: they must be trained from scratch for every new dataset. If a company wants to predict customer churn for one product and then switch to predicting loan defaults for another, the model must be retrained, a process that requires time, computing power, and careful tuning of settings.

Recently, a new approach has emerged that borrows a technique from the study of language. Instead of training a new model for every task, these newer systems use a single, pre-trained foundation model that can learn from examples provided in the moment. This method, called in-context learning, allows the model to look at a few examples of the problem it is trying to solve and then make a prediction for a new case without ever changing its internal settings. While this offers a promising path toward a universal tool for tabular data, a major hurdle remains. As the amount of historical data the model needs to consider grows, the time it takes to make a single prediction explodes. The model must compare every new question against every single piece of past data it has ever seen, creating a computational bottleneck that makes it impractical for large-scale, real-time use.

Researchers at the University of Cambridge have addressed this bottleneck with a method they call Localized TabICLv2. Their work focuses on a specific version of the in-context learning model known as TabICLv2, which has already shown state-of-the-art performance on various classification tasks. The core problem with the original model is that during its final stage of prediction, it forces every new data point to pay attention to the entire training dataset simultaneously. If a dataset contains hundreds of thousands of rows, the model must process a massive amount of information for every single query, leading to slow response times and high energy costs. The researchers asked a simple question: does a model really need to look at every single past example to make a good prediction, or can it find a smaller, more relevant group of examples that contain the necessary clues?

To answer this, the team introduced a retrieval step that acts as a filter before the final prediction is made. Instead of feeding the entire history of data into the model, they first convert each row of data into a mathematical representation that captures its essential features. When a new query arrives, the system searches through the stored history to find the few dozen rows that are most similar to the new case. It then feeds only these closest matches, rather than the whole dataset, into the prediction engine. This approach is similar to how a human might solve a problem by recalling a handful of relevant past experiences rather than trying to remember every single event in their life. By limiting the context to these nearest neighbors, the researchers drastically reduced the amount of information the model had to process at once.

However, simply cutting down the data was not enough to maintain the high accuracy of the original system. The model had been trained to expect the full context, so removing most of it initially caused its performance to drop. To fix this, the researchers fine-tuned the model's internal mechanisms. They adjusted the way the model creates its representations of the data and the way it uses those representations to make predictions, specifically training it to work well with this smaller, localized view. This process ensured that the model learned to extract the most critical information from just a few examples, rather than relying on the sheer volume of data to find patterns.

The results of this approach were measured against a wide range of real-world datasets, covering everything from credit card fraud detection to customer churn. When the researchers tested the localized model on a standard benchmark containing thirty-eight different datasets, they found that the fine-tuned version retained nearly all of the accuracy of the full model. Specifically, it preserved 98.64 percent of the original performance, meaning it made almost as many correct predictions as the much slower, full-context version. The trade-off was a massive gain in speed. In scenarios where the model was asked to process data in batches, it ran more than twice as fast. In situations where the model had to answer a single question at a time, the speedup was even more dramatic, reaching a median improvement of 249 times faster than the original system.

The study also revealed that the size of the dataset mattered significantly for these speed gains. The larger the training set, the more beneficial the localization became. For smaller datasets, the time spent searching for the right neighbors sometimes offset the time saved by processing less data. But as the number of training rows grew into the hundreds of thousands, the localized method became increasingly efficient, proving that the approach scales well with the very data sizes that usually slow down these models. Furthermore, the researchers compared their method against simpler alternatives, such as using a standard decision tree on just the retrieved neighbors or a basic voting system. Their localized model consistently outperformed these simpler baselines, demonstrating that the combination of smart retrieval and a specialized prediction engine was the key to success.

This work suggests that the future of tabular machine learning may not lie in building larger models that consume more energy, but in making existing models smarter about what information they need. By teaching a powerful foundation model to focus only on the most relevant examples, the researchers have shown that it is possible to achieve high accuracy without the heavy computational cost of processing entire datasets. The findings indicate that these models can be made practical for real-world deployment, where speed and efficiency are just as important as predictive power. While the method relies on the assumption that the most similar past examples are the most informative, the results show that this assumption holds true across a vast array of data types. The study concludes that with the right adjustments, the promise of in-context learning for tabular data can be realized without sacrificing the efficiency required for large-scale applications.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →