# 🧪 Can a CPU and a GPU give the same AI answer? DetLLM shows one way

AI Today · published 2026-11-13T07:40:27Z · https://ai-today.com/opinions/edac1f83-c51b-4ac7-ba68-9753b374b645?lang=en

- 🖥️ Nathan Barry ran a small Qwen model using integers. Its internal output scores matched across nine CPU and GPU test configurations.
- 🔁 The demo used one prompt and the same prepared model file. It shows a way to reproduce outputs when debugging or comparing systems.

🧠 A language model can give different answers on two machines even when it always picks the most likely piece of text. In an experiment called DetLLM, Nathan Barry adapted a small Qwen model to use integers when generating an answer. For one prompt, the model's internal output scores matched across nine CPU and GPU configurations. Reproducing a bug on a second machine would require the same prepared model file.

🔢 A language model scores many possible continuations before it chooses the next piece of text. That involves adding large quantities of numbers. With floating-point arithmetic, changing the order of those additions can slightly change the result. A GPU may split the work differently when it serves a batch of requests. If two possible continuations are close, rounding can decide which one wins.

🔧 Barry prepared Qwen3-0.6B for integer arithmetic. He included the calculations between the large matrix operations, such as determining how much weight to give different parts of the preceding text. The implementation uses a fixed rule when rounding between numerical scales and picks the lower token ID when two scores tie.

In the demo, the model added 512 tokens to a short passage. Barry varied the setup on NVIDIA A100 and H100 GPUs, including whether the prompt ran alone or alongside other requests. He also used AMD, Intel and Apple CPUs. A checksum covering the internal output scores matched in all nine integer runs. The floating-point scores differed in all nine runs. Eight still generated the same text. On the Apple CPU, a close race later in the passage ended in a tie and changed the wording.

💾 Barry provides the code and the prepared model file. Anyone comparing results on two machines can first check that the files have the same digital fingerprint. The result depends on that common preparation. Barry lists larger models and random sampling of text continuations as open work.

## Sources

- [DetLLM code](https://github.com/nathanrs/detllm)
- [DetLLM experiment](https://nathan.rs/posts/detllm/)
- [Prepared Qwen model](https://huggingface.co/nathanbarry/detllm-qwen3-0.6b-int8)
- [Earlier research on reproducibility](https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/)

---
This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources.
