SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.26504 · 2026

From Interface to Inference: Eliciting Any-Order Inference from Any-Order Models

Sham Kakade, Yilun Du, Sitan Chen, Jaeyeon Kim, Yuyuan Chen, Seunggeun Kim, Taekyun Lee

arXiv · PDF · Open in the Atlas

Code that ran

7 of 15 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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 4 failures of our instrument; 8 no recorded run), measured 2026-11-22; 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/2607.26504.json · badge: /api/ran/2607.26504.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
SeunggeunKimkr/genuine-any-order community
Papers with Code archive
7 ran · 8 no recorded run
FunctionStatusWhere it lives
RMSNorm Ran
ran on a synthesized input
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("3960fafde947a0b8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 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

def rms_norm(x: torch.Tensor, weight: torch.Tensor, eps: float=1e-06) -> torch.Tensor:
    var = x.pow(2).mean(dim=-1, keepdim=True) + eps
    x = x * torch.rsqrt(var)
    return x * weight

class RMSNorm(nn.Module):

    def __init__(self, dim: int, eps: float=1e-06):
        super().__init__()
        self.weight = nn.Parameter(torch.ones(dim))
        self.eps = eps

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return rms_norm(x, self.weight, self.eps)


INIT_ARGS = {
    'dim': 4,
    'eps': 1e-06
}

ARGS = {
    'x': torch.randn(2, 3, 4)
}

if __name__ == '__main__':
    model = RMSNorm(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 float, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RotaryEmbedding Ran
ran on a synthesized input
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("eafa1d1973ed3a8a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple, ndim 5, 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
from typing import Optional, Tuple

class RotaryEmbedding(nn.Module):

    def __init__(self, dim: int, max_position: int=1024, base: float=10000.0):
        super().__init__()
        assert dim % 2 == 0, 'dimension must be even'
        self.dim = dim
        self.max_position = max_position
        inv_freq = 1.0 / base ** (torch.arange(0, dim, 2) / dim)
        t = torch.arange(max_position, device=inv_freq.device, dtype=torch.float)
        freqs = torch.einsum('t, d -> t d', t, inv_freq)
        emb = torch.cat((freqs, freqs), dim=-1)
        self.register_buffer('cos', emb.cos().unsqueeze(1).unsqueeze(0), persistent=False)
        self.register_buffer('sin', emb.sin().unsqueeze(1).unsqueeze(0), persistent=False)

    def forward(self, seqlen: int, position_offset: int=0) -> Tuple[torch.Tensor, torch.Tensor]:
        end = position_offset + seqlen
        return (self.cos[:, position_offset:end], self.sin[:, position_offset:end])


INIT_ARGS = {
    'dim': 8,
    'max_position': 128,
    'base': 10000.0
}

ARGS = {
    'seqlen': 16,
    'position_offset': 0
}

if __name__ == '__main__':
    model = RotaryEmbedding(**INIT_ARGS)
    cos, sin = model(**ARGS)
    print(f"cos shape: {cos.shape}")
    print(f"sin shape: {sin.shape}")
    print(f"cos sample: {cos[0, 0, 0, :3]}")
    print(f"sin sample: {sin[0, 0, 0, :3]}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 5, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SwiGLU Ran
ran on a synthesized input
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("3d885aa9390a35ec")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
import torch.nn.functional as F

class SwiGLU(nn.Module):
    """
    SwiGLU: (xW1) ⊗ swish(xW2) @ W3
    Shapes:
      in=hidden, hidden=intermediate_size
    """

    def __init__(self, hidden_size: int, intermediate_size: int, dropout: float=0.0):
        super().__init__()
        self.w1 = nn.Linear(hidden_size, intermediate_size, bias=False)
        self.w2 = nn.Linear(hidden_size, intermediate_size, bias=False)
        self.w3 = nn.Linear(intermediate_size, hidden_size, bias=False)
        self.dropout = nn.Dropout(dropout)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        a = self.w1(x)
        b = F.silu(self.w2(x))
        out = self.w3(a * b)
        return self.dropout(out)


INIT_ARGS = {
    "hidden_size": 4,
    "intermediate_size": 6,
    "dropout": 0.1,
}

ARGS = {
    "x": torch.randn(2, 4),
}

if __name__ == "__main__":
    model = SwiGLU(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
apply_rope Ran
ran; our contract draft was wrong, not the code
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("bc605409c93e760b")
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 tuple, ndim 4, 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

torch.manual_seed(0)

# Create small tensors for q, k, cos, sin
# q and k are query and key tensors with shape (batch, seq_len, dim)
# cos and sin are rotation embeddings with compatible shapes
batch_size = 2
seq_len = 3
dim = 4

q = torch.randn(batch_size, seq_len, dim)
k = torch.randn(batch_size, seq_len, dim)
cos = torch.randn(batch_size, seq_len, dim)
sin = torch.randn(batch_size, seq_len, dim)

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
}
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 tuple, ndim 4, 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
first_eos_valid_mask Ran
ran; our contract draft was wrong, not the code
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("221634112f3d4c0e")
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 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 batch of token sequences
# batch_size=2, sequence_length=4
tokens = torch.tensor([
    [10, 20, 2, 0],  # sequence with EOS token (2) at position 2
    [10, 20, 30, 2]  # sequence with EOS token (2) at position 3
])

eos_id = 2

ARGS = {
    "tokens": tokens,
    "eos_id": eos_id
}
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 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
rms_norm Ran
ran; our contract draft was wrong, not the code
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("ef6476cb022a3586")
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 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 input tensor: batch_size=2, feature_dim=4
x = torch.randn(2, 4)

# Create a weight tensor matching the last dimension of x
weight = torch.randn(4)

# eps is a float parameter with default value
eps = 1e-06

ARGS = {
    "x": x,
    "weight": weight,
    "eps": eps,
}
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 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
rotate_half Ran
ran; our contract draft was wrong, not the code
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("0c3c32d281da5332")
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 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)

# The function rotate_half takes a tensor x and performs a rotation operation
# on pairs of elements along the last dimension.
# It expects a tensor with even-sized last dimension.

# Create a small tensor with shape (2, 4) - batch size 2, last dim 4 (even)
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 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
CombinedTransformer Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("e39a0defe21f90c9")
How it ran

no invocation recorded.

DecodeTransformer Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("13182262fa6b3d51")
How it ran

no invocation recorded.

EncodeTransformer Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("ba9094a92bf279a2")
How it ran

no invocation recorded.

LatentMDMTransformer Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("b9b01da2cc8639f1")
How it ran

no invocation recorded.

MDMConfig Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("a7600ccb1bb31c58")
How it ran

no invocation recorded.

MDMTransformer Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("9ea013e749852e65")
How it ran

no invocation recorded.

QwenAttention Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("2dba2e9b8d28eb25")
How it ran

no invocation recorded.

TransformerBlock Not yet run
unverified (harvested, no recorded run)
SeunggeunKimkr/genuine-any-order/LatentMDM/model/latent_mdm.py
code served (permissive licence) · get_code("92e841bff119fbfb")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Many discrete reasoning tasks, such as code generation, are inherently non-causal: programmers move between high-level structure and local details, a process we call any-order inference. For autoregressive language models, which lack a native any-order interface, non-causal abilities such as infilling and next-edit prediction require hand-designed mechanisms. Can we instead design models that natively support any-order inference? Masked diffusion models have recently emerged as compelling candidates, as their any-order training objective naturally offers an anyorder prediction interface. This interface, however, does not automatically yield any-order inference. We demonstrate that this interface-inference gap stems from positional uncertainty: fixed-canvas, token-level models may know what semantic component should appear without knowing where to place it. In light of this, we propose two complementary approaches: (1) Insertion-based masked diffusion, building on FlexMDM [Kim et al., 2025a], relaxes fixed-position commitments via insertions, enabling generation across non-contiguous regions. (2) Latent-space masked diffusion shifts prediction to coarser semantic segments, enabling search over latent generation orders. Empirically, we train a 7B FlexMDM for Python coding and a 125M LatentMDM for GSM8K and show that both approaches induce distinct anyorder inference behaviors and improve downstream performance. We release our codebase at https://github.com/SeunggeunKimkr/genuine-any-order.

For agents

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

get_harvested_code_for_paper("2607.26504")
get_code_for_paper("2607.26504")
have("2607.26504")

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

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

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

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

Connect an agent — have() is free.