03 · What You Need to Know
Understanding and Managing Nondeterminism in AI Research
What does nondeterministic mean in generative AI?
A deterministic computational process produces the same result when executed with the same relevant inputs and state. A nondeterministic process may produce different results even when those conditions appear identical.
Generative AI systems frequently use probabilistic methods to select output tokens. Rather than always choosing the single most probable continuation, a model may sample from a distribution of possible continuations.
As generation proceeds, an early difference can influence subsequent tokens and produce substantially different responses.
However, observed variability should not automatically be attributed to random sampling. Backend implementation differences, changing model configurations, hidden application instructions, or differences in conversation state may also contribute.
Stochastic generation
Output variation associated with probabilistic sampling under a specified generation procedure.
Observed response variability
Differences between outputs that may arise from stochastic generation, changing system conditions, or both.
The distinction matters because researchers may observe changing responses without being able to isolate their precise cause.
Why does nondeterminism matter for scientific conclusions?
Suppose an AI model answers a question correctly in one trial but incorrectly in another. Reporting only the successful response would suggest a level of reliability that the observations do not support.
The opposite problem is equally possible. A researcher who encounters one incorrect response might conclude that the model cannot perform the task, even though other executions produce correct answers.
For some studies, the relevant outcome is the probability of success across repeated executions. For others, the central question concerns the consistency of classifications, the range of possible responses, or the frequency of particular failure types.
These are different quantities and should not be collapsed into one measure.
Researchers therefore need to define what they are estimating before deciding how nondeterministic outputs should be collected and analyzed.
Which AI settings can influence response variability?
Several settings and system characteristics may affect output variation. Their availability and behavior differ among providers.
| Factor |
Potential influence |
Research consideration |
| Temperature |
May alter the distribution used for token selection |
Record the configured value and verify provider-specific behavior |
| Top-p sampling |
May restrict the cumulative probability mass considered during sampling |
Document the value when configurable |
| Random seed |
May support repeatable sampling under certain implementations |
Record the seed and any reproducibility limitations |
| Model version |
May change model behavior and output distributions |
Record the exact available identifier and testing period |
| Conversation history |
Changes the context supplied to the model |
Control or deliberately vary prior messages |
| System and developer instructions |
May constrain response behavior or interpretation |
Preserve accessible instructions and acknowledge hidden ones |
| External tools or retrieval |
May introduce changing information or tool results |
Document tool access, retrieved material, and execution conditions |
Not every platform exposes these controls. Researchers should report the settings they could observe and avoid assuming that unavailable parameters were fixed at particular values.
Does setting temperature to zero make AI deterministic?
Not necessarily.
Temperature zero commonly produces more concentrated token selection and may reduce variation. However, the exact implementation is provider-dependent, and identical outputs are not guaranteed across all services or computing environments.
Some systems may exhibit variability due to numerical computation, infrastructure differences, changing backend configurations, or other implementation factors.
Researchers should distinguish a configured temperature value from an empirically demonstrated level of output stability.
If a study depends on deterministic behavior, that property should be tested under the actual experimental conditions rather than assumed from a parameter setting.
How many repeated generations are necessary?
There is no universally sufficient repetition count.
The appropriate number depends on the expected variability, the number of evaluation items, the precision required, and the study's inferential objectives.
A small pilot may reveal whether repeated outputs differ substantially and help estimate the resources needed for the main study.
For example, a researcher might initially collect five generations per prompt across a representative subset of tasks. This would be an exploratory design choice, not an established methodological minimum.
Subsequent repetitions should be justified using the desired precision, statistical power, or another relevant design criterion.
The distinction between unique prompts and repeated generations is particularly important. Repeating one prompt one hundred times does not provide the same evidence as testing one hundred different prompts.
A more detailed discussion of how many times researchers should repeat an AI prompt addresses the design and statistical implications of different repetition counts.
What should count as a different AI response?
Not every textual difference is methodologically meaningful.
Two responses may use different words while communicating the same conclusion. Conversely, two responses may appear linguistically similar while differing in factual accuracy, classification, or practical implications.
Researchers should therefore define response equivalence according to the task being evaluated.
| Evaluation task |
Possible stability criterion |
| Multiple-choice questions |
Whether the selected answer changes |
| Document classification |
Whether the assigned category changes |
| Numerical problem solving |
Whether the numerical result falls within a predefined tolerance |
| Research summarization |
Whether central factual claims remain consistent and supported |
| Qualitative coding |
Whether the assigned codes or interpretations differ meaningfully |
| Open-ended advice |
Whether substantive recommendations or consequential claims change |
For subjective tasks, researchers may need a coding rubric and trained evaluators. Agreement among evaluators should be considered separately from agreement among AI responses.
How should researchers statistically analyze repeated AI outputs?
The analysis should reflect the experimental design and the outcome being measured.
For a binary outcome such as correct versus incorrect, researchers may estimate the proportion of successful generations. For categorical classifications, they may examine the distribution of labels or the proportion of repeated trials producing the same category.
For numerical scores, the mean, standard deviation, and distribution of outcomes may be relevant.
However, repeated generations from the same prompt share an evaluation item and may not be independent observations. Treating all outputs as unrelated can underestimate uncertainty, particularly when conclusions are intended to generalize across tasks.
Hierarchical models, cluster-aware uncertainty estimates, or item-level summaries may be appropriate, depending on the design.
Researchers should also distinguish variability within a prompt from variability between prompts. A model may be highly stable on straightforward tasks but inconsistent on ambiguous or difficult ones.
Can researchers use majority voting to handle variable responses?
Majority voting is one possible aggregation strategy, but it changes the quantity being evaluated.
If a model produces five classifications and three agree, selecting the majority label describes the performance of a five-generation aggregation procedure rather than the performance of a single generation.
This distinction should be made explicit.
Majority voting may improve performance under some conditions, but it does not guarantee correctness. Repeated outputs can share systematic errors, and a frequently generated answer can still be wrong.
Researchers should prespecify the aggregation rule and report whether performance estimates refer to individual responses or aggregated decisions.
What if the model changes during data collection?
Repeated testing assumes that the conditions being compared are sufficiently stable for the intended inference.
If a provider changes the underlying model or application configuration during the study, observed differences may reflect both generation variability and system changes.
Researchers should record the model version, preserve available configuration details, and document the dates and times of testing.
When a meaningful update is identified, it may be necessary to analyze results separately by version or testing period.
If the change cannot be characterized, the resulting uncertainty should be acknowledged rather than attributed exclusively to nondeterminism.
Does nondeterminism make AI research irreproducible?
No. Reproducibility does not always require identical individual outputs.
For a stochastic system, a defensible replication may reproduce the testing procedure and obtain statistically compatible patterns of results without generating the exact same text.
Researchers should distinguish exact output replication from reproducibility of the experimental method and stability of the estimated findings.
This distinction becomes especially important when studying AI systems that change over time.
04 · A Practical Example
Measuring Variation in AI-Generated Research Classifications
Hypothetical Example
Repeated classification of educational research abstracts
A researcher evaluates whether a language model can classify educational research abstracts into qualitative, quantitative, or mixed-methods categories.
The study includes 80 abstracts with reference classifications established through a documented expert-review procedure. Each abstract is submitted ten times using the same prompt template and accessible model settings, producing 800 responses.
The researcher wants to estimate classification accuracy and determine how frequently the model changes its classification for the same abstract.
Step 1: Define the test conditions
The researcher records the model identifier, instructions, sampling settings, and testing period. Each generation starts with the same defined conversation context.
Step 2: Preserve every response
All classifications are retained, including incorrect outputs, refusals, and responses that do not follow the requested format. The handling of invalid responses is specified in advance.
Step 3: Examine within-abstract variation
For one abstract, suppose the model produces the correct classification in eight trials and an incorrect classification in two. The observed success proportion for that abstract is 80%, although ten trials provide only a limited estimate of its underlying success probability.
Step 4: Analyze performance across abstracts
The researcher calculates accuracy for each abstract and summarizes performance across the 80 items. The analysis distinguishes variation within abstracts from differences in difficulty between abstracts.
Step 5: Report accuracy and stability separately
The final report presents the estimated accuracy and a prespecified measure of response consistency, with appropriate uncertainty estimates and limitations.
The study does not treat the 800 generated responses as 800 independent abstracts. Its design contains 80 distinct evaluation items, each tested ten times.
By preserving this structure, the researcher can investigate both the model's average performance and the extent to which individual outputs vary.