Gemini Diffusion and the new paradigm of code generation by diffusion

Published on

One of the 8349083409 launch announcements at Google I/O today that really caught me by surprise (in a good way) was the new Gemini Diffusion model (which I managed to test!!).

It’s a diffusion model, but instead of generating images, it generates text and code using diffusion (yes, that’s really what you’re reading).

Diffusion models became famous because they were the engine behind the most popular image generation AIs, like DALL-E and Midjourney (plus audio and video too).

Explaining it simply, these models work in two stages: first, they learn to gradually add noise to the input data (images, audio) until it becomes noise (like the static on the TV). Then, they learn to reverse that process, that is, starting from random noise, they can remove the noise step by step until they generate a coherent final piece of data, like a new image or song (all based on the original data they were trained on).

Well, now this technique is being used to generate text and code too.

A few months ago Inception Labs had announced the Mercury Coder model (which we mentioned on the IA Sob Controle podcast) showing the potential of diffusion for text, and it seems like the idea really caught on.

The trick here is the way these models generate content. While traditional autoregressive models (the ones behind Gemini, ChatGPT, etc) generate text word by word (token by token, actually), a diffusion model starts with noise and refines the text in stages, and because of that it can be much faster.

I got access to this new Gemini Diffusion model today and ran a few initial tests (video below), and look, the speed of code generation is REALLY impressive! The video is NOT sped up! It can generate up to 1000 tokens per second, which is ABSURD compared to today’s autoregressive models, practically 5 times faster than Gemini 2.5.

But of course, it’s not all roses (yet!). The generated code, although fast, isn’t perfect. Imagine that today it has the code generation ability of models from 1 year ago, meaning you can’t put it in production yet, but the potential is huge!

What’s most exciting to me here is seeing a technique that was seen as something only for generating images, audio and video, now being successfully applied to generating text and code.

A test model like the one Google released opens up a new range of possibilities and a new frontier for AI research. For example, a diffusion model being used for NLP could have advantages in parallel generation and maybe even greater control over the result (or not, we’ll see).

I’m genuinely super curious to see how this technology evolves and whether we’ll really have a war between autoregressive vs. diffusion models for code generation. And of course, we’re the ones who win.

Congratulations to the Google DeepMind research team!