SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.14157 · ICLR · 2025

Beyond Autoregression: Discrete Diffusion for Complex Reasoning and Planning

Xin Jiang, Zhenguo Li, Jiahui Gao, Lingpeng Kong, Lin Zheng, Jiacheng Ye, Shansan Gong

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2410.14157.json · badge: /api/ran/2410.14157.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
HKUNLP/diffusion-vs-ar canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
count_parameters Ran
ran, honoured the contract we drafted
HKUNLP/diffusion-vs-ar/src/llmtuner/extras/misc.py
code served (permissive licence) · get_code("c9e23707f64ef795")
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 int; 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple model with trainable and non-trainable parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Trainable parameter
        self.linear1 = nn.Linear(4, 3)
        # Non-trainable parameter
        self.linear2 = nn.Linear(3, 2)
        self.linear2.weight.requires_grad = False
        self.linear2.bias.requires_grad = False
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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, ndim 1, dtype family int — 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
dispatch_model Ran
ran; our contract draft was wrong, not the code
HKUNLP/diffusion-vs-ar/src/llmtuner/extras/misc.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from wujwyi/CMC, is pointer only (licence: NONE) · get_code("7aba54878bdf4a47")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from wujwyi/CMC, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_logger Ran
ran; our contract draft was wrong, not the code
HKUNLP/diffusion-vs-ar/src/llmtuner/extras/logging.py
code served (permissive licence) · get_code("56faa444d1b260c6")
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 Logger. 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 sys
import logging

# The function get_logger takes a single parameter: name (a string)
# Reading the function body:
# - It creates a formatter with a format string and date format
# - It creates a StreamHandler pointing to sys.stdout
# - It sets the formatter on the handler
# - It gets a logger by name
# - It sets the logger level to INFO
# - It adds the handler to the logger
# - It returns the logger
#
# The only parameter needed is 'name', which should be a string identifier for the logger

ARGS = {
    "name": "test_logger"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
infer_optim_dtype Ran
ran; our contract draft was wrong, not the code
HKUNLP/diffusion-vs-ar/src/llmtuner/extras/misc.py
code served (permissive licence) · get_code("a9e798cf22bd399b")
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 dtype. 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

torch.manual_seed(0)

# The function takes model_dtype as a parameter
# It checks against torch.bfloat16 and uses torch.float16 and torch.float32
# We need to set up the global variables that the function references

# Mock the availability flags that the function uses
_is_bf16_available = True
_is_fp16_available = True

# Inject these into the module namespace so infer_optim_dtype can access them
import sys
current_module = sys.modules[__name__]
current_module._is_bf16_available = _is_bf16_available
current_module._is_fp16_available = _is_fp16_available

def infer_optim_dtype(model_dtype: torch.dtype) -> torch.dtype:
    """
    Infers the optimal dtype according to the model_dtype and device compatibility.
    """
    if _is_bf16_available and model_dtype == torch.bfloat16:
        return torch.bfloat16
    elif _is_fp16_available:
        return torch.float16
    else:
        return torch.float32

# Build arguments
ARGS = {
    "model_dtype": torch.float32
}
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 dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype 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
pad_sequence Ran
ran, honoured the contract we drafted
HKUNLP/diffusion-vs-ar/src/llmtuner/dsets/preprocess.py
code served (permissive licence) · get_code("f92a36628049ade8")
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 list, ndim 2, dtype family int; 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

torch.manual_seed(0)

# Construct arguments for pad_sequence
lists = [
    [1, 2, 3],
    [4, 5],
    [6, 7, 8, 9, 10]
]

padding_value = 0

cut_len = 4

ARGS = {
    "lists": lists,
    "padding_value": padding_value,
    "cut_len": cut_len
}
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 list, ndim 2, dtype family int — a list 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
smooth Ran
ran, violated the contract we drafted
HKUNLP/diffusion-vs-ar/src/llmtuner/extras/ploting.py
code served (permissive licence) · get_code("70c7f6d657ef0a9e")
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 list, 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 math
from typing import List

torch_imported = False
try:
    import torch
    torch_imported = True
except ImportError:
    pass

# Create a simple list of float scalars for testing
scalars = [1.0, 2.5, 3.2, 4.1, 5.0, 6.3, 7.1, 8.5]

ARGS = {
    "scalars": scalars
}
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 list, ndim 1, dtype family float — a list 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
split_dataset Ran
ran; our contract draft was wrong, not the code
HKUNLP/diffusion-vs-ar/src/llmtuner/dsets/utils.py
code served (permissive licence) · get_code("1c0a502523d29b60")
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 dict. 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.

from dataclasses import dataclass, field
from typing import Dict, Optional, Union

torch_imported = False
try:
    import torch
    torch_imported = True
    torch.manual_seed(0)
except ImportError:
    pass


@dataclass
class DataArguments:
    val_size: float = 0.2
    streaming: bool = False
    buffer_size: int = 1000


@dataclass
class TrainingArguments:
    do_train: bool = True
    seed: int = 42


class MockDataset:
    """Mock Dataset with train_test_split method"""
    def __init__(self, size: int = 100):
        self.size = size
        self.data = list(range(size))
    
    def train_test_split(self, test_size: float, seed: int):
        split_idx = int(self.size * (1 - test_size))
        return {
            'train': MockDataset(split_idx),
            'test': MockDataset(int(self.size * test_size))
        }


class MockIterableDataset:
    """Mock IterableDataset with take, skip, and shuffle methods"""
    def __init__(self, size: int = 100):
        self.size = size
        self.data = list(range(size))
    
    def take(self, n: int):
        result = MockIterableDataset(min(n, self.size))
        result.data = self.data[:n]
        return result
    
    def skip(self, n: int):
        result = MockIterableDataset(max(0, self.size - n))
        result.data = self.data[n:]
        return result
    
    def shuffle(self, buffer_size: int, seed: int):
        # Return self for chaining
        return self


# Create test arguments for different scenarios
data_args = DataArguments(val_size=0.2, streaming=False, buffer_size=1000)
training_args = TrainingArguments(do_train=True, seed=42)

# Use non-streaming dataset (train_test_split path)
dataset = MockDataset(size=100)

ARGS = {
    'dataset': dataset,
    'data_args': data_args,
    'training_args': training_args
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 5 the same month, 7 later) and 0 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.

FunctionAlso present inEarliest-datedOthers named
get_logger 8 other papers
5 dated earlier, 2 the same month, 1 later
2311.13246 (2023-11)
CoachLM: Automatic Instruction Revisions Improve the Data Quality in LLM Instruction Tuning
2312.02554 (2023-12)
ULMA: Unified Language Model Alignment with Human Demonstration and Point-wise Preference
2403.13786 (2024-03)
Chain-of-Interaction: Enhancing Large Language Models for Psychiatric Behavior Understanding by Dyadic Contexts
and 5 more not named here
infer_optim_dtype 5 other papers
3 dated earlier, 1 the same month, 1 later
2303.18223 (2023-03)
A Survey of Large Language Models
2403.13786 (2024-03)
Chain-of-Interaction: Enhancing Large Language Models for Psychiatric Behavior Understanding by Dyadic Contexts
2406.15786 (2024-06)
What Matters in Transformers? Not All Attention is Needed
and 2 more not named here
smooth 5 other papers
2 dated earlier, 1 the same month, 2 later
2403.13786 (2024-03)
Chain-of-Interaction: Enhancing Large Language Models for Psychiatric Behavior Understanding by Dyadic Contexts
2406.15786 (2024-06)
What Matters in Transformers? Not All Attention is Needed
2410.17599 (2024-10)
Cross-model Control: Improving Multiple Large Language Models in One-time Training
and 2 more not named here
count_parameters 4 other papers
2 dated earlier, 1 the same month, 1 later
2403.13786 (2024-03)
Chain-of-Interaction: Enhancing Large Language Models for Psychiatric Behavior Understanding by Dyadic Contexts
2406.15786 (2024-06)
What Matters in Transformers? Not All Attention is Needed
2410.07672 (2024-10)
MACPO: Weak-to-Strong Alignment via Multi-Agent Contrastive Preference Optimization
and 1 more not named here
dispatch_model 2 other papers
1 the same month, 1 later
2410.17599 (2024-10)
Cross-model Control: Improving Multiple Large Language Models in One-time Training
2502.19805 (2025-02)
Implicit Search via Discrete Diffusion: A Study on Chess
pad_sequence 1 other paper
1 later
2502.19805 (2025-02)
Implicit Search via Discrete Diffusion: A Study on Chess
split_dataset 1 other paper
1 later
2502.19805 (2025-02)
Implicit Search via Discrete Diffusion: A Study on Chess

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-23.

Repositories linked to this paper

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

Abstract

Autoregressive language models, despite their impressive capabilities, struggle with complex reasoning and long-term planning tasks. We introduce discrete diffusion models as a novel solution to these challenges. Through the lens of subgoal imbalance, we demonstrate how diffusion models effectively learn difficult subgoals that elude autoregressive approaches. We propose Multi-Granularity Diffusion Modeling (MGDM), which prioritizes subgoals based on difficulty during learning. On complex tasks like Countdown, Sudoku, and Boolean Satisfiability Problems, MGDM significantly outperforms autoregressive models without using search techniques. For instance, MGDM achieves 91.5% and 100% accuracy on Countdown and Sudoku, respectively, compared to 45.8% and 20.7% for autoregressive models. Our work highlights the potential of diffusionbased approaches in advancing AI capabilities for sophisticated language understanding and problem-solving tasks. All associated codes are available at https://github.com/HKUNLP/diffusion-vs-ar.

For agents

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

get_harvested_code_for_paper("2410.14157")
get_code_for_paper("2410.14157")
have("2410.14157")

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

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

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

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

Connect an agent — have() is free.