Foundation Prior: How LLM Outputs Reshape Bayesian Beliefs
Deriving the Foundation Prior framework from scratch — why synthetic data is not real evidence, the constrained optimization that produces exponential tilting, the trust parameter λ, prompt heterogeneity through mixtures, calibration via real data, and the final posterior — all step by step with one coin example.
This is Part 2. If you have not read Mathematical Prerequisites for Foundation Prior, start there — we will use parameters, likelihood, Beta distributions, KL divergence, entropy, exponential tilting, marginal likelihood, and the law of total variance throughout this post.
The Running Example
We continue with the same coin. The parameter is unknown. Our prior belief is:
This means we lean toward but not strongly — it behaves like having seen 1 pseudo-head and 1 pseudo-tail.
What Are We Even Modeling?
The paper revolves around seven symbols, and we need to fix their meaning before anything else. The unknown parameter is the thing you care about — in our coin example it is , but in real applications it might be a sales trend, consumer preference, or treatment effect. Real data is data from the actual world. Synthetic data is data generated by the LLM. The prior represents your belief before seeing any data. The likelihood measures how likely a dataset is under a given value of . The foundation prior is your updated prior after incorporating synthetic data. And the trust parameter controls how much weight synthetic data receives. Every derivation in this post uses these seven objects and nothing else.
The Standard Bayesian World (Baseline)
Before LLMs exist, everything is straightforward. You have a prior , you observe real data , and you update via Bayes:
The prior is your belief, the likelihood is what the world tells you, and the posterior is their combination. Everything is clean because data comes from reality.
What Changes With LLMs?
Now instead of real data, you generate synthetic data:
where is a prompt and is the LLM’s distribution over outputs.
In real life, you ask something like: “Generate consumer choice data for Chicago ice cream sales.” The model generates something. But here is the key: you do not accept just any output. You tweak the prompt until the output matches what you expect. This is epistemic circularity, and it is the core reason the entire Foundation Prior framework exists.
The circular loop works like this. You start with beliefs about . Those beliefs shape how you write the prompt. The prompt shapes what the LLM generates. You then judge the output against your expectations — which come from the same beliefs you started with. If the output looks wrong, you reject it and re-prompt. If it looks right, you accept it. So the “data” you end up with has been filtered by the very beliefs it is supposed to update. Your prior determined what you accepted, and now you want to use that accepted output to update your prior. That is circular.
In standard Bayesian inference this never happens. Real data comes from nature — it does not care about your beliefs. But synthetic data is different. It passed through a subjective filter. If you treat it like real evidence, you are essentially confirming your own assumptions back to yourself. The entire paper is built to handle this problem: how do you extract genuine information from synthetic data without falling into a self-reinforcing loop?
The Anticipation Distribution
Before generating synthetic data, the user already expects certain patterns. Mathematically, the user anticipates data that looks like:
This is called the prior predictive distribution. It represents all possible data weighted by your prior beliefs. For each possible , you weight by and integrate. This gives expected data patterns. We integrate because you do not know — so you average over all possible weighted by belief. That is what marginalization means.
In our coin example, if your prior is , you expect roughly equal heads and tails, but with some spread.
Prompt Engineering as Optimization
The user compares generated data with anticipated data using a divergence , where is a distance measure — it could be KL divergence, moment mismatch, or likelihood difference.
Why introduce ? Because users reject outputs they dislike. Mathematically, prompt engineering becomes gradient descent:
In real life, you generate data, check if it “looks right,” modify the prompt, and repeat until — you stop when output matches your expectation. This is selection. This is the source of subjectivity.
Why We Cannot Use Normal Bayes on Synthetic Data
Suppose the synthetic dataset we accepted is 8 Heads and 2 Tails. Call this . The likelihood is:
Normal Bayes would say:
That gives with mean . This strongly pushes belief toward “biased coin.”
The paper says: that is wrong. Why? Because you generated the data. You wrote the prompt, rejected weird outputs, and accepted one that looked plausible. This is not random data from nature. It is filtered imagination. So we must downweight it.
The Core Theoretical Move
This is the most important mathematical part of the entire paper.
After synthetic data is generated, we want beliefs about . But we do NOT want to treat synthetic data like real data. So instead of normal Bayes, the paper sets up a constrained optimization problem.
The idea in plain English
Find a new belief that changes your old belief as little as possible, but still makes the synthetic data “not too implausible.” That sentence becomes math.
What is ?
is the new belief distribution after using synthetic data. Before synthetic data, you believed . After synthetic data, you will believe . It is a function (a probability distribution) over .
”Make synthetic data not too implausible” becomes a constraint
The paper uses:
Let us unpack what this means. By definition, . Here , so:
Substituting the log-likelihood we derived:
The interpretation is this: for each possible , compute “how well explains the synthetic data” (that is the log-likelihood), weight it by how much you believe that (that is ), and average. So the constraint means: on average, under my new belief, the synthetic dataset should not look too unlikely.
Why log-likelihood instead of raw likelihood?
The constraint uses rather than for three reasons. First, additivity: likelihood multiplies across independent observations, and log turns products into sums (), which makes the optimization tractable. Second, information-geometric duality: KL divergence and log-likelihood both live in the geometry of exponential families, and using log ensures the constraint and the objective operate in the same mathematical space — this is what makes the Lagrangian solution clean. Third, convexity: log-likelihood is often concave in , which makes the optimization well-behaved; if we used raw likelihood, the problem could become non-convex and the closed-form solution would not exist.
”Change my belief as little as possible” becomes KL minimization
The paper chooses KL divergence:
If , KL = 0 (no change). Bigger KL means you moved farther from your prior beliefs. So “minimal change” becomes .
We also require to be a valid probability distribution: and .
The full optimization problem (coin version)
Putting it together:
subject to:
That is exactly the paper’s key move, now fully instantiated for the coin.
Solving the Optimization Step by Step
Step 1 — Build a Lagrangian
We turn constraints into penalties using multipliers: for the expected log-likelihood constraint, and for normalization.
Step 2 — Take the functional derivative with respect to
We use these derivative facts: the derivative of with respect to is , and the derivative of with respect to is .
First expand the KL integrand:
Now differentiate :
Set to zero at the optimum:
Rearrange:
Step 3 — Exponentiate to solve for
Now we use three identities: , , and is just a constant (same for all ). So:
where is a constant chosen so that . That gives the final form:
This is the foundation prior form. Nothing was assumed. It came from optimization.
Making It Concrete: Coin Numbers
We have and .
Raise likelihood to :
Multiply:
That is a Beta distribution again — this is Beta-Bernoulli conjugacy at work. Because the Beta prior and the Bernoulli/Binomial likelihood belong to the same exponential family, multiplying them always yields another Beta. The posterior stays in the same family as the prior, which is exactly what “conjugate prior” means.
In the coin example, conjugacy gives us a completely explicit foundation prior — no numerical integration needed.
Numerical check:
Interpreting the Foundation Prior
What Beta(4, 2.5) means
For a Beta distribution, gives pseudo-heads and gives pseudo-tails.
Before synthetic data, means 1 pseudo-head and 1 pseudo-tail. Very weak belief, centered at 0.5. After synthetic data with , means 3 pseudo-heads and 1.5 pseudo-tails.
Not 8 heads. Not 2 tails. Because downweighted them. The effective heads are and the effective tails are . Adding the prior pseudo-counts of 1 head and 1 tail gives total heads of and total tails of . Converting back to Beta parameters (, ) gives and — exactly .
What this distribution looks like
The mean is:
Your best guess is now . Not 0.8. Not 0.5. Somewhere in between. You started with “coin is roughly fair,” synthetic data suggested “looks biased toward heads,” but you did not fully believe it. So you updated gently. represents that gentle shift.
The paper’s entire point: synthetic data should act like a small number of pseudo-observations, not real data. shows exactly that. Synthetic data did not dominate. It just tilted the prior.
Understanding — The Trust Parameter
What does mechanically
Recall:
Since the coin likelihood is , raising to power gives . So synthetic data behaves like heads and tails. literally scales the data size.
Concrete interpretation
If synthetic data had 8 heads and 2 tails, then the effective heads are and the effective tails are . So controls how many synthetic flips you act like you observed.
Why is necessary
This is the core philosophical insight of the paper. Imagine synthetic data size = 10,000 flips. If we used normal Bayes (), you would become almost completely certain about . But synthetic data is generated by you. You can generate infinite synthetic data. So if , you can make yourself arbitrarily confident without real evidence. That is epistemically dangerous.
Extreme values of
When , synthetic data is ignored entirely and — you fall back to your original prior with zero effective synthetic counts. When is between 0 and 1, you have partial trust — the intended regime — where synthetic contributes effective counts, a fraction of the full synthetic sample. When , synthetic is treated exactly like real data, contributing the full counts. When , you trust synthetic more than real data, which is very dangerous — the effective counts exceed the actual synthetic sample size.
The effective sample size of synthetic data is , so directly controls how much influence synthetic evidence exerts. In our coin example with 10 synthetic flips and , the effective sample size is — you act as though you observed only 2.5 synthetic flips instead of 10. This is the mechanism that prevents epistemic circularity from spiraling: no matter how much synthetic data you generate, caps its effective contribution.
When Real Data Arrives
Suppose after synthetic data, you flip the real coin 10 times and observe 6 Heads, 4 Tails. The real likelihood is:
The final posterior becomes:
We already know that , so:
Real data updates normally, starting from the foundation prior.
Computing it explicitly
We had . Multiply by real likelihood and add exponents:
For :
The mean is . Real data now has strong influence. Synthetic only nudged the initial belief. That is the design.
Prompt Dependence and Mixtures
So far, we assumed one synthetic dataset: 8 Heads, 2 Tails. But imagine you run the simulation again. You might get 8H and 2T on the first run, 6H and 4T on the second, and 9H and 1T on the third. Each run gives a different synthetic dataset, each dataset produces a different foundation prior, and this means your belief depends on the prompt and random generation. That is subjectivity.
Computing each foundation prior
Let throughout.
Case A (8H, 2T):
Case B (6H, 4T):
Case C (9H, 1T):
Different synthetic datasets produce different priors.
The paper’s solution: average over prompts
Instead of trusting one synthetic dataset, the paper proposes averaging across possible prompts. Mathematically:
In coin language, instead of integrating over prompts, we integrate over synthetic datasets. Each dataset gets a weight, and the final prior is the weighted sum of all foundation priors.
The mixture prior
Assume equal weights:
This is a mixture of Beta distributions — no longer a single Beta. It reflects uncertainty about the synthetic generation process.
Mixture mean
Using the law of total expectation from Part 1:
After averaging across prompt/generation variability, our best guess for heads-probability is about 0.60.
Mixture variance
Using the law of total variance from Part 1, total variance has two parts: average within-component variance plus variance of component means.
All three components have , so the denominator is the same for all. The within-component variances are:
The squared deviations from the mixture mean are:
Applying the law of total variance — each term is (within-variance + between-variance) for that component:
The standard deviation is approximately . The mixture is more uncertain than any single component, because it includes both “what is ?” uncertainty and “which prompt/run did I get?” uncertainty.
Why this matters
If you rely on one synthetic dataset, your belief is unstable. If you average over many, your belief becomes robust. This step is about reducing prompt sensitivity.
Updating the Mixture With Real Data
When real data arrives (6H, 4T), two things happen: each component updates normally, and the mixture weights change.
Updating each component
Each Beta prior updates by adding real counts. Component A goes from to with mean . Component B goes from to with mean . Component C goes from to with mean .
Updating the mixture weights
Before real data, the weights were equal: . After real data, Bayes’ rule says:
The term is the marginal likelihood of real data under that component — the Beta-Binomial evidence:
The binomial coefficient cancels when normalizing weights. Computing the evidence ratios gives approximately 0.0007265 for A, 0.0007168 for B, and 0.0006983 for C. The normalized updated weights are , , and . Real data (6H, 4T) slightly favors component A, but not by much — all three prompts are still plausible.
The final mixture posterior
The mixture mean is:
What this shows: two layers of uncertainty
There are two distinct layers of uncertainty operating simultaneously.
Layer 1 — uncertainty about . Even within a single component, you do not know the true coin bias. Each updated Beta is spread out over a range of values. This is ordinary statistical uncertainty.
Layer 2 — uncertainty about which synthetic world is correct. The three components correspond to three different synthetic generation outcomes. Before real data, you had no reason to prefer one over another. After real data, the weights shift — reality starts telling you which synthetic scenario was more plausible. This is epistemic uncertainty about the synthetic process itself.
Real data reduces both layers. It sharpens each component (Layer 1) and concentrates the mixture weights (Layer 2). As real data grows large, the weights eventually concentrate on one component — the synthetic scenario most consistent with reality — and the influence of the other components becomes negligible. In the limit of infinite real data, the mixture collapses and the synthetic starting point no longer matters. This is the robustness guarantee: even if your prompts were unstable or your synthetic data was biased, enough real data will wash out that instability.
Calibrating With Real Data
should not be arbitrary. The paper says: let real data decide how helpful synthetic data was.
What “calibrate” means
You generated synthetic flips. That produced a foundation prior . Then you collect real flips . Now you ask: how much should I have trusted the synthetic flips, given what real flips actually show?
The method
We evaluate different values by how well they predict the real data. Given , your foundation prior is . The probability your model assigns to the real data is:
This is a single number for each — bigger means better. So the calibration rule is:
Choose the trust level that makes real data most plausible after using synthetic data. This is exactly “let reality decide how helpful synthetic data was.”
Why this is independent of
We integrate out. For each possible , we compute how likely real data is, weight by our belief, and average. After integrating, disappears. The result is just a number measuring predictive quality. When we choose , we are not choosing . We are choosing how much we trust synthetic data. So we evaluate how well the entire belief distribution predicts real data.
Explicit formula for the coin-Beta case
We have a prior , synthetic data with heads and tails, and real data with heads and tails. From the foundation prior derivation, .
The evidence for real data under a Beta prior is Beta-Binomial:
Then . In practice you try a grid of values — 0, 0.05, 0.1, 0.2, and so on — and pick the best.
The Final Posterior After Calibration
Once is chosen, you do the final update:
In the coin-Beta case, this is again a Beta:
Synthetic contributes and as soft counts, while real data contributes and as full counts.
Why the framework is self-correcting
The calibration step creates a feedback loop between synthetic and real data. If your synthetic data happened to align well with reality — say synthetic suggested and real flips also point to — then the evidence is maximized at a higher , and synthetic data gets more influence. It earned that influence by being correct.
If synthetic data contradicts reality — say synthetic suggested but real flips point to — then higher values make real data less plausible (because the foundation prior is pulled away from where the real data actually lands). The evidence drops, and shrinks toward zero. In the extreme, if synthetic is completely misleading, calibration sets and the framework gracefully ignores the synthetic data altogether, falling back to a standard Bayesian update with the original prior.
This means you cannot be permanently misled by bad synthetic data, as long as you eventually collect real data and calibrate. The framework does not require you to know in advance whether synthetic data is trustworthy — it lets reality decide after the fact.
Why KL Was the Right Choice
You might ask: why minimize KL? Why not squared distance?
If we measured closeness using squared difference , we would ignore the fact that probabilities must remain positive and that they combine multiplicatively. Squared distance does not respect the geometry of probability distributions. KL divergence does — it compares distributions multiplicatively (via log-ratios), it measures information gain (how many extra bits are needed to encode if you designed your code for ), and critically, it produces a tractable solution.
Csiszar’s I-projection theorem
When you solve “stay as close as possible to prior but satisfy an expectation constraint,” the result is governed by Csiszar’s I-projection theorem: if you measure closeness using KL divergence, and your constraint is linear in the distribution (like an expectation), the unique solution must be:
That exponential form is not chosen — it is mathematically forced by the structure of KL. In our coin case, , so . This is why the foundation prior has the form it does. No other divergence gives this clean exponential tilting structure.
The Gibbs variational principle
There is a dual way to see the same result. The Gibbs variational principle (also called the Donsker-Varadhan variational formula) states:
and the supremum is achieved by the exponential tilt . In our setting, . So the foundation prior is exactly the optimizer in the Donsker-Varadhan formula — the distribution that maximizes expected log-likelihood minus KL cost. The left-hand side of the formula gives the normalizing constant , which is the partition function of the tilted distribution.
This is not a coincidence. The constrained optimization (minimize KL subject to expectation constraint) and the variational formula (maximize expectation minus KL) are Lagrangian duals of each other. They produce the same solution from opposite directions.
Connection to Jaynes’s maximum entropy
The paper’s core optimization is literally relative maximum entropy (also called minimum relative entropy or minimum discrimination information). Jaynes’s Maximum Entropy principle says: when you must choose a distribution satisfying certain moment constraints, pick the one with maximum entropy — the least informative distribution consistent with your constraints. When you already have a prior , the correct generalization replaces entropy with relative entropy: minimize subject to constraints. You are saying: given my old belief , and given that expected log-likelihood must be at least , what is the least informative update?
Normal Bayesian updating can also be derived this way — as minimizing KL divergence subject to exact data constraints. So Bayes’ rule is itself a relative entropy projection. The paper uses that same machinery, but with softened (-weighted) constraints for synthetic data. This framework sits directly inside information geometry, maximum entropy theory, and variational inference. It is not ad hoc.
The Practical Recipe
Here is the paper’s workflow, translated to the coin example.
You begin by picking a real-world likelihood model and a prior — for the coin, that means a Beta prior and Bernoulli likelihood. Next, you generate synthetic datasets using prompts and accept the ones that pass your stopping rule — for the coin, you generate multiple synthetic flip sequences. For each accepted synthetic dataset , you form a foundation prior:
If you want robustness, you combine these by averaging across prompts into a mixture:
Then you collect real data and choose by calibration — picking the that best predicts by maximizing the evidence. Finally, you produce the final posterior using and .
Where This Connects to Broader Theory
To summarize the named results that appear throughout the derivation:
- Csiszar’s I-projection theorem gives the form of the solution: KL minimization under linear constraints uniquely produces exponential tilting.
- The Gibbs variational principle / Donsker-Varadhan formula provides the dual view: the foundation prior maximizes expected log-likelihood minus KL cost, and the partition function falls out as a byproduct.
- Jaynes’s Maximum Entropy principle (in its relative form) explains why KL is the right objective: it produces the least informative update consistent with the synthetic data constraint.
- Beta-Bernoulli conjugacy keeps everything in closed form for the coin example — the foundation prior, the posterior after real data, and the marginal likelihood for calibration all remain Beta or Beta-Binomial.
- Generalized Bayesian updating is the broader framework where likelihood is raised to a power instead of used at full strength — the foundation prior is a special case where the power-likelihood applies only to synthetic data.
- The law of total expectation and law of total variance govern the mixture calculations when averaging across prompt heterogeneity.
It is fundamentally an information-theoretic Bayesian update, and every step uses a named, well-established result.
The Deep Epistemic Insight
The entire paper can be summarized as one philosophical shift. The old view says: LLM gives data. The new view says: LLM gives subjective prior predictive draws shaped by prompt optimization.
Therefore, synthetic outputs belong in the prior layer, not the likelihood layer. And mathematically, they act as exponential tilts of the prior.
If you treat synthetic as real (), you can generate unlimited “data” and become arbitrarily confident — which is not legitimate. So synthetic must behave like prior information (soft, downweighted), not like observations from reality.
That is the key epistemic correction. The mathematical elegance lies in the fact that this correction emerges naturally from a single constrained optimization — minimize KL, satisfy a log-likelihood constraint, and the entire foundation prior framework falls out.
Summary
We derived the Foundation Prior framework entirely from one coin example. Synthetic data cannot be treated like real evidence because it is generated, filtered, and prompt-dependent — so the paper replaces normal Bayesian updating with a constrained optimization: minimize KL divergence from the prior subject to a log-likelihood constraint on synthetic data, which uniquely produces an exponential tilt . The trust parameter downweights synthetic data to prevent manufactured certainty, prompt heterogeneity is handled by averaging foundation priors into a mixture, and is calibrated by choosing the value that best predicts real data. The final posterior combines real data at full weight with synthetic data at weight , giving a principled, self-correcting framework where LLM outputs serve as structured prior information rather than hard evidence.
Previous: Mathematical Prerequisites for Foundation Prior
Next: MoE Load Balancing from Scratch
Enjoyed this post?
Subscribe to get notified when I publish new posts. No spam, unsubscribe anytime.