Why identical queries to LLMs produce different answers and how to handle it
An identical query to an LLM does not guarantee an identical answer: the result is altered by phrasing, randomness, and specifics of GPU computations.

Rephrasing can change the answer even if all conditions and numbers are preserved. In a study by Fagih and co-authors, the model made errors in 23% of individual cases after rephrasing, though it solved the original tasks correctly. The average accuracy remained nearly unchanged, creating a false sense of reliability.
A study by An and Yin describes Prompt-Reverse Inconsistency: a model may label the same option as both correct and incorrect if the question is phrased differently. The words "correct" and "incorrect" do not function for it as strict logical values—probabilities for text continuation are recalculated from scratch.
Setting temperature = 0 also does not guarantee reproducibility. With dynamic batching, queries end up in different groups, and changes in the order of floating-point number operations create minor discrepancies. These can accumulate and lead to a different answer.
The result is also influenced by the reuse of the KV-cache. The source states that with FP16, it alters the generation trajectory in 37.4% of cases, and with 4-bit quantization—in 82.5%. Therefore, average accuracy is insufficient: it is important to check the stability of answers for each question.





