The Non-Determinism Budget: Why Every Layer of Your Agent Stack Spends Randomness You Never Accounted For
You set temperature to zero and told yourself the system was deterministic. It never was. Sampling, retrieval ordering, tool latency, concurrent state, and floating-point non-associativity each inject variance, and they compound. The question is not whether your agent is non-deterministic -- it is how much randomness each layer spends, whether you budgeted for it, and where in the stack an unbudgeted overspend turns a flaky demo into an unreproducible production incident.

The Determinism You Think You Have
Every team that ships an agent stack goes through the same ritual. Someone asks whether the system is reproducible, someone else says "we set temperature to zero," and the room relaxes. The reassurance is worth almost nothing. Temperature zero constrains exactly one source of variance -- token sampling in the language model -- and leaves a dozen others untouched. The system that produced a clean answer in the demo and a different answer in production did not break. It spent randomness you never counted, from budgets you never opened.
The useful reframe is to stop asking whether your agent is deterministic and start treating non-determinism as a budget. Every layer of the stack has a variance line item. Some are small and some are large, some you can zero out and some you cannot, and they do not sit in isolation -- they compound. A little jitter in retrieval order feeds a little jitter in what the model attends to, which feeds a branch in tool selection, which feeds a different downstream state. By the time the output diverges, the cause is three layers upstream and nobody is looking there because everybody is still looking at temperature.
The Line Items Nobody Budgets For
Start with the model, since that is where the false confidence lives. Temperature zero is greedy decoding, not deterministic decoding. Under load, production inference batches requests, and batched matrix operations on GPUs are not associative in floating point -- the same logits summed in a different order produce microscopically different values, and near a decision boundary that microscopic difference flips a token. Two identical prompts, same model, same temperature, different batch composition, different answer. You did not misconfigure anything. Non-associative floating point is a hardware fact, and it means bit-exact reproducibility is off the table the moment you serve concurrent traffic.
Retrieval is the next unbudgeted line. Vector search over an approximate index does not guarantee stable ordering, and ties in relevance score resolve however the index feels like resolving them that millisecond. The set of chunks is roughly stable; the order is not -- and order changes what lands in the context window and what gets truncated out of it. This is where retrieval variance quietly becomes reasoning variance, a dynamic that gets far worse once retrieval freshness in enterprise RAG means the underlying corpus is also shifting under you between calls.
Then concurrency. The moment your agent reads and writes shared state -- memory, a scratchpad, a queue -- interleaving order becomes a variance source, and interleaving order is a function of scheduling you do not control. Two runs of the same task hit the same records in different sequences and diverge. This is the class of bug that structured concurrency in agent orchestration exists to contain, and it is invisible until a race that fired one time in fifty becomes the incident.
And tool latency. An agent that races two tool calls and proceeds with whichever returns first has made wall-clock timing a determinant of its logic. The faster tool on Tuesday is the slower tool on Wednesday, and the agent takes a different branch for a reason that has nothing to do with the input. That is timing non-determinism promoted straight into control flow.
Why the Budgets Compound Instead of Add
If these sources simply added up, you could tolerate them. The problem is that agent architectures are feedback systems, and feedback systems multiply variance rather than sum it. A small perturbation in retrieval order changes the context, the changed context shifts a token, the shifted token changes which tool the agent picks, the different tool returns a different result, and that result reenters the loop as input to the next step. Each hop takes the variance of the layer before it and amplifies it. This is ordinary sensitive dependence on initial conditions, and multi-step agents are practically engineered to exhibit it.
The compounding is exactly why single-layer fixes disappoint. You pin temperature and the system is still flaky, because temperature was never the dominant term. You add a seed and it helps in dev and not in prod, because the seed does nothing about batch-order floating point or index tie-breaking or scheduling. Chasing one line item while the others stay open is how teams spend a quarter making a system "more deterministic" and end up exactly as unreproducible as when they started. Without observability built into the system from day one, you cannot even see which layer overspent, so you keep re-fixing the one layer you can see.
Spending the Budget on Purpose
The goal is not zero non-determinism. That is unattainable above one GPU and undesirable anyway -- some variance is the exploration that makes agents useful. The goal is a budget you set deliberately: bounded where it must be bounded, allowed where it is harmless, and observable everywhere.
Pin what is cheap to pin. Seed every sampler. Fix retrieval tie-breaking with a deterministic secondary sort key so equal-score chunks always order the same way. Make tool selection a function of results, never of which result arrived first. These are the low-cost line items; close them and you eliminate the noise that masks the variance that actually matters.
Bound what you cannot eliminate. You will not get bit-exact model outputs under batched load, so stop trying and instead constrain the blast radius. Force consequential outputs through schemas and validators so a flipped token cannot become a malformed action, and make every side effect idempotent with idempotency patterns for agent actions so a divergent replay cannot double-charge or double-send. The variance still exists; it just can no longer hurt you.
Make every run replayable. The only durable defense against compounding non-determinism is a complete record of what each run actually did -- every prompt, retrieval set, tool result, and state transition captured as an ordered log. Event sourcing for agent audit and compliance turns "we cannot reproduce it" into "we can replay exactly what happened," which is the difference between a two-hour investigation and a two-week one. Pair it with write-ahead logging for agent state machines and a divergence becomes a diff you can read instead of a ghost you chase.
Test against distributions, not golden outputs. A test that asserts one exact output will flake the first time batching shifts a token, and your team will learn to ignore it -- the worst outcome. Assert invariants that must hold across the distribution of valid runs instead, the discipline behind canary analysis of model outputs. You are testing that the system stays inside its budget, not that it produced one blessed string.
Budget It or It Spends You
Non-determinism in an agent stack is not a bug to be exterminated; it is a resource that gets spent whether or not you are keeping the books. The teams that ship reliable agents are not the ones who achieved determinism -- nobody does above a single device. They are the ones who know their variance line items, closed the cheap ones, bounded the expensive ones, and instrumented the whole stack so an overspend shows up as a logged divergence instead of a customer ticket. Set the budget deliberately, or the stack will set it for you at the worst possible time.
Bigyan Analytics builds agent systems with the variance budget accounted for at every layer -- pinned where it should be, bounded where it must be, and observable end to end. Book a working session to pressure-test your stack's reproducibility.
Founder & Principal Architect
Ready to explore AI for your organization?
Schedule a free consultation to discuss your AI goals and challenges.
Book Free Consultation