Latte: Transfering LLMs' Latent-level Knowledge for Few-shot Tabular Learning
Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 6173-6181.
https://doi.org/10.24963/ijcai.2025/687
Keywords
- Machine Learning: ML: Few-shot learning
- Machine Learning: ML: Semi-supervised learning
- Machine Learning: ML: Representation learning
- Machine Learning: ML: Meta-learning
Abstract
Few-shot tabular learning, in which machine learning models are trained with a limited amount of labeled data, provides a cost-effective approach to addressing real-world challenges. The advent of Large Language Models (LLMs) has sparked interest in leveraging their pre-trained knowledge for few-shot tabular learning. Despite promising results, existing approaches either rely on test-time knowledge extraction, which introduces undesirable latency, or text-level knowledge, which leads to unreliable feature engineering. To overcome these limitations, we propose Latte, a training-time knowledge extraction framework that transfers the latent prior knowledge within LLMs to optimize a more generalized downstream model. Latte enables general knowledge-guided downstream tabular learning, facilitating the weighted fusion of information across different feature values while reducing the risk of overfitting to limited labeled data. Furthermore, Latte is compatible with existing unsupervised pre-training paradigms and effectively utilizes available unlabeled samples to overcome the performance limitations imposed by an extremely small labeled dataset. Extensive experiments on various few-shot tabular learning benchmarks demonstrate the superior performance of Latte, establishing it as a state-of-the-art approach in this domain. Our code is available at https://github.com/ruxueshi/Latte.git.
- [Arik and Pfister, 2021] Sercan Ö Arik and Tomas Pfister. Tabnet: Attentive interpretable tabular learning. In Pro- ceedings of the AAAI conference on artificial intelligence, volume 35, pages 6679-6687, 2021.
- [Badirli et al., 2020] Sarkhan Badirli, Xuanqing Liu, Zheng- ming Xing, Avradeep Bhowmik, Khoa Doan, and Sathiya S Keerthi. Gradient boosting neural networks: Grownet. arXiv preprint arXiv:2002.07971, 2020.
- [Bahri et al., 2021] Dara Bahri, Heinrich Jiang, Yi Tay, and Donald Metzler. Scarf: Self-supervised contrastive learn- ing using random feature corruption. arXiv preprint arXiv:2106.15147, 2021.
- [Breiman, 2001] Leo Breiman. Random forests. Machine learning, 45:5-32, 2001.
- [Cao, 2022] Longbing Cao. Ai in finance: challenges, techniques, and opportunities. ACM Computing Surveys (CSUR), 55(3):1-38, 2022.
- [Chen and Guestrin, 2016] Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowl- edge discovery and data mining, pages 785-794, 2016.
- [Chen et al., 2019] Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. arXiv preprint arXiv:1904.04232, 2019.
- [Chen et al., 2023] Suiyao Chen, Jing Wu, Naira Hov- akimyan, and Handong Yao. Recontab: Regularized con- trastive representation learning for tabular data. arXiv preprint arXiv:2310.18541, 2023.
- [Chen et al., 2024] Chao Chen, Kai Liu, Ze Chen, Yi Gu, Yue Wu, Mingyuan Tao, Zhihang Fu, and Jieping Ye. In- side: Llms' internal states retain the power of hallucination detection. arXiv preprint arXiv:2402.03744, 2024.
- [Duan et al., 2024] Hanyu Duan, Yi Yang, and Kar Yan Tam. Do llms know about hallucination? an empiri- cal investigation of llm's hidden states. arXiv preprint arXiv:2402.09733, 2024.
- [Gorishniy et al., 2021] Yury Gorishniy, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. Revisiting deep learning models for tabular data. Advances in Neural In- formation Processing Systems, 34:18932-18943, 2021.
- [Han et al., 2024a] Sungwon Han, Jinsung Yoon, Sercan O Arik, and Tomas Pfister. Large language models can auto- matically engineer features for few-shot tabular learning. arXiv preprint arXiv:2404.09491, 2024.
- [Han et al., 2024b] Sungwon Han, Jinsung Yoon, Sercan O Arik, and Tomas Pfister. Large language models can auto- matically engineer features for few-shot tabular learning. arXiv preprint arXiv:2404.09491, 2024.
- [Hegselmann et al., 2023] Stefan Hegselmann, Alejandro Buendia, Hunter Lang, Monica Agrawal, Xiaoyi Jiang, and David Sontag. Tabllm: Few-shot classification of tab- ular data with large language models. In International Conference on Artificial Intelligence and Statistics, pages 5549-5581. PMLR, 2023.
- [Hollmann et al., 2023] Noah Hollmann, Samuel Müller, Katharina Eggensperger, and Frank Hutter. Tabpfn: A transformer that solves small tabular classification prob- lems in a second. In The Eleventh International Confer- ence on Learning Representations, 2023.
- [Huang et al., 2020] Xin Huang, Ashish Khetan, Milan Cvitkovic, and Zohar Karnin. Tabtransformer: Tabu- lar data modeling using contextual embeddings. arXiv preprint arXiv:2012.06678, 2020.
- [Ke et al., 2017] Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie-Yan Liu. Lightgbm: A highly efficient gradient boost- ing decision tree. Advances in neural information process- ing systems, 30, 2017.
- [Ke et al., 2018] Guolin Ke, Jia Zhang, Zhenhui Xu, Jiang Bian, and Tie-Yan Liu. Tabnn: A universal neural network solution for tabular data. 2018.
- [Ke et al., 2019] Guolin Ke, Zhenhui Xu, Jia Zhang, Jiang Bian, and Tie-Yan Liu. Deepgbm: A deep learning frame- work distilled by gbdt for online prediction tasks. In Pro- ceedings of the 25th ACM SIGKDD International Confer- ence on Knowledge Discovery & Data Mining, pages 384- 394, 2019.
- [Klambauer et al., 2017] Günter Klambauer, Thomas Un- terthiner, Andreas Mayr, and Sepp Hochreiter. Self- normalizing neural networks. Advances in neural infor- mation processing systems, 30, 2017.
- [LaValley, 2008] Michael P LaValley. Logistic regression. Circulation, 117(18):2395-2399, 2008.
- [Li et al., 2024] Yingji Li, Mengnan Du, Rui Song, Xin Wang, Mingchen Sun, and Ying Wang. Mitigating social biases of pre-trained language models via contrastive self- debiasing with double data augmentation. Artificial Intel- ligence, 332:104143, 2024.
- [Liu et al., 2024] Ruoxue Liu, Linjiajie Fang, Wenjia Wang, and Bingyi Jing. D2r2: Diffusion-based representation with random distance matching for tabular few-shot learn- ing. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
- [Loh, 2011] Wei-Yin Loh. Classification and regression trees. Wiley interdisciplinary reviews: data mining and knowledge discovery, 1(1):14-23, 2011.
- [Nam et al., 2023] Jaehyun Nam, Jihoon Tack, Kyungmin Lee, Hankook Lee, and Jinwoo Shin. Stunt: Few-shot tab- ular learning with self-generated tasks from unlabeled ta- bles. In The Eleventh International Conference on Learn- ing Representations, 2023.
- [Oreshkin et al., 2018] Boris Oreshkin, Pau Rodríguez López, and Alexandre Lacoste. Tadam: Task dependent adaptive metric for improved few-shot learning. Advances in neural information processing systems, 31, 2018.
- [Perković et al., 2024] Gabrijela Perković, Antun Drobnjak, and Ivica Botički. Hallucinations in llms: Understand- ing and addressing challenges. In 2024 47th MIPRO ICT and Electronics Convention (MIPRO), pages 2084-2088. IEEE, 2024.
- [Popov et al., 2019] Sergei Popov, Stanislav Morozov, and Artem Babenko. Neural oblivious decision ensem- bles for deep learning on tabular data. arXiv preprint arXiv:1909.06312, 2019.
- [Prokhorenkova et al., 2018] Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, and Andrey Gulin. Catboost: unbiased boosting with categor- ical features. Advances in neural information processing systems, 31, 2018.
- [Shailaja et al., 2018] K Shailaja, Banoth Seetharamulu, and MA Jabbar. Machine learning in healthcare: A review. In 2018 Second international conference on electronics, communication and aerospace technology (ICECA), pages 910-914. IEEE, 2018.
- [Shi et al., 2025] Ruxue Shi, Yili Wang, Mengnan Du, Xu Shen, and Xin Wang. A comprehensive survey of synthetic tabular data generation. arXiv preprint arXiv:2504.16506, 2025.
- [Slack and Singh, 2023] Dylan Slack and Sameer Singh. Tablet: Learning from instructions for tabular data. arXiv preprint arXiv:2304.13188, 2023.
- [Snell et al., 2017] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. Advances in neural information processing systems, 30, 2017.
- [Somepalli et al., 2021] Gowthami Somepalli, Micah Gold- blum, Avi Schwarzschild, C Bayan Bruss, and Tom Gold- stein. Saint: Improved neural networks for tabular data via row attention and contrastive pre-training. arXiv preprint arXiv:2106.01342, 2021.
- [Song et al., 2019] Weiping Song, Chence Shi, Zhiping Xiao, Zhijian Duan, Yewen Xu, Ming Zhang, and Jian Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. In Proceedings of the 28th ACM international conference on information and knowl- edge management, pages 1161-1170, 2019.
- [Touvron et al., 2023] Hugo Touvron, Thibaut Lavril, Gau- tier Izacard, Xavier Martinet, Marie-Anne Lachaux, Tim- othée Lacroix, Baptiste Rozière, Naman Goyal, Eric Ham- bro, Faisal Azhar, et al. Llama: Open and efficient founda- tion language models. arXiv preprint arXiv:2302.13971, 2023.
- [Wang et al., 2020] Yaqing Wang, Quanming Yao, James T Kwok, and Lionel M Ni. Generalizing from a few ex- amples: A survey on few-shot learning. ACM computing surveys (csur), 53(3):1-34, 2020.
- [Wang et al., 2021a] Bo Wang, Tao Shen, Guodong Long, Tianyi Zhou, Ying Wang, and Yi Chang. Structure- augmented text representation learning for efficient knowl- edge graph completion. In Proceedings of the Web Con- ference 2021, pages 1737-1748, 2021.
- [Wang et al., 2021b] Ruoxi Wang, Rakesh Shivanna, Derek Cheng, Sagar Jain, Dong Lin, Lichan Hong, and Ed Chi. Dcn v2: Improved deep & cross network and practical lessons for web-scale learning to rank systems. In Pro- ceedings of the web conference 2021, pages 1785-1797, 2021.
- [Wei et al., 2022] Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yo- gatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022.
- [Wen et al., 2024] Xumeng Wen, Han Zhang, Shun Zheng, Wei Xu, and Jiang Bian. From supervised to generative: A novel paradigm for tabular deep learning with large lan- guage models. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 3323-3333, 2024.
- [Yoon et al., 2020] Jinsung Yoon, Yao Zhang, James Jordon, and Mihaela van der Schaar. Vime: Extending the suc- cess of self-and semi-supervised learning to tabular do- main. Advances in Neural Information Processing Sys- tems, 33:11033-11043, 2020.
- [Zhou et al., 2024] Zhenhong Zhou, Haiyang Yu, Xinghua Zhang, Rongwu Xu, Fei Huang, and Yongbin Li. How alignment and jailbreak work: Explain llm safety through intermediate hidden states. arXiv preprint arXiv:2406.05644, 2024.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
Given the high cost of sample annotation, both in terms of financial and temporal resources, learning from a limited number of labeled samples presents a more cost-effective approach for adapting machine learning models to practical deployment [Snell et al., 2017; Wang et al., 2020; Oreshkin et al., 2018; Wang et al., 2021a]. This scenario, commonly referred to as few-shot learning, has recently attracted significant research attention over various domains, including computer vision (CV) [Chen et al., 2019] and tabular learning [Nam et al., 2023; Shi et al., 2025]. However, without adequate supervisory signals, traditional supervised learning in this situation cannot effectively yield desirably parameterized models, as its performance heavily depends on the statistical convergence of a large number of labeled samples. This challenge becomes more intractable in the context of tabular data, owing to the inherent scarcity of labeled tabular data [Liu et al., 2024] in many real-world applications, such as fraud detection [Cao, 2022] and disease diagnosis [Shailaja et al., 2018].
With the rapid advancement of Large Language Models (LLMs), several pioneering studies have explored their potential in few-shot tabular learning and achieved promising results: The extensive knowledge encoded during pre-training makes LLMs a natural choice for analyzing tabular data, as it provides a rich prior understanding of the relationships between diverse tabular features and the task objective. For instance, knowledge regarding the increased risk of certain diseases in older individuals can be helpful in identifying truly predictive tabular features in disease prediction tasks [Han et al., 2024a]. However, most existing LLM-based methods [Slack and Singh, 2023; Hegselmann et al., 2023] adopt test-time knowledge extraction strategies, where each test sample is directly fed into a pre-trained or fine-tuned LLM as a query to obtain its final prediction. This approach necessitates at least one LLM inference per sample, leading to undesirable response latency and increased computational costs.
To solve above limitations, FeatLLM [Han et al., 2024a] is first proposed by designing a training-time extraction strategy. Specifically, in this framework, the LLM functions as a "feature engineer" to reduce the inherent redundancy in the original tabular features: Before each tabular learning task begins, FeatLLM instructs the "feature engineer" to analyze the metadata (including task and feature descriptions) and generate insightful rules for each answer class. These rules guide the subsequent feature engineering, i.e., transforming heterogeneous column features of a tabular dataset into unified binary features. This approach reduces the reliance on complex model architectures, thereby alleviating the urgent need for a large number of labeled samples in few-shot settings.
However, FeatLLM still faces several bottlenecks that limit its performance potential: ❶ Unreliable knowledge extraction: FeatLLM prompts LLMs to generate textual rules as the criteria for feature engineering. However, this kind of textlevel knowledge, i.e. textual responses auto-regressively generated by LLMs, often suffers from hallucinations and might include plausible yet factually wrong knowledge [Duan et al., 2024; Perkovi´c et al., 2024; Li et al., 2024], thereby leading to unreliable feature engineering. In addition, [Zhou et al., 2024; Chen et al., 2024] have demonstrated that the latentlevel knowledge, i.e. hidden states directly hooked from LLMs, is more informative and discriminative than the textlevel knowledge due to the randomness and information loss during the next-token sampling; ❷ Overlook of unlabeled tabular data: Constructing pseudo-supervision (e.g., by data clustering) based on unlabeled data has been proven to be an effective practice to facilitate few-shot tabular learning [Nam et al., 2023]. However, the tabular learning framework of FeatLLM cannot make use of these cluster pseudo-labels, as its feature engineering process is designed exclusively for ground-truth classes, implying its performance upper-bound is strictly constrained by the extremely limited labeled samples.
Contributions: To accommodate the above bottlenecks, we propose a training-time knowledge extraction framework to transfer LLMs' Latent-level Knowledge for few-shot tabular learning (Latte). Unlike FeatLLM, which treats the LLM as a "feature engineer", Latte positions the LLM as a "teacher" to instruct the training process of the downstream tabular learning model. Specifically, for a tabular learning task, Latte inputs its metadata (i.e., task and feature descriptions) into the LLM and retrieves the hidden states produced by the final transformer layer as task-relevant knowledge. To distill this latent-level knowledge into downstream training, we propose two key components: 1) a semanticaware tabular encoder that integrates feature semantics into the representation of feature values; and 2) a knowledge adapter that takes this latent-level knowledge as the guideline to weightedly fuse information from different feature values, thereby constructing more predictive row embeddings. Together, these two components enable a general knowledgeguided training process, mitigating the risk of overfitting to limited labeled samples-a persistent challenge in few-shot settings-and thereby promoting convergence toward a more generalized model checkpoint. (Bottleneck ❶). In addition, Latte includes an additional unsupervised pre-training stage, making full use of the available unlabeled samples to provide a robust parameter initialization for the subsequent knowledge-guided training (Bottleneck ❷).
We conducted extensive experiments to validate Latte 's effectiveness on few-shot tabular learning tasks. Latte consistently outperforms all competing methods by a significant margin across various datasets and prediction tasks. Comprehensive ablation studies further highlight the superiority of latent-level knowledge over text-level knowledge, as well as the effectiveness of the individual components in this framework.
2 RelatedWork
2.1 Classical Tabular Prediction
A wide range of machine learning methods have been developed for tabular data. For modeling linear relationships, logistic regression (LR) [LaValley, 2008] is commonly used. In contrast, tree-based models, such as decision trees (DT) [Loh, 2011] and ensemble methods like XGBoost [Chen and Guestrin, 2016], random forests [Breiman, 2001], CatBoost [Prokhorenkova et al., 2018], and LightGBM [Ke et al., 2017], are preferred for modeling non-linear relationships. With the rise of deep learning, there has been growing interest in applying neural networks to tabular data. These approaches can be broadly categorized into four types: (1) Standard Neural Networks: This group includes methods like SNN [Klambauer et al., 2017], AutoInt [Song et al., 2019], and DCN V2 [Wang et al., 2021b]. (2) Hybrid Methods: These combine decision trees and neural networks for endto-end training, with notable examples being NODE [Popov et al., 2019], GrowNet [Badirli et al., 2020], TabNN [Ke et al., 2018], and DeepGBM [Ke et al., 2019]. (3) TransformerBased Methods: These models, such as TabNet [Arik and Pfister, 2021], TabTransformer [Huang et al., 2020], and FT Transformer [Gorishniy et al., 2021], utilize attention mechanisms to learn from tabular data. (4) Representation Learning Methods: These methods leverage self-supervised and semi-supervised learning to extract meaningful representations, with prominent examples including VIME [Yoon et al., 2020], SCARF [Bahri et al., 2021], SAINT [Somepalli et al., 2021], and Recontab [Chen et al., 2023].
2.2 Few-shot Tabular Prediction
Few-shot tabular prediction holds significant promise in fields like agriculture, industry, and finance, where obtaining and annotating data can be challenging. As a result, this area has garnered increasing attention. However, traditional tabular prediction methods often require large amounts of annotated data and tend to perform poorly in few-shot scenarios. To address these challenges, two main approaches have emerged: (1) TNNs-based methods: These approaches generate tasks from unlabeled data for meta-learning and use a small amount of labeled data to create prototypes for tabular classification tasks [Nam et al., 2023]. (2) LLMs-based methods: These rely on the inference capabilities of large language models. For example, the In-context method [Wei et al., 2022] directly converts tabular data into text prompts for the LLMs. TABLET [Slack and Singh, 2023] further enhances this by adding task-specific instructions to the prompts, improving the model's ability to reason about tabular. FeatLLM [Han et al., 2024b] uses LLMs as a feature engineer to automatically perform feature extraction, which is then used to train specialized classification networks. Alternatively, LLMs can be fine-tuned using a small number of labeled samples, as demonstrated by methods like TabLLM [Hegselmann et al., 2023]. Additionally, GTL [Wen et al., 2024] fine-tunes LLMs using a large amount of tabular data to obtain a tabular foundation model.
3 Method
In this section, we innovatively propose Latte to transfer LLMs' latent-level knowledge for few-shot tabular learning. As shown in Fig. 1, Latte first utilizes a semantic-aware tabular encoder to obtain the representation of feature values integrated with their corresponding semantics (Section 3.2).

Next, Latte leverages task metadata to extract task-relevant knowledge from LLMs (Section 3.3) and transfers this latentlevel knowledge into downstream training via a specially designed knowledge adapter (Section 3.4). Finally, we outline the overall downstream training process (Section 3.5).
3.1 ProblemFormulation
In this section, we formally define the problem settings for few-shot tabular learning: Consider a tabular dataset D = {Dl,Du,M}, where Dl represents the set of labeled samples, Du the set of unlabeled samples, and M the corresponding metadata, respectively. Specifically, each sample in the tabular dataset is in this form (x, y), where x denotes all feature values of a single row, and y represents its corresponding label. The labeled set Dl = {(xil , yi l )}Nl i=1 contains Nl labeled instances, and the unlabeled set Du = {xiu}Nu i=1 consists of Nu unlabeled instances, with Nl ≪ Nu. Metadata M = {F, T} provides textual descriptions of the task objective and the definitions of features in the dataset, where F = {fj : dj}dj=1 represents the column names and their descriptions, and T denotes the task description. Formally, the goal is to train a downstream modelfθ : X → Y, parameterized by θ, to map the row feature space X to the label space Y, where Y could be {0, 1}C with C classes or R, depending on the specific task (classification or regression).
3.2 Semantic-aware Tabular Encoder
Tabular data presents unique challenges compared to text and images due to its inherent heterogeneity, permutation invariance, and the rich semantic information provided by column names. These characteristics of tabular complicate the encoding process. Traditional feature value encoders struggle with limited labeled samples, making it difficult to infer the semantic meaning of feature names implicitly due to the scarcity of supervisory signals. To address this limitation and better handle the heterogeneity of tabular data, we propose an encoding method that explicitly incorporates feature semantic information into the representation of feature values:
Here, fj denotes the j-th feature (e.g., "Gender"), xj is its corresponding value (e.g., "Male"), and × represents element-wise multiplication between numerical features and values, because BERT's tokenizer typically splits numerical values into subcomponents, which can hinder its effectiveness for encoding numerical features. This approach generates effective tabular semantic representations for both categorical and numerical features, resulting in a feature set H = {hj}nj=1 , where n is the total number of features. To obtain a global representation of the sample, we introduce an extra token [CLS] to the feature set H. This token serves as an aggregate representation of the entire sample, capturing the overall context and facilitating downstream tasks.
The interaction between tabular features is crucial for capturing meaningful patterns. For instance, the relationship between weight and blood pressure (BP) can provide valuable insights into cardiovascular health, which is vital for heart disease classification. To model these interactions while preserving the inherent permutation invariance of tabular data, we employ a Transformer architecture without positional embeddings to further refine the quality of feature value embeddings:
Here, ˆH = {ˆhCLS, ˆhj}nj=1 , where ˆhCLS and {ˆhj}nj=1 refers to the global representation and the set of tabular feature representations, respectively. These capture the implicit relationships between features, enabling the model to effectively understand and leverage feature interactions.
3.3 Task-relevant Prior Knowledge Extraction
The above semantic-aware tabular encoder effectively processes heterogeneous tabular data and incorporates its semantic information into the representations of feature values. However, when labeled data is limited, capturing task-specific semantics becomes more challenging. Thanks to large-scale pretraining, LLMs encode substantial general knowledge within their parameters. For a given a tabular learning task, to effectively obtain the task-relevant knowledge within LLMs, we formulate the following knowledge extraction process: Based on the metadata M of the given tabular dataset D, we elaborately craft the input prompt, describing the task objective and feature semantics (See Fig. 1 for an example of input prompt), in order to retrieve taskrelevant knowledge from the pre-trained LLM. Specifically, after the LLM processes this prompt, we hook the hidden states produced at the last transformer layer of all input tokens and apply average pooling to them. This operation results in a dense vector that encapsulates the LLM's prior understanding of the task, serving as our latent-level knowledge for subsequent knowledge-guided downstream training. The process can be formally described as follows:
where hi represents the last-layer hidden states of the i-th token after processing the input prompt. We obtain the prompt representation, i.e. the latent-level knowledge, by applying average pooling to the hidden states of all tokens:
where Average(·) represents the average pooling operator and hM denotes the representation of the input prompt. We regard this dense vector, which contains abundant prior understandings of the given tabular dataset, as the useful latent-level knowledge for subsequent model training.
3.4 Knowledge Adapter
The semantic spaces of LLMs and the BERT-based Semanticaware Tabular Encoder differ significantly in both dimension and representation, making it challenging to directly integrate the Latent-level knowledge from the LLM into our model. To address this, we design a knowledge adapter that aligns these two semantic spaces and facilitates the transfer of LLMgenerated knowledge into our model. We introduce a novel GTransformer to generate the global query vector q:
where both ˆhCLS and {ˆhj}nj=1 are representations encoded by the Semantic-Aware Tabular Encoder. To distill taskrelated semantic knowledge from the LLM into the global query vector q and obtain the task-relevant global query vector qLLM, we apply the following knowledge distillation formula:
where τ is the temperature, the matrix W0 is initialized randomly using Kaiming initialization, which aligns the dimensions of hM and q. Meanwhile, through the attention mechanism, we obtain the LLMs semantic knowledge guided taskrelevant semantic representation hLLM as:
where the ˆH generated by the Semantic-aware Tabular Encoder is directly used as K and V, ensuring that the semantic information of the sample remains unaffected and d is the feature dimension of qLLM. Finally, we combine the general tabular semantics ˆhCLS from the Semantic-aware Tabular Encoder with the task-relevant semantic representation hLLM to obtain a high-quality representation ˆhLLM, which effectively integrates both task-relevant and general tabular semantic in-
where g(·; ϕ) is a learnable transformation designed to align the semantic spaces of hLLM and ˆhCLS and η is a constant that allows for fine-tuning the influence of the LLM's prior knowledge on the prediction process, ensuring an optimal balance between the model's learned features and the external knowledge introduced.
3.5 Model Training
To fully leverage the available unlabeled samples and ensure robust parameter initialization for subsequent knowledgeguided training, we include an unsupervised pre-training stage, in addition to downstream task fine-tuning. During the pre-training stage, we generate N-way K-shot meta-training tasks using unlabeled datasets and perform meta-learning, guided by task-relevant knowledge extracted from LLMs. To obtain the meta-training task, we first generate pseudo-labels ˜y for the unlabeled data using the following cluster procedure:
where k represents the number of centroids, 1k is a vector of ones, C is the centroid matrix, and m is random noise used to corrupt features, aiding in the learning of robust embeddings for downstream tasks. Next, we randomly select k samples from each cluster to create an N-way K-shot meta-training task. By introducing different noise m, we generate a variety of meta-tasks. Finally, we compute the meta-learning loss as follows:
| Data | # of samples | # of cat/num feature | Task type |
|---|---|---|---|
| Bank | 45211 | 8/8 | classification |
| Blood | 748 | 0/4 | classification |
| Credit-g | 1000 | 12/8 | classification |
| Diabetes | 768 | 0/8 | classification |
| Heart | 918 | 4/7 | classification |
| Myocardial | 1700 | 94/17 | classification |
| Abalone | 4177 | 1/7 | regression |
| Boston | 506 | 2/11 | regression |
| Cholesterol | 303 | 9/4 | regression |
where LKL = KL(W0hM/τ, q/τ) denotes the KL divergence loss, which is used to guide the distillation of task-relevant knowledge from LLMs and Lpseudo is the loss associated with the pseudo-labels, given by Lpseudo =
-˜y log(MLP(ˆhLLM)). This stage of training enables the model to learn task-relevant semantic information under the guidance of LLM task-relevant knowledge, preparing the model for adapting to downstream tasks. Therefore, during the downstream task fine-tuning stage, Our model is capable of rapidly generalizing to downstream tasks with the guidance of limited labeled data. The loss is computed as:
where Ltrue depends on the type of task:
This final step refines the model's performance on the specific task using the limited number of labeled examples available.
4 Experiment
In this section, we first introduce the setup for few-shot tabular data prediction and provide the implementation details. We then evaluate the proposed model against with baseline, including traditional machine learning methods, few-shot tabular algorithms, and LLM-based frameworks. Additionally, we conduct extensive ablation studies to test the effectiveness of the proposed modules.
4.1 Experimental Settings
Dataset. As shown in Table 1, we evaluate the proposed method using nine real-world datasets, including six classification tasks and three regression tasks. Each dataset provides metadata such as a clear description for each attribute and task. Refer to Appendix A for details of the dataset
Baselines. We compare the proposed method against ten baseline models. The first is conventional tabular learning approaches: (1) Logistic Regression (LogReg) [LaValley, 2008], (2) XGBoost [Chen and Guestrin, 2016], and (3) Random Forest [Breiman, 2001]. The next two baselines leverage unlabeled datasets: (4) SCARF [Bahri et al., 2021] and (5) STUNT [Nam et al., 2023], though it is worth noting that in real-world scenarios while obtaining unlabeled data is typically straightforward, the process of labeling it can be expensive and time-consuming. Another recent baseline, (6) TabPFN [Hollmann et al., 2023], generates synthetic datasets with diverse distributions to pretrain the model. The final group of baselines utilizes LLMs: (7) In-context learning [Wei et al., 2022], which embeds few-shot training samples directly into the input prompt without fine-tuning; (8) TABLET [Slack and Singh, 2023], which enriches the prompt with additional hints through an external classifier using rule sets and prototypes to improve inference quality; (9) TabLLM [Hegselmann et al., 2023], which applies parameter-efficient tuning techniques such as IA3 to train the LLMs with few-shot samples; and (10) FeatLLM [Han et al., 2024b], which treats the LLMs as a feature engineer, automating feature extraction and using the engineered features for few-shot tabular classification.
Implementation details. We obtain task-relevant knowledge from the LLaMA2 series models [Touvron et al., 2023]. The hidden layer dimensions of the Feed Forward Network (FFN) and other components are set to 256 and 128, respectively. For the Semantic-aware Tabular Encoder, we use a 2-layer, 8-head transformer, while the knowledge adapter consists of a 2-layer, 2-head transformer. Dropout is set to 0.1. During the meta-learning phase, The Adam optimizer is used for training, with the learning rate set to 1e-4. The activation vector in the LLMs is obtained from the 30 layers. For the fine-tuning phase, the learning rate is reduced to 1e-5 due to the limited number of labeled samples. For evaluation, we use the Area Under the Curve (AUC) metric for classification tasks and Mean Squared Error (MSE) for regression tasks.
4.2 Results and Analysis
Latte offers an effective and comprehensive solution for few-shot tabular prediction. For Effectiveness: As shown in Table 2, Latte outperforms or comparable of the current state-of-the-art baseline across all datasets and shot setting. For example, in classification tasks, our method exceeds the performance of the state-of-the-art method FeatLLM in all shot settings, achieving an average performance improvement of 4.22%. This improvement is primarily due to Latte's ability to leverage both unlabeled data and taskrelated knowledge from LLM, which is something that existing methods cannot achieve.
For Comprehensiveness: Latte directly applicable to regression tasks without the need for modifications. Detailed experimental results can be found in Appendix B. In contrast, existing few-shot learning methods are often designed specifically for classification tasks and cannot be directly applied to regression. While large language models (LLMs) can handle regression tasks, they tend to produce inaccurate predictions, often due to spurious patterns or "hallucination."
4.3 Ablation Study
Each module in Latte plays a crucial role. We conduct ablation studies to assess the contribution of key components to the model's performance. Specifically, we evaluate four factors: (1) SaTE explores the decision of whether to use a semantic-aware table encoder. If a semantic-aware approach is not employed, a non-semantic-aware encoder from STUNT [Nam et al., 2023] is used as an alternative, (2) LLM indicates whether task-relevant knowledge is extracted from the LLMs, (3) Meta refers to the process of applying metalearning techniques to unlabeled data, and (4) Size represents the effect of varying LLM scales on performance.
| data | shot | LogReg | XGBoost | RandomForest | SCARF | TabPFN | STUNT | In-context | TABLET | TabLLM | FeatLLM | Latte |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Heart ↑ | 4 8 16 32 64 | 70.543.83 50.000.00 78.1210.59 55.883.98 83.023.70 78.627.14 84.843.53 87.111.22 89.993.82 | 70.852.02 79.434.28 83.453.95 88.772.36 89.742.62 | 59.383.42 74.356.93 83.665.91 88.452.43 90.971.55 | 67.3315.29 77.892.34 81.455.05 88.002.34 90.202.57 | 88.273.32 88.782.38 89.132.10 89.653.04 89.623.16 | 60.764.00 65.463.77 67.007.83 71.943.88 OOW | 68.1911.17 69.8510.82 68.3911.73 71.909.07 OOW | 59.744.49 70.147.91 81.723.92 87.432.32 89.782.59 | 75.664.59 79.462.16 83.711.88 87.193.66 88.084.11 | 86.105.42 89.594.09 92.102.79 93.002.68 93.272.33 | |
| Myocardial ↑ | 4 8 16 32 64 4 | 89.743.30 51.253.85 55.341.11 60.005.16 58.630.96 57.041.94 63.703.87 72.523.21 58.7810.54 70.345.86 | 50.000.00 55.632.92 56.5512.22 57.315.31 56.182.85 50.000.00 | 51.914.49 52.775.83 54.164.53 46.435.02 55.004.73 60.593.90 61.749.91 65.6710.43 | 47.704.10 49.373.41 54.311.42 53.520.74 54.412.00 58.535.49 55.2811.88 65.811.79 68.451.06 | OOW OOW OOW OOW OOW 63.1911.60 62.817.84 73.792.21 77.713.56 82.142.28 | 52.772.01 55.404.41 61.223.45 60.761.58 59.790.56 56.3412.82 63.018.78 69.850.95 71.641.65 72.261.62 | OOW OOW OOW OOW OOW 61.381.30 69.5713.35 69.768.55 66.935.67 OOW | OOW OOW OOW OOW OOW 58.116.29 69.086.00 69.4011.28 73.619.28 | OOW OOW OOW OOW OOW 62.518.95 63.195.79 63.736.43 | 52.873.44 56.221.64 55.329.15 60.024.02 61.473.91 70.453.69 | 55.122.86 59.853.25 61.964.49 62.406.40 63.841.76 74.332.57 79.912.88 82.263.56 |
| Bank ↑ | 8 16 32 64 4 8 | 77.513.09 79.633.57 76.251.26 82.271.61 56.7926.02 68.515.16 68.306.16 | 81.921.00 50.000.00 59.971.36 63.287.62 66.416.37 | 74.295.32 79.553.19 48.5012.82 63.4311.03 65.986.49 63.464.43 | 68.283.97 56.2221.00 65.775.00 66.275.04 69.716.24 | 58.7219.16 66.3010.01 64.146.80 68.654.37 | 48.576.04 60.004.84 54.764.53 59.873.72 | 56.3012.43 58.9910.12 56.595.21 58.691.53 | OOW 56.4515.45 56.3711.56 60.624.13 57.944.16 | 66.513.92 70.833.43 55.8713.49 66.019.25 65.147.55 69.953.39 | 75.856.66 78.411.08 78.374.50 81.186.17 68.347.48 70.373.23 | 83.239.26 85.177.71 70.753.64 69.973.25 72.461.87 |
| Boold ↑ | 16 32 64 | 67.394.46 71.762.56 | 69.462.96 50.000.00 | 68.835.61 52.507.77 | 72.754.36 62.357.48 | 73.881.97 69.089.68 | 61.752.19 64.226.78 67.3912.92 73.796.48 | 65.792.05 71.715.31 72.212.07 71.645.05 | 63.477.36 63.963.32 | 70.881.58 | 70.075.19 71.134.38 71.044.36 | 74.812.67 74.732.08 |
| Diabetes ↑ | 4 8 16 32 64 | 57.0918.84 65.5213.18 73.440.52 73.953.32 74.521.59 | 50.8622.03 65.696.54 72.973.77 72.563.17 | 65.348.84 65.696.33 71.278.04 76.922.39 57.0010.75 59.847.33 | 64.6913.33 71.863.16 72.913.09 74.444.13 | 56.2813.01 73.693.21 75.223.21 77.823.49 | 76.704.55 78.643.32 48.806.76 54.508.25 57.637.58 | 73.321.59 70.224.09 52.994.08 52.434.36 55.294.80 | 65.473.95 66.710.76 66.971.75 69.276.15 54.336.54 52.905.79 | 70.423.69 64.305.88 67.342.79 69.744.41 71.564.55 | 80.280.75 79.381.66 80.151.35 80.061.18 80.911.62 | 72.065.04 73.704.94 76.784.69 77.012.44 78.322.49 |
| Credit-g ↑ | 4 8 16 32 64 | 52.684.46 55.528.88 58.265.17 67.855.78 72.779.29 | 50.000.00 52.224.90 56.234.37 65.336.28 70.792.34 | 58.428.36 57.485.73 68.534.99 | 48.924.60 55.263.92 59.2211.38 72.607.18 73.126.23 | 54.007.34 52.5811.27 58.918.04 66.275.06 68.956.14 | 63.245.47 70.974.95 | OOW OOW | 51.654.02 OOW OOW | 51.909.40 56.4212.89 60.3814.03 68.643.86 70.804.09 | 55.941.10 57.423.10 56.602.22 61.7910.25 66.432.90 | 58.210.93 62.904.52 67.111.22 73.131.49 75.651.05 |
| SaTE | LLM | Meta | Size | 4 | 8 | 16 | 32 | 64 |
|---|---|---|---|---|---|---|---|---|
| ✓ ✓ ✓ ✓ | ✓ ✓ | ✓ ✓ ✓ | 13B | 85.164.44 81.2710.13 84.644.16 76.576.56 | 84.866.73 86.267.29 84.717.93 83.131.79 87.396.01 | 88.598.54 90.435.07 89.636.21 | 90.033.60 90.522.59 90.634.90 83.095.95 92.932.71 | 91.072.75 91.992.46 91.524.53 89.685.81 93.132.60 |
| ✓ | 13B 7B | 85.485.85 | 86.522.34 92.083.24 | |||||
| ✓ | ✓ | ✓ | 13B | 86.105.42 | 89.594.09 | 92.102.79 | 93.002.68 | 93.272.33 |
Table 3 presents the impact of various ablation experiments on the AUC across the Heart datasets. In all cases, modifying any of the ablated components leads to a decline in performance. Specifically, we replaced SaTE with the encoder from STUNT [Nam et al., 2023] and the result reveal a maximum performance drop, particularly with few-shot labeled samples. For instance, with just 4 labeled samples, performance decreased by nearly 10%. This highlights the critical role of capturing the unique properties of tabular data and the importance of incorporating semantic information from column names, especially when working with limited labeled data. Besides, without extracting task-relevant knowledge from the LLMs using metadata, or meta-learning with unlabeled data, also decrease the model's performance. This highlights the importance of learning task-related semantic knowledge in the meta-learning process. Interestingly, increasing the size of the selected LLMs does not result in significant performance gains, possibly due to the 7B model has already contained all the necessary task-related semantic knowledge.
4.4 Impact of Labeled Sample Size and LLM Activation Layers on Latte
The deeper of LLM, the more sufficient knowledge it contains. Fig. 2 (a-b) illustrates the effect of activation in different layers L of the LLM and the number of labeled samples on model performance. Fig. 2 (a) presents AUC values for classification tasks on the Blood dataset, while Fig. 2 (b) shows MSE values for regression tasks on the Abalone dataset. As the number of labeled samples increases, model performance improves across both tasks. In classification tasks, performance improves as deeper layers of the LLM are activated. This suggests that higher-order knowledge is accumulated in the later layers. In contrast, for regression tasks, optimal performance is achieved at around 30 layers. In summary, adding more layers may not improve the model's performance and could instead introduce noise, leading to a decline in the quality of learned representations.


4.5 What Latent Knowledge Does Latte Transfer From the LLM
Latte can retrieve task-related semantic information from metadata. To examine the task-related semantic information embedded in the representations learned by Latte during the unlabeled data meta-learning stage, we measured the semantic similarity between the learned representations and the LLM activation at the word level using metadata. This was visualized through a heatmap, as shown in Fig. 3. Higher values, indicated by redder colors, reflect greater semantic similarity. As an example of a downstream task, this involves predicting whether a patient has heart disease. The results of the heatmap demonstrate that our model, after meta-learning on unlabeled data, captures task-relevant semantic information. For example, the representations learned by Latte exhibit high semantic similarity with "patient" and "heart disease," indicating its effective learning of task-relevant semantic knowledge. Furthermore, the model identifies and emphasizes key features such as "age," "cholesterol," "fast blood sugar," "maximum heart rate," and "peak exercise ST segment," which are crucial for determining heart disease.
4.6 Comparison of LLM Invocation Costs
Latte has an efficiency advantage in calling LLM. Table 4 compares the number of LLM calls required by Latteand other LLM-based baselines across the data preprocessing, training, and inference stages. Specifically, TABLET, Incontext and TabLLM require calling the LLM once for each test sample during inference, resulting in significant overhead. While FeatLLM limits LLM calls to the training phase to assist in learning, the number of calls still scales with the size of the training dataset. Our method calls the LLM only once during preprocessing to gather task-relevant knowledge, which is then stored locally. As a result, our approach significantly reduces the overall number of LLM calls throughout the entire process.
| Methods | |||||
|---|---|---|---|---|---|
| Stage | In-context | TABLET | TabLLM | FeatLLM | Latte |
| Preprocessing | 0 | 0 | 0 | 0 | 1 |
| Training | 0 | 1 | 1 | 30 | 0 |
| Inference | 9043 | 9043 | 9043 | 0 | 0 |
| Totle | 9043 | 9044 | 9044 | 30 | 1 |
4.7 Visualization Experiments
Latte can generate high-quality representations with limited labeled data. The visualization of representations on the Bank dataset is shown in Fig. 2 (c-e), where the original representations refer to those generated without training. Latte learns effective representations in few-shot settings. With just four labeled samples, it produces a separable representation, and this separability improves as the number of labeled samples increases to 64. This demonstrates the model's strong ability to learn useful features with minimal supervision.
5 Conclusion
This paper introduces a novel framework, Latte, aimed at addressing the challenges of few-shot tabular learning by extracting latent-level knowledge from large language models (LLMs) during the training process. Latte positions the LLM as a "teacher" that provides task-relevant guidance to the downstream tabular model and enable a knowledgeguided training process that mitigates overfitting, a common issue in few-shot settings, and promotes convergence toward a generalized model. Additionally, Latte incorporates an unsupervised pre-training stage that leverages unlabeled data for robust parameter initialization, further enhancing the framework's performance. Extensive experiments demonstrate the effectiveness of Latte on a variety of few-shot tabular learning tasks.
Acknowledgments
This work was supported by a grant from the National Natural Science Foundation of China under grants (No.62372211, 62272191), and the Science and Technology Development Program of Jilin Province (No.20250102216JC).
Contribution Statement
Ruxue Shi and Hengrui Gu have equal contributions, with Xin Wang as the corresponding author.
@inproceedings{ijcai2025p687,
title = {Latte: Transfering LLMs' Latent-level Knowledge for Few-shot Tabular Learning},
author = {Shi, Ruxue and Gu, Hengrui and Ye, Hangting and Dai, Yiwei and Shen, Xu and Wang, Xin},
booktitle = {Proceedings of the Thirty-Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-25}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {James Kwok},
pages = {6173--6181},
year = {2025},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2025/687},
url = {https://doi.org/10.24963/ijcai.2025/687},
}
TY - CPAPER TI - Latte: Transfering LLMs' Latent-level Knowledge for Few-shot Tabular Learning AU - Shi, Ruxue AU - Gu, Hengrui AU - Ye, Hangting AU - Dai, Yiwei AU - Shen, Xu AU - Wang, Xin T2 - Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2025 SP - 6173 EP - 6181 DO - 10.24963/ijcai.2025/687 UR - https://doi.org/10.24963/ijcai.2025/687 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: