SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.11628 · ICML · 2025

Discrete Neural Algorithmic Reasoning

Liudmila Prokhorenkova, Gleb Rodionov

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 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/2402.11628.json · badge: /api/ran/2402.11628.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
yandex-research/dnar canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
bfs Ran
ran; our contract draft was wrong, not the code
yandex-research/dnar/generate_data.py
code served (permissive licence) · get_code("1b250b791459ce0e")
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 numpy as np

class ProblemInstance:
    def __init__(self, adj, start, weighted, randomness):
        self.adj = np.copy(adj)
        self.start = start
        self.weighted = weighted
        self.randomness = np.copy(randomness)
        self.edge_index = np.stack(np.nonzero(adj + np.eye(adj.shape[0])))
        self.out_nodes = [[] for _ in range(adj.shape[0])]
        for x, y in self.edge_index[:, self.edge_index[0] != self.edge_index[1]].T:
            self.out_nodes[x].append(y)
        random_pos = np.random.uniform(0.0, 1.0, (adj.shape[0],))
        self.pos = random_pos[np.argsort(random_pos)]

# Create a small adjacency matrix for a simple graph
# 4 nodes with some edges
adj = np.array([
    [0, 1, 0, 0],
    [1, 0, 1, 0],
    [0, 1, 0, 1],
    [0, 0, 1, 0]
], dtype=np.int32)

start = 0
weighted = False
randomness = np.array([0.1, 0.2, 0.3, 0.4])

instance = ProblemInstance(adj, start, weighted, randomness)

ARGS = {
    "instance": instance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
dfs Ran
ran; our contract draft was wrong, not the code
yandex-research/dnar/generate_data.py
code served (permissive licence) · get_code("df4c2e1bb388ca7f")
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 numpy as np

class ProblemInstance:
    def __init__(self, adj, start, weighted, randomness):
        self.adj = np.copy(adj)
        self.start = start
        self.weighted = weighted
        self.randomness = np.copy(randomness)
        self.edge_index = np.stack(np.nonzero(adj + np.eye(adj.shape[0])))
        self.out_nodes = [[] for _ in range(adj.shape[0])]
        for x, y in self.edge_index[:, self.edge_index[0] != self.edge_index[1]].T:
            self.out_nodes[x].append(y)
        random_pos = np.random.uniform(0.0, 1.0, (adj.shape[0],))
        self.pos = random_pos[np.argsort(random_pos)]

# Create a small adjacency matrix for a simple graph
# 4 nodes with a few edges
adj = np.array([
    [0, 1, 1, 0],
    [0, 0, 1, 0],
    [0, 0, 0, 1],
    [0, 0, 0, 0]
], dtype=np.int32)

start_node = 0
weighted = False
randomness = np.array([0.1, 0.2, 0.3, 0.4], dtype=np.float32)

# Create a ProblemInstance
instance = ProblemInstance(adj, start_node, weighted, randomness)

# Define arguments for the dfs function
ARGS = {
    "instance": instance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
gumbel_softmax Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yandex-research/dnar/utils.py
code served (permissive licence) · get_code("b1d27ed952dcc5ab")
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 (6,) 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
from torch_geometric.utils import group_argsort, scatter, softmax

torch.manual_seed(0)

# Create logits tensor: shape (6,) for 6 elements
logits = torch.randn(6, dtype=torch.float32)

# Create index tensor: group assignments for the 6 elements
# This tells which group each logit belongs to
index = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

ARGS = {
    "logits": logits,
    "index": index,
    "tau": 1.0,
    "use_noise": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — 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 (6,) — shape (6,) 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
mst Ran
ran; our contract draft was wrong, not the code
yandex-research/dnar/generate_data.py
code served (permissive licence) · get_code("3620d36101d9d5c2")
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 numpy as np

class ProblemInstance:
    def __init__(self, adj, start, weighted, randomness):
        self.adj = np.copy(adj)
        self.start = start
        self.weighted = weighted
        self.randomness = np.copy(randomness)
        self.edge_index = np.stack(np.nonzero(adj + np.eye(adj.shape[0])))
        self.out_nodes = [[] for _ in range(adj.shape[0])]
        for x, y in self.edge_index[:, self.edge_index[0] != self.edge_index[1]].T:
            self.out_nodes[x].append(y)
        random_pos = np.random.uniform(0.0, 1.0, (adj.shape[0],))
        self.pos = random_pos[np.argsort(random_pos)]

# Create a small adjacency matrix for a 4-node graph
np.random.seed(42)
n_nodes = 4
adj = np.array([
    [0.0, 1.5, 2.0, 0.0],
    [1.5, 0.0, 0.0, 1.2],
    [2.0, 0.0, 0.0, 0.8],
    [0.0, 1.2, 0.8, 0.0]
], dtype=np.float64)

start_node = 0
weighted = True
randomness = np.random.uniform(0.0, 1.0, (n_nodes,))

instance = ProblemInstance(
    adj=adj,
    start=start_node,
    weighted=weighted,
    randomness=randomness
)

ARGS = {
    "instance": instance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
read_config Ran
ran; our contract draft was wrong, not the code
yandex-research/dnar/configs/base_config.py
code served (permissive licence) · get_code("7dc8b4d3f1a728dc")
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 Config. 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 yaml
import tempfile
import os
from dataclasses import dataclass

torch.manual_seed(0)

@dataclass
class Config:
    algorithm: str = None
    batch_size: int = 32
    learning_rate: float = 0.0001
    weight_decay: float = 0.0
    num_iterations: int = 1000
    eval_each: int = 250
    stepwise_training: bool = True
    processor_upper_t: float = 3.0
    processor_lower_t: float = 0.01
    use_noise: bool = True
    num_samples: dict = None
    problem_size: dict = None
    edge_weights: bool = False
    generate_random_numbers: bool = False
    h: int = 128
    temp_on_eval: float = 0.0
    num_node_states: int = 1
    num_edge_states: int = 1
    output_type: str = 'pointer'
    output_idx: int = 0
    models_directory: str = 'models'
    tensorboard_logs: bool = True

def read_config(config_path: str):
    with open(config_path, 'r') as f:
        config_dict = yaml.safe_load(f)
    return Config(**config_dict)

# Create a temporary YAML config file
config_dict = {
    'algorithm': 'ppo',
    'batch_size': 16,
    'learning_rate': 0.001,
    'weight_decay': 0.0001,
    'num_iterations': 500,
    'eval_each': 100,
    'stepwise_training': True,
    'processor_upper_t': 2.5,
    'processor_lower_t': 0.05,
    'use_noise': False,
    'num_samples': {'train': 100, 'val': 20},
    'problem_size': {'nodes': 10, 'edges': 15},
    'edge_weights': True,
    'generate_random_numbers': True,
    'h': 64,
    'temp_on_eval': 1.0,
    'num_node_states': 2,
    'num_edge_states': 3,
    'output_type': 'classification',
    'output_idx': 1,
    'models_directory': '/tmp/models',
    'tensorboard_logs': False,
}

# Create temporary file
temp_fd, temp_path = tempfile.mkstemp(suffix='.yaml')
try:
    with os.fdopen(temp_fd, 'w') as f:
        yaml.dump(config_dict, f)
    
    ARGS = {
        'config_path': temp_path,
    }
finally:
    pass

ARGS = {
    'config_path': temp_path,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Config — a Config output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Config 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
temp_by_step Ran
ran, honoured the contract we drafted
yandex-research/dnar/utils.py
code served (permissive licence) · get_code("442d7bedb7a5b8b8")
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 float64, ndim 0, 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 numpy as np

ARGS = {
    "step": 5,
    "high": 1.0,
    "low": 0.1,
    "num_steps": 10,
    "temp_on_eval": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
reverse_edge_index Not yet run
unverified (harvested, no recorded run)
yandex-research/dnar/utils.py
code served (permissive licence) · get_code("c44d8613055ccc58")
How it ran

no invocation recorded.

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

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

Neural algorithmic reasoning aims to capture computations with neural networks by training models to imitate the execution of classical algorithms. While common architectures are expressive enough to contain the correct model in the weight space, current neural reasoners struggle to generalize well on out-of-distribution data. On the other hand, classical computations are not affected by distributional shifts as they can be described as transitions between discrete computational states. In this work, we propose to force neural reasoners to maintain the execution trajectory as a combination of finite predefined states. To achieve this, we separate discrete and continuous data flows and describe the interaction between them. Trained with supervision on the algorithm's state transitions, such models are able to perfectly align with the original algorithm. To show this, we evaluate our approach on multiple algorithmic problems and achieve perfect test scores both in single-task and multitask setups. Moreover, the proposed architectural choice allows us to prove the correctness of the learned algorithms for any test data.

For agents

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

get_harvested_code_for_paper("2402.11628")
get_code_for_paper("2402.11628")
have("2402.11628")

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

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

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

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

Connect an agent — have() is free.