Testing with Generative AI study guide

Non-Determinism in LLMs

Non-determinism in Generative AI means that providing the exact same input prompt to the model multiple times may result in different output text across runs, which can make strict string assertions brittle for some tasks.

Practical example

Because LLMs sample from a probability distribution, the output can vary depending on sampling, model implementation and execution conditions. Even at 0.0, floating-point math optimizations on GPUs can occasionally cause slight output variations in massive models.

Exam scenario and common trap

Question: A regression test suite for a GenAI feature is highly flaky (failing 30% of the time). What is the primary cause? The Trap: "The test environment network is unstable." The Correct Answer: Inherent model variation and overly strict exact-string assertions are possible causes, but unstable networks, test data or other dependencies may also be responsible. Investigate the failures before choosing a fix.

Related syllabus sections cover this topic. Reference sections: 3.1.4. See the official ISTQB syllabus for exam scope. Examples are independent; QA-ace is not affiliated with ISTQB.