On Evaluating LLMs' Capabilities as Functional Approximators: A Bayesian Evaluation Framework

Shoaib Ahmed Siddiqui, Yanzhi Chen, Juyeon Heo, Menglin Xia, Adrian Weller

Abstract

Recent works have successfully applied Large Language Models (LLMs) to function modeling tasks. However, the reasons behind this success remain unclear. In this work, we propose a new evaluation framework to comprehensively assess LLMs’ function modeling abilities. By adopting a Bayesian perspective of function modeling, we discover that LLMs are relatively weak in understanding patterns in raw data, but excel at utilizing prior knowledge about the domain to develop a strong understanding of the underlying function. Our findings offer new insights about the strengths and limitations of LLMs in the context of function modeling.

Introduction

Large Language Models (LLMs) are increasingly deployed as "functional approximators"—engines capable of regression, time-series forecasting, and scientific discovery. Despite their empirical success, a fundamental question remains: are these models truly learning mathematical relationships from data, or are they simply retrieving patterns from their massive pre-training corpora?

To answer this, we must distinguish between two core abilities: Pattern Recognition (the ability to discern mathematical relationships in raw, unlabeled data) and Domain Integration (the ability to use semantic context to constrain the space of possible functions). This paper introduces a Bayesian framework to disentangle these capabilities, revealing that while LLMs are mediocre at raw numerical pattern recognition, they are exceptionally proficient at leveraging internal "prior knowledge" to model real-world phenomena.

A Bayesian Perspective on Function Modeling

Function modeling can be framed through a Bayesian lens: $p(f|D) \propto p(D|f)p(f)$, where $p(f|D)$ is the posterior (the model's understanding after seeing data), $p(D|f)$ is the likelihood (how well the function fits the data), and $p(f)$ is the prior (pre-existing knowledge about the function).

To isolate these components, the researchers developed two distinct prompting strategies:

  1. Evaluating the Likelihood ($p(D|f)$): Tasks are "Numerized" and "Decontextualized." Semantic labels are removed (e.g., "Age" becomes "Feature 0"), and data is normalized. This forces the LLM to rely purely on numerical pattern recognition.
  2. Evaluating the Posterior ($p(f|D)$): Tasks are "Verbalized" and "Contextualized." Natural language descriptions are provided, and a "hinting" prompt explicitly encourages the use of domain knowledge (e.g., "Please actively utilize any domain knowledge you know about the task").
Prompting strategies for evaluating likelihood (left) vs. posterior (right).

LLMs as "Jagged" Mathematicians

When stripped of context and forced to model 1D synthetic functions (like Sine waves or Quadratics), LLMs exhibit a "jagged" behavior. Unlike standard Multi-Layer Perceptrons (MLPs) or Gaussian Processes (GPs) that produce smooth, continuous curves, GPT-4 often generates noisy, approximate shapes.

Comparison of MLP and LLM performance on 1D function modeling tasks.

As shown in the figure above, while the LLM captures the general trend of simple functions like linear or quadratic curves, it struggles significantly with periodic or complex patterns (e.g., Sine waves). This suggests that the Transformer architecture, or perhaps its numerical tokenization, is fundamentally less efficient at pure numerical regression than specialized neural networks.

The Power of the Prior

The true strength of LLMs emerges when domain context is introduced. In experiments involving income prediction (UCI Adult dataset) and CO2 emission modeling (Mauna Loa Observatory), the addition of semantic labels led to dramatic performance gains.

  • Data Efficiency: In the income task, GPT-4 reached ~80% accuracy with only 100 samples when given domain context. A standard MLP required 10,000 samples to reach a similar level (82%). The LLM's internal "prior" compensated for the lack of data.
  • Zero-Shot Reasoning: When asked to select important features or design Gaussian Process kernels, GPT-4's suggestions matched expert-designed systems. For CO2 modeling, it correctly predicted seasonal oscillations and accelerating trends because it "knew" the underlying physics of climate change, even when the provided data was noisy.

Conclusion and Future Work

This evaluation framework clarifies that LLMs are not superior mathematicians but superior "contextualizers." Their success in function modeling is driven by their ability to act as "data-efficient" learners in small-data regimes by applying strong, pre-trained priors. Future research should explore multimodal architectures that can process raw numerical arrays directly while maintaining the rich semantic priors of natural language.

Summary updated

BibTeX
@inproceedings{siddiqui2025evaluating,
  author = {Shoaib Ahmed Siddiqui and Yanzhi Chen and Juyeon Heo and Menglin Xia and Adrian Weller},
  title = {{On Evaluating LLMs' Capabilities as Functional Approximators: A Bayesian Evaluation Framework}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=G2inaClCxr},
}
Figure