---
title: Bayesian Symbolic Regression
url: https://www.emergentmind.com/topics/bayesian-symbolic-regression
type: topic
---

# Bayesian Symbolic Regression

Bayesian symbolic regression is the formulation of symbolic regression as probabilistic inference over mathematical expressions. Instead of ranking candidate equations solely by heuristic fit-complexity criteria, it places priors on expression structure and parameters, combines them with a likelihood for noisy observations, and targets a posterior distribution over equations, coefficients, and predictions. In this formulation, the central objects are posterior model probabilities, marginal likelihoods, description lengths, and posterior predictive distributions rather than a single heuristic optimum [2507.19540][1910.08892].

## 1. Probabilistic formulation

At its core, Bayesian symbolic regression treats a candidate expression \(m_i\) or \(f_i\) as a statistical model. A standard formulation assumes noisy observations
\[
y^k = m^*(x^k, \theta^*) + \epsilon^k,
\]
with Gaussian observational noise of zero mean and unknown variance \(\sigma^2\). For a candidate model \(m_i\) with parameters \(\theta_i\),
\[
p(m_i,\theta_i\mid D)=\frac{p(D\mid m_i,\theta_i)\,p(\theta_i\mid m_i)\,p(m_i)}{p(D)},
\]
and the posterior over expressions is obtained by marginalizing parameters,
\[
p(m_i\mid D)=\frac{p(m_i)}{p(D)}\int d\theta_i\, p(D\mid m_i,\theta_i)\,p(\theta_i\mid m_i).
\]
The maximum-a-posteriori equation is
\[
\hat m = \arg\max_{m_i} p(m_i\mid D),
\]
which the physicist-oriented treatment identifies with the model minimizing description length [2507.19540].

An equivalent description-length formulation appears in Bayesian Machine Scientist-style work:
\[
p(f_i\mid D) = \frac{1}{Z}\int_{\Theta_i} d\theta_i\; p(D\mid f_i,\theta_i)\,p(\theta_i\mid f_i)\,p(f_i) = \frac{\exp[-\mathcal{L}(f_i)]}{Z}.
\]
Here the posterior over symbolic models is written as an exponential family over description lengths, making explicit that Bayesian symbolic regression is simultaneously a model-selection problem and a compression problem [2301.11919].

The formulation need not be restricted to a single tree. One influential Bayesian symbolic regression model assumes an additive structure,
\[
y = \beta_0 + \sum_{i=1}^{k} \beta_i \cdot g(\mathbf{x};T_i,M_i,\Theta_i) + \epsilon, \qquad \epsilon \sim N(0,\sigma^2),
\]
so that complex signals are represented as linear combinations of several concise symbolic trees rather than one large expression [1910.08892]. This suggests a broad conception of Bayesian symbolic regression: the latent symbolic object may be a single formula, an additive ensemble of formulas, or a support set in a screened symbolic library, provided that inference is posterior-based rather than purely heuristic.

A defining implication of the probabilistic view is that the full predictive target is not only a MAP equation but a posterior predictive distribution. One explicit expression is
\[
p(y\mid D,x)=\sum_{m_i}\int d\theta_i\,\delta\!\left(y-m_i(x,\theta_i)\right)p(m_i,\theta_i\mid D),
\]
which makes model averaging intrinsic rather than optional [2507.19540].

## 2. Prior structure, representation, and scientific knowledge

Bayesian symbolic regression depends critically on priors over symbolic form. In tree-based formulations, a symbolic expression is represented as a tree whose internal nodes are operators and leaves are variables or constants. Complexity is then controlled through a depth-dependent branching prior. Early Bayesian symbolic regression used
\[
p_1(\eta,T)=\alpha(1+d_\eta)^{-\beta},
\]
for the probability that a node at depth \(d_\eta\) is non-terminal, together with priors over operators and terminal features [1910.08892]. Hierarchical Bayesian symbolic regression later generalized this idea through
\[
p_m = \alpha (1+m)^{-\delta_0},
\]
so that deeper nodes are less likely to split, thereby regularizing tree depth and placing exponentially small mass on dense trees [2509.19710].

Beyond generic parsimony, priors can encode structural regularities of scientific expressions. One approach uses an \(n\)-gram language model over expression trees. Instead of counting operators independently, it models the probability of local operator configurations along tree paths, so that structurally different expressions with identical operator counts need not receive the same prior mass. The same work combines this with a Fractional Bayes Factor treatment of numerical parameter priors to make evidence-based model comparison well-defined even under weak or improper parameter priors [2304.06333].

A more formal route represents prior knowledge with probabilistic Regular Tree Expressions and evaluates the resulting tree prior via probabilistic tree automata. In that framework, symbolic expressions are treated as trees over a ranked alphabet, syntactic correctness is guaranteed by construction, and independent scientific constraints can be combined through Boolean operations because regular tree languages are closed under union, intersection, difference, and complement [2306.08506]. This is especially relevant when prior knowledge is modular—for example, translational invariance, dimensional restrictions, or known motifs.

Domain priors can also be explicitly scientific rather than purely structural. In adsorption thermodynamics, a corpus-based prior in Bayesian Machine Scientist was replaced by a thermodynamic prior that penalized violations of constraints such as
\[
\lim_{p\to 0} f(p) = 0,\qquad \lim_{p\to 0} f'(p) < \infty.
\]
These constraints were incorporated as soft penalties in the Bayesian prior rather than as hard feasibility rules, because hard constraints “severely hindered the search process,” whereas soft constraints preserved connectivity of the search space [2301.11919]. This use of priors illustrates a recurrent theme in Bayesian symbolic regression: background knowledge changes the posterior distribution itself, rather than merely modifying a downstream fitness score.

## 3. Inference algorithms and computational hardness

The posterior over symbolic expressions is transdimensional, combinatorial, and typically multimodal, so Bayesian symbolic regression has been developed through a range of approximate inference algorithms. Classical Bayesian symbolic regression uses Metropolis-Hastings and reversible-jump MCMC over symbolic trees, with proposal moves such as Grow, Prune, Delete, Insert, ReassignOperator, and ReassignFeature. Reversible-jump updates are required because the number of parameters changes when tree structure changes, for example when linear-transform nodes are inserted or removed [1910.08892].

Bayesian Machine Scientist-style systems also perform MCMC over expression trees, using detailed-balance-preserving moves such as node replacement, root addition/removal, and elementary tree replacement [2301.11919]. In missing-physics workflows, RJMCMC has been used as the second-stage interpretability mechanism after training a neural network inside a universal differential equation, yielding posterior samples over symbolic trees instead of a single post-hoc equation [2603.14918]. Sequential Monte Carlo has also been proposed for Bayesian symbolic regression, using adaptive tempering, probabilistic selection, stratified resampling, rejuvenation, and a normalized marginal likelihood score to approximate the posterior over expressions under noise [2512.10849].

Other Bayesian formulations exploit partial conjugacy or continuous relaxations. In polynomial neural networks and polynomial neural ODEs, the inference target is a posterior over weights and biases, which is then propagated to a posterior over recovered polynomial coefficients; the compared methods were Laplace approximation, Hamiltonian Monte Carlo and NUTS, and variational inference, with Laplace found to be the best method for that class of problems [2308.10892]. VaSST replaces discrete operator and feature assignments by Binary Concrete and Gumbel-Softmax relaxations in “soft symbolic trees,” then optimizes a variational ELBO with black-box variational inference [2602.23561]. Bayesian SISSO keeps the expensive sure independence screening stage deterministic and reformulates only the sparsifying operator stage as Bayesian inference over the screened support space, enabling exact posterior enumeration after screening [2606.04042].

The computational difficulty of all such methods is illuminated by the formal hardness result for symbolic regression. Symbolic regression is posed as
\[
f^\star = \arg\min_{f \in \mathcal{F}} \mathcal{L}\left(\mathbf{y}, f(\mathbf{x})\right),
\]
with decision version
\[
\exists f \in \mathcal{F} : \mathcal{L} \left( \mathbf{y}, f(\mathbf{x}) \right) \leq \epsilon.
\]
The optimization problem is NP-hard, and the decision problem remains NP-complete even under the restricted primitive set \(\mathcal{P}=\{+, x_1,\dots,x_d\}\), \(\epsilon=0\), and a single observation [2207.01018]. This suggests that exact posterior normalization or exact MAP search over realistic expression spaces is generally intractable, so Bayesian symbolic regression is usually implemented through approximation, restriction of the search space, or both.

## 4. Uncertainty quantification, ensembles, and theoretical guarantees

A major distinction between Bayesian symbolic regression and classical symbolic regression is that uncertainty in model structure is treated as a primary output rather than a nuisance. The physicist-oriented formulation emphasizes that the posterior over equations is the “true object of interest,” and that the full predictive distribution requires averaging over sampled models rather than relying on a single winner. This is especially important when \(p(\hat m\mid D)\) is far below 1 and several distinct equations have similar posterior weight, forming a Rashomon set [2507.19540].

This posterior view changes both prediction and interpretation. Bayesian-model-averaged prediction appears explicitly in Bayesian SISSO:
\[
p(y_*\mid\mathbf x_*,\mathcal D_{\mathcal I}) =\sum_{\gamma}p(\gamma\mid\mathcal D_{\mathcal I}) \,p(y_*\mid\mathbf x_*,\gamma,\mathcal D_{\mathcal I}),
\]
where \(\gamma\) indexes screened symbolic supports. The same framework computes posterior inclusion probabilities
\[
P(k\in\gamma\mid\mathcal D_{\mathcal I}) =\sum_{\gamma\ni k}p(\gamma\mid\mathcal D_{\mathcal I}),
\]
which quantify descriptor stability and reveal when a deterministic symbolic descriptor is merely one representative of a broader family of nearly degenerate alternatives [2606.04042].

Structural uncertainty is also explicit in RJMCMC-based missing-physics recovery. There, posterior samples showed robust support for predator-prey interaction terms in Lotka–Volterra dynamics, but also many syntactically different trees encoding the same mathematical idea, including redundant variants and equivalent forms. The posterior therefore distinguishes robust interaction structure from syntactic non-uniqueness [2603.14918].

The Bayesian literature on symbolic regression also includes formal performance guarantees. One account stresses consistency: if the model class contains the true law and the prior does not exclude it, Bayesian symbolic regression selects the true model with probability tending to one as \(N\to\infty\) [2507.19540]. A stronger structural-learning result is the near-minimax posterior concentration theorem for HierBOSSS, where under a well-conditioned expression design and a sub-critical split rule \(p_m\le q<\frac12\), the posterior contracts around the true regression function at a rate
\[
\epsilon_n^2 \asymp \max\left\{ n^{-1}\left(K^\dagger\log p + S^\dagger\log |O|+\log n\right),\ a_n^2 \right\},
\]
yielding near-parametric behavior in well-specified cases and near-minimax behavior in misspecified Hölder cases [2509.19710].

## 5. Scientific applications and domain-specific extensions

Bayesian symbolic regression has been developed for a wide range of scientific tasks in which interpretability, data scarcity, and uncertainty quantification are all material. In adsorption studies, Bayesian Machine Scientist was adapted with a thermodynamic prior and applied to rediscovering Langmuir-like, dual-site Langmuir, and BET isotherms from historical experimental datasets. Adding the thermodynamic prior increased the share of candidate expressions satisfying physically meaningful constraints, although the paper also stressed that incorrect constraints may hinder the search and that runtime increased by about an order of magnitude because constraints were checked symbolically with SymPy [2301.11919].

In dynamical systems, Bayesian polynomial neural networks and polynomial neural ODEs convert symbolic neural models from point estimation to posterior inference under Gaussian likelihood and Gaussian parameter priors. A Gaussian process regression preprocessing step smooths noisy trajectories for neural ODE training, and posterior samples over network parameters are propagated to empirical posteriors over recovered polynomial coefficients. The reported conclusion for that model class was that Laplace approximation was the best balance of accuracy, interpretability, and computational efficiency, especially for noisy data [2308.10892].

Bayesian symbolic regression has also been coupled to experiment design. In Bayesian optimal experimental design for symbolic discovery, the unknown symbolic law is a discrete random model index \(m\in\mathcal M\) with model-specific continuous parameters \(\theta_m\), and the next design point is chosen by maximizing mutual information \(I(y;m\mid x)\), equivalently minimizing predictive entropy \(H(y\mid x)\). Hamiltonian Monte Carlo is used to sample from the model-specific parameter priors or posteriors that define the predictive distribution [2211.15860]. In the fed-batch bioreactor case of Bayesian inference for missing physics, a well-designed experiment produced a posterior concentrated around Monod-like growth laws, whereas a random design left the posterior diffuse and structurally uncertain [2603.14918].

For differential-equation discovery from raw time series, integral Bayesian symbolic regression replaces derivative fitting by comparison of numerically integrated trajectories with observations. The posterior is written over the integrated governing function \(F_i\),
\[
p(f_i \mid D) = p(F_i \mid D) = \frac{1}{Z} \exp{\left[-(F_i, D)\right]},
\]
so candidate differential equations are judged by their integrated solutions rather than by estimated derivatives. The reported results indicate that this integral approach had the best exact-recovery performance and robustness among the compared methods on logistic growth and Lotka–Volterra benchmarks, and it was then used to discover bacterial-growth equations from experimental time series [2511.14388].

Materials and chemistry applications show a complementary use of posterior structure. Bayesian SISSO on an \(X_2YZ\) Heusler-alloy magnetic-moment dataset yielded posterior probabilities over descriptor supports, feature-inclusion probabilities, Bayesian-model-averaged predictions, and near-nominal empirical coverage of 95\% predictive intervals, while exposing competing, physically related descriptor families that deterministic SISSO would render artificially unique [2606.04042]. HierBOSSS extended this structural-learning emphasis to simulated problems, canonical Feynman equations, and a single-atom catalysis dataset, combining full posterior inference with a marginal posterior-based Occam’s window selection rule and a graph-edit structural fidelity metric [2509.19710].

## 6. Related approaches, misconceptions, and unresolved issues

Not every symbolic-regression method that uses a Bayesian criterion is a full Bayesian symbolic regression method. Some methods are explicitly Bayesian-inspired rather than posterior-based. CADSR, for example, uses a Gaussian likelihood and a BIC reward
\[
\text{BIC}(\tau) = k \log(N) - 2 \log(L(\tau)),
\]
with \(k\) defined as the number of nodes in the expression tree plus the number of constant tokens. This yields a Bayesian model-selection surrogate inside reinforcement learning, but it does not maintain a posterior distribution over equations and does not perform posterior inference over expression trees [2406.06751]. Similarly, domain-aware Tree-RNN symbolic regression learns symbol priors from domain corpora and regularizes a policy by KL divergence toward those priors, but it is described as Bayesian in spirit rather than a classical Bayesian posterior model over expressions [2503.09592].

A common misconception is that Bayesian symbolic regression must output a single best formula. Several of the cited formulations argue the opposite. The posterior can remain diffuse because of noise, limited data, or genuine non-identifiability, and the scientifically proper output may then be a sampled ensemble, posterior support probabilities, or a posterior predictive distribution rather than a single canonical equation [2507.19540]. Another misconception is that priors merely encode simplicity. In the literature they also encode operator frequencies, local symbolic grammar, scientific constraints, domain corpora, screening relevance, and weak physical hypotheses such as the Slater–Pauling-inspired prior in Bayesian SISSO [2304.06333][2606.04042].

The unresolved issues are largely computational and epistemic rather than conceptual. Exact inference remains difficult because symbolic regression is NP-hard [2207.01018]. MCMC-based schemes may suffer from slow exploration of highly multimodal transdimensional spaces, motivating SMC, variational inference, and hybrid deterministic-Bayesian decompositions [2512.10849][2602.23561]. Even in the probabilistic framework, there are regimes in which the true equation may be unlearnable from the available data: one treatment explicitly notes a learnability transition above some noise level, where no algorithm can recover the ground truth from the data alone [2507.19540]. A plausible implication is that the mature form of Bayesian symbolic regression is not a universal exact solver for equation discovery, but a family of principled approximate inference procedures that combine structural priors, posterior uncertainty, and tractable search over a provably hard expression space.

Source: https://www.emergentmind.com/topics/bayesian-symbolic-regression