SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.01331 · 2026

MetaState: Persistent Working Memory Enhances Reasoning in Discrete Diffusion Language Models

Mingzhe Li, Dachuan Shi, Xiangchi Yuan, Kejing Xia, Wenke Lee, Zhenbang Du, Qirui Jin, Lixuan Wei

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 0 no recorded run), measured 2026-11-21; 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.01331.json · badge: /api/ran/2603.01331.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
Les1a/MetaState canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
add_gumbel_noise Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Les1a/MetaState/dllm/core/samplers/utils.py
code served (permissive licence) · get_code("c7fd61b6c723375b")
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

torch.manual_seed(0)

# Create a small logits tensor (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4, dtype=torch.float32)

# Create a temperature value
temperature = 0.5

ARGS = {
    "logits": logits,
    "temperature": temperature,
}
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
clip_row Ran
ran; our contract draft was wrong, not the code
Les1a/MetaState/dllm/utils/data.py
code served (permissive licence) · get_code("67f6e87d643dd456")
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.

import torch

torch.manual_seed(0)

# The function clips sequences in a dict based on max_length and truncation direction
# It expects a dict with optional keys: 'input_ids', 'labels', 'attention_mask'
# Each value should be a sequence (list or tensor) that supports slicing

row = {
    'input_ids': torch.tensor([1, 2, 3, 4, 5, 6, 7, 8]),
    'labels': torch.tensor([0, 1, 0, 1, 0, 1, 0, 1]),
    'attention_mask': torch.tensor([1, 1, 1, 1, 1, 1, 1, 1])
}

max_length = 4
truncation = 'right'

ARGS = {
    'row': row,
    'max_length': max_length,
    'truncation': truncation
}
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
compute_kv_replace_offset Ran
ran, honoured the contract we drafted
Les1a/MetaState/dllm/core/modules/recurrent.py
code served (permissive licence) · get_code("de5487e7b83bbedd")
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 int, ndim 0, dtype family int, shape () 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)

# Create a valid replace_position tensor: [B, L] boolean tensor
# with a contiguous block of True values at the same position across all rows
B = 2
L = 4

# Create a boolean mask where rows have a contiguous True block starting at position 1
replace_position = torch.zeros((B, L), dtype=torch.bool)
replace_position[:, 1:3] = True  # All rows have True values at positions 1 and 2

ARGS = {
    "replace_position": replace_position,
}
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 int, ndim 0, dtype family int, shape () — shape () 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
create_recurrent_module_config Ran
ran; our contract draft was wrong, not the code
Les1a/MetaState/dllm/core/modules/recurrent.py
code served (permissive licence) · get_code("9b41aca897525bbf")
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 RecurrentModuleConfig. 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
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass
class MockHuggingFaceConfig:
    """Mock HuggingFace config object with required attributes."""
    d_model: int = 4096
    state_hidden_size: int = 1024
    num_memory_slots: int = 64
    time_cond_dim: int = 512
    unroll_steps: int = 4
    aux_loss_weights: dict = None
    debug_stats: bool = False
    initializer_range: float = 0.02
    mixer_dim: int = None
    mixer_num_heads: int = None
    mixer_use_gqa: bool = True
    mixer_mlp_ratio: float = 2.0
    mixer_slot_attn: bool = False
    updater_z_gate_bias: float = 0.0
    updater_r_gate_bias: float = 0.0
    unroll_steps_max: int = None
    warmup_k_fraction: float = 0.5
    injector_dim: int = None
    injector_num_heads: int = None
    injector_use_gqa: bool = True
    injector_mlp_ratio_bottleneck: float = 2.0
    disable_time_conditioning: bool = False

    def __post_init__(self):
        if self.aux_loss_weights is None:
            self.aux_loss_weights = {}

config = MockHuggingFaceConfig(
    d_model=4096,
    state_hidden_size=1024,
    num_memory_slots=64,
    time_cond_dim=512,
    unroll_steps=4,
    aux_loss_weights={"loss_1": 0.5},
    debug_stats=False,
    initializer_range=0.02,
    mixer_dim=2048,
    mixer_num_heads=8,
    mixer_use_gqa=True,
    mixer_mlp_ratio=2.0,
    mixer_slot_attn=False,
    updater_z_gate_bias=0.0,
    updater_r_gate_bias=0.0,
    unroll_steps_max=8,
    warmup_k_fraction=0.5,
    injector_dim=512,
    injector_num_heads=4,
    injector_use_gqa=True,
    injector_mlp_ratio_bottleneck=2.0,
    disable_time_conditioning=False
)

ARGS = {
    "config": config
}
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 RecurrentModuleConfig — a RecurrentModuleConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RecurrentModuleConfig 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
get_num_transfer_tokens_uniform Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Les1a/MetaState/dllm/core/samplers/utils.py
code served (permissive licence) · get_code("effe0c4dc9789e1b")
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 int, shape (2, 3) 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)

# Create a small mask_index tensor
# Shape: (batch_size, num_tokens) where each element is 0 or 1
# batch_size=2, num_tokens=4
mask_index = torch.tensor([
    [1, 1, 0, 1],
    [1, 0, 1, 1]
], dtype=torch.long)

# steps parameter
steps = 3

ARGS = {
    "mask_index": mask_index,
    "steps": steps
}
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 int, shape (2, 3) — shape (2, 3) 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_recurrent_checkpoint_model_type Ran
ran; our contract draft was wrong, not the code
Les1a/MetaState/dllm/utils/models.py
code served (permissive licence) · get_code("4c6685fbeb28fcff")
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 json
import os
import tempfile
import shutil

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

# Create the metadata file with model_type
meta_path = os.path.join(temp_dir, 'recurrent_checkpoint_meta.json')
metadata = {'model_type': 'custom_recurrent_model'}
with open(meta_path, 'w') as f:
    json.dump(metadata, f)

ARGS = {
    'path': temp_dir
}
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 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
is_lightweight_recurrent_checkpoint Ran
ran, violated the contract we drafted
Les1a/MetaState/dllm/utils/models.py
code served (permissive licence) · get_code("f9026375563cfa72")
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 bool, ndim 0, dtype family float, shape () 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 os
import tempfile
import json

# Create a temporary directory to act as the checkpoint path
temp_dir = tempfile.mkdtemp()

# Create the recurrent checkpoint meta file
meta_file_path = os.path.join(temp_dir, 'recurrent_checkpoint_meta.json')
with open(meta_file_path, 'w') as f:
    json.dump({'dummy': 'metadata'}, f)

ARGS = {
    'path': temp_dir
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
tokenize_and_group Ran
ran; our contract draft was wrong, not the code
Les1a/MetaState/dllm/utils/data.py
code served (permissive licence) · get_code("fb98ed14f9cf7c37")
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.

import torch
import numpy as np
from transformers import AutoTokenizer

# Create a minimal stand-in tokenizer that has the required interface
class MinimalTokenizer:
    def __init__(self):
        self.eos_token_id = 50256
    
    def __call__(self, texts, add_special_tokens=False):
        # Simulate tokenization: convert text to token IDs
        # Return a dict with 'input_ids' key
        if isinstance(texts, str):
            texts = [texts]
        
        input_ids = []
        for text in texts:
            # Simple mock: map characters to token IDs
            tokens = [ord(c) % 100 for c in text]
            input_ids.append(tokens)
        
        return {'input_ids': input_ids}

# Create example data
tokenizer = MinimalTokenizer()

examples = {
    'text': [
        'hello world this is a test',
        'another example with some tokens'
    ]
}

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'text_field': 'text',
    'seq_length': 1024,
    'insert_eos': True,
    'drop_tail': True,
    'add_special_tokens': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — 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 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
add_gumbel_noise 1 other paper
1 later
2608.08086 (2026-08)
Archer: Adaptive Reuse of Cached Hidden States for Efficient Rollback in Diffusion Language Models

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

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 language models (dLLMs) generate text by iteratively denoising a masked sequence. However, standard dLLMs condition each denoising step solely on the current hard-masked sequence, while intermediate continuous representations are discarded after sampling and remasking. We term this bottleneck the Information Island issue: continuous information remains isolated within individual denoising steps and fails to propagate across the trajectory. This bottleneck is especially harmful for reasoning, which requires intermediate reasoning state to be preserved and updated across many denoising steps. To address this limitation, we introduce MetaState, a lightweight recurrent augmentation that equips a frozen dLLM backbone with persistent, fixed-size working memory. MetaState comprises three modules with a shared time conditioner: a cross-attention Mixer that reads backbone activations into memory slots, a GRU-style Updater that integrates information across steps, and a cross-attention Injector that writes the updated memory back into the backbone. We train these modules with a dedicated K-step unrolling pipeline to learn multi-step dynamics. MetaState adds only ∼0.6% trainable parameters while keeping the backbone frozen, and consistently improves reasoning performance over frozen baselines on mathematical reasoning and code generation benchmarks, with an average gain of 4.5 percentage points across all evaluations. Our code is available at https://github.com/Les1a/MetaState.

For agents

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

get_harvested_code_for_paper("2603.01331")
get_code_for_paper("2603.01331")
have("2603.01331")

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

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

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

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

Connect an agent — have() is free.