Introduction
Deep learning has achieved remarkable success in unstructured domains such as computer vision and natural language processing. However, tabular data—the most common data format in industrial applications—remains a challenging frontier. The heterogeneous nature of tabular data, which often mixes numerical values with categorical variables, typically requires specialized, manually designed encoding pipelines. Traditional methods often rely on one-hot encoding or learned lookup tables, which treat feature names as arbitrary indices and fail to capture the inherent semantic relationships between categories (e.g., "January" and "February"). This paper explores a "plug-and-play" approach that leverages the semantic knowledge of Large Language Models (LLMs) to encode tabular features, enabling models to benefit from pre-trained linguistic common sense.
Methodology
The proposed framework bridges the gap between structured tables and semantic embeddings through a four-stage pipeline designed to be compatible with existing deep learning architectures.
- Template-based Serialization: Raw feature-value pairs are converted into natural language strings using simple templates. For instance, a "Gender" feature with the value "Male" is transformed into the sentence: "The Gender is Male."
- LLM-based Feature Embedding: These strings are processed by a frozen LLM to generate high-dimensional embeddings. The researchers evaluated several models, including BGE (BAAI General Embedding), Llama 3, and MiniLM, to determine the impact of model scale and specialization on performance.
- Embedding Adaptation: To manage the high dimensionality of LLM outputs (which can reach 4096 dimensions), a single-layer Multi-Layer Perceptron (MLP) projects the embeddings into a lower-dimensional space (e.g., 1024 dimensions). This adaptation layer is trainable, allowing the system to fine-tune the general semantic features for specific downstream tasks.
- Downstream Training: The adapted embeddings serve as input features for standard tabular models, such as MLPs, ResNets, and FT-Transformers.
Experimental Evaluation
The effectiveness of LLM-based embeddings was tested across seven classification datasets representing diverse domains, including banking (e.g., bank-marketing), medicine (e.g., diabetes, heart), and academic performance. These datasets vary in size from small-scale (145 samples) to large-scale (over 45,000 samples), ensuring a comprehensive assessment of the method's generalizability.
Results and Discussion
The experimental results demonstrate that LLM embeddings consistently enhance the performance of deep learning models on tabular tasks.
Performance Gains and Model Synergy
As shown in the results table, the "with LLM" variants outperformed the base models in nearly every configuration. The most significant improvements were observed with the FT-Transformer, which saw an average accuracy increase of approximately 3.05%. This suggests a strong synergy between the attention mechanisms of Transformers and the high-quality semantic features provided by LLMs.
The Efficiency of Specialized Models
While large generative models like Llama 3 are highly capable, the study identified BGE as the optimal choice for feature encoding. BGE provided consistent performance gains while being significantly more computationally efficient than larger alternatives. This indicates that specialized embedding models are well-suited for this "plug-and-play" role.
Limitations: Numerical Reasoning and Domain Specifics
Despite the overall success, the approach faces challenges with purely numerical data. In datasets like blood-transfusion, which are highly technical and lack descriptive feature names, the LLM-enhanced models showed slight performance degradation. This highlights a known limitation of current LLMs in handling raw numerical reasoning without sufficient semantic context. Additionally, the computational cost of querying LLMs for continuous numerical values remains a hurdle for real-time applications.
Conclusion
Integrating LLM embeddings into tabular deep learning represents a promising shift toward semantically-aware data processing. By treating table rows as text, models can leverage vast amounts of pre-trained knowledge, narrowing the performance gap between deep learning and traditional tree-based models like XGBoost. Future research will focus on improving numerical handling and exploring cross-table transfer learning, where shared semantic embeddings could allow models to generalize across entirely different datasets.
Summary updated