SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.05289 · 2024

MARS: A neurosymbolic approach for interpretable drug discovery

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 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; 9 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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.05289.json · badge: /api/ran/2410.05289.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
laurendelong21/mars canonical (classifier label)
classifier basis: census
10 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_query_metrics Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/results/metrics_utils.py
code served (permissive licence) · get_code("d3416d21dbea26a4")
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 modifies a metrics_dict and uses answer_pos as an integer position
# It returns the modified metrics_dict

ARGS = {
    "metrics_dict": {
        "MRR": 0.0,
        "Hits@20": 0,
        "Hits@10": 0,
        "Hits@5": 0,
        "Hits@3": 0,
        "Hits@1": 0,
        "MRR_rule": 0.0,
        "Hits@20_rule": 0,
        "Hits@10_rule": 0,
        "Hits@5_rule": 0,
        "Hits@3_rule": 0,
        "Hits@1_rule": 0,
    },
    "answer_pos": 2,
    "rule": False,
}
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
create_output_and_model_dir Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/moa_retrieval_system/trainer.py
code served (permissive licence) · get_code("8ffcdab35ffb0787")
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 os
import tempfile
import shutil

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

params = {
    'base_output_dir': temp_dir + '/',
    'path_length': 5,
    'Lambda': 0.1,
    'embedding_size': 64,
    'hidden_size': 128,
    'alpha': 0.01,
    'beta': 0.02,
    'gamma_baseline': 0.99,
    'max_branching': 3,
    'learning_rate': 0.001
}

mode = 'train'

ARGS = {
    'params': params,
    'mode': mode
}
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 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
get_metapath_chunks Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/moa_retrieval_system/rules.py
code served (permissive licence) · get_code("b658e375bf5fe476")
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

# Analyze the function: it takes a 'path' parameter and iterates through it
# looking for tuples of consecutive elements, skipping 'NO_OP' entries
# The path should be a list/sequence of strings (relationship types)

ARGS = {
    "path": ["rel_A", "rel_B", "rel_C", "NO_OP", "rel_D", "rel_E"]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
get_metrics_by_length Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/results/metrics_utils.py
code served (permissive licence) · get_code("549a0e31b2bffee2")
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 DataFrame. 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 statistics
import pandas as pd

# Set seed for reproducibility
import torch
torch.manual_seed(0)

# Construct the arguments for get_metrics_by_length

# answer_positions: list of dicts, where each dict maps pair identifiers to answer positions
answer_positions = [
    {
        'pair_1': 0,
        'pair_2': 2,
        'pair_3': 5,
        'pair_4': 10,
        'pair_5': 15,
    },
    {
        'pair_1': 1,
        'pair_2': 3,
        'pair_3': 4,
        'pair_4': 8,
        'pair_5': 12,
    }
]

# path_lengths: dict mapping length identifiers to sets of pair identifiers
path_lengths = {
    1: {'pair_1', 'pair_2'},
    2: {'pair_3', 'pair_4'},
    3: {'pair_5'}
}

# rule: boolean flag
rule = False

ARGS = {
    'answer_positions': answer_positions,
    'path_lengths': path_lengths,
    'rule': rule
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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_paths Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/results/path_utils.py
code served (permissive licence) · get_code("79ee91714f0aff89")
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 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 tempfile
import os

# Create a temporary file with sample PoLo output format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file_path = temp_file.name

# Write sample data in the expected format
sample_content = """entity1 entity2
Reward:1
AnswerPosition:0
node1	node2	node3
rel1	rel2	rel3
1
___________________
node4	node5
rel4	rel5
1
___________________
#####################
entity3 entity4
Reward:1
AnswerPosition:1
node6	node7
rel6	rel7
1
___________________
#####################
entity5 entity6
Reward:0
AnswerPosition:0
node8	node9
rel8	rel9
0
___________________
#####################
"""

temp_file.write(sample_content)
temp_file.close()

# Define ARGS dict with all required parameters
ARGS = {
    'file_path': temp_file_path,
    'correct_only': True
}
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 tuple, ndim 1, 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
get_shortest_path_lengths Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/results/path_utils.py
code served (permissive licence) · get_code("866af7800401cb0d")
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 defaultdict. 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 tempfile
import os
import pandas as pd

# Create temporary CSV files for kg_file and test_edges
temp_dir = tempfile.mkdtemp()

# Create a knowledge graph file
kg_data = [
    ["entity_0", "relation_a", "entity_1"],
    ["entity_1", "relation_b", "entity_2"],
    ["entity_2", "relation_c", "entity_3"],
    ["entity_0", "relation_d", "entity_3"],
]
kg_file = os.path.join(temp_dir, "kg.tsv")
kg_df = pd.DataFrame(kg_data)
kg_df.to_csv(kg_file, sep='\t', header=False, index=False)

# Create a test edges file
test_edges_data = [
    ["entity_0", "test_rel", "entity_2"],
    ["entity_1", "test_rel", "entity_3"],
    ["entity_0", "test_rel", "entity_3"],
]
test_edges_file = os.path.join(temp_dir, "test_edges.tsv")
test_edges_df = pd.DataFrame(test_edges_data)
test_edges_df.to_csv(test_edges_file, sep='\t', header=False, index=False)

ARGS = {
    "kg_file": kg_file,
    "test_edges": test_edges_file,
    "max_path_length": 5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
initialize_metrics_dict Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/results/metrics_utils.py
code served (permissive licence) · get_code("f36a2d0b67fb9d33")
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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'rule': False
}
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
initialize_setting Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/moa_retrieval_system/trainer.py
code served (permissive licence) · get_code("e99232faa9759c14")
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 os
import tempfile
import torch

torch.manual_seed(0)

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

ARGS = {
    'params': {
        'base_output_dir': temp_dir + '/',
        'path_length': 3,
        'Lambda': 0.5,
        'embedding_size': 64,
        'hidden_size': 128,
        'alpha': 0.1,
        'beta': 0.2,
        'gamma_baseline': 0.9,
        'max_branching': 5,
        'learning_rate': 0.001,
    },
    'relation_vocab': {
        'rel_0': 0,
        'rel_1': 1,
        'rel_2': 2,
    },
    'entity_vocab': {
        'ent_0': 0,
        'ent_1': 1,
        'ent_2': 2,
        'ent_3': 3,
    },
    'mode': 'train',
}
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
p2h_probability Ran
ran, honoured the contract we drafted
laurendelong21/mars/MARS/moa_retrieval_system/rules.py
code served (permissive licence) · get_code("a577670cbc47418f")
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 float, 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 torch
import numpy as np

torch.manual_seed(0)

# Construct a metapath as a list of relation strings
mpath = ['rel_A', 'rel_B', 'rel_C', 'rel_D']

# Construct empirical probabilities dictionary mapping two-hop chunks to probabilities
empirical_probs = {
    ('rel_A', 'rel_B'): 0.5,
    ('rel_B', 'rel_C'): 0.3,
    ('rel_C', 'rel_D'): 0.7,
}

ARGS = {
    'mpath': mpath,
    'empirical_probs': empirical_probs,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
sum_dicts Ran
ran; our contract draft was wrong, not the code
laurendelong21/mars/MARS/moa_retrieval_system/rules.py
code served (permissive licence) · get_code("99fb2d53ed439c8a")
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

torch.manual_seed(0)

# Construct arguments for sum_dicts
dict1 = {
    'a': 5,
    'b': 10,
    'c': torch.tensor([1.0, 2.0, 3.0, 4.0])
}

dict2 = {
    'b': 3,
    'd': 20,
    'c': torch.tensor([0.5, 0.5, 0.5, 0.5])
}

ARGS = {
    'dict1': dict1,
    'dict2': dict2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
get_rel_mapping Not yet run
unverified (harvested, no recorded run)
laurendelong21/mars/MARS/results/path_utils.py
code served (permissive licence) · get_code("d7a541cef218158e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
initialize_setting 1 other paper
1 dated earlier
1711.05851 (2017-11)
Go for a Walk and Arrive at the Answer: Reasoning Over Paths in Knowledge Bases using Reinforcement Learning

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

Background: Neurosymbolic (NeSy) artificial intelligence describes the combination of logic or rule-based techniques with neural networks. Compared to neural approaches, NeSy methods often possess enhanced interpretability, which is particularly promising for biomedical applications like drug discovery. However, no clear guidelines exist to assess the biological plausibility of model interpretations. Methods: To assess interpretability in the context of drug discovery, we devise a novel prediction task, called drug mechanism-of-action (MoA) deconvolution, with an associated, tailored knowledge graph (KG), MoA-net. We then develop the MoA Retrieval System (MARS), a NeSy approach for drug discovery which leverages logical rules with learned rule weights. Results: Using MARS' interpretable features alongside domain knowledge, we find that MARS and other NeSy approaches on KGs are susceptible to reasoning shortcuts, in which the prediction of true labels is driven by ``degree-bias'' rather than the domain-based rules. Subsequently, we demonstrate ways to identify and mitigate this. Thereafter, MARS achieves performance on par with current state-of-the-art models while producing model interpretations aligned with known MoAs. Conclusion: Through MARS, we showcase the novel task of computational MoA deconvolution. Our results emphasize the importance of using interpretable models, like NeSy ones, for applications in drug discovery. Specifically, by identifying and mitigating reasoning shortcuts, MARS MoA predictions which are biologically meaningful and, therefore, more reliable for downstream drug discovery research.

For agents

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

get_harvested_code_for_paper("2410.05289")
get_code_for_paper("2410.05289")
have("2410.05289")

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

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

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

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

Connect an agent — have() is free.