SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.15527 · 2024

Interpretable Concept-Based Memory Reasoning

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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2407.15527.json · badge: /api/ran/2407.15527.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
daviddebot/CMR canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
get_accuracy Ran
ran, honoured the contract we drafted
daviddebot/CMR/experiments/cebab/models.py
code served (permissive licence) · get_code("b45172fecb8d6720")
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 torch.nn as nn
from torch.utils.data import DataLoader

torch.manual_seed(0)

class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def predict(self, inputs):
        x, c, y = inputs
        # Return logits with shape (batch_size, num_classes)
        return self.linear(x)

class DummyDataLoader:
    def __init__(self):
        self.data = [
            (
                torch.randn(2, 4),  # x: batch_size=2, features=4
                torch.randn(2, 5),  # c: batch_size=2, context_features=5
                torch.nn.functional.one_hot(torch.tensor([0, 1]), num_classes=3).float()  # y: batch_size=2, num_classes=3
            ),
            (
                torch.randn(2, 4),
                torch.randn(2, 5),
                torch.nn.functional.one_hot(torch.tensor([2, 0]), num_classes=3).float()
            )
        ]
    
    def __iter__(self):
        return iter(self.data)

model = DummyModel()
data_loader = DummyDataLoader()

ARGS = {
    "model": model,
    "data_loader": data_loader
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, 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
get_accuracy Ran
ran, honoured the contract we drafted
daviddebot/CMR/experiments/cub/models.py
code served (permissive licence) · get_code("17adc58c54e10b59")
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 torch.nn as nn
from torch.utils.data import DataLoader

torch.manual_seed(0)

# Define a simple model that implements predict method
class SimpleClassifier(nn.Module):
    def __init__(self, input_size, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_size, num_classes)
    
    def predict(self, batch):
        x, c, y = batch
        # x is the main input, c and y are auxiliary
        # Return logits with shape (batch_size, num_classes)
        output = self.linear(x)
        return output

# Create model
model = SimpleClassifier(input_size=4, num_classes=3)

# Create a small dataset as list of tuples (x, c, y)
# x: input features (batch_size=2, features=4)
# c: context/category (batch_size=2, some_dim=3)
# y: one-hot encoded labels (batch_size=2, num_classes=3)
data = [
    (
        torch.randn(2, 4),
        torch.randn(2, 3),
        torch.tensor([[1, 0, 0], [0, 1, 0]], dtype=torch.float32)
    ),
    (
        torch.randn(2, 4),
        torch.randn(2, 3),
        torch.tensor([[0, 0, 1], [1, 0, 0]], dtype=torch.float32)
    )
]

# Create data loader (list of batches)
data_loader = data

ARGS = {
    "model": model,
    "data_loader": data_loader
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, 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
get_accuracy Ran
ran, honoured the contract we drafted
daviddebot/CMR/experiments/mnist/models_copy.py
code served (permissive licence) · get_code("328e02ae2ef2610b")
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 torch.nn as nn
from torch.utils.data import DataLoader

torch.manual_seed(0)

# Define a minimal model that has a predict method
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def predict(self, inputs):
        x, c, y = inputs
        # Return predictions as a tensor of class indices
        logits = self.linear(x)
        preds = torch.argmax(logits, dim=1)
        return preds

# Create model instance
model = DummyModel()

# Create a simple data loader
# Each batch is a tuple of (x, c, y)
# x: input features (batch_size, 4)
# c: context or additional features (batch_size, 3)
# y: labels (batch_size,)
data_list = [
    (torch.randn(2, 4), torch.randn(2, 3), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.randn(2, 3), torch.tensor([1, 0])),
]

data_loader = data_list

ARGS = {
    "model": model,
    "data_loader": data_loader,
    "print_report": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, 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
get_iteration_based_stop_criterion Ran
ran; our contract draft was wrong, not the code
daviddebot/CMR/experiments/mnist/models_copy.py
code served (permissive licence) · get_code("aea24e497fa11bb4")
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 function. 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)

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)
    
    def aggregate_rules(self, data_loader, type='most_likely', inv=False):
        # Returns two dicts mapping task names to lists of rules
        task_to_rules = {
            'task_1': ['rule_a', 'rule_b'],
            'task_2': ['rule_c']
        }
        task_to_used_rules_idx = {
            'task_1': [0, 1],
            'task_2': [0]
        }
        return task_to_rules, task_to_used_rules_idx

# Create small train and validation loaders
# Each element is a (features, target) tuple
train_loader = [
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
    (torch.randn(2, 4), torch.randint(0, 2, (2,)))
]

val_loader = [
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
]

model = MockModel()

ARGS = {
    'max_it': 10
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_rules Ran
ran; our contract draft was wrong, not the code
daviddebot/CMR/experiments/cebab/local_experiments.py
code served (permissive licence) · get_code("843ebd990b938537")
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.

from sklearn.tree import DecisionTreeClassifier
import numpy as np

# Train a simple decision tree classifier
X = np.array([[0, 0], [1, 1], [2, 2], [3, 3]])
y = np.array([0, 1, 0, 1])
tree = DecisionTreeClassifier(max_depth=2, random_state=0)
tree.fit(X, y)

feature_names = ['feature_0', 'feature_1']
class_names = ['class_0', 'class_1']

ARGS = {
    'tree': tree,
    'feature_names': feature_names,
    'class_names': class_names
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
reasoning Ran
ran; our contract draft was wrong, not the code
daviddebot/CMR/experiments/mnist/models_copy.py
code served (permissive licence) · get_code("55c1ae1bcc80736c")
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 (2,) 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)

# Analyze the function:
# - logic: not used in the function body
# - concepts: used in arithmetic operations with tensors, needs to support element-wise ops
# - polarity: used in arithmetic operations, needs to support element-wise ops
# - relevance: used in arithmetic operations, needs to support element-wise ops
# - The function performs: irrelevance = 1 - relevance, negpolarity = 1 - pospolarity - irrelevance
# - Then uses torch.prod(preds, dim=-1), so needs dim=-1 to exist
# All parameters should be tensors with batch dimension and feature dimension

# Create small tensors with distinct sizes (batch=2, features=4)
logic = torch.randn(2, 4)
concepts = torch.sigmoid(torch.randn(2, 4))  # Should be in [0,1] for semantic meaning
polarity = torch.sigmoid(torch.randn(2, 4))  # Should be in [0,1] for semantic meaning
relevance = torch.sigmoid(torch.randn(2, 4))  # Should be in [0,1] for semantic meaning

ARGS = {
    "logic": logic,
    "concepts": concepts,
    "polarity": polarity,
    "relevance": relevance,
}
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 float, shape (2,) — shape (2,) 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
sample_bernoulli Ran
ran, honoured the contract we drafted
daviddebot/CMR/experiments/celeba/models.py
code served (permissive licence) · get_code("50eb2cd86f0408f1")
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
import torch.distributions as dist

torch.manual_seed(0)

# Create a simple distribution object with logits attribute
# The function calls distribution.logits and distribution.sample()
logits_tensor = torch.randn(2, 4)
distribution = dist.Bernoulli(logits=logits_tensor)

ARGS = {
    "distribution": distribution
}
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
softselect Ran
ran; our contract draft was wrong, not the code
daviddebot/CMR/experiments/cebab/cbm_models.py
code served (permissive licence) · get_code("40b97e37597522ba")
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 tensor with batch size 2 and dimension 4
# The function expects values to have at least 2 dimensions (uses dim=1 for softmax/mean)
values = torch.randn(2, 4)

# temperature is a scalar that scales the mean adjustment
temperature = 0.5

# use_sigmoid is a boolean flag
use_sigmoid = True

ARGS = {
    "values": values,
    "temperature": temperature,
    "use_sigmoid": use_sigmoid
}
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

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

The lack of transparency in the decision-making processes of deep learning systems presents a significant challenge in modern artificial intelligence (AI), as it impairs users' ability to rely on and verify these systems. To address this challenge, Concept Bottleneck Models (CBMs) have made significant progress by incorporating human-interpretable concepts into deep learning architectures. This approach allows predictions to be traced back to specific concept patterns that users can understand and potentially intervene on. However, existing CBMs' task predictors are not fully interpretable, preventing a thorough analysis and any form of formal verification of their decision-making process prior to deployment, thereby raising significant reliability concerns. To bridge this gap, we introduce Concept-based Memory Reasoner (CMR), a novel CBM designed to provide a human-understandable and provably-verifiable task prediction process. Our approach is to model each task prediction as a neural selection mechanism over a memory of learnable logic rules, followed by a symbolic evaluation of the selected rule. The presence of an explicit memory and the symbolic evaluation allow domain experts to inspect and formally verify the validity of certain global properties of interest for the task prediction process. Experimental results demonstrate that CMR achieves better accuracy-interpretability trade-offs to state-of-the-art CBMs, discovers logic rules consistent with ground truths, allows for rule interventions, and allows pre-deployment verification.

For agents

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

get_harvested_code_for_paper("2407.15527")
get_code_for_paper("2407.15527")
have("2407.15527")

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

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

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

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

Connect an agent — have() is free.