Statistical Foundations of LLMs Workshop · NeurIPS 2024 · LLM auditing & interpretability
Quantifying perturbation impacts for large language models
Workshop paper · University of Cambridge
Paulius Rauba and Qiyao Wei contributed equally.
Statistical Foundations of LLMs and Foundation Models Workshop at NeurIPS 2024 (2024)
Original abstract
We consider the problem of quantifying how an input perturbation impacts the outputs of large language models (LLMs), a fundamental task for model reliability and post-hoc interpretability. A key obstacle in this domain is disentangling the meaningful changes in model responses from the intrinsic stochasticity of LLM outputs. To overcome this, we introduce Distribution-Based Perturbation Analysis (DBPA), a framework that reformulates LLM perturbation analysis as a frequentist hypothesis testing problem. DBPA constructs empirical null and alternative output distributions within a low-dimensional semantic similarity space via Monte Carlo sampling. Comparisons of Monte Carlo estimates in the reduced dimensionality space enables tractable frequentist inference without relying on restrictive distributional assumptions. The framework is model-agnostic, supports the evaluation of arbitrary input perturbations on any black-box LLM, yields interpretable p-values, supports multiple perturbation testing via controlled error rates, and provides scalar effect sizes for any chosen similarity or distance metric. We demonstrate the effectiveness of DBPA in evaluating perturbation impacts, showing its versatility for perturbation analysis.
Distribution-Based Perturbation Analysis separates the effect of changing a prompt from the variability of repeated LLM responses. It compares sampled output distributions through semantic similarities and reports effect sizes and statistical evidence.
Did the prompt change the answer, or did sampling?#
Ask a language model the same question twice and the responses may differ. Now change a word in the prompt and ask again. A difference between the two answers does not, by itself, identify the effect of the prompt edit: some difference could have occurred without changing anything.
Distribution-Based Perturbation Analysis (DBPA) addresses this problem by comparing repeated samples. The target is the change in a response distribution induced by an intervention. This 2024 workshop paper develops that framing for black-box language models and shows how a semantic representation makes the comparison tractable.
The paper is useful for understanding the foundations of the approach. The later ICML 2025 paper, Statistical Hypothesis Testing for Auditing Robustness in Language Models, presents a related development with an explicit raw-output permutation procedure and additional auditing case studies. They are listed separately here because they are separate publication records.
From text outputs to comparable distributions#

Original Figure 1. Repeated reference responses describe ordinary variability, while comparisons with perturbed responses reveal potential distribution shifts. Source: Section 2.4, CC BY 4.0.
The complete space of text outputs grows exponentially with vocabulary size and sequence length. Estimating a full distribution over every possible answer is therefore impractical. Exact wording is also an imperfect target: two very different strings may express the same recommendation.
DBPA instead draws responses from the original and perturbed conditions, represents them through a semantic similarity function, and compares the resulting empirical distributions. Similarities between reference responses capture variation that is already present. Similarities between reference and perturbed responses capture how the intervention relates to that baseline.
This produces a practical four-stage workflow:
| Stage | Purpose |
|---|---|
| Response sampling | Collect multiple responses under each condition. |
| Distribution construction | Convert responses into comparable semantic similarity measurements. |
| Distributional comparison | Quantify a discrepancy between the empirical distributions. |
| Statistical inference | Evaluate the evidence for an intervention effect under the chosen testing procedure. |
The distinction between effect size and statistical evidence is central. An effect size describes the magnitude of the measured change. A p-value addresses how surprising the observed statistic would be under a specified null model. Neither quantity is a direct score of whether an answer is correct.
What can count as a perturbation?#
The formulation accommodates changes to the input and to the system being queried. A researcher might alter a prompt instruction, substitute information, or compare system configurations. The interface requirement is the ability to sample outputs, rather than access model weights or gradients.
That flexibility makes DBPA relevant to API-only language models, where conventional gradient-based sensitivity analysis is unavailable. It also shifts the emphasis from inspecting a memorable pair of examples to collecting enough repeated observations to characterize variability.
What this workshop paper establishes#
The contribution is a statistical formulation of perturbation analysis and a practical route through Monte Carlo sampling and semantic comparison. The paper illustrates that route with LLM perturbation experiments and discusses choices of similarity and discrepancy measures. Its purpose is to make response changes measurable under stochastic generation.
An audit still needs a substantive definition of a desirable change. A model should often respond differently when relevant evidence changes, while remaining stable when an irrelevant detail changes. Detecting an effect establishes neither improvement nor harm without that application context.
For implementation, use the exact procedure associated with the paper being reproduced. In particular, repeated pairwise similarities share underlying response samples, so they should not automatically be treated as independent observations. The later ICML paper explicitly discusses this dependence and performs permutation testing at the raw-output level.
Scope and limitations#
The semantic representation determines which differences the method can see. An embedding may underrepresent a factual distinction that matters to a user, and a low-dimensional summary inevitably discards information. A failure to detect change is therefore not proof that the full text-generation distributions are identical.
Sampling also costs model calls. The number of draws affects precision and statistical power, and comparisons require stable model and decoding configurations. Testing many perturbations introduces multiplicity; interpreting many unadjusted p-values as separate discoveries would defeat the purpose of a statistically grounded audit.
These qualifications are part of using the framework correctly. DBPA offers evidence about sampled behavior under specified interventions, rather than a global certificate of robustness.
Questions about the paper#
Can this work without access to model weights?#
Yes. DBPA is designed around black-box sampling. It requires responses and a way to compare them, rather than internal activations or parameter gradients.
Does a small effect size mean an answer is safe?#
No. Stability and safety are different properties. A consistently incorrect answer can be stable, and a correct answer may need to change when the prompt provides new evidence.
Which version should I cite?#
Cite this workshop paper when referring specifically to its formulation or experiments. When using the later ICML method or its case studies, cite Statistical Hypothesis Testing for Auditing Robustness in Language Models.
Source and publication context#
This page summarizes arXiv:2412.00868, presented at the Statistical Foundations of LLMs and Foundation Models Workshop at NeurIPS 2024. Sections 2–3 describe the distributional formulation and procedure. The paper marks Paulius Rauba and Qiyao Wei as equal contributors.
Use in your work
Cite this paper
Cite the original research below. This generated explanation is a reading aid.
Rauba, P., Wei, Q., & van der Schaar, M. (2024). Quantifying perturbation impacts for large language models. Statistical Foundations of LLMs and Foundation Models Workshop at NeurIPS 2024. https://arxiv.org/abs/2412.00868
BibTeX
@inproceedings{rauba2024quantifyingperturbationimpacts,
title = {Quantifying perturbation impacts for large language models},
author = {Rauba, Paulius and Wei, Qiyao and van der Schaar, Mihaela},
year = {2024},
booktitle = {Statistical Foundations of LLMs and Foundation Models Workshop at NeurIPS 2024},
eprint = {2412.00868},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2412.00868}
}