# From coding to machine translation: The benefits of diffusion language models

> Source: <https://commandline.microsoft.com/diffusion-language-models-machine-translation-public-benchmarks/>
> Published: 2026-11-30 16:58:53+00:00

**Recommendation:** For long-output translation, consider diffusion decoding over a 1,024-token canvas: 30–40 denoising steps replaced about 1,024 autoregressive steps, though short outputs see little gain.
More in the playbook "Inference and self-hosting": <https://wpnews.pro/playbooks/inference-serving>

It started as a hackathon project.

I wanted to see how well diffusion language models (DLMs) could perform on coding benchmarks, particularly SWE-Bench Verified. I had noticed that, despite having been around for a while, diffusion models were largely absent from public benchmark leaderboards. Were they simply not good enough, or were we evaluating them in ways that favored autoregressive models? I decided to find out.

## From coding agents to a generation problem

I started with DiffusionGemma-27B and fine-tuned it on software engineering datasets, including SWE-Smith and SWE-Rebench.

Rather than relying solely on supervised fine-tuning, I experimented with reinforcement learning using LLM-based feedback. My approach was to score individual messages and actions within each trajectory, rewarding steps that contributed to the correct solution and penalizing irrelevant or harmful ones.

After several rounds of RL experiments, during which the model continued training on SWE-Bench Verified without access to ground-truth solutions, I achieved a score of 71.3%. But there was a catch: the model remained unstable, producing incorrectly formatted output in roughly 5–10% of cases. For coding agents, that much waste is unacceptable.

I realized that part of the challenge was fundamental to diffusion models.

Unlike autoregressive LLMs, which generate tokens sequentially, diffusion models progressively denoise a sequence, refining multiple tokens in a single forward pass. That introduces a different engineering challenge: when do you stop denoising?

You can use average token entropy, confidence thresholds, stability between successive steps, or a maximum number of iterations. Each approach has trade-offs: stop too early and some tokens remain incorrect; continue too long and you waste computation.

I experimented with different combinations but couldn’t reliably eliminate malformed outputs.

Maybe coding agents weren’t the right place to start.

## An unexpected direction: Translation

Rather than sticking with coding, I started looking for a task that could benefit from generating multiple tokens in parallel, while being less dependent on complex output formatting.

Translation came to mind almost immediately.

Unlike a coding agent, a translation model doesn’t need to navigate a repository, execute commands, or maintain a complicated interaction protocol. It needs to produce a coherent sequence of text. That seemed like a much better opportunity to exploit diffusion’s parallel generation capabilities.

So I changed directions.

## Building a diffusion translation model

I adapted DiffusionGemma-27B for machine translation, using a canvas of 1,024 tokens.

I split the public CoCoDoc-MT dataset into a training set of about 79.1K samples and a test set of 200 samples. Training had two stages: one full epoch of supervised fine-tuning on a single A100 GPU, followed by reinforcement learning on 260 samples with four candidates per step, using an LLM (GPT-5.4) as the judge.

Instead of generating one token at a time, the model progressively denoises the entire canvas, typically completing generation in 30–40 steps. That’s approximately 30 tokens processed per forward pass. For comparison, autoregressive decoding requires approximately 1,024 sequential generation steps for a 1,024-token output.

Outputs shorter than the canvas are padded after the end-of-sequence token. The speedup is therefore largest for long texts; short inputs wouldn’t see the same gain compared to autoregressive decoding, because an autoregressive model only needs as many steps as its output is long.

My initial experiment focused on translating English to four languages: Spanish, French, Russian, and traditional Chinese.

I evaluated the model on the CoCoDoc-MT test set using chrF++, comparing it against Microsoft Translator API and GPT-5-mini. The results exceeded my expectations.

## The results: Competitive quality with fewer sequential passes

The model achieved an overall chrF++ score of **69.42**, compared to 66.66 for Microsoft Translator API and 68.49 for GPT-5 mini.

| **Language pair** | **Our model** | **Microsoft Translator API** | **GPT-5 mini** | 
|---|---|---|---|
| English → Spanish | **74.65** | 72.02 | 74.00 | 
| English → French | **71.87** | 69.38 | 71.00 | 
| English → Russian | **68.94** | 64.30 | 66.90 | 
| English → Chinese | 34.55 | 32.72 | **35.40** | 
| **Overall** | **69.42** | 66.66 | 68.49 | 

he diffusion model outperformed both baselines in Spanish, French, and Russian. Traditional Chinese was the exception, where the diffusion model remained slightly behind GPT-5 mini.

But the most interesting part wasn’t the translation quality. It was achieving competitive results while requiring roughly 30 times fewer sequential generation passes. To be precise, this is a reduction in sequential steps, not a measured 30x gain in total compute, and the advantage comes from those fewer steps.

You can try the translator at [dlmtranslate.vercel.app](https://dlmtranslate.vercel.app/). 

## The takeaway

I think we’re still underexploring diffusion language models.

Most of today’s LLM tooling and evaluation practices were developed around autoregressive generation. That’s understandable, but diffusion models have different strengths and failure modes. Treating them as interchangeable might cause us to overlook interesting applications.

Translation is one example. Other tasks like offline speech recognition and optical character recognition could also benefit from generating or refining multiple tokens concurrently.

There are several directions I’d like to explore next:

- Run experiments on translation quality against the number of denoising steps
- **Adaptive canvas size:** Investigate scaling dynamically beyond the current 1,024-token canvas
- **More languages:** Expand language coverage and translation directions
- **Adaptive denoising:** Determine when tokens have converged and reallocate computation dynamically

What started as a hackathon experiment to see whether diffusion models could compete on software engineering benchmarks led me somewhere unexpected.

I started by asking whether diffusion models could code. I ended up learning that translation might be one of their most promising applications.
