arXiv:2610.42024cs.LGOct 2026

Manuscript Offprint

arXiv:2610.42024

Know When the Equation Is Wrong: Structural Uncertainty for LLM-Guided Symbolic Regression under Extrapolation

Mostafa Cham, Bayu Adhi Tama, Jianwu Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large language models (LLMs) can help discover mathematical equations from data, but most LLM-guided symbolic regression methods focus on a single best equation without quantifying uncertainty over alternative functional forms. This is challenging because distinct equations can fit the observed data similarly while producing substantially different extrapolations. Our experiments on the LLM-SRBench dataset show that standard conformal intervals achieve nominal in-distribution coverage but frequently fail under extrapolation. To tackle this challenge, we introduce LLM-SR-UQ, a framework that retains competing equation structures and uses their disagreement to characterize uncertainty about the underlying functional form. We extend the standard fixed-width conformal approach to quantify structural intervals, which measure disagreement among candidate equations and identify where prediction intervals should widen. Extensive experiments show our framework substantially improves coverage attainment by incorporating structural disagreement while preserving in-distribution coverage. Our approach also shows good generalizability when it is applied to other symbolic-regression methods. The code for this paper is available at https://github.com/MostafaCham/LLM-SR-UQ

1 INTRODUCTION

Symbolic regression aims to discover interpretable mathematical equations that describe observed data and, ideally, remain valid beyond the observed range. Recent advances in large language models (LLMs) have improved symbolic regression by enabling the generation and refinement of candidate equations using scientific context and iterative feedback (Shojaee et al., 2025a; Grayeli et al., 2024; Wang et al., 2025; Xia et al., 2025). Despite these advances, current LLM-guided symbolic regression systems typically focus on identifying a single best equation, leaving an important question unanswered: when several equations can explain the observed data, how certain are we that the selected equation is the appropriate functional form, and how reliable are its predictions outside the observed range?

Different mathematical equations can fit the observed data equally well while representing different hypotheses about the underlying relationship. These differences may be difficult to detect within the observed range but can lead to substantially different predictions under extrapolation. As a result, selecting only the highest-scoring equation can hide whether it is uniquely supported by the data or is one of several plausible alternatives. Classical symbolic regres-

sion has explored this problem through Bayesian model selection, ensembles, and other approaches that retain information about competing equations (Guimerà et al., 2020; Fasel et al., 2022; Hirsh et al., 2022; Bartlett et al., 2024). However, quantifying such structural uncertainty remains relatively unexplored in LLM-guided symbolic regression.

Evaluating the accuracy of a discovered equation is not sufficient to establish the reliability of its uncertainty estimates. Existing symbolic regression benchmarks primarily assess point-prediction accuracy and symbolic recovery (La Cava et al., 2021; Shojaee et al., 2025b). but these metrics do not indicate whether prediction intervals contain the true outcomes at the expected frequency. In particular, an equation may achieve low prediction error within the observed range while producing unreliable uncertainty estimates under extrapolation. For scientific applications, it is therefore important to evaluate not only predictive accuracy but also whether uncertainty estimates remain calibrated under the conditions in which the equation is applied.

Conformal prediction offers a practical approach to estimating predictive uncertainty by constructing prediction intervals from observed prediction errors (Vovk et al., 2005; Lei et al., 2018; Angelopoulos & Bates, 2021). It provides finite-sample marginal coverage guarantees when calibration and test data are exchangeable, even if the underlying model is incorrect. However, when applied to a single equation selected through symbolic regression, conventional conformal prediction does not explicitly account for alternative

¹Department of Information Systems, University of Maryland, Baltimore County, Baltimore, MD, USA. Correspondence to: Mostafa Cham mcham2@umbc.edu.

Preprint. Under review equations discarded during the search. This limitation is particularly important under extrapolation, where equations that fit the observed data similarly may produce substantially different predictions. Even when the coefficients of a selected equation are well estimated, uncertainty about its functional form may remain. Once competing equations have been discarded, their disagreement can no longer inform the uncertainty estimate. Consequently, post-hoc calibration may produce reliable intervals within the observed distribution while failing to capture structural ambiguity under extrapolation.

To address these limitations, we introduce LLM-SR-UQ, which retains competing equation structures throughout the search rather than selecting a single best equation. Evidence-weighted model averaging produces a point predictor, while disagreement among retained equations determines how uncertainty varies across inputs. We extend fixed-width split-conformal intervals by normalizing held-out calibration errors using this structural scale and applying the resulting conformal quantile to construct prediction intervals. These structural intervals widen where candidate predictions diverge and remain narrower where they agree.

We also test whether uncertainty-related feedback improves equation discovery. An optional LLM critic examines fitting diagnostics and coefficient identifiability, with its extrapolation-aware setting additionally using disagreement among candidates on unlabeled inputs beyond the training range. The critic guides proposals without accessing shifted test data or altering retained candidates. Ablations compare it with rule-based feedback.

Our main contributions are summarized as follows: (1) Structural uncertainty framework. We introduce LLM-SR-UQ, a framework that retains multiple candidate equation structures during symbolic regression and combines their disagreement with conformal calibration to construct input-dependent prediction intervals that reflect ambiguity in the underlying functional form (Section 3). (2) Evaluation of uncertainty under extrapolation. We systematically evaluate prediction accuracy, coverage, and interval sharpness under both in-distribution (ID) and extrapolative settings. Our experiments demonstrate that incorporating structural disagreement improves empirical coverage under extrapolation, including when applied to independent symbolic-regression methods (Sections 3 and 5). (3) Calibration-aware search feedback. We investigate whether uncertainty-related information can improve equation discovery through controlled ablations of rule-based feedback and an LLM-based critic. Our results show that the critic does not improve calibration or equation recovery beyond rule-based feedback, highlighting the importance of retaining structural alternatives rather than introducing additional LLM-guided search mechanisms (Section 3 and Appendix C).

References (28)