SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.22075 · 2026

Autoregressive vs. Masked Diffusion Language Models: A Controlled Comparison

Caio Vicentino

arXiv · PDF · Open in the Atlas

Code that ran

4 of 9 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 0 have no contract verdict; 3 failures of our instrument; 5 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/2603.22075.json · badge: /api/ran/2603.22075.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
caiovicentino/arche canonical (classifier label)
classifier basis: census
4 ran · 5 no recorded run
FunctionStatusWhere it lives
generate_ar_batch Ran
ran; our contract draft was wrong, not the code
caiovicentino/arche/eval_diversity.py
code served (permissive licence) · get_code("cb42e76e4ef89ca8")
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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Build a minimal model that satisfies how it's used in the function
class MinimalARModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_dim=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, x):
        # x shape: (batch_size, seq_len)
        # output shape: (batch_size, seq_len, vocab_size)
        embedded = self.embedding(x)
        logits = self.linear(embedded)
        return logits

# Build a minimal tokenizer that satisfies how it's used
class MinimalTokenizer:
    def __init__(self, vocab_size=100):
        self.vocab_size = vocab_size
        self.word_to_id = {'Once': 42}
        self.id_to_word = {42: 'Once', 1: 'the', 2: 'cat', 3: 'sat'}
    
    def encode(self, text):
        # Return a list of token ids
        return [self.word_to_id.get(text, 1)]
    
    def decode(self, token_ids):
        # Convert list of token ids back to text
        words = [self.id_to_word.get(tid, f'<{tid}>') for tid in token_ids]
        return ' '.join(words)

# Create instances
model = MinimalARModel(vocab_size=100, hidden_dim=4)
tokenizer = MinimalTokenizer(vocab_size=100)
batch_size = 2
length = 5
device = 'cpu'

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'batch_size': batch_size,
    'length': length,
    'device': device
}
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
generate_mdlm_single Ran
ran, honoured the contract we drafted
caiovicentino/arche/eval_diversity.py
code served (permissive licence) · get_code("1adc464f6d3c4418")
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 int, shape (8,) 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)

class DummyMDLMModel(nn.Module):
    def __init__(self, vocab_size=10, hidden_dim=4):
        super().__init__()
        self.mask_id = 0
        self.vocab_size = vocab_size
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.time_embed = nn.Linear(1, hidden_dim)
        self.output_layer = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, x, t):
        # x: (batch_size, length)
        # t: (1,) - time tensor
        batch_size, length = x.shape
        
        # Embed tokens
        embedded = self.embedding(x)  # (batch_size, length, hidden_dim)
        
        # Embed time
        t_embedded = self.time_embed(t.unsqueeze(-1))  # (1, hidden_dim)
        
        # Broadcast and add time embedding
        t_embedded_expanded = t_embedded.expand(batch_size, -1)  # (batch_size, hidden_dim)
        t_expanded = t_embedded_expanded.unsqueeze(1).expand(-1, length, -1)  # (batch_size, length, hidden_dim)
        
        combined = embedded + t_expanded  # (batch_size, length, hidden_dim)
        
        # Output logits
        logits = self.output_layer(combined)  # (batch_size, length, vocab_size)
        
        return logits

model = DummyMDLMModel(vocab_size=10, hidden_dim=4)
device = 'cpu'
length = 8
steps = 5

ARGS = {
    'model': model,
    'length': length,
    'steps': steps,
    'device': device
}
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 int, shape (8,) — shape (8,) 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
load_text Ran
ran; our contract draft was wrong, not the code
caiovicentino/arche/data.py
code served (permissive licence) · get_code("520869c6f3ac5003")
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 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 os
import tempfile

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

# Create a test text file
test_file_path = os.path.join(temp_dir, 'test_input.txt')
with open(test_file_path, 'w', encoding='utf-8') as f:
    f.write('This is test data for the load_text function.')

ARGS = {
    'path': test_file_path,
    'dataset': 'shakespeare',
    'max_chars': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets — 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
tokenize_words Ran
ran; our contract draft was wrong, not the code
caiovicentino/arche/eval_diversity.py
code served (permissive licence) · get_code("059f792a8b4f7d6e")
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. 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

ARGS = {
    "texts": [
        "Hello World Example",
        "This Is A Test"
    ]
}
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 — a list 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
count_parameters Not yet run
unverified (harvested, no recorded run)
caiovicentino/arche/model.py
code served (permissive licence) · get_code("df002d2585b26d51")
How it ran

no invocation recorded.

create_models Not yet run
unverified (harvested, no recorded run)
caiovicentino/arche/gpu/models.py
code served (permissive licence) · get_code("89bc2d1f6eba841c")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
caiovicentino/arche/gpu/arche_colab.py
code served (permissive licence) · get_code("22d6fb48dd51a30d")
How it ran

no invocation recorded.

prepare_data Not yet run
unverified (harvested, no recorded run)
caiovicentino/arche/data.py
code served (permissive licence) · get_code("3549fc9ad12536ac")
How it ran

no invocation recorded.

train_one Not yet run
unverified (harvested, no recorded run)
caiovicentino/arche/gpu/arche_colab.py
code served (permissive licence) · get_code("9c09903fa4847edc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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-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

We present a controlled empirical comparison between autoregressive (AR) and masked diffusion (MDLM) language models. Both models are trained on identical data (50M tokens from TinyStories), identical compute budget (20,000 steps, batch size 32, sequence length 512), and identical hardware (NVIDIA H100 80GB), isolating the generation paradigm as the sole variable. We report three findings. First, both paradigms achieve comparable training throughput (∼50K tokens/second), with MDLM requiring only 4.7% more wall-clock time, countering the perception that diffusion training is substantially more expensive. Second, AR converges faster and begins overfitting by step 14,000, while MDLM converges more slowly and is still improving at step 20,000, suggesting different compute-optimal training regimes. Third, quantitative diversity analysis over 1,000 generated samples reveals a structural diversity-fluency trade-off: AR produces fluent but repetitive outputs (99.8% begin with the same word), while MDLM generates more diverse narratives (93.4% unique 5-word openings, higher Distinct-n, lower Self-BLEU), at the cost of occasional grammatical inconsistencies. We note that validation losses across paradigms are not directly comparable, as they measure different objectives (next-token prediction vs. masked token prediction). All code, trained checkpoints, and data pipelines are released for reproducibility.

For agents

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

get_harvested_code_for_paper("2603.22075")
get_code_for_paper("2603.22075")
have("2603.22075")

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

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

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

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

Connect an agent — have() is free.