SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.08316 · NeurIPS · 2025

Why Masking Diffusion Works: Condition on the Jump Schedule for Improved Discrete Diffusion

Andrew Wilson, Nate Gruver, Alan Amin

arXiv · PDF · Open in the Atlas

Code that ran

10 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 8 failures of our instrument; 6 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2506.08316.json · badge: /api/ran/2506.08316.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
alannawzadamin/scud canonical (classifier label)
classifier basis: classifier_2025
10 ran · 6 no recorded run
FunctionStatusWhere it lives
convert_to_probs Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("0325c917fceb7495")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family int, shape (2, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Test case 1: integer tensor (int64)
x_0_int = torch.tensor([[0, 1, 2, 3], [1, 2, 0, 1]], dtype=torch.int64)
num_classes_int = 4

ARGS = {
    "x_0": x_0_int,
    "num_classes": num_classes_int,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family int, shape (2, 4, 4) — shape (2, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_a_b_func_sc Ran
ran on a synthesized input
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("340e4d9099615dcc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small valid transition matrix K (stochastic matrix)
# Make it 4x4 for small size
K = torch.tensor([
    [0.7, 0.1, 0.1, 0.1],
    [0.1, 0.7, 0.1, 0.1],
    [0.1, 0.1, 0.7, 0.1],
    [0.1, 0.1, 0.1, 0.7]
], dtype=torch.float64)

# Create a valid probability distribution p0 (must sum to 1)
p0 = torch.tensor([0.25, 0.25, 0.25, 0.25], dtype=torch.float64)

# Optional parameters - set to None to use defaults
precompute_mis = None
second_eval = None

ARGS = {
    'K': K,
    'p0': p0,
    'precompute_mis': precompute_mis,
    'second_eval': second_eval
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_gif Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("dc3cbb6c4c03d2c2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from torch import nn

torch.manual_seed(0)

class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.num_classes = 5
        self.linear = nn.Linear(4, 4)
    
    def get_stationary(self):
        # Return a probability distribution over num_classes
        return torch.softmax(torch.randn(self.num_classes), dim=0)
    
    def sample_sequence(self, init_noise, attn_mask, stride, n_T):
        # Return a list of tensors with shape (batch_size, channels, height, width)
        # Make 3 samples in the sequence
        batch_size = init_noise.shape[0]
        images = []
        for _ in range(3):
            # Create a tensor that looks like image data: (batch, channels, h, w)
            img = torch.randint(0, self.num_classes, (batch_size, 3, 4, 4), dtype=torch.float32)
            images.append(img)
        return images

# Create model instance
model = StandInModel()

# sample_x: should have shape (batch, channels, height, width) to establish the shape
sample_x = torch.randint(0, 5, (2, 3, 4, 4), dtype=torch.float32)

# sample_a: attention mask, optional. Shape (1, seq_len) or similar
sample_a = torch.ones(1, 8)

# batch_size for generation
batch_size = 2

# Number of generation/transition steps
gen_trans_step = 10

ARGS = {
    "sample_x": sample_x,
    "sample_a": sample_a,
    "model": model,
    "gen_trans_step": gen_trans_step,
    "batch_size": batch_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_inf_gen Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("708ec5714fd16adf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Test with 'uniform' type - simplest case
forward_kwargs_uniform = {
    'type': 'uniform'
}

num_classes = 4

ARGS = {
    'forward_kwargs': forward_kwargs_uniform,
    'num_classes': num_classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
evodiff, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_text Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("171b7d239afea3df")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.vocab_size = 100
    
    def get_stationary(self):
        # Returns a probability distribution over vocab
        return torch.softmax(torch.randn(self.vocab_size), dim=0)
    
    def sample_sequence(self, init_noise, attn_mask, stride, n_T):
        # Returns a list of token tensors
        batch_size = init_noise.shape[0]
        seq_len = 5
        # Return list of token tensors at different timesteps
        return [torch.randint(0, self.vocab_size, (batch_size, 3)) for _ in range(n_T)]

# Create a minimal tokenizer with both decode and pad_token_id
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
    
    def decode(self, token_ids):
        # Simple decode: just return a string representation
        if isinstance(token_ids, torch.Tensor):
            token_ids = token_ids.tolist()
        return "text_" + str(token_ids)

# Build arguments
model = MinimalModel()

# sample_x: small tensor with shape (batch, seq_len, features)
sample_x = torch.randn(2, 3, 4)

# sample_a: attention mask with shape (1, seq_len) - will be repeated
sample_a = torch.ones(1, 3)

# batch_size
batch_size = 2

# gen_trans_step: number of generation/transition steps
gen_trans_step = 20

# tokenizer
tokenizer = MinimalTokenizer()

ARGS = {
    'sample_x': sample_x,
    'sample_a': sample_a,
    'model': model,
    'gen_trans_step': gen_trans_step,
    'batch_size': batch_size,
    'tokenizer': tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
hash_matrix Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("2ba39f54891a0f2e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import hashlib

torch.manual_seed(0)

# The function hash_matrix expects a matrix (tensor) that has:
# - .cpu() method
# - .numpy() method on the result of .cpu()
# - .tobytes() method on the numpy array result

# Create a small tensor with distinct dimensions
matrix = torch.randn(2, 4)

ARGS = {
    "matrix": matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
kls Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("e8d679e578149494")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create two small distribution tensors
# Shape: (batch_size=2, num_classes=4)
dist1 = torch.randn(2, 4)
dist2 = torch.randn(2, 4)

ARGS = {
    'dist1': dist1,
    'dist2': dist2,
    'eps': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
newton_root_finder Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("828ffbe52bb6c5b1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Define a simple function that takes x and ts and returns a value
# The function is used with autograd, so it needs to support gradients
def simple_func(x, ts):
    # x and ts are tensors, return some differentiable function
    return x**2 - ts

# Set up the arguments
x0 = torch.tensor(2.0)
ts = torch.tensor([1.0, 4.0, 9.0, 16.0], dtype=torch.float64)
min_x = torch.tensor(1e-08, dtype=torch.float64)
max_iter = 1000
tol = 1e-12
print_ = False

ARGS = {
    "func": simple_func,
    "x0": x0,
    "ts": ts,
    "min_x": min_x,
    "max_iter": max_iter,
    "tol": tol,
    "print_": print_
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample_n_transitions_cont Ran
ran; our contract draft was wrong, not the code
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("8bd5456946e5396e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple callable that acts as log_alpha(t)
# It takes a tensor of times and returns log_alpha values
class LogAlphaFunction:
    def __call__(self, times):
        # Simple function: log_alpha(t) = -0.5 * t
        return -0.5 * times

log_alpha_fn = LogAlphaFunction()

# Test the function to ensure it works correctly
batch_size = 2
times = torch.tensor([0.5, 1.0, 1.5, 2.0], dtype=torch.float32)

ARGS = {
    "log_alpha": log_alpha_fn,
    "batch_size": batch_size,
    "times": times
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
try_load Ran
ran, honoured the contract we drafted
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("113fa009b87737b7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch
import os
import tempfile

torch.manual_seed(0)

# Create a temporary directory for the test
temp_dir = tempfile.mkdtemp()

# Define a simple function that returns a tensor
def sample_func():
    return torch.randn(2, 4)

# Set up the arguments
ARGS = {
    'func': sample_func,
    'fname': 'test_alphas.npy',
    'path': temp_dir + '/'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ContinuousTimeDiffusion Not yet run
unverified (harvested, no recorded run)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("350372f89ed37c5f")
How it ran

no invocation recorded.

DiffusionTrainer Not yet run
unverified (harvested, no recorded run)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("a47877ec65e2b4e1")
How it ran

no invocation recorded.

SCUD Not yet run
unverified (harvested, no recorded run)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("90974b46a044c53a")
How it ran

no invocation recorded.

get_a_b_func_cont Not yet run
unverified (harvested, no recorded run)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("7245f56fde77ea57")
How it ran

no invocation recorded.

get_a_b_func_mi Not yet run
unverified (harvested, no recorded run)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("f0b1e6873435a4df")
How it ran

no invocation recorded.

get_betas Not yet run
unverified (harvested, no recorded run)
alannawzadamin/scud/scud/scud.py
code served (permissive licence) · get_code("00ed359ed5a206e4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 16 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Discrete diffusion models, like continuous diffusion models, generate high-quality samples by gradually undoing noise applied to datapoints with a Markov process. Gradual generation in theory comes with many conceptual benefits; for example, inductive biases can be incorporated into the noising Markov process, and access to improved sampling algorithms. In practice, however, the consistently best performing discrete diffusion model is, surprisingly, masking diffusion, which does not denoise gradually. Here we explain the superior performance of masking diffusion by noting that it makes use of a fundamental difference between continuous and discrete Markov processes: discrete Markov processes evolve by discontinuous jumps at a fixed rate and, unlike other discrete diffusion models, masking diffusion builds in the known distribution of jump times and only learns where to jump to. We show that we can similarly bake in the known distribution of jump times into any discrete diffusion model. The resulting models -schedule-conditioned diffusion (SCUD) -generalize classical discrete diffusion and masking diffusion. By applying SCUD to models with noising processes that incorporate inductive biases on images, text, and protein data, we build models that outperform masking.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2506.08316")
get_code_for_paper("2506.08316")
have("2506.08316")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2506.08316.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2506.08316.svg)](https://syntology.ai/paper/2506.08316)

Connect an agent — have() is free.