Seedlabs

OrderHeat: Order-Diverse Best-of-N Sampling for Diffusion Code Models

A sampling method for AI coders that generates diverse options to find the best working code.

An inference-time sampling mode for dLLM coding endpoints that generates N candidates at high temperature — diversifying not just token choice but generation order — and auto-selects the one that passes the user's tests, converting the demonstrated pass@10 lift into higher first-shot acceptance.

Computer ScienceSoftware Engineering Research
Reasoning and Retrieval OptimizationAI coding assistants and coding agents with test-verification loops.

Concept

A thin serving-layer feature (or API parameter) for diffusion code models. For each generation request it samples N candidate completions at high temperature and picks the winner via cheap verification — compile, lint, or the user's existing test suite. The dLLM-specific edge: in masked-diffusion models, raising temperature diversifies not only which tokens are chosen but the order in which the model generates them [0], so the N candidates differ structurally (different solution approaches) rather than superficially, raising the odds that at least one passes. That diversity mechanism is something autoregressive samplers cannot replicate. One wedge: a better best-of-N hit rate per unit of inference compute.

Why now

DiffuCoder quantifies the effect: pass@10 accuracy rises as sampling temperature increases from 0.2 to 1.2, driven by diversification of both token choice and generation order [0]. Producing N candidates is cheap on dLLMs because block-wise KV caching and parallel decoding already deliver large throughput gains over naive diffusion decoding [1]. The evidence is prototype-scale (a 7B model), but the feature requires no training — it wraps an existing dLLM endpoint and converts the demonstrated pass@10 lift into higher acceptance rates for any coding workflow that can already run tests.

Written by GLM · 29 Nov 2026

AI assessment

Backed by 2 papers93

An exceptionally focused and evidence-backed inference optimization that turns a unique property of diffusion models into a tangible win for AI coding agents.

Evidence strength
5/5
The idea directly leverages the DiffuCoder finding that temperature increases diversify generation order and token choice, which specifically boosts pass@10 metrics.
Market pull
5/5
Coding agents (All Hands, Sourcegraph) already employ test-verification loops, making a higher-hit-rate sampling method a high-value drop-in improvement.
Novelty & moat
3/5
While 'Fastest-Correct' does candidate selection, this specifically leverages the unique structural diversity of dLLMs (generation order) rather than just runtime efficiency, filling a gap in dLLM-specific inference strategies.
Feasibility
5/5
The implementation is a thin wrapper around an existing endpoint, and the necessary throughput gains are already demonstrated by the Fast-dLLM research.
Wedge clarity
5/5
The wedge is a specific API parameter/mode for dLLM endpoints to increase first-shot acceptance via best-of-N sampling.
Simplicity / focus
5/5
It is a single, focused feature (sampling mode) rather than a complex platform or training pipeline.

Scored by Gemma 4 · 29 Nov 2026. Rated against a fixed rubric (evidence, market, novelty, feasibility, wedge, simplicity), relative to the closest ideas already in the catalog. A prior estimate to compare ideas before real-world signal arrives.

Act on this idea

Ideas only matter if someone runs with them. Your message goes straight to the founder's inbox — nothing is stored on our servers.

Who benefits

  • A high-temperature order-diverse sampling mode is a drop-in feature for its fast code dLLM, directly converting the demonstrated pass@10 lift into higher acceptance rates for customers with test harnesses.

  • Factorycompany

    Its development 'droids' already verify candidate code against tests; structurally diverse candidates raise the chance one passes per rollout, cutting expensive retry loops.

  • Its open-source OpenHands agent runs tests on generated code; a dLLM backbone with this sampler improves its best-of-N success rate at little extra inference cost.

  • Enterprise Cody deployments sit on repositories with existing test suites — exactly the verification signal the sampler needs to auto-select among diverse candidates.

Research it builds on

  1. Fast-dLLM: Training-free Acceleration of Diffusion LLM by Enabling KV Cache and Parallel Decoding
    Chengyue Wu, Hao Zhang, Shuchen Xue et al. · 2026 · 514 citations
    All ideas from this paper →
  2. DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation
    Shansan Gong, Ruixiang Zhang, Huangjie Zheng et al. · 2026 · 234 citations
    All ideas from this paper →
Leave feedback
feasibility