schristoph.online

AI ยท 3 min read

๐ŸŽ™๏ธ In a fantastic interview 'How AI will change software engineering โ€“ with Mart

๐ŸŽ™๏ธ In a fantastic interview “How AI will change software engineering โ€“ with Martin Fowler” at the Pragmatic Engineer Podcast [1], Martin Fowler highlights the non-determinism introduced by Agentic AI as the big challenge for adoption. So big of a challenge that he compares it to the evolution from assembler code to higher-level programming languages.

๐Ÿค” Indeed, I see a lot of customers struggling with this non-determinism. What is correct? How do I evaluate a system? What about cascading effects in multi-agent systems?

โœ… So I agree with Martin - non-determinism is hard to deal with. However, I slightly disagree with his side remark that non-determinism in non-AI software only happens in esoteric corner cases like race conditions. In a world of distributed systems, non-determinism in the execution - message ordering, timing, partial failures - becomes rather the norm; we just have mechanisms in place by now to keep the observable results predictable despite it.

๐Ÿง  But why is there non-determinism in LLMs in the first place? Agent-level variability layers on top of it - tool results, environment state, and retries all vary between runs - but the model call itself is the base case, so let’s start there. At first glance, it’s obvious: LLMs essentially operate on probabilities, so we get non-deterministic answers. But wait - shouldn’t we get the exact same output with the exact same input? After all, those probabilities are fixed in the LLM and don’t change. ๐ŸŒก๏ธ Yes, but alongside the prompt, the API call carries decoding configuration (usually not visible to the standard user) โ€” among it a parameter called temperature, which controls how the next token is sampled from those probabilities. Setting this parameter to 0 selects greedy decoding, which in theory - on a fixed stack, with a fixed input - should give us the same answer every time. But we don’t always get that.

๐Ÿ”ฌ Horace He, in collaboration with others at Thinking Machine, dives deeper into this in their blog post “Defeating Nondeterminism in LLM Inference” [2]. A fascinating piece of work:

“Large language model (LLM) inference is often surprisingly nondeterministicโ€”even at zero temperature, supposedly a deterministic mode, repeated requests can yield different outputs. This nondeterminism isn’t just due to floating-point non-associativity and parallel execution, even though those can cause minor numerical discrepancies. Instead, the primary cause is lack of batch invariance: the batch size used by inference servers changes in response to system load, and many low-level GPU and framework kernels produce outputs that depend on batch size, even for a single promptโ€”making outputs unpredictably variable for users.”

A bit technical, but really a great read. And a good thing to know as this helps us better deal with non-determinism and possibly embrace it.

โ“ ๐—œ๐˜€ ๐—ป๐—ผ๐—ป-๐—ฑ๐—ฒ๐˜๐—ฒ๐—ฟ๐—บ๐—ถ๐—ป๐—ถ๐˜€๐—บ ๐—ฎ๐—น๐˜„๐—ฎ๐˜†๐˜€ ๐—ฎ ๐—ฏ๐—ฎ๐—ฑ ๐˜๐—ต๐—ถ๐—ป๐—ด?

Actually, it’s not. It is if we want to achieve 100% repeatable results. But if we want to explore new options or variations, it’s not necessarily bad.

๐ŸŽฏ ๐—ฆ๐—ผ ๐—ถ๐˜ ๐—ฎ๐—น๐˜„๐—ฎ๐˜†๐˜€ ๐—ฑ๐—ฒ๐—ฝ๐—ฒ๐—ป๐—ฑ๐˜€ ๐—ผ๐—ป ๐˜†๐—ผ๐˜‚๐—ฟ ๐˜‚๐˜€๐—ฒ ๐—ฐ๐—ฎ๐˜€๐—ฒ.

What is your experience with the non-determinism of LLM? Did you watch/listen to the interview? Got a chance to work through the blog post?


๐Ÿ“ Last updated: August 13, 2026 โ€” Technical corrections from a quality audit

AISoftwareEngineeringAIAgents