Research
Language Model Representations for Efficient Few-Shot Tabular Classification
Overview Research area: Natural Language Processing / tabular machine learning — specifically few-shot classification of structured web tables using embeddings from off-the-shelf large language models
- arXiv
- 2602.15844
- Published
- 2026-01-21
- Authors
- Inwon Kang, Parikshit Ram, Yi Zhou, Horst Samulowitz, Oshani Seneviratne
AI summary
Overview
Research area: Natural Language Processing / tabular machine learning — specifically few-shot classification of structured web tables using embeddings from off-the-shelf large language models.
Technical level: Intermediate. The framework itself is lightweight and gradient-free, but understanding it requires familiarity with kernel regression, softmax temperature scaling, embedding anisotropy, and meta-learning.
One-sentence scope: The paper introduces TaRL and its meta-learned variant mTaRL, a training-free pipeline that serializes individual table rows, embeds them with a pretrained LLM, applies a geometric correction and a calibrated softmax temperature, and matches specialized tabular foundation models in low-data regimes on semantically-rich datasets.
What This Paper Is About
The web is full of structured data in tables — product catalogs, knowledge bases, scientific data portals — but tables are heterogeneous in structure and semantics, making a single unified classifier hard to build. The authors ask whether LLMs that are already deployed for tasks like semantic search can be reused to classify rows from these tables, without training a specialized model or serializing whole tables into token-heavy prompts. Their goal is to show that off-the-shelf LLM embeddings of individual table rows carry usable predictive signal, provided two specific adaptations are applied.
Key Contributions
- TaRL framework. A lightweight, gradient-free framework that reuses off-the-shelf LLM semantic embeddings of serialized table rows for few-shot classification on web datasets, with minimal computational overhead.
- Two identified semantic adaptations. Common Component Removal (CCR) to mitigate embedding anisotropy, and per-task softmax temperature calibration (γ) to enable dynamic attention over context examples — the paper shows these unlock much of the performance latent in LLM embeddings.
- An oracle upper bound and its approximation. The authors establish an oracle that uses the optimal γ per task, then approximate it with mTaRL, a simple meta-learned regression model trained on dataset-agnostic meta-features (such as mean similarity, variance, and class imbalance) that trains in minutes.
- Competitive accuracy and large runtime gains. Demonstrated on the semantically-rich CARTE-CLF benchmarks in the low-data regime (k ≤ 32), with up to 1000× speedup reported over autoregressive LLM inference.
Main Findings
-
Raw embeddings help, but only modestly. A KNN classifier on Llama 3.1 8B embeddings of table rows beats a KNN classifier on raw features for k-shot classification on CARTE-CLF datasets (Figure 1), showing useful predictive signal exists in the embeddings. However, the naive kernel classifier described in Section 3.2 "performs poorly, barely above random chance."
-
Both CCR and γ calibration are necessary. Figure 3 shows performance increasing as components are added — naive classifier, then CCR, then γ adjustment, then the meta-learned calibration — confirming that task-specific adaptation is crucial.
-
Label embeddings beat one-hot labels. In the oracle comparison (Table 4), using LLM embeddings of class labels scores 0.7742 / 0.8057 / 0.8220 / 0.8243 / 0.8260 / 0.8469 / 0.8481 / 0.8335 for k = 4 through 512, versus 0.5869 / 0.6360 / 0.6884 / 0.7041 / 0.7490 / 0.7703 / 0.7882 / 0.7892 when one-hot encoded labels are used instead.
-
Oracle performance is far above every baseline. On CARTE-Binary (11 datasets) the oracle reaches 0.7742 at k = 4 up to 0.8481 at k = 256; on TabArena-Binary (28 datasets) it ranges from 0.8038 (k = 4) to 0.8932 (k = 256). The authors note this is not necessarily an achievable upper bound because it relies on an oracle to select the best γ per instance.
-
mTaRL is competitive in low-data regimes, less so as k grows. On CARTE-Binary, mTaRL scores 0.5305 (k = 4), 0.5367 (k = 8), 0.5683 (k = 16), 0.5535 (k = 32), against ConTextTab at 0.5160, 0.5390, 0.5655, and 0.5745 respectively, and TabPFN at 0.5038, 0.5350, 0.5434, 0.5548. At larger k the gap widens: at k = 512 mTaRL reaches 0.6072 while ConTextTab reaches 0.6697 and TabPFN 0.6352. On TabArena-Binary, mTaRL scores 0.5475 at k = 4 and 0.5974 at k = 32, while TabPFN reaches 0.5688 and 0.6961 — i.e., TaRL is stronger on the semantically-rich CARTE tables than on the more general TabArena tables, where column names may not be meaningful and numerical features are more prevalent.
-
Rank analysis. Averaged ranks place mTaRL at 6.4886 (k ≤ 32) and 6.6705 (k > 32) on CARTE-Binary and 6.7411 / 7.3438 on TabArena-Binary, compared with ConTextTab at 6.3295 / 5.0795 on CARTE-Binary and TabPFN at 4.7545 / 4.1875 on TabArena-Binary.
-
Large per-task runtime savings. Table 2 compares average runtime in seconds per k-shot task on CARTE-CLF against running TabuLa-8B autoregressively: k = 2 → 36,867.90 s vs 29.93 s (×1232); k = 4 → 37,518.86 s vs 42.19 s (×889); k = 8 → 34,785.27 s vs 67.19 s (×518); k = 16 → 30,369.63 s vs 118.06 s (×257); k = 32 → 21,455.61 s vs 222.76 s (×96).
-
Encoder-only models can compete. In the LLM backbone comparison (Table 5, reported as percentages), all-MiniLM-L6-v2, with roughly 22 million parameters, scores 74.24 at k = 2 rising to 77.29 at k = 512, outperforming much larger Qwen variants at lower k. Llama3.1-8B shows generally the strongest performance (77.18 at k = 2 up to 86.32 at k = 512), with TabuLa-8B close behind (77.19 to 83.35). Embedding-tuning substantially improves the Qwen variants: Qwen3-Emb. scores 73.90 to 79.10 versus Qwen3-Base at 61.53 to 64.68 and Qwen3 at 57.43 to 55.66.
-
Overhead comparison. Table 1 places TaRL at under 1 hour of overhead, against TabPFN at 2 weeks, ConTextTab at 4–10 days, and TabuLa-8B at 6 days; the exact runtime for TabLLM is not reported by its authors. TaRL is also described as model-agnostic and requiring no task-specific prompting.
-
Sampling realism. Unlike the baseline few-shot results in Gardner et al. (2024), which optimized a single context reused for every query, the authors resample the support set for each query, which they describe as more challenging and more realistic.
Methodology in Plain English
Step 1 — Turn each row into text. A serialization function concatenates column names with their values, so a row with columns "Feature A" and "Feature B" and values 1.2 and 3.4 becomes "Feature A: 1.2, Feature B: 3.4". Categorical features use their string representation and date/time features are converted to a standard YY-MM-DD:HH format. Each row is embedded separately by a pretrained LLM — this matters because transformer cost scales quadratically with input length, so TaRL's cost scales only with the single longest context example rather than with a serialized prompt containing all examples and task instructions.
Step 2 — Classify by kernel regression. The support set of k labeled examples and the query are embedded. Similarity is the negative inverse cosine similarity, i.e. the negated angle between two vectors, chosen because it is bounded between [−π, 0], which stabilizes the softmax. Similarities are converted to weights via softmax, the query's label embedding is a weighted sum of support labels, and the predicted class is the one whose label embedding is most similar to that weighted sum. No parameters are trained, which lets the authors probe the embedding quality directly.
Step 3 — Fix the embedding geometry (CCR). LLM embeddings are anisotropic — they cluster in narrow regions rather than spreading uniformly — so a few dominant directions can dominate the similarity scores. The fix is Common Component Removal: subtract the mean embedding vector (computed over the support set plus the query) from every embedding before computing similarities.
Step 4 — Calibrate the softmax temperature. Because similarity scales vary across tasks, a parameter γ multiplies the similarities inside the softmax. High γ produces a peaked distribution resembling a nearest-neighbor classifier; low γ produces a more uniform distribution that averages over more support examples.
Step 5 — Choose γ. A simple heuristic sets γ to the reciprocal of the maximum (negated) similarity between query and any support example. To do better, the authors define an oracle that picks the γ minimizing cross-entropy loss on the query's true label, then train mTaRL — a regression model on dataset-agnostic support-set statistics such as mean similarity, variance, and class imbalance — to predict γ for new tasks without any gradient-based training on the task itself. Meta-training uses data from multiple datasets and few-shot settings, with optimal γ determined by cross-validation.
Experimental setup. γ is searched over 2^[−10, 15]. Support sizes k range over {2, 4, 8, 16, 32, 64, 128, 256, 512}, with 128 randomly sampled context-query pairs per k, preserving the original class balance. Balanced accuracy (average per-class recall) is the primary metric because class imbalance can skew few-shot results. Baselines include XGBoost, KNN (with neighbors set to log₂(k)), TabPFN, ConTextTab, TabuLa-8B, Llama 3.1 8B, Granite 3 8B, Qwen 3 8B, and all-MiniLM-L6-v2. TabuLa-8B is evaluated only on CARTE-CLF for k ≤ 32 due to the cost of autoregressive prompting — gathering those results took approximately 12 days.
Why This Matters
Impact on research. The paper argues that the gap between general-purpose LLM representations and specialized tabular models is mostly a geometry and calibration problem rather than a modeling-capacity problem. It provides an oracle upper bound showing substantial headroom in off-the-shelf embeddings, and it positions a gradient-free, model-agnostic alternative alongside compute-heavy tabular foundation models like TabPFN, ConTextTab, and TabuLa-8B. It also flags a methodological issue in prior few-shot tabular work: reusing one optimized context for all queries assumes we can choose the best possible context per task, which the authors argue is unrealistic.
Real-world applications:
- Classifying product metadata and catalog entries in web-scale e-commerce tables.
- Categorizing user-submitted forms with structured fields.
- Triaging support tickets that contain structured attributes.
- Understanding knowledge base exports and scientific data portals with meaningful column names.
Industry relevance. The paper's motivating scenario is organizations that have already deployed LLMs for customer support, content generation, or semantic search and then encounter structured-data classification tasks. Reusing that existing infrastructure avoids deploying a separate specialized model, avoids days of GPU time, and avoids the token-intensive serialization cost that can exceed 100 tokens even for a 3-column, 2-example task. The reported overhead — under 1 hour versus 2 weeks, 4–10 days, and 6 days for the comparison systems — is the paper's key practical argument. The paper is candid about the boundary condition: the advantage is largest for semantically-rich tables with meaningful column names, and smaller on more generic benchmark data.
Future Directions
- Closing the gap to the oracle. The oracle classifier outperforms every baseline by a large margin across all benchmarks and k values, so better per-task γ prediction — through richer meta-features or stronger meta-learners — remains an open opportunity.
- Extending beyond binary classification. The paper reports the main results on
Authors’ abstract
The Web is a rich source of structured data in the form of tables, from product catalogs and knowledge bases to scientific datasets. However, the heterogeneity of the structure and semantics of these tables makes it challenging to build a unified method that can effectively leverage the information they contain. Meanwhile, Large language models (LLMs) are becoming an increasingly integral component of web infrastructure for tasks like semantic search. This raises a crucial question: can we leverage these already-deployed LLMs to classify structured data in web-native tables (e.g., product catalogs, knowledge base exports, scientific data portals), avoiding the need for specialized models or extensive retraining? This work investigates a lightweight paradigm, $\textbf{Ta}$ble $\textbf{R}$epresentation with $\textbf{L}$anguage Model~($\textbf{TaRL}$), for few-shot tabular classification that directly utilizes semantic embeddings of individual table rows. We first show that naive application of these embeddings underperforms compared to specialized tabular models. We then demonstrate that their potentials can be unlocked with two key techniques: removing the common component from all embeddings and calibrating the softmax temperature. We show that a simple meta-learner, trained on handcrafted features, can learn to predict an appropriate temperature. This approach achieves performance comparable to state-of-the-art models in low-data regimes ($k \leq 32$) of semantically-rich tables. Our findings demonstrate the viability of reusing existing LLM infrastructure for efficient semantics-driven pathway to reuse existing LLM infrastructure for Web table understanding.