NeurIPS 2026

Blocked Gibbs meets Diffusion Transformers: Unsupervised Learning for Constraint Optimization

1 University of Toronto2 Vector Institute

Paper Code Poster

Key takeaways

Standard diffusion

Sudoku board with strong noise across every cell.Early · Large noise
Sudoku board with weaker noise across every cell.Late · Small noise

Blocked Gibbs diffusion

Sudoku board with noise on many cells and locks on the rest.Early · Large block
Sudoku board with noise on two cells and locks on the rest.Late · Small block
Standard diffusion applies progressively smaller denoising updates to all variables. BloGDiT instead denoises selected blocks with a fixed forward noise scale, while annealing the block size from large to small. Locks indicate variables copied unchanged; pixelated cells indicate the selected block.

BloGDiT performs iterative block resampling: early steps modify large blocks for global exploration, while later steps focus on smaller blocks for local refinement. On hard Sudoku, BloGDiT achieves 94.1% accuracy, compared to 48.6% for DiT. On large-scale MaxCut, it reduces the average gap from 162.00 to 32.75.

Motivation

Why blocked Gibbs diffusion?

Improving a near-feasible solution often requires changing a selected subset of variables while preserving the rest. Standard diffusion denoises all variables at every step and can disrupt already-correct assignments.

Why unsupervised learning?

Solution samples are often difficult to obtain for complex constraint problems. BloGDiT uses differentiable problem energies in an unsupervised Boltzmann objective to learn a reusable proposal mechanism without solution labels.

Two small Sudoku boards illustrate how an update to the whole board can introduce errors in cells that were correct.
A global update changes previously correct entries without resolving the original constraint violations.

Learned proposals for Sudoku

Classical sampling methods typically solve each instance from scratch using hand-designed proposal mechanisms. BloGDiT instead learns a reusable proposal mechanism across instances. In this Sudoku example, the non-learned baseline makes many exploratory updates, several of which remain close to the initial assignment.

Projected search paths for one Sudoku instance. Non-learned sampling explores around initialization over 1,024 steps. BloGDiT approaches the target in three steps.

Non-learned sampling · 1,024 steps

The baseline makes many exploratory moves, some revisiting the starting region.

BloGDiT · 3 steps

The learned sampler moves directly toward the target.
Both trajectories are visualized in the same two-dimensional projection of the solution space. The cross marks initialization, the circle the final sample, and the star the target solution.

Constraint optimization as Boltzmann sampling

  1. Constrained optimization

    minX∈𝒳f(X)s.t.cj(X)=true,∀j∈[m]

    The goal is to find an assignment X that satisfies all constraints while minimizing the objective.

  2. Energy with constraint penalties

    E(X)=f(X)+∑j=1mλjφj(X)

    The energy combines the objective with nonnegative constraint penalties, weighted to prioritize feasible assignments.

  3. Boltzmann distribution

    pB(X)=exp(−E(X)/τ)∑X′∈𝒳exp(−E(X′)/τ)

    The Boltzmann distribution assigns higher probability to lower-energy assignments. Decreasing the temperature τ concentrates probability mass near energy minimizers.

An energy curve reaches its minimum where the Boltzmann curves have their peaks.
The Boltzmann distribution concentrates on low-energy assignments as the temperature decreases.

Blocked Gibbs Diffusion Transformer

BloGDiT performs iterative block resampling, denoising selected variables conditional on the unmasked part of the current assignment.

Forward and reverse trajectories

The forward process applies Gaussian corruption to selected blocks. The reverse chain starts from a Gaussian prior in logit space and denoises each selected block while preserving the remaining variables.

Forward · left to rightReverse · right to left
Forward and reverse blocked diffusion paths link a solved Sudoku board on the left to a noisy assignment on the right.

Near the noisy start

Early reverse update with a large block of selected cells.

Near the final assignment

Late reverse update with a small block of selected cells.
The reverse chain (blue) proceeds from a noisy assignment toward a low-energy solution. Each mask selects a block for conditional resampling.
  1. Select a block

    Sample a binary mask mt identifying the variables to update.

  2. Denoise the block

    The Transformer predicts the Gaussian mean and variance used to resample the selected logits.

  3. Copy the complement

    Copy unmasked variables unchanged.

Diffusion in logit space

Each Sudoku variable is represented by nine logits, one per possible digit. The model resamples the logits for selected variables, while the given clues remain fixed.

During training, constraint energies are evaluated on continuous assignments obtained by applying a row-wise softmax to the logits. For Graph Coloring, the penalty for an edge is the dot product of its endpoints’ color probabilities, penalizing assignments that favor the same color. At inference, a row-wise argmax produces the discrete assignment.

Forward and reverse distributions

We augment each forward and reverse transition with a binary mask that selects the variables to update. The resulting transition factors into mask selection and conditional denoising.

Standard diffusion

Forward
p(X0:T)=pB(X0)∏t=1Tp(Xt∣Xt−1)noise all
Reverse
qθ(X0:T)=q(XT)∏t=1Tqθ(Xt−1∣Xt)denoise all

Blocked Gibbs diffusion

Forward
p(X0:T,m1:T)=pB(X0)∏t=1Tpt(mt∣Xt−1)select blockp(Xt∣Xt−1,mt)noise block
Reverse
qθ(X0:T,m1:T)=q(XT)∏t=1Tqθ,t(mt∣Xt)select blockqθ(Xt−1∣Xt,mt)denoise block

Introducing auxiliary masks does not change the corresponding marginal diffusion trajectory: summing out the masks recovers the distribution over assignments (Proposition 3.1). The Boltzmann distribution remains the target over final assignments.

Unsupervised training

Forward KL requires samples from the Boltzmann target, which are generally unavailable for complex constraint problems. We instead minimize a mask-augmented joint KL upper bound on the reverse KL between the model distribution and the Boltzmann target.

Training objective in detail

Let qθ and p denote the reverse and forward joint distributions over trajectories and auxiliary masks.

KL(qθ(X0)∥pB(X0))≤KL(qθ(X0:T,m1:T)∥p(X0:T,m1:T))

Multiplying the joint KL by τ yields energy, entropy, forward noise-matching, and mask distribution-matching terms, up to a constant independent of θ. Expectations are taken under the reverse joint distribution.

Sample energy
𝔼qθ[E(X0)]
Entropy
−τ∑t=1T𝔼qθ[h(qθ(Xt−1∣Xt,mt))]
Forward noise matching
−τ∑t=1T𝔼qθ[logp(Xt∣Xt−1,mt)]
Mask distribution matching
+τ∑t=1T𝔼qθ[logqθ,t(mt∣Xt)pt(mt∣Xt−1)]

The masked Gaussian transitions yield closed-form entropy and forward noise-matching terms. The mask distribution-matching term vanishes because the forward and reverse processes share the same training mask schedule.

Which variables enter the block?

During training, forward and reverse processes use the same time-dependent, state-agnostic Bernoulli mask schedule, with masking rate ρt. At inference, the sampler can select blocks adaptively based on model uncertainty or constraint violations.

Two vertices are circled across the graph.
Select randomlySample vertices at the scheduled rate.
Circled vertices have small gaps between their two most likely colors.
Favor uncertain verticesPrioritize variables with small confidence margins.
Both endpoints of a red same-color edge are circled.
Favor conflicted verticesPrioritize variables involved in violated constraints.
Both endpoints of a sampled edge are circled.
Select connected verticesSelect variables participating in a common constraint.

Experiments

Sampling step 1

Sudoku

Sudoku with noise on many selected cells at left, and a board with several incorrect digits at right.

Graph coloring

Graph with locks marking copied vertices at left. Many red conflict edges remain in the updated coloring at right.

Sampling step 50

Sudoku

Sudoku with a smaller selected block at left, and fewer incorrect digits at right.

Graph coloring

Graph with locks marking copied vertices at left. Fewer red conflict edges remain in the updated coloring at right.

Sampling step 1,000

Sudoku

Sudoku with a small selected block at left, and a completed board at right.

Graph coloring

Graph with locks marking copied vertices at left. The updated coloring at right has no red conflict edges.
Illustrative blocked updates on Sudoku and Graph Coloring. Locks mark copied variables, pixelated cells indicate selected Sudoku variables, and red edges indicate coloring conflicts. The masks and graph recolorings are schematic.

We compare BloGDiT with a standard DiT baseline using the same Transformer backbone, training data, unsupervised objective, optimization settings, and inference budget. DiT applies Gaussian denoising to all variables at each step.

Benchmark results

Table 2. Performance comparison across four benchmarks. Bold indicates the best result and underline the second-best result. Higher is better for Sudoku, Graph Coloring, and MIS; lower is better for MaxCut.

Sudoku

MethodEasy ↑Hard ↑
OR-Tools100100
SATNet98.33.2
RRN99.828.6
Yang et al. (2023)10032.9
IRED99.462.1
RLSA4.21.8
ConsFormer10077.7
DiT10048.6
BloGDiT10094.1

Instances solved (%). Easy is SATNet. Hard is the out-of-distribution RRN split.

OR-Tools solves all instances on both splits. BloGDiT achieves the highest accuracy among learned methods on the harder, out-of-distribution RRN split.

Graph coloring

Method5 colors10 colors
n = 50 ↑n = 100 ↑n = 100 ↑n = 200 ↑
OR-Tools83.0857.1652.4110.25
Greedy32.420.000.750.00
Feasibility Jump82.8354.5035.666.00
ANYCSP79.1734.830.000.00
RLSA37.830.4210.752.50
ConsFormer81.0047.3352.6011.92
DiT79.7548.9150.5014.25
BloGDiT83.0054.6753.9218.58

Instances solved (%). For each color count, the larger graphs are out of distribution.

BloGDiT remains competitive with OR-Tools on the 5-color splits and achieves the highest solve rates on both 10-color splits.

Maximum independent set

MethodRB-small ↑RB-large ↑
OR-Tools20.1042.66
LwD19.0132.32
INTEL18.4734.47
DGL17.3634.50
LTFT19.1837.48
DIFUSCO18.52–
RLSA19.9740.19
X2GNN20.0739.28
DiffUCO18.8838.10
DiT8.050.29
BloGDiT19.5237.05

Mean independent set size on the two RB test splits.

BloGDiT substantially improves over DiT on both RB splits, while OR-Tools achieves the highest average objective values.

MaxCut

Method800 ↓1,000 ↓2,000 ↓≥ 3,000 ↓
OR-Tools143.89112.78365.89378.62
RUNCSP185.89156.56357.33401.00
ECO-DQN65.1154.67157.00428.25
ECORD8.678.7839.22187.75
ANYCSP1.222.4413.1151.63
RLSA3.224.0013.066.75
X2GNN21.116.0022.4446.38
DiffUCO4.116.3331.67116.75
ConsFormer16.3312.4452.11115.25
DiT56.1150.00101.33162.00
BloGDiT0.111.337.8832.75

Mean absolute gap to the best-known cut size, grouped by the number of vertices in GSET graphs.

BloGDiT achieves the smallest average gap across all GSET size buckets. For graphs with at least 3,000 vertices, the gap decreases from 162.00 for DiT to 32.75 for BloGDiT.

Effect of adaptive mask selection

We ablate adaptive mask selection by replacing it with random block selection at the same masking rate. On MIS-RB-large, the average independent set size increases from 17.16 to 37.05 with adaptive selection. On hard Sudoku, accuracy increases from 88.21% to 94.12%.

Number of sampling steps

On Sudoku, accuracy improves rapidly during the early denoising steps and exhibits diminishing returns beyond a few hundred steps. Additional inference steps do not always improve solution quality: on some MaxCut splits, a larger sampling budget increases the gap to the best-known solution.

Sudoku accuracy rises steeply early and then levels off across curves with different sampling budgets.
Sudoku accuracy as a function of reverse diffusion steps, evaluated with different inference budgets using the same trained model.

BibTeX

@inproceedings{xu2026blocked,
  title={Blocked Gibbs meets Diffusion Transformers: Unsupervised Learning for Constraint Optimization},
  author={Yudong Will Xu and Wenhao Li and Xiaoyu Wang and Scott Sanner and Elias Boutros Khalil},
  booktitle={The Fortieth Annual Conference on Neural Information Processing Systems},
  year={2026},
  url={https://openreview.net/forum?id=z5oDNb2lwJ}
}