Understanding LLM Embeddings for Regression

Eric Tang, Bangding Yang, Xingyou Song

Abstract

While Large Language Models (LLMs) are primarily known for text generation, their internal vector representations (embeddings) offer significant potential as features for numerical regression. This paper evaluates the efficacy of LLM embeddings against traditional feature engineering across synthetic and real-world benchmarks. We find that LLM embeddings exhibit superior robustness in high-dimensional settings and that their performance is closely linked to the "smoothness" of the embedding space, quantified by a novel Normalized Lipschitz Factor Distribution (NLFD).

Introduction

In traditional machine learning, regression tasks typically rely on handcrafted feature engineering, such as normalizing continuous variables or one-hot encoding categorical data. While recent research has explored using LLMs for regression via text decoding (asking the model to "type" a number), the use of fixed LLM embeddings as inputs for separate predictors remains understudied. This research investigates whether LLM embeddings can outperform traditional features, particularly as the dimensionality of the input space increases.

Methodology

The researchers compared two primary feature extraction approaches:

  1. Traditional ($\phi_{trad}$): Standard feature engineering where continuous values are normalized and categorical values are one-hot encoded.
  2. LLM-based ($\phi_{LLM}$): Tabular data is converted into a JSON-like string and passed through an LLM (such as T5 or Gemini). The resulting vectors are pooled into a fixed-size embedding.

These features were then used to train downstream predictors, specifically Multi-Layer Perceptrons (MLPs) and XGBoost. To analyze the underlying reasons for performance differences, the authors introduced the Normalized Lipschitz Factor Distribution (NLFD). This metric quantifies the "smoothness" of the mapping from the input space to the embedding space, testing the hypothesis that smoother mappings are easier for downstream models to learn.

Normalized Lipschitz Factor Distribution (NLFD) comparing LLM embeddings to traditional features across different synthetic functions at DOF=100.

Key Insights and Results

Dimensional Robustness

A critical finding of the study is the stability of LLM embeddings in high-dimensional spaces. In traditional regression, performance often degrades significantly as the number of input variables (Degrees of Freedom, or DOF) increases. However, LLM embeddings (particularly T5-XXL and Gemini Pro) remain remarkably stable, effectively compressing high-dimensional relationships.

Kendall-Tau Correlation vs. Degrees of Freedom (DOF) for various synthetic functions, comparing LLM embeddings (T5, Gemini) against traditional baselines (MLP, XGBoost).

The Smoothness Connection

The research identified a strong correlation between regression accuracy and the smoothness of the embedding space. As illustrated by the NLFD, LLMs often map similar inputs to similar embedding vectors more effectively than traditional methods. This preservation of Lipschitz continuity provides a better inductive bias, allowing simple MLPs to learn complex numerical functions more efficiently.

Performance on Real-World Tasks

In high-dimensional production tasks—such as tuning compiler latencies (XLA) or hardware accelerator designs (L2DA)—LLM embeddings outperformed traditional features in 30% to 41% of individual tasks. Interestingly, while XGBoost is often the preferred model for tabular data, MLPs were found to perform better when utilizing LLM embeddings as features. Furthermore, including parameter names (e.g., batch_size) in the input string improved performance, suggesting that the models leverage semantic knowledge even for purely numerical tasks.

Limitations and Future Work

Despite their performance benefits, LLM-based embeddings face challenges regarding computational cost and latency compared to simple normalization. Future work may focus on developing smaller, specialized models optimized for embedding-based regression or exploring how these techniques apply to non-tabular data structures like graphs and trees. Additionally, the sensitivity of regression performance to different prompt formats remains an area for further optimization.

Summary updated

BibTeX
@article{tang2025understanding,
  author = {Eric Tang and Bangding Yang and Xingyou Song},
  title = {{Understanding LLM Embeddings for Regression}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
}
Figure