How much of an LLM’s score is the prompt’s wording? Variance decomposition with IMMBA

LLM
evaluation
statistics
prompt-engineering
opensource
A mean score per configuration hides where the variation comes from. IMMBA fits a linear mixed model with the prompt as a random effect and bootstraps it, and on 21,168 human-rated answers it attributes 23.2% of the variance to the configuration, 7.2% to the wording of the prompt and the rest to noise.
Author

Pedro Carvalho Brom

Published

April 17, 2026

Code repositorypcbrom/immba

Someone on your team rewords one sentence of a prompt without changing what it asks, reruns the evaluation, and the average score moves by a few tenths of a point. Is the new prompt better, worse, or the same prompt drawn a second time? Most evaluation reports cannot say, because they ran one phrasing and reported one mean per configuration. The same reports then rank models on gaps of a few tenths, and nobody checks whether those gaps are larger than what the wording alone produces.

IMMBA, which stands for Integrated Mixed Models with Bootstrap Analysis, is a framework for measuring exactly that. I developed it with Vinícius Di Oliveira and Li Weigang, and we presented it at WEBIST 2025 (DI OLIVEIRA; BROM; WEIGANG, 2025). The paper has a page on this site, IMMBA, and every number below comes from it. Its question is not which model is best but how the total variation in a score splits between what you configured, how you asked and what you cannot control.

This post expands a LinkedIn post of April 17, 2026: IMMBA and the variance in LLM scores.

A task where errors cost money

The test bed was structured classification under the Mercosur Common Nomenclature (NCM), the commodity code system of the Mercosur countries, based on the Harmonized System of the World Customs Organization. A wrong code is not a stylistic flaw, it can carry fiscal or legal consequences. The items came from descriptions of goods captured from Brazilian electronic invoices, and each answer was produced inside a retrieval-augmented generation (RAG) pipeline.

The design was a full factorial. Five models, gpt-4o-mini, deepseek-chat, TeenyTinyLlama, gemini-2.0-flash and Mistral-7B, were crossed with three temperatures (0.1, 1.0 and 1.9), three top-p thresholds (0.1, 0.5 and 0.9) and two retrieval methods, conventional semantic retrieval and a variant with metadata filtering. A power analysis for a medium effect (Cohen’s f = 0.25, \alpha = 0.05, power 0.8) called for 196 replicates per condition. The count of conditions needs a word of transparency. Five models times three temperatures times three top-p values times two retrieval methods gives 90, but the paper writes the design as 3 × 3 × 6 × 2 = 108, and the experimental_design.py script in the repository lists six models, not all of them the five named in the results. I cannot settle the discrepancy from the material at hand, so I report the paper’s figures as it gives them. The total of 21,168 answers is 196 × 108. Trained human raters scored every answer on four 0 to 10 scales, quality, agreement with an expert baseline, accuracy against the gold label and hallucination, where lower is better. Disagreements between raters were adjudicated.

The model behind the split

The core of IMMBA is a linear mixed model. The configuration factors and their interactions enter as fixed effects, and the prompt enters as a random effect, a draw from the population of ways the same instruction could have been phrased:

Y_{ijk,pr} = \mu + A_i + B_j + C_k + R_r + (AB)_{ij} + (AC)_{ik} + (BC)_{jk} + (ABC)_{ijk} + P_p + \varepsilon_{ijkr}

Here A_i is the model, B_j the temperature, C_k the top-p, R_r the retrieval method, P_p \sim N(0, \sigma^2_P) the prompt and \varepsilon \sim N(0, \sigma^2_e) the residual. Once fitted, the total variance of a score splits into three parts:

\mathrm{Var}(Y) = \sigma^2_f + \sigma^2_P + \sigma^2_e

The scores are bounded and, in this study, multimodal, so the paper does not rely on the model’s parametric standard errors alone. It resamples the data with replacement 1,000 times, refits the model on each resample and builds confidence intervals from the empirical distribution of the estimates. The notebook in the repository fits the model with statsmodels. The excerpt below is a reduced version of the equation, without the interactions with the retrieval method (rag_type) and with the random intercept grouped by attempt, which in experimental_design.py indexes the 196 replicates:

formula = "value ~ model + temperature + top_p + rag_type + model:temperature + model:top_p + temperature:top_p"

md_mlmm = smf.mixedlm(formula, data=df_long, groups=df_long['attempt'],
                       re_formula="~1", vc_formula={"response_type": "0 + C(response_type)"})

What the split says

The fitted components were \sigma^2_f = 2.14 for the fixed effects, \sigma^2_P = 0.66 for the prompt and \sigma^2_e = 6.42 for the residual, a total of 9.22. In shares, configuration accounts for 23.2% of the variance, the wording of the prompt for 7.2% and the residual for 69.6%.

The shares are easier to feel on the scale of the scores. The square root of 0.66 is about 0.81, so the prompt component alone has a standard deviation of roughly 0.8 points on a 0 to 10 scale. Now go back to the reworded prompt. In the paper’s descriptive table, gpt-4o-mini averages 4.6 in quality and gemini-2.0-flash 4.3, a gap of 0.3 points. That comparison is mine, not the paper’s, and it sets a pooled variance component against means of one metric, so it is a sense of scale rather than a test. It is still enough to show why a ranking produced with one phrasing of the prompt can be a fact about that phrasing.

The residual deserves the same attention. At 69.6%, most of the variation is neither configuration nor wording. The paper names what sits inside it, the stochastic output of the models and the subjectivity of human scoring, and the paper does not separate the two. Adding the rater as a further random effect is one of the extensions the paper proposes. Until then, a single score per configuration samples a distribution that is mostly noise, and reporting it as if it were the configuration’s value overstates what was learned.

Effects that only show up together

The fixed part has its own lesson, because the factors that look inert alone are not inert in combination. Temperature had minimal main effects, but its interaction with specific models, TeenyTinyLlama in particular, amplified variability. The retrieval method interacted with the model, with the metadata-filtering strategy yielding higher precision and less hallucination, especially in smaller models. In the bootstrap table of fixed effects, the retrieval term, labelled retrieval[T.Common], carries a coefficient of −2.29 with a 95% interval from −2.45 to −2.12, larger in absolute value than any of the model terms. A top-p of 0.9 marginally reduced precision in some configurations.

The model rows tell a familiar story with numbers attached. gpt-4o-mini and deepseek-chat combined the highest quality, agreement and accuracy with hallucination around 2.3 to 2.4, a level gemini-2.0-flash also reached. Mistral-7B averaged 1.9 in accuracy and 5.5 in hallucination, which the paper judges unsuitable for a task where a code has to be right. Across all models, quality, agreement and accuracy were almost interchangeable, with Spearman correlations between 0.955 and 0.977, while hallucination correlated only weakly and negatively with them, at about −0.28. In this task, three of the four scales carry close to the same information and the fourth carries something else.

What to change in your own evaluation

None of this needs exotic tooling. Treat the prompt as a sample, not a constant, by writing several phrasings of the same instruction and running all of them. Fit a model that lets the prompt vary at random, so its share of the variance is estimated instead of silently folded into the comparison. Replicate each condition enough to estimate dispersion, and put a bootstrap interval around every effect you intend to act on. Look for interactions before you conclude that a parameter does nothing.

The paper is open about its limits. NCM classification is a structured domain, and the framework still has to be tried on less structured and multilingual tasks. Human scoring adds subjectivity even under a standard protocol. The residual is large enough to motivate better tools for quantifying uncertainty.

The same habit of asking where a score’s variation comes from runs through two related studies. The post on back-translation shows an overlap metric rewarding a model that did not translate, and the post on TraCE-LLM separates a correct answer from the quality of the reasoning behind it.

A comparison run with a single phrasing of the prompt answers a narrower question than the one usually asked of it. It says which configuration won with that wording, and the wording is a sample of one.


Paper. DI OLIVEIRA, V.; BROM, P. C.; WEIGANG, L. IMMBA: Integrated Mixed Models with Bootstrap Analysis - A Statistical Framework for Robust LLM Evaluation. In: INTERNATIONAL CONFERENCE ON WEB INFORMATION SYSTEMS AND TECHNOLOGIES, 21., 2025. Proceedings […]. [S. l.]: SciTePress, 2025. p. 92-102. DOI: 10.5220/0013819400003985.

Code. Experimental design, model calls, data aggregation and the mixed-model and bootstrap analysis, in Python notebooks and scripts.

References.

DI OLIVEIRA, V.; BROM, P. C.; WEIGANG, L. IMMBA: Integrated Mixed Models with Bootstrap Analysis - A Statistical Framework for Robust LLM Evaluation. In: INTERNATIONAL CONFERENCE ON WEB INFORMATION SYSTEMS AND TECHNOLOGIES, 21., 2025. Proceedings […]. [S. l.]: SciTePress, 2025. p. 92-102. DOI: 10.5220/0013819400003985.

The source is open on GitHub: github.com/pcbrom/immba, and the paper is at DOI 10.5220/0013819400003985. I write about this kind of work, scientific method, statistics, and AI applied with rigor, on LinkedIn: linkedin.com/in/pcbrom.