Stay Ahead, Stay ONMINE

Avoidable and Unavoidable Randomness in GPT-4o

Of course there is randomness in GPT-4o’s outputs. After all, the model samples from a probability distribution when choosing each token. But what I didn’t understand was that those very probabilities themselves are not deterministic. Even with consistent prompts, fixed seeds, and temperature set to zero, GPT-4o still introduces subtle, frustrating randomness. There’s no fix for this, and it might not even be something OpenAI could fix if they wanted to, just so we’re clear up front about where this article is headed. Along the way, we’ll examine all the sources of randomness in GPT-4o output, which will require us to break down the sampling process to a low level. We’ll point at the issue—the probabilities vary—and critically examine OpenAI’s official guidance on determinism. First, though, let’s talk about why determinism matters. Determinism means that the same input always produces the same output, like a mathematical function. While LLM creativity is often desirable, determinism serves crucial purposes: researchers need it for reproducible experiments, developers for verifying reported results, and prompt engineers for debugging their changes. Without it, you’re left wondering if different outputs stem from your tweaks or just the random number generator’s mood swings. Flipping a coin We’re going to keep things extremely simple here and prompt the most recent version of GPT-4o (gpt-4o-2024-08-06 in the API) with this:  Flip a coin. Return Heads or Tails only. Flipping a coin with LLMs is a fascinating topic in itself (see for example Van Koevering & Kleinberg, 2024 in the references), but here, we’ll use it as a simple binary question with which to explore determinism, or the lack thereof. This is our first attempt. import os from openai import OpenAI client = OpenAI(api_key=os.getenv(‘OPENAI_API_KEY’)) prompt = ‘Flip a coin. Return Heads or Tails only.’ response = client.chat.completions.create(     model=’gpt-4o-2024-08-06′,     messages=[{‘role’: ‘user’, ‘content’: prompt}], ) print(response.choices[0].message.content) Running the code gave me Heads. Maybe you’ll get Tails, or if you’re really lucky, something far more interesting. The code first initializes an OpenAI client with an API key set in the environment variable OPENAI_API_KEY (to avoid sharing billing credentials here). The main action happens with client.chat.completions.create, where we specify the model to use and send the prompt (as a part of a very simple conversation named messages) to the server. We get an object called response back from the server. This object contains a lot of information, as shown below, so we need to dig into it to extract GPT-4o’s actual response to the message, which is response.choices[0].message.content. > > > responseChatCompletion(id=’chatcmpl-B48EqZBLfUWtp9H7cwnchGTJbBDwr’, choices=[Choice(finish_reason=’stop’, index=0, logprobs=None, message=ChatCompletionMessage(content=’Heads’, refusal=None, role=’assistant’, audio=None, function_call=None, tool_calls=None))], created=1740324680, model=’gpt-4o-2024-08-06′, object=’chat.completion’, service_tier=’default’, system_fingerprint=’fp_eb9dce56a8′, usage=CompletionUsage(completion_tokens=2, prompt_tokens=18, total_tokens=20, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0))) Now let’s flip the coin ten times. If this were a real, fair coin, of course, we would expect roughly equal heads and tails over time thanks to the law of large numbers. But GPT-4o’s coin doesn’t work quite like that. import os from openai import OpenAI client = OpenAI(api_key=os.getenv(‘OPENAI_API_KEY’)) prompt = ‘Flip a coin. Return Heads or Tails only.’ for _ in range(10):     response = client.chat.completions.create(         model=’gpt-4o-2024-08-06′,         messages=[{‘role’: ‘user’, ‘content’: prompt}],     )     print(response.choices[0].message.content) Running this code gave me the following output, although you might get different output, of course. HeadsHeadsHeadsHeadsHeadsHeadsTailsHeadsHeadsHeads GPT-4o’s coin is clearly biased, but so are humans. Bar-Hillel, Peer, and Acquisti (2014) found that people flipping imaginary coins choose “heads” 80% of the time. Maybe GPT-4o learned that from us. But whatever the reason, we’re just using this simple example to explore determinism. Just how biased is GPT-4o’s coin? Let’s say we wanted to know precisely what percentage of GPT-4o coin flips land Heads. Rather than the obvious (but expensive) approach of flipping it a million times, there’s a smarter way. For classification tasks with a small set of possible answers, we can extract token probabilities instead of generating full responses. With the right prompt, the first token carries all the necessary information, making these API calls incredibly cheap: around 30,000 calls per dollar, since each requires just 18 (cached) input tokens and 1 output token. OpenAI gives us (natural) log probabilities. These are called logprobs in the code, and we convert them to regular probabilities by exponentiation. (We’ll discuss temperature soon, but note that exponentiating logprobs directly like this corresponds to a temperature setting of 1.0, and is how we calculate probabilities throughout this article). OpenAI lets us request logprobs for the top 20 most likely tokens, so we do that. import os import math from openai import OpenAI from tabulate import tabulate client = OpenAI(api_key=os.getenv(‘OPENAI_API_KEY’)) prompt = ‘Flip a coin. Return Heads or Tails only.’ response = client.chat.completions.create(     model=’gpt-4o-2024-08-06′,     max_tokens=1,     logprobs=True,     top_logprobs=20,     messages=[{‘role’: ‘user’, ‘content’: prompt}], ) logprobs_list = response.choices[0].logprobs.content[0].top_logprobs data = [] total_pct = 0.0 for logprob_entry in logprobs_list:     token = logprob_entry.token     logprob = logprob_entry.logprob     pct = math.exp(logprob) * 100  # Convert logprob to a percentage     total_pct += pct     data.append([token, logprob, pct]) print(     tabulate(         data,         headers=[“Token”, “Log Probability”, “Percentage (%)”],         tablefmt=”github”,         floatfmt=(“s”, “.10f”, “.10f”)     ) ) print(f”nTotal probabilities: {total_pct:.6f}%”) If you run this, you’ll get something like the following output, but actual numbers will vary. | Token     |   Log Probability |   Percentage (%) ||———–|——————-|——————|| Heads     |     -0.0380541235 |    96.2660836887 || T         |     -3.2880542278 |     3.7326407467 || Sure      |    -12.5380544662 |     0.0003587502 || Head      |    -12.7880544662 |     0.0002793949 || Tail      |    -13.2880544662 |     0.0001694616 || Certainly |    -13.5380544662 |     0.0001319768 || “T        |    -14.2880544662 |     0.0000623414 || I’m       |    -14.5380544662 |     0.0000485516 || heads     |    -14.5380544662 |     0.0000485516 || Heads     |    -14.9130544662 |     0.0000333690 || ”         |    -15.1630544662 |     0.0000259878 || _heads    |    -15.1630544662 |     0.0000259878 || tails     |    -15.5380544662 |     0.0000178611 || HEAD      |    -15.7880544662 |     0.0000139103 || TAIL      |    -16.2880535126 |     0.0000084370 || T         |    -16.7880535126 |     0.0000051173 || “`       |    -16.7880535126 |     0.0000051173 || Here’s    |    -16.9130535126 |     0.0000045160 || I         |    -17.2880535126 |     0.0000031038 || As        |    -17.2880535126 |     0.0000031038 |Total probabilities: 99.999970% Looking at these probabilities, we see Heads at ≈96% and T at ≈4%. Our prompt is doing pretty well at constraining the model’s responses. Why T and not Tails? This is the tokenizer splitting Tails into T + ails, while keeping Heads as one piece, as we can see in this Python session: > > > import tiktoken > > > encoding = tiktoken.encoding_for_model(“gpt-4o-2024-08-06″) > > > encoding.encode(‘Tails’) [51, 2196] > > > encoding.decode([51]) ‘T’ > > > encoding.encode(‘Heads’) [181043] These probabilities are not deterministic Run the code to display the probabilities for the top 20 tokens again, and you’ll likely get different numbers. Here’s what I got on a second running. | Token     |   Log Probability |   Percentage (%) ||———–|——————-|——————|| Heads     |     -0.0110520627 |    98.9008786933 || T         |     -4.5110521317 |     1.0986894433 || Certainly |    -14.0110521317 |     0.0000822389 || Head      |    -14.2610521317 |     0.0000640477 || Sure      |    -14.2610521317 |     0.0000640477 || Tail      |    -14.3860521317 |     0.0000565219 || heads     |    -15.3860521317 |     0.0000207933 || Heads     |    -15.5110521317 |     0.0000183500 || “`       |    -15.5110521317 |     0.0000183500 || _heads    |    -15.6360521317 |     0.0000161938 || tails     |    -15.6360521317 |     0.0000161938 || I’m       |    -15.8860521317 |     0.0000126117 || “T        |    -15.8860521317 |     0.0000126117 || As        |    -16.3860511780 |     0.0000076494 || ”         |    -16.5110511780 |     0.0000067506 || HEAD      |    -16.6360511780 |     0.0000059574 || TAIL      |    -16.7610511780 |     0.0000052574 || Here’s    |    -16.7610511780 |     0.0000052574 || “        |    -17.1360511780 |     0.0000036133 || T         |    -17.6360511780 |     0.0000021916 |Total probabilities: 99.999987% In their cookbook, OpenAI offers the following advice on receiving “mostly identical” outputs: If the seed, request parameters, and system_fingerprint all match across your requests, then model outputs will mostly be identical. There is a small chance that responses differ even when request parameters and system_fingerprint match, due to the inherent non-determinism of our models. They also give “mostly identical” advice in the reproducible outputs section of their documentation. The request parameters that could affect randomness are temperature and seed. OpenAI also suggests we track system_fingerprint, because differences here might cause differences in output. We’ll examine each of these below, but spoiler: none of them will fix or even explain this non-determinism. Temperature, and why it won’t fix this Temperature controls how random the model’s responses are. Low temperatures (1.5) produce gibberish. Temperature is often called the “creativity parameter”, but this is an oversimplification. In their analysis, Peeperkorn, Kouwenhoven, Brown, and Jordanous (2024) evaluated LLM outputs across four dimensions of creativity: novelty (originality), coherence (logical consistency), cohesion (how well the text flows), and typicality (how well it fits expected patterns). They observed that: temperature is weakly correlated with novelty, and unsurprisingly, moderately correlated with incoherence, but there is no relationship with either cohesion or typicality. But, this is beside the point for coin flipping. Under the hood, the log probabilities are divided by the temperature before they’re renormalized and exponentiated to be converted to probabilities. This creates a non-linear effect: temperature=0.5 squares the probabilities, making likely tokens dominate, while temperature=2.0 applies a square root, flattening the distribution. What about temperature=0.0? Instead of breaking math dividing by zero, the model simply picks the highest-probability token. Sounds deterministic, right? Not quite. Here’s the catch: temperature only comes into play after the log probabilities are computed, when we convert them to probabilities. In summary: if the logprobs aren’t deterministic, setting temperature to 0.0 won’t make the model deterministic. In fact, since we’re just asking the model for the raw logprobs directly rather than generating full responses, the temperature setting doesn’t come into play in our code at all. Seeds, and why they won’t fix this After temperature is used to compute probabilities, the model samples from these probabilities to pick the next token. OpenAI gives us a little control over the sampling process by letting us set the seed parameter for the random number generator. In an ideal world, setting a seed would give us determinism at any temperature. But seeds only affect sampling, not the log probabilities before sampling. In summary: if the logprobs aren’t deterministic, setting a seed won’t make the model deterministic. In fact, seed only matters with non-zero temperatures. With temperature=0.0, the model is always choosing the highest probability token regardless of the seed. Again, since we’re just asking the model for the raw logprobs directly rather than sampling, neither of these settings can help us achieve determinism. System fingerprints, our last hope The system_fingerprint identifies the current combination of model weights, infrastructure, and configuration options in OpenAI’s backend. At least, that’s what OpenAI tells us. Variations in system fingerprints might indeed explain variations in logprobs. Except that they don’t, as we will verify below. Nothing can get you determinism Let’s confirm what we’ve been building toward. We’ll run the same request 10 times with every safeguard in place. Even though neither of these parameters should matter for what we’re doing, you can never be too safe, so we’ll set temperature=0.0 and seed=42. And to see if infrastructure differences explain our varying logprobs, we’ll print system_fingerprint. Here’s the code: import os import math from openai import OpenAI from tabulate import tabulate from tqdm import tqdm client = OpenAI(api_key=os.getenv(‘OPENAI_API_KEY’)) prompt = ‘Flip a coin. Return Heads or Tails only.’ data = [] for _ in tqdm(range(10), desc=’Generating responses’):     response = client.chat.completions.create(         model=’gpt-4o-2024-08-06′,         temperature=0.0,         seed=42,         max_tokens=1,         logprobs=True,         top_logprobs=20,         messages=[{‘role’: ‘user’, ‘content’: prompt}],     )     fingerprint = response.system_fingerprint     logprobs_list = response.choices[0].logprobs.content[0].top_logprobs     heads_logprob = next(         entry.logprob for entry in logprobs_list if entry.token == ‘Heads’     )     pct = math.exp(heads_logprob) * 100     data.append([fingerprint, heads_logprob, f”{pct:.10f}%”]) headers = [“Fingerprint”, “Logprob”, “Probability”] print(tabulate(data, headers=headers, tablefmt=”pipe”)) Running this 10 times, here are the logprobs and probabilities for the token Heads: | Fingerprint   |    Logprob | Probability    ||—————|————|—————-|| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.160339  | 85.1854886858% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.0110521 | 98.9008786933% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% || fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% | Mixture-of-experts makes determinism impossible OpenAI is decidedly not open about the architecture behind GPT-4o. However, it’s widely believed that GPT-4o uses a mixture-of-experts (MoE) architecture with either 8 or 16 experts. According to a paper by Google DeepMind researchers Puigcerver, Riquelme, Mustafa, and Houlsby (hat tip to user elmstedt on the OpenAI forum), mixture-of-experts architectures may add an unavoidable level of non-determinism: Under capacity constraints, all Sparse MoE approaches route tokens in groups of a fixed size and enforce (or encourage) balance within the group. When groups contain tokens from different sequences or inputs, these tokens compete for available spots in expert buffers. Therefore, the model is no longer deterministic at the sequence-level, but only at the batch-level. In other words, when your prompt (a sequence of tokens, in the quote above) reaches OpenAI’s servers, it gets batched with a group of other prompts (OpenAI isn’t open about how many other prompts). Each prompt in the batch is then routed to an “expert” within the model. However, since only so many prompts can be routed to the same expert, the expert your prompt gets routed to will depend on all the other prompts in the batch. This “competition” for experts introduces a real-world randomness completely beyond our control. Non-determinism beyond mixture-of-experts While non-determinism may be inherent to real-world mixture-of-experts models, that does not seem to be the only source of non-determinism in OpenAI’s models. Making a few changes to our code above (switching to gpt-3.5-turbo-0125, looking for the token He since GPT-3.5’s tokenizer splits “Heads” differently, and ignoring system_fingerprint because this model doesn’t have it) reveals that GPT-3.5-turbo also exhibits non-deterministic logprobs: |     Logprob | Probability    ||————-|—————-|| -0.00278289 | 99.7220983436% || -0.00415331 | 99.5855302068% || -0.00258838 | 99.7414961980% || -0.00204034 | 99.7961735289% || -0.00240277 | 99.7600117933% || -0.00204034 | 99.7961735289% || -0.00204034 | 99.7961735289% || -0.00258838 | 99.7414961980% || -0.00351419 | 99.6491976144% || -0.00201214 | 99.7989878007% | No one is claiming that GPT-3.5-turbo uses a mixture-of-experts architecture. Thus, there must be additional factors beyond mixture-of-experts contributing to this non-determinism. What 10,000 GPT-4o coin flip probabilities tell us To better understand the patterns and magnitude of this non-determinism, I conducted a more extensive experiment with GPT-4o, performing 10,000 “coin flips” while recording the probability assigned to “Heads” in each case. The results reveal something fascinating. Across 10,000 API calls with identical parameters, GPT-4o produced not just a few different probability values, but 42 distinct probabilities. If the mixture-of-experts hypothesis were the complete explanation for non-determinism in GPT-4o, we might expect to see one distinct probability for each expert. But GPT-4o is believed to have either 8 or 16 experts, not 42. In the output below, I clustered these probabilities, ensuring that each cluster was separated from the others by 0.01 (as a raw percentage). This groups the output into 12 clusters. Probability          Count           Fingerprints——————————————————————85.1854379113%       5               fp_eb9dce56a8, fp_f9f4fb6dbf85.1854455275%       74              fp_eb9dce56a8, fp_f9f4fb6dbf85.1854886858%       180             fp_eb9dce56a8, fp_f9f4fb6dbf——————————————————————88.0662448207%       31              fp_eb9dce56a8, fp_f9f4fb6dbf88.0678628883%       2               fp_f9f4fb6dbf——————————————————————92.3997629747%       1               fp_eb9dce56a892.3997733012%       4               fp_eb9dce56a892.3997836277%       3               fp_eb9dce56a8——————————————————————92.4128943690%       1               fp_f9f4fb6dbf92.4129143363%       21              fp_eb9dce56a8, fp_f9f4fb6dbf92.4129246643%       8               fp_eb9dce56a8, fp_f9f4fb6dbf——————————————————————93.9906837191%       4               fp_eb9dce56a8——————————————————————95.2569999350%       36              fp_eb9dce56a8——————————————————————96.2660836887%       3391            fp_eb9dce56a8, fp_f9f4fb6dbf96.2661285161%       2636            fp_eb9dce56a8, fp_f9f4fb6dbf——————————————————————97.0674551052%       1               fp_eb9dce56a897.0674778863%       3               fp_eb9dce56a897.0675003058%       4               fp_eb9dce56a897.0675116963%       1               fp_eb9dce56a897.0680739932%       19              fp_eb9dce56a8, fp_f9f4fb6dbf97.0681293191%       6               fp_eb9dce56a8, fp_f9f4fb6dbf97.0681521003%       74              fp_eb9dce56a8, fp_f9f4fb6dbf97.0682421405%       4               fp_eb9dce56a8——————————————————————97.7008960695%       1               fp_f9f4fb6dbf97.7011122645%       3               fp_eb9dce56a897.7011462953%       3               fp_eb9dce56a897.7018178132%       1               fp_eb9dce56a8——————————————————————98.2006069902%       426             fp_eb9dce56a8, fp_f9f4fb6dbf98.2006876548%       6               fp_f9f4fb6dbf98.2007107019%       1               fp_eb9dce56a898.2009525133%       5               fp_eb9dce56a898.2009751945%       1               fp_eb9dce56a898.2009867181%       1               fp_eb9dce56a8——————————————————————98.5930987656%       3               fp_eb9dce56a8, fp_f9f4fb6dbf98.5931104270%       235             fp_eb9dce56a8, fp_f9f4fb6dbf98.5931222721%       4               fp_eb9dce56a8, fp_f9f4fb6dbf98.5931340253%       9               fp_eb9dce56a898.5931571644%       159             fp_eb9dce56a8, fp_f9f4fb6dbf98.5931805790%       384             fp_eb9dce56a8——————————————————————98.9008436920%       95              fp_eb9dce56a8, fp_f9f4fb6dbf98.9008550214%       362             fp_eb9dce56a8, fp_f9f4fb6dbf98.9008786933%       1792            fp_eb9dce56a8, fp_f9f4fb6dbf (With a threshold of 0.001 there are 13 clusters, and with a threshold of 0.0001 there are 17 clusters.) As the chart above demonstrates, this multitude of results cannot be explained by system_fingerprint values. Across all 10,000 calls, I received only two different system fingerprints: 4488 results with fp_f9f4fb6dbf and 5512 with fp_eb9dce56a8, and for the most part the two system fingerprints returned the same sets probabilities, rather than each fingerprint producing its own distinct set of probabilities. It could be that these 12 clusters of probabilities represent 12 different experts. Even assuming that, the variations within the clusters remain puzzling. These don’t seem likely to be simple rounding errors, because they are too systematic and consistent. Take the giant cluster at around 96.266% with two distinct probabilities representing over half of our coin flips. The difference between these two probabilities, 0.0000448274%, is tiny but persistent. Conclusion: Non-determinism is baked in There is an underlying randomness in the log probabilities returned by all currently available non-thinking OpenAI models: GPT-4o, GPT-4o-mini, and the two flavors of GPT-3.5-turbo. Because this non-determinism is baked into the log probabilities, there’s no way for a user to get around it. Temperature and seed values have no effect, and system fingerprints don’t explain it. While mixture-of-experts architectures inherently introduce some randomness in the competition for experts, the non-determinism in GPT-4o seems to go far beyond this, and the non-determinism in GPT-3.5-turbo can’t be explained by this at all, because GPT-3.5-turbo isn’t a mixture-of-experts model. While we can’t verify this claim any more because the model isn’t being served, this behaviour wasn’t seen with GPT-3, according to user _j on the OpenAI forum: It is a symptom that was not seen on prior GPT-3 AI models where across hundreds of trials to investigate sampling, you never had to doubt that logprobs would be the same. Even if you found a top-2 answer that returned exactly the same logprob value via the API, you would never see them switch position or return different values. This suggests that whatever is causing this randomness first emerged in either GPT-3.5 or GPT-3.5-turbo. But regardless of when it emerged, this non-determinism is a serious obstacle to understanding these models. If you want to study a model—how it generalizes, how it biases responses, how it assigns probabilities to different tokens—you need consistency. but as we’ve seen, even when we lock down every knob OpenAI lets us touch, we still can’t get an answer to the simplest possible question: “what is the probability that GPT-4o says a coin lands heads?” Worse, while mixture-of-experts explains some of this non-determinism, there are clearly other, hidden sources of randomness that we can’t see, control, or understand. In an ideal world, the API would provide more transparency by telling us which expert processed our request or by offering additional parameters to control this routing process. Without such visibility, we’re left guessing at the true nature of the variability. References Bar-Hillel, M., Peer, E., & Acquisti, A. (2014). “Heads or tails?” – A reachability bias in binary choice. Journal of Experimental Psychology: Learning, Memory, and Cognition, 40(6), 1656–1663. https://doi.org/10.1037/xlm0000005. Peeperkorn, M., Kouwenhoven, T., Brown, D., & Jordanous, A. (2024). Is temperature the creativity parameter of Large Language Models?. In The 15th International Conference on Computational Creativity (ICCC’24). arXiv:2405.00492. Puigcerver, J., Riquelme, C., Mustafa, B., & Houlsby, N. (2024). From sparse to soft mixtures of experts. In The Twelfth International Conference on Learning Representations (ICLR 2024). https://openreview.net/forum?id=jxpsAj7ltE. arXiv:2308.00951.Van Koevering, K., & Kleinberg, J. (2024). How random is random? Evaluating the Randomness and humanness of LLMs’ coin flips. arXiv:2406.00092.

Of course there is randomness in GPT-4o’s outputs. After all, the model samples from a probability distribution when choosing each token. But what I didn’t understand was that those very probabilities themselves are not deterministic. Even with consistent prompts, fixed seeds, and temperature set to zero, GPT-4o still introduces subtle, frustrating randomness.

There’s no fix for this, and it might not even be something OpenAI could fix if they wanted to, just so we’re clear up front about where this article is headed. Along the way, we’ll examine all the sources of randomness in GPT-4o output, which will require us to break down the sampling process to a low level. We’ll point at the issue—the probabilities vary—and critically examine OpenAI’s official guidance on determinism.

First, though, let’s talk about why determinism matters. Determinism means that the same input always produces the same output, like a mathematical function. While LLM creativity is often desirable, determinism serves crucial purposes: researchers need it for reproducible experiments, developers for verifying reported results, and prompt engineers for debugging their changes. Without it, you’re left wondering if different outputs stem from your tweaks or just the random number generator’s mood swings.

Flipping a coin

We’re going to keep things extremely simple here and prompt the most recent version of GPT-4o (gpt-4o-2024-08-06 in the API) with this:

 Flip a coin. Return Heads or Tails only.

Flipping a coin with LLMs is a fascinating topic in itself (see for example Van Koevering & Kleinberg, 2024 in the references), but here, we’ll use it as a simple binary question with which to explore determinism, or the lack thereof.

This is our first attempt.

import os
from openai import OpenAI
client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))

prompt = 'Flip a coin. Return Heads or Tails only.'

response = client.chat.completions.create(
    model='gpt-4o-2024-08-06',
    messages=[{'role': 'user', 'content': prompt}],
)

print(response.choices[0].message.content)

Running the code gave me Heads. Maybe you’ll get Tails, or if you’re really lucky, something far more interesting.

The code first initializes an OpenAI client with an API key set in the environment variable OPENAI_API_KEY (to avoid sharing billing credentials here). The main action happens with client.chat.completions.create, where we specify the model to use and send the prompt (as a part of a very simple conversation named messages) to the server. We get an object called response back from the server. This object contains a lot of information, as shown below, so we need to dig into it to extract GPT-4o’s actual response to the message, which is response.choices[0].message.content.

>>> response
ChatCompletion(id=’chatcmpl-B48EqZBLfUWtp9H7cwnchGTJbBDwr’, choices=[Choice(finish_reason=’stop’, index=0, logprobs=None, message=ChatCompletionMessage(content=’Heads’, refusal=None, role=’assistant’, audio=None, function_call=None, tool_calls=None))], created=1740324680, model=’gpt-4o-2024-08-06′, object=’chat.completion’, service_tier=’default’, system_fingerprint=’fp_eb9dce56a8′, usage=CompletionUsage(completion_tokens=2, prompt_tokens=18, total_tokens=20, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), prompt_tokens_details=PromptTokensDetails(audio_tokens=0, cached_tokens=0)))

Now let’s flip the coin ten times. If this were a real, fair coin, of course, we would expect roughly equal heads and tails over time thanks to the law of large numbers. But GPT-4o’s coin doesn’t work quite like that.

import os
from openai import OpenAI
client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))

prompt = 'Flip a coin. Return Heads or Tails only.'

for _ in range(10):
    response = client.chat.completions.create(
        model='gpt-4o-2024-08-06',
        messages=[{'role': 'user', 'content': prompt}],
    )
    print(response.choices[0].message.content)

Running this code gave me the following output, although you might get different output, of course.

Heads
Heads
Heads
Heads
Heads
Heads
Tails
Heads
Heads
Heads

GPT-4o’s coin is clearly biased, but so are humans. Bar-Hillel, Peer, and Acquisti (2014) found that people flipping imaginary coins choose “heads” 80% of the time. Maybe GPT-4o learned that from us. But whatever the reason, we’re just using this simple example to explore determinism.

Just how biased is GPT-4o’s coin?

Let’s say we wanted to know precisely what percentage of GPT-4o coin flips land Heads.

Rather than the obvious (but expensive) approach of flipping it a million times, there’s a smarter way. For classification tasks with a small set of possible answers, we can extract token probabilities instead of generating full responses. With the right prompt, the first token carries all the necessary information, making these API calls incredibly cheap: around 30,000 calls per dollar, since each requires just 18 (cached) input tokens and 1 output token.

OpenAI gives us (natural) log probabilities. These are called logprobs in the code, and we convert them to regular probabilities by exponentiation. (We’ll discuss temperature soon, but note that exponentiating logprobs directly like this corresponds to a temperature setting of 1.0, and is how we calculate probabilities throughout this article). OpenAI lets us request logprobs for the top 20 most likely tokens, so we do that.

import os
import math
from openai import OpenAI
from tabulate import tabulate

client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))

prompt = 'Flip a coin. Return Heads or Tails only.'

response = client.chat.completions.create(
    model='gpt-4o-2024-08-06',
    max_tokens=1,
    logprobs=True,
    top_logprobs=20,
    messages=[{'role': 'user', 'content': prompt}],
)

logprobs_list = response.choices[0].logprobs.content[0].top_logprobs

data = []
total_pct = 0.0

for logprob_entry in logprobs_list:
    token = logprob_entry.token
    logprob = logprob_entry.logprob
    pct = math.exp(logprob) * 100  # Convert logprob to a percentage
    total_pct += pct
    data.append([token, logprob, pct])

print(
    tabulate(
        data,
        headers=["Token", "Log Probability", "Percentage (%)"],
        tablefmt="github",
        floatfmt=("s", ".10f", ".10f")
    )
)
print(f"nTotal probabilities: {total_pct:.6f}%")

If you run this, you’ll get something like the following output, but actual numbers will vary.

| Token     |   Log Probability |   Percentage (%) |
|———–|——————-|——————|
| Heads     |     -0.0380541235 |    96.2660836887 |
| T         |     -3.2880542278 |     3.7326407467 |
| Sure      |    -12.5380544662 |     0.0003587502 |
| Head      |    -12.7880544662 |     0.0002793949 |
| Tail      |    -13.2880544662 |     0.0001694616 |
| Certainly |    -13.5380544662 |     0.0001319768 |
| “T        |    -14.2880544662 |     0.0000623414 |
| I’m       |    -14.5380544662 |     0.0000485516 |
| heads     |    -14.5380544662 |     0.0000485516 |
| Heads     |    -14.9130544662 |     0.0000333690 |
| ”         |    -15.1630544662 |     0.0000259878 |
| _heads    |    -15.1630544662 |     0.0000259878 |
| tails     |    -15.5380544662 |     0.0000178611 |
| HEAD      |    -15.7880544662 |     0.0000139103 |
| TAIL      |    -16.2880535126 |     0.0000084370 |
| T         |    -16.7880535126 |     0.0000051173 |
| “`       |    -16.7880535126 |     0.0000051173 |
| Here’s    |    -16.9130535126 |     0.0000045160 |
| I         |    -17.2880535126 |     0.0000031038 |
| As        |    -17.2880535126 |     0.0000031038 |

Total probabilities: 99.999970%

Looking at these probabilities, we see Heads at ≈96% and T at ≈4%. Our prompt is doing pretty well at constraining the model’s responses. Why T and not Tails? This is the tokenizer splitting Tails into T + ails, while keeping Heads as one piece, as we can see in this Python session:

>>> import tiktoken
>>> encoding = tiktoken.encoding_for_model("gpt-4o-2024-08-06")
>>> encoding.encode('Tails')
[51, 2196]
>>> encoding.decode([51])
'T'
>>> encoding.encode('Heads')
[181043]

These probabilities are not deterministic

Run the code to display the probabilities for the top 20 tokens again, and you’ll likely get different numbers. Here’s what I got on a second running.

| Token     |   Log Probability |   Percentage (%) |
|———–|——————-|——————|
| Heads     |     -0.0110520627 |    98.9008786933 |
| T         |     -4.5110521317 |     1.0986894433 |
| Certainly |    -14.0110521317 |     0.0000822389 |
| Head      |    -14.2610521317 |     0.0000640477 |
| Sure      |    -14.2610521317 |     0.0000640477 |
| Tail      |    -14.3860521317 |     0.0000565219 |
| heads     |    -15.3860521317 |     0.0000207933 |
| Heads     |    -15.5110521317 |     0.0000183500 |
| “`       |    -15.5110521317 |     0.0000183500 |
| _heads    |    -15.6360521317 |     0.0000161938 |
| tails     |    -15.6360521317 |     0.0000161938 |
| I’m       |    -15.8860521317 |     0.0000126117 |
| “T        |    -15.8860521317 |     0.0000126117 |
| As        |    -16.3860511780 |     0.0000076494 |
| ”         |    -16.5110511780 |     0.0000067506 |
| HEAD      |    -16.6360511780 |     0.0000059574 |
| TAIL      |    -16.7610511780 |     0.0000052574 |
| Here’s    |    -16.7610511780 |     0.0000052574 |
| “        |    -17.1360511780 |     0.0000036133 |
| T         |    -17.6360511780 |     0.0000021916 |

Total probabilities: 99.999987%

In their cookbook, OpenAI offers the following advice on receiving “mostly identical” outputs:

If the seed, request parameters, and system_fingerprint all match across your requests, then model outputs will mostly be identical. There is a small chance that responses differ even when request parameters and system_fingerprint match, due to the inherent non-determinism of our models.

They also give “mostly identical” advice in the reproducible outputs section of their documentation.

The request parameters that could affect randomness are temperature and seed. OpenAI also suggests we track system_fingerprint, because differences here might cause differences in output. We’ll examine each of these below, but spoiler: none of them will fix or even explain this non-determinism.

Temperature, and why it won’t fix this

Temperature controls how random the model’s responses are. Low temperatures (1.5) produce gibberish. Temperature is often called the “creativity parameter”, but this is an oversimplification. In their analysis, Peeperkorn, Kouwenhoven, Brown, and Jordanous (2024) evaluated LLM outputs across four dimensions of creativity: novelty (originality), coherence (logical consistency), cohesion (how well the text flows), and typicality (how well it fits expected patterns). They observed that:

temperature is weakly correlated with novelty, and unsurprisingly, moderately correlated with incoherence, but there is no relationship with either cohesion or typicality.

But, this is beside the point for coin flipping. Under the hood, the log probabilities are divided by the temperature before they’re renormalized and exponentiated to be converted to probabilities. This creates a non-linear effect: temperature=0.5 squares the probabilities, making likely tokens dominate, while temperature=2.0 applies a square root, flattening the distribution.

What about temperature=0.0? Instead of breaking math dividing by zero, the model simply picks the highest-probability token. Sounds deterministic, right? Not quite. Here’s the catch: temperature only comes into play after the log probabilities are computed, when we convert them to probabilities.

In summary: if the logprobs aren’t deterministic, setting temperature to 0.0 won’t make the model deterministic.

In fact, since we’re just asking the model for the raw logprobs directly rather than generating full responses, the temperature setting doesn’t come into play in our code at all.

Seeds, and why they won’t fix this

After temperature is used to compute probabilities, the model samples from these probabilities to pick the next token. OpenAI gives us a little control over the sampling process by letting us set the seed parameter for the random number generator. In an ideal world, setting a seed would give us determinism at any temperature. But seeds only affect sampling, not the log probabilities before sampling.

In summary: if the logprobs aren’t deterministic, setting a seed won’t make the model deterministic.

In fact, seed only matters with non-zero temperatures. With temperature=0.0, the model is always choosing the highest probability token regardless of the seed. Again, since we’re just asking the model for the raw logprobs directly rather than sampling, neither of these settings can help us achieve determinism.

System fingerprints, our last hope

The system_fingerprint identifies the current combination of model weights, infrastructure, and configuration options in OpenAI’s backend. At least, that’s what OpenAI tells us. Variations in system fingerprints might indeed explain variations in logprobs. Except that they don’t, as we will verify below.

Nothing can get you determinism

Let’s confirm what we’ve been building toward. We’ll run the same request 10 times with every safeguard in place. Even though neither of these parameters should matter for what we’re doing, you can never be too safe, so we’ll set temperature=0.0 and seed=42. And to see if infrastructure differences explain our varying logprobs, we’ll print system_fingerprint. Here’s the code:

import os
import math
from openai import OpenAI
from tabulate import tabulate
from tqdm import tqdm

client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))

prompt = 'Flip a coin. Return Heads or Tails only.'

data = []

for _ in tqdm(range(10), desc='Generating responses'):
    response = client.chat.completions.create(
        model='gpt-4o-2024-08-06',
        temperature=0.0,
        seed=42,
        max_tokens=1,
        logprobs=True,
        top_logprobs=20,
        messages=[{'role': 'user', 'content': prompt}],
    )

    fingerprint = response.system_fingerprint
    logprobs_list = response.choices[0].logprobs.content[0].top_logprobs
    heads_logprob = next(
        entry.logprob for entry in logprobs_list if entry.token == 'Heads'
    )
    pct = math.exp(heads_logprob) * 100
    data.append([fingerprint, heads_logprob, f"{pct:.10f}%"])

headers = ["Fingerprint", "Logprob", "Probability"]
print(tabulate(data, headers=headers, tablefmt="pipe"))

Running this 10 times, here are the logprobs and probabilities for the token Heads:

| Fingerprint   |    Logprob | Probability    |
|—————|————|—————-|
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.160339  | 85.1854886858% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.0110521 | 98.9008786933% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |
| fp_f9f4fb6dbf | -0.0380541 | 96.2660836887% |

Mixture-of-experts makes determinism impossible

OpenAI is decidedly not open about the architecture behind GPT-4o. However, it’s widely believed that GPT-4o uses a mixture-of-experts (MoE) architecture with either 8 or 16 experts.

According to a paper by Google DeepMind researchers Puigcerver, Riquelme, Mustafa, and Houlsby (hat tip to user elmstedt on the OpenAI forum), mixture-of-experts architectures may add an unavoidable level of non-determinism:

Under capacity constraints, all Sparse MoE approaches route tokens in groups of a fixed size and enforce (or encourage) balance within the group. When groups contain tokens from different sequences or inputs, these tokens compete for available spots in expert buffers. Therefore, the model is no longer deterministic at the sequence-level, but only at the batch-level.

In other words, when your prompt (a sequence of tokens, in the quote above) reaches OpenAI’s servers, it gets batched with a group of other prompts (OpenAI isn’t open about how many other prompts). Each prompt in the batch is then routed to an “expert” within the model. However, since only so many prompts can be routed to the same expert, the expert your prompt gets routed to will depend on all the other prompts in the batch.

This “competition” for experts introduces a real-world randomness completely beyond our control.

Non-determinism beyond mixture-of-experts

While non-determinism may be inherent to real-world mixture-of-experts models, that does not seem to be the only source of non-determinism in OpenAI’s models.

Making a few changes to our code above (switching to gpt-3.5-turbo-0125, looking for the token He since GPT-3.5’s tokenizer splits “Heads” differently, and ignoring system_fingerprint because this model doesn’t have it) reveals that GPT-3.5-turbo also exhibits non-deterministic logprobs:

|     Logprob | Probability    |
|————-|—————-|
| -0.00278289 | 99.7220983436% |
| -0.00415331 | 99.5855302068% |
| -0.00258838 | 99.7414961980% |
| -0.00204034 | 99.7961735289% |
| -0.00240277 | 99.7600117933% |
| -0.00204034 | 99.7961735289% |
| -0.00204034 | 99.7961735289% |
| -0.00258838 | 99.7414961980% |
| -0.00351419 | 99.6491976144% |
| -0.00201214 | 99.7989878007% |

No one is claiming that GPT-3.5-turbo uses a mixture-of-experts architecture. Thus, there must be additional factors beyond mixture-of-experts contributing to this non-determinism.

What 10,000 GPT-4o coin flip probabilities tell us

To better understand the patterns and magnitude of this non-determinism, I conducted a more extensive experiment with GPT-4o, performing 10,000 “coin flips” while recording the probability assigned to “Heads” in each case.

The results reveal something fascinating. Across 10,000 API calls with identical parameters, GPT-4o produced not just a few different probability values, but 42 distinct probabilities. If the mixture-of-experts hypothesis were the complete explanation for non-determinism in GPT-4o, we might expect to see one distinct probability for each expert. But GPT-4o is believed to have either 8 or 16 experts, not 42.

In the output below, I clustered these probabilities, ensuring that each cluster was separated from the others by 0.01 (as a raw percentage). This groups the output into 12 clusters.

Probability          Count           Fingerprints
——————————————————————
85.1854379113%       5               fp_eb9dce56a8, fp_f9f4fb6dbf
85.1854455275%       74              fp_eb9dce56a8, fp_f9f4fb6dbf
85.1854886858%       180             fp_eb9dce56a8, fp_f9f4fb6dbf
——————————————————————
88.0662448207%       31              fp_eb9dce56a8, fp_f9f4fb6dbf
88.0678628883%       2               fp_f9f4fb6dbf
——————————————————————
92.3997629747%       1               fp_eb9dce56a8
92.3997733012%       4               fp_eb9dce56a8
92.3997836277%       3               fp_eb9dce56a8
——————————————————————
92.4128943690%       1               fp_f9f4fb6dbf
92.4129143363%       21              fp_eb9dce56a8, fp_f9f4fb6dbf
92.4129246643%       8               fp_eb9dce56a8, fp_f9f4fb6dbf
——————————————————————
93.9906837191%       4               fp_eb9dce56a8
——————————————————————
95.2569999350%       36              fp_eb9dce56a8
——————————————————————
96.2660836887%       3391            fp_eb9dce56a8, fp_f9f4fb6dbf
96.2661285161%       2636            fp_eb9dce56a8, fp_f9f4fb6dbf
——————————————————————
97.0674551052%       1               fp_eb9dce56a8
97.0674778863%       3               fp_eb9dce56a8
97.0675003058%       4               fp_eb9dce56a8
97.0675116963%       1               fp_eb9dce56a8
97.0680739932%       19              fp_eb9dce56a8, fp_f9f4fb6dbf
97.0681293191%       6               fp_eb9dce56a8, fp_f9f4fb6dbf
97.0681521003%       74              fp_eb9dce56a8, fp_f9f4fb6dbf
97.0682421405%       4               fp_eb9dce56a8
——————————————————————
97.7008960695%       1               fp_f9f4fb6dbf
97.7011122645%       3               fp_eb9dce56a8
97.7011462953%       3               fp_eb9dce56a8
97.7018178132%       1               fp_eb9dce56a8
——————————————————————
98.2006069902%       426             fp_eb9dce56a8, fp_f9f4fb6dbf
98.2006876548%       6               fp_f9f4fb6dbf
98.2007107019%       1               fp_eb9dce56a8
98.2009525133%       5               fp_eb9dce56a8
98.2009751945%       1               fp_eb9dce56a8
98.2009867181%       1               fp_eb9dce56a8
——————————————————————
98.5930987656%       3               fp_eb9dce56a8, fp_f9f4fb6dbf
98.5931104270%       235             fp_eb9dce56a8, fp_f9f4fb6dbf
98.5931222721%       4               fp_eb9dce56a8, fp_f9f4fb6dbf
98.5931340253%       9               fp_eb9dce56a8
98.5931571644%       159             fp_eb9dce56a8, fp_f9f4fb6dbf
98.5931805790%       384             fp_eb9dce56a8
——————————————————————
98.9008436920%       95              fp_eb9dce56a8, fp_f9f4fb6dbf
98.9008550214%       362             fp_eb9dce56a8, fp_f9f4fb6dbf
98.9008786933%       1792            fp_eb9dce56a8, fp_f9f4fb6dbf

(With a threshold of 0.001 there are 13 clusters, and with a threshold of 0.0001 there are 17 clusters.)

As the chart above demonstrates, this multitude of results cannot be explained by system_fingerprint values. Across all 10,000 calls, I received only two different system fingerprints: 4488 results with fp_f9f4fb6dbf and 5512 with fp_eb9dce56a8, and for the most part the two system fingerprints returned the same sets probabilities, rather than each fingerprint producing its own distinct set of probabilities.

It could be that these 12 clusters of probabilities represent 12 different experts. Even assuming that, the variations within the clusters remain puzzling. These don’t seem likely to be simple rounding errors, because they are too systematic and consistent. Take the giant cluster at around 96.266% with two distinct probabilities representing over half of our coin flips. The difference between these two probabilities, 0.0000448274%, is tiny but persistent.

Conclusion: Non-determinism is baked in

There is an underlying randomness in the log probabilities returned by all currently available non-thinking OpenAI models: GPT-4o, GPT-4o-mini, and the two flavors of GPT-3.5-turbo. Because this non-determinism is baked into the log probabilities, there’s no way for a user to get around it. Temperature and seed values have no effect, and system fingerprints don’t explain it.

While mixture-of-experts architectures inherently introduce some randomness in the competition for experts, the non-determinism in GPT-4o seems to go far beyond this, and the non-determinism in GPT-3.5-turbo can’t be explained by this at all, because GPT-3.5-turbo isn’t a mixture-of-experts model.

While we can’t verify this claim any more because the model isn’t being served, this behaviour wasn’t seen with GPT-3, according to user _j on the OpenAI forum:

It is a symptom that was not seen on prior GPT-3 AI models where across hundreds of trials to investigate sampling, you never had to doubt that logprobs would be the same. Even if you found a top-2 answer that returned exactly the same logprob value via the API, you would never see them switch position or return different values.

This suggests that whatever is causing this randomness first emerged in either GPT-3.5 or GPT-3.5-turbo.

But regardless of when it emerged, this non-determinism is a serious obstacle to understanding these models. If you want to study a model—how it generalizes, how it biases responses, how it assigns probabilities to different tokens—you need consistency. but as we’ve seen, even when we lock down every knob OpenAI lets us touch, we still can’t get an answer to the simplest possible question: “what is the probability that GPT-4o says a coin lands heads?”

Worse, while mixture-of-experts explains some of this non-determinism, there are clearly other, hidden sources of randomness that we can’t see, control, or understand. In an ideal world, the API would provide more transparency by telling us which expert processed our request or by offering additional parameters to control this routing process. Without such visibility, we’re left guessing at the true nature of the variability.

References

Bar-Hillel, M., Peer, E., & Acquisti, A. (2014). “Heads or tails?” – A reachability bias in binary choice. Journal of Experimental Psychology: Learning, Memory, and Cognition, 40(6), 1656–1663. https://doi.org/10.1037/xlm0000005.

Peeperkorn, M., Kouwenhoven, T., Brown, D., & Jordanous, A. (2024). Is temperature the creativity parameter of Large Language Models?. In The 15th International Conference on Computational Creativity (ICCC’24). arXiv:2405.00492.

Puigcerver, J., Riquelme, C., Mustafa, B., & Houlsby, N. (2024). From sparse to soft mixtures of experts. In The Twelfth International Conference on Learning Representations (ICLR 2024). https://openreview.net/forum?id=jxpsAj7ltE. arXiv:2308.00951.Van Koevering, K., & Kleinberg, J. (2024). How random is random? Evaluating the Randomness and humanness of LLMs’ coin flips. arXiv:2406.00092.

Shape
Shape
Stay Ahead

Explore More Insights

Stay ahead with more perspectives on cutting-edge power, infrastructure, energy,  bitcoin and AI solutions. Explore these articles to uncover strategies and insights shaping the future of industries.

Shape

The US will install these country-specific tariffs Aug. 7

The U.S. plans to lift its pause on country-specific tariffs while implementing a range of new rates for specific trading partners on Aug. 7, per an executive order President Donald Trump signed Thursday.  The order lists rates for over 60 trading partners, ranging from 10% to 41%. The list includes

Read More »

Spotlight report: How AI is reshaping IT

The emergence of AI as the next big game changer has IT leaders rethinking not just how IT is staffed, organized, and funded, but also how the IT team works with the business to capture the value and promise of AI. Learn more in this Spotlight Report from the editors

Read More »

SD-WAN reality check: Why enterprise ‘rip-and-replace’ isn’t happening

However, despite aggressive vendor positioning around complete infrastructure overhauls, ISG’s research shows that overlay approaches are winning. Even the most technologically advanced organizations are taking a more cautious approach to SD-WAN deployments. “Honestly, even the digitally mature enterprises are favoring controlled, phased transitions due to operational complexity, embedded legacy contracts,

Read More »

Oil Drops on Weak U.S. Data

Oil sank as the outlook for the world’s largest economy darkened after a barrage of poor US data and tariff announcements, weighing on the prospects for energy demand growth. West Texas Intermediate crude fell 2.8% to settle near $67 a barrel on Friday, the biggest plunge in a single day since June 24. Prices also came under pressure as investors widely anticipate that OPEC and its allies will decide to add more supplies to the market during an upcoming weekend meeting. US jobs growth cooled sharply over the past three months, while factory activity contracted in July at the fastest clip in nine months, in a sign the economy is shifting into a lower gear amid widespread uncertainty. The swath of bearish data increased investor concerns that the impact of US President Donald Trump’s ever-changing tariff rates — which had so far been muted — has finally begun to weigh on economic growth. The weaker data come as Trump finalized plans for tariffs on several countries, including a higher rate on neighbor Canada, though oil is exempt. “Tariffs are now officially a part of daily life. With the catalyst in the rearview, focus must shift to the fallout,” said Daniel Ghali, a commodity strategist at TD Securities. Oil traders had been forced to the sidelines in recent weeks as numerous wild cards surrounding US trade policy and OPEC+ production confounded supply-and-demand outlooks. The unpredictable environment, which initially caused wild price swings earlier in the year, has dampened risk-on sentiment and sapped volatility from the market. The potential onset of an economic slowdown threatens to coincide with a period for oversupply widely expected for later this year. Second-quarter earnings for oil industry giants blew out expectations, with record oil production blunting the impact of lower crude prices. Exxon Mobil Corp. pumped

Read More »

Xcel Energy ‘prepared to go to trial’ to fight Marshall Fire liability

Dive Brief: Xcel Energy has emerged from court-ordered mediation without a settlement and will go to trial for its role in the 2021 Marshall Fire in Colorado, company executives said during a Thursday earnings call. A 2023 investigation by the Boulder County Sheriff attributed the fire to the merging of two independent ignitions: kindling from an old fire on a property owned by the Twelve Tribes, a religious organization, and sparks from an Xcel Energy power line. President and CEO Bob Frenzel said the company believes it can prove its equipment did not start the fire. The company is already paying claims on another fire, the 2024 Smokehouse Creek Fire in the Texas panhandle, on which it faces an estimated $290 million in liability. Dive Insight: Xcel Energy remains open to settling with the more than 500 parties suing the utility for the Marshall Fire. But any settlement, Frenzel said Thursday, must “start with the idea that our equipment didn’t cause that second” ignition. Hearings are set to begin on Sept. 25 and will likely continue through November now that the July 31 deadline for court-ordered mediation has passed, Frenzel said. When the fire started, he said, the embers on the Twelve Tribes property were fanned by 100 miles per hour winds for over an hour and 20 minutes, allowing it to spread into nearby towns long before the second ignition at Xcel Energy’s power line is alleged to have taken place, he said. “As we step back and think about the trial broadly and the fire broadly, we continue to maintain that our equipment didn’t start the second ignition in the wildfire, and we’re prepared to go to court,” Frenzel said, later adding that “we feel very good about the facts and circumstances of our trial.” Insurance data suggest the

Read More »

PPL Electric ‘advanced-stage’ data center pipeline grows 32%, to 14 GW

Dive Brief: PPL Electric Utilities has advanced-stage agreements to interconnect about 14 GW of data centers in its Pennsylvania service territory, up 32% from three months ago, Vincent Sorgi, president and CEO of PPL Corp., said Thursday during an earnings conference call. Under signed agreements, PPL Electric Utilities’ data center load could grow from 800 MW in 2026 to 14.4 GW in 2034, according to a second-quarter earnings presentation. PPL Electric Utilities has a 60-GW data center interconnection queue, according to Sorgi. PPL’s data center strategy includes an unregulated joint venture with Blackstone Infrastructure to build power plants in Pennsylvania to directly serve data centers. “The joint venture is actively engaged with hyperscalers, landowners, natural gas pipeline companies and turbine manufacturers and has secured multiple land parcels to enable this new generation buildout,” Sorgi said. Dive Insight: However, discussions on potential electricity service agreements aren’t far enough along for the joint venture to commit to buying turbines and it is unclear when it would be able to announce any news, according to Sorgi. “We’ve made no material financial commitments to date as it relates to the joint venture,” he said. PPL intends to make sure that the joint venture’s deals don’t change the company’s credit risk profile, Sorgi said. PPL supports pending legislation in Pennsylvania — H.B. 1272 and S.B. 897 — that would allow regulated utilities like PPL Electric Utilities to build and own generation to address a resource adequacy need, Sorgi said. The bills would also encourage utilities to enter into agreements with independent power producers to help “derisk” their new generation investments, according to Sorgi.  “We are primed to act quickly once this proposed legislation becomes law,” he said. PPL Electric Utilities estimates it will need about 7.5 GW of new generation in the next five to seven

Read More »

Indian Refiner Snaps Up USA Oil

India’s largest oil refiner has snapped up millions of barrels of crude from the US and United Arab Emirates, with the South Asian nation facing mounting pressure from Washington and Europe over its purchases from Russia. State-owned Indian Oil Corp. bought at least 5 million barrels US crude, on top of 2 million barrels of supplies from Abu Dhabi, according to traders who asked not to be identified as they aren’t authorized to speak publicly. The purchases were both large and for relatively immediate delivery by the company’s usual standards. State-owned processors were told to come up with plans for buying non-Russian crude earlier this week.  An Indian Oil spokesman didn’t respond to a request for comment. India’s refiners have been in the spotlight over the past two weeks, after being singled out by the European Union and the US for supporting Moscow during its war in Ukraine by buying Russian oil. US President Donald Trump has repeatedly threatened to impose secondary tariffs on buyers of Russian oil, and in a post earlier this week singled out India for criticism, saying that it would pay an additional economic penalty for its ongoing purchases.  “We are interpreting the increased buying activity from India as a sign of diversification away from Russian supply,” said Livia Gallarati, global crude lead at consultant Energy Aspects. “Physical players are unlikely to gamble on buying Russian barrels, especially at current high prices, even if skepticism remains over whether US President Donald Trump will follow through with these threats.” This week, IOC sought crude supplies in multiple back-to-back purchase tenders, which traders said was unusual for the company and pointed to relatively urgent demand for crude. Earlier in the week, it also purchased 4 million barrels of West African barrels, as well as the UAE’s Murban crude for delivery

Read More »

Reliance to explore offshore India under new agreement

@import url(‘https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap’); a { color: #c19a06; } .ebm-page__main h1, .ebm-page__main h2, .ebm-page__main h3, .ebm-page__main h4, .ebm-page__main h5, .ebm-page__main h6 { font-family: Inter; } body { line-height: 150%; letter-spacing: 0.025em; font-family: Inter; } button, .ebm-button-wrapper { font-family: Inter; } .label-style { text-transform: uppercase; color: var(–color-grey); font-weight: 600; font-size: 0.75rem; } .caption-style { font-size: 0.75rem; opacity: .6; } #onetrust-pc-sdk [id*=btn-handler], #onetrust-pc-sdk [class*=btn-handler] { background-color: #c19a06 !important; border-color: #c19a06 !important; } #onetrust-policy a, #onetrust-pc-sdk a, #ot-pc-content a { color: #c19a06 !important; } #onetrust-consent-sdk #onetrust-pc-sdk .ot-active-menu { border-color: #c19a06 !important; } #onetrust-consent-sdk #onetrust-accept-btn-handler, #onetrust-banner-sdk #onetrust-reject-all-handler, #onetrust-consent-sdk #onetrust-pc-btn-handler.cookie-setting-link { background-color: #c19a06 !important; border-color: #c19a06 !important; } #onetrust-consent-sdk .onetrust-pc-btn-handler { color: #c19a06 !important; border-color: #c19a06 !important; background-color: undefined !important; } Reliance Industries Ltd. entered into a joint operating agreement with Oil and Natural Gas Corp. (ONGC) and BP Exploration (Alpha) Ltd. to explore Block GS-OSHP-2022/2 off the western coast of India in Saurashtra basin. The three firms jointly bid for the block in the 9th bid round of Open Acreage Licensing Policy (OALP) last year. The block spans an area of 5,454 sq km and is classified under Category-II basins. The consortium will explore the block to assess its hydrocarbon potential. ONGC will be operator of the block.

Read More »

Expand says efficiency lets executives trim capex by $100 million

The leaders of Expand Energy Corp., Oklahoma City, have trimmed the 2025 capital spending forecast by $100 million after posting record drilling performance during the second quarter. The company, formed last October via the merger of Chesapeake Energy and Southwestern Energy, is continuing with plans to build about 300 million cu ft equivalent/day (MMcfed) of potential capacity for 2026. Expand produced an average of just over 7.2 bcfed from its operations in the Haynesville basin as well southwest and northeast Appalachia, up from nearly 6.8 bcfed in the first three months of this year. President and chief executive officer Nick Dell’Osso and his team expect third-quarter production to also be around 7.2 bcfed, with Haynesville output growing about 2% and that from Appalachia ticking down. That production will use 11 rigs, down from the 12 executives had planned 3 months ago. Expand teams are expected to turn in line the same number of wells for the year as before—they added 59 to the company’s count during the second quarter, down from 89 in the year’s first quarter—but they’re doing so more efficiently: All three of the company’s regions drilled at least 20% more ft/day in the second quarter than early this year and set records. That rising efficiency is translating into the $100 million capex cut, which includes plans to set up Expand’s growth in 2026. Three months ago, executives expected they’d spend $300 million and end 2025 with 15 rigs to set up an additional 300 MMcfed of production next year. Those figures are now $275 million and 12 rigs—and Dell’Osso said recent gyrations in the price of natural gas won’t lead to major changes. “We’re just not bothered by the volatility that we’re seeing here this summer,” Dell’Osso said. “If you think about where we are in the

Read More »

DOE announces site selection for AI data centers

“The DOE is positioned to lead on advanced AI infrastructure due to its historical mandate and decades of expertise in extreme-scale computing for mission-critical science and national security challenges,” he said. “National labs are central hubs for advancing AI by providing researchers with unparalleled access to exascale supercomputers and a vast, interdisciplinary technical workforce.” “The Department of Energy is actually a very logical choice to lead on advanced AI data centers in my opinion,” said Wyatt Mayham, lead consultant at Northwest AI, which specializes in enterprise AI integration. “They already operate the country’s most powerful supercomputers. Frontier at Oak Ridge and Sierra at Lawrence Livermore are not experimental machines, they are active systems that the DOE built and continues to manage.” These labs have the physical and technical capacity to handle the demands of modern AI. Running large AI data centers takes enormous electrical capacity, sophisticated cooling systems, and the ability to manage high and variable power loads. DOE labs have been handling that kind of infrastructure for decades, says Mayham. “DOE has already built much of the surrounding ecosystem,” he says. “These national labs don’t just house big machines. They also maintain the software, data pipelines, and research partnerships that keep those machines useful. NSF and Commerce play important roles in the innovation system, but they don’t have the hands-on operational footprint the DOE has.” And Tanmay Patange, founder of AI R&D firm Fourslash, says the DOE’s longstanding expertise in high-performance computing and energy infrastructure directly overlap with the demands we have seen from AI development in places. “And the foundation the DOE has built is essentially the precursor to modern AI workloads that often require gigawatts of reliable energy,” he said. “I think it’s a strategic play, and I won’t be surprised to see the DOE pair their

Read More »

Data center survey: AI gains ground but trust concerns persist

Cost issues: 76% Forecasting future data center capacity requirements: 71% Improving energy performance for facilities equipment: 67% Power availability: 63% Supply chain disruptions: 65% A lack of qualified staff: 67% With respect to capacity planning, there’s been a notable increase in the number of operators who describe themselves as “very concerned” about forecasting future data center capacity requirements. Andy Lawrence, Uptime’s executive director of research, said two factors are contributing to this concern: ongoing strong growth for IT demand, and the often-unpredictable demand that AI workloads are creating. “There’s great uncertainty about … what the impact of AI is going to be, where it’s going to be located, how much of the power is going to be required, and even for things like space and cooling, how much of the infrastructure is going to be sucked up to support AI, whether it’s in a colocation, whether it’s in an enterprise or even in a hyperscale facility,” Lawrence said during a webinar sharing the survey results. The survey found that roughly one-third of data center owners and operators currently perform some AI training or inference, with significantly more planning to do so in the future. As the number of AI-based software deployments increases, information about the capabilities and limitations of AI in the workplace is becoming available. The awareness is also revealing AI’s suitability for certain tasks. According to the report, “the data center industry is entering a period of careful adoption, testing, and validation. Data centers are slow and careful in adopting new technologies, and AI will not be an exception.”

Read More »

Micron unveils PCIe Gen6 SSD to power AI data center workloads

Competitive positioning With the launch of the 9650 SSD PCIe Gen 6, Micron competes with Samsung and SK Hynix enterprise SSD offerings, which are the dominant players in the SSD market. In December last year, SK Hynix announced the development of PS1012 U.2 Gen5 PCIe SSD, for massive high-capacity storage for AI data centers.  The PM1743 is Samsung’s PCIe Gen5 offering in the market, with 14,000 MBps sequential read, designed for high-performance enterprise workloads. According to Faruqui, PCIe Gen6 data center SSDs are best suited for AI inference performance enhancement. However, we’re still months away from large-scale adoption as no current CPU platforms are available with PCIe 6.0 support. Only Nvidia’s Blackwell-based GPUs have native PCIe 6.0 x16 support with interoperability tests in progress. He added that PCIe Gen 6 SSDs will see very delayed adoption in the PC segment and imminent 2025 2H adoption in AI, data centers, high-performance computing (HPC), and enterprise storage solutions. Micron has also introduced two additional SSDs alongside the 9650. The 6600 ION SSD delivers 122TB in an E3.S form factor and is targeted at hyperscale and enterprise data centers looking to consolidate server infrastructure and build large AI data lakes. A 245TB variant is on the roadmap. The 7600 PCIe Gen5 SSD, meanwhile, is aimed at mixed workloads that require lower latency.

Read More »

AI Deployments are Reshaping Intra-Data Center Fiber and Communications

Artificial Intelligence is fundamentally changing the way data centers are architected, with a particular focus on the demands placed on internal fiber and communications infrastructure. While much attention is paid to the fiber connections between data centers or to end-users, the real transformation is happening inside the data center itself, where AI workloads are driving unprecedented requirements for bandwidth, low latency, and scalable networking. Network Segmentation and Specialization Inside the modern AI data center, the once-uniform network is giving way to a carefully divided architecture that reflects the growing divergence between conventional cloud services and the voracious needs of AI. Where a single, all-purpose network once sufficed, operators now deploy two distinct fabrics, each engineered for its own unique mission. The front-end network remains the familiar backbone for external user interactions and traditional cloud applications. Here, Ethernet still reigns, with server-to-leaf links running at 25 to 50 gigabits per second and spine connections scaling to 100 Gbps. Traffic is primarily north-south, moving data between users and the servers that power web services, storage, and enterprise applications. This is the network most people still imagine when they think of a data center: robust, versatile, and built for the demands of the internet age. But behind this familiar façade, a new, far more specialized network has emerged, dedicated entirely to the demands of GPU-driven AI workloads. In this backend, the rules are rewritten. Port speeds soar to 400 or even 800 gigabits per second per GPU, and latency is measured in sub-microseconds. The traffic pattern shifts decisively east-west, as servers and GPUs communicate in parallel, exchanging vast datasets at blistering speeds to train and run sophisticated AI models. The design of this network is anything but conventional: fat-tree or hypercube topologies ensure that no single link becomes a bottleneck, allowing thousands of

Read More »

ABB and Applied Digital Build a Template for AI-Ready Data Centers

Toward the Future of AI Factories The ABB–Applied Digital partnership signals a shift in the fundamentals of data center development, where electrification strategy, hyperscale design and readiness, and long-term financial structuring are no longer separate tracks but part of a unified build philosophy. As Applied Digital pushes toward REIT status, the Ellendale campus becomes not just a development milestone but a cornerstone asset: a long-term, revenue-generating, AI-optimized property underpinned by industrial-grade power architecture. The 250 MW CoreWeave lease, with the option to expand to 400 MW, establishes a robust revenue base and validates the site’s design as AI-first, not cloud-retrofitted. At the same time, ABB is positioning itself as a leader in AI data center power architecture, setting a new benchmark for scalable, high-density infrastructure. Its HiPerGuard Medium Voltage UPS, backed by deep global manufacturing and engineering capabilities, reimagines power delivery for the AI era, bypassing the limitations of legacy low-voltage systems. More than a component provider, ABB is now architecting full-stack electrification strategies at the campus level, aiming to make this medium-voltage model the global standard for AI factories. What’s unfolding in North Dakota is a preview of what’s coming elsewhere: AI-ready campuses that marry investment-grade real estate with next-generation power infrastructure, built for a future measured in megawatts per rack, not just racks per row. As AI continues to reshape what data centers are and how they’re built, Ellendale may prove to be one of the key locations where the new standard was set.

Read More »

Amazon’s Project Rainier Sets New Standard for AI Supercomputing at Scale

Supersized Infrastructure for the AI Era As AWS deploys Project Rainier, it is scaling AI compute to unprecedented heights, while also laying down a decisive marker in the escalating arms race for hyperscale dominance. With custom Trainium2 silicon, proprietary interconnects, and vertically integrated data center architecture, Amazon joins a trio of tech giants, alongside Microsoft’s Project Stargate and Google’s TPUv5 clusters, who are rapidly redefining the future of AI infrastructure. But Rainier represents more than just another high-performance cluster. It arrives in a moment where the size, speed, and ambition of AI infrastructure projects have entered uncharted territory. Consider the past several weeks alone: On June 24, AWS detailed Project Rainier, calling it “a massive, one-of-its-kind machine” and noting that “the sheer size of the project is unlike anything AWS has ever attempted.” The New York Times reports that the primary Rainier campus in Indiana could include up to 30 data center buildings. Just two days later, Fermi America unveiled plans for the HyperGrid AI campus in Amarillo, Texas on a sprawling 5,769-acre site with potential for 11 gigawatts of power and 18 million square feet of AI data center capacity. And on July 1, Oracle projected $30 billion in annual revenue from a single OpenAI cloud deal, tied to the Project Stargate campus in Abilene, Texas. As Data Center Frontier founder Rich Miller has observed, the dial on data center development has officially been turned to 11. Once an aspirational concept, the gigawatt-scale campus is now materializing—15 months after Miller forecasted its arrival. “It’s hard to imagine data center projects getting any bigger,” he notes. “But there’s probably someone out there wondering if they can adjust the dial so it goes to 12.” Against this backdrop, Project Rainier represents not just financial investment but architectural intent. Like Microsoft’s Stargate buildout in

Read More »

Microsoft will invest $80B in AI data centers in fiscal 2025

And Microsoft isn’t the only one that is ramping up its investments into AI-enabled data centers. Rival cloud service providers are all investing in either upgrading or opening new data centers to capture a larger chunk of business from developers and users of large language models (LLMs).  In a report published in October 2024, Bloomberg Intelligence estimated that demand for generative AI would push Microsoft, AWS, Google, Oracle, Meta, and Apple would between them devote $200 billion to capex in 2025, up from $110 billion in 2023. Microsoft is one of the biggest spenders, followed closely by Google and AWS, Bloomberg Intelligence said. Its estimate of Microsoft’s capital spending on AI, at $62.4 billion for calendar 2025, is lower than Smith’s claim that the company will invest $80 billion in the fiscal year to June 30, 2025. Both figures, though, are way higher than Microsoft’s 2020 capital expenditure of “just” $17.6 billion. The majority of the increased spending is tied to cloud services and the expansion of AI infrastructure needed to provide compute capacity for OpenAI workloads. Separately, last October Amazon CEO Andy Jassy said his company planned total capex spend of $75 billion in 2024 and even more in 2025, with much of it going to AWS, its cloud computing division.

Read More »

John Deere unveils more autonomous farm machines to address skill labor shortage

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More Self-driving tractors might be the path to self-driving cars. John Deere has revealed a new line of autonomous machines and tech across agriculture, construction and commercial landscaping. The Moline, Illinois-based John Deere has been in business for 187 years, yet it’s been a regular as a non-tech company showing off technology at the big tech trade show in Las Vegas and is back at CES 2025 with more autonomous tractors and other vehicles. This is not something we usually cover, but John Deere has a lot of data that is interesting in the big picture of tech. The message from the company is that there aren’t enough skilled farm laborers to do the work that its customers need. It’s been a challenge for most of the last two decades, said Jahmy Hindman, CTO at John Deere, in a briefing. Much of the tech will come this fall and after that. He noted that the average farmer in the U.S. is over 58 and works 12 to 18 hours a day to grow food for us. And he said the American Farm Bureau Federation estimates there are roughly 2.4 million farm jobs that need to be filled annually; and the agricultural work force continues to shrink. (This is my hint to the anti-immigration crowd). John Deere’s autonomous 9RX Tractor. Farmers can oversee it using an app. While each of these industries experiences their own set of challenges, a commonality across all is skilled labor availability. In construction, about 80% percent of contractors struggle to find skilled labor. And in commercial landscaping, 86% of landscaping business owners can’t find labor to fill open positions, he said. “They have to figure out how to do

Read More »

2025 playbook for enterprise AI success, from agents to evals

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More 2025 is poised to be a pivotal year for enterprise AI. The past year has seen rapid innovation, and this year will see the same. This has made it more critical than ever to revisit your AI strategy to stay competitive and create value for your customers. From scaling AI agents to optimizing costs, here are the five critical areas enterprises should prioritize for their AI strategy this year. 1. Agents: the next generation of automation AI agents are no longer theoretical. In 2025, they’re indispensable tools for enterprises looking to streamline operations and enhance customer interactions. Unlike traditional software, agents powered by large language models (LLMs) can make nuanced decisions, navigate complex multi-step tasks, and integrate seamlessly with tools and APIs. At the start of 2024, agents were not ready for prime time, making frustrating mistakes like hallucinating URLs. They started getting better as frontier large language models themselves improved. “Let me put it this way,” said Sam Witteveen, cofounder of Red Dragon, a company that develops agents for companies, and that recently reviewed the 48 agents it built last year. “Interestingly, the ones that we built at the start of the year, a lot of those worked way better at the end of the year just because the models got better.” Witteveen shared this in the video podcast we filmed to discuss these five big trends in detail. Models are getting better and hallucinating less, and they’re also being trained to do agentic tasks. Another feature that the model providers are researching is a way to use the LLM as a judge, and as models get cheaper (something we’ll cover below), companies can use three or more models to

Read More »

OpenAI’s red teaming innovations define new essentials for security leaders in the AI era

Join our daily and weekly newsletters for the latest updates and exclusive content on industry-leading AI coverage. Learn More OpenAI has taken a more aggressive approach to red teaming than its AI competitors, demonstrating its security teams’ advanced capabilities in two areas: multi-step reinforcement and external red teaming. OpenAI recently released two papers that set a new competitive standard for improving the quality, reliability and safety of AI models in these two techniques and more. The first paper, “OpenAI’s Approach to External Red Teaming for AI Models and Systems,” reports that specialized teams outside the company have proven effective in uncovering vulnerabilities that might otherwise have made it into a released model because in-house testing techniques may have missed them. In the second paper, “Diverse and Effective Red Teaming with Auto-Generated Rewards and Multi-Step Reinforcement Learning,” OpenAI introduces an automated framework that relies on iterative reinforcement learning to generate a broad spectrum of novel, wide-ranging attacks. Going all-in on red teaming pays practical, competitive dividends It’s encouraging to see competitive intensity in red teaming growing among AI companies. When Anthropic released its AI red team guidelines in June of last year, it joined AI providers including Google, Microsoft, Nvidia, OpenAI, and even the U.S.’s National Institute of Standards and Technology (NIST), which all had released red teaming frameworks. Investing heavily in red teaming yields tangible benefits for security leaders in any organization. OpenAI’s paper on external red teaming provides a detailed analysis of how the company strives to create specialized external teams that include cybersecurity and subject matter experts. The goal is to see if knowledgeable external teams can defeat models’ security perimeters and find gaps in their security, biases and controls that prompt-based testing couldn’t find. What makes OpenAI’s recent papers noteworthy is how well they define using human-in-the-middle

Read More »