SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.14336 · NeurIPS · 2023

Learning Interpretable Rules for Scalable Data Representation and Classification

Wei Zhang, Ning Liu, Zhuo Wang, Jianyong Wang

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (9 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-23; 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/2310.14336.json · badge: /api/ran/2310.14336.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
12wang3/rrl canonical (classifier label)
classifier basis: classifier_2025
10 ran · 5 no recorded run
FunctionStatusWhere it lives
Binarize Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("68267dd50278a7cc")
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 an instance of its own class, Binarize: the run constructed the object and did not call it, so no result was computed. 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 Binarize.forward method takes X as input and applies torch.where
# to create a binary tensor (0s and 1s based on whether X > 0)
# The backward method just clones the gradient
# So X needs to be a tensor with both positive and negative values

X = torch.randn(2, 4, requires_grad=True)

ARGS = {
    "ctx": None,  # ctx is passed by autograd.Function, we pass None as placeholder
    "X": X
}
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 Binarize — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Binarize 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
BinarizeLayer Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("c09a6107207cd650")
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 an instance of its own class, BinarizeLayer: the run constructed the object and did not call it, so no result was computed. 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)

# Parameters for BinarizeLayer.__init__
n = 3  # number of discretization centers
input_dim = [4, 5]  # [discrete_features, continuous_features]
use_not = True  # whether to use NOT operator
left = torch.randn(3, 5)  # bounds for continuous features
right = left + torch.abs(torch.randn(3, 5)) + 1  # ensure right > left

ARGS = {
    'n': n,
    'input_dim': input_dim,
    'use_not': use_not,
    'left': left,
    'right': right,
}
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 BinarizeLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BinarizeLayer 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
ConjunctionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("2d4f5ef0a5bc7aa9")
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 an instance of its own class, ConjunctionLayer: the run constructed the object and did not call it, so no result was computed. 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 = {
    'n': 3,
    'input_dim': 4,
    'use_not': False,
    'alpha': 0.999,
    'beta': 8,
    'gamma': 1
}
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 ConjunctionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConjunctionLayer 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
DisjunctionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("ce761d8e4c68879b")
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 an instance of its own class, DisjunctionLayer: the run constructed the object and did not call it, so no result was computed. 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 = {
    'n': 3,
    'input_dim': 4,
    'use_not': False,
    'alpha': 0.999,
    'beta': 8,
    'gamma': 1
}
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 DisjunctionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DisjunctionLayer 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
EstimatedProduct Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("6a13ff9c6a99af14")
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 an instance of its own class, EstimatedProduct: the run constructed the object and did not call it, so no result was computed. 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)

# Construct a tensor X with shape (batch_size=2, features=4)
# All values must be positive since we take log(X) in the forward pass
X = torch.rand(2, 4) + 0.1  # Add 0.1 to ensure all values are > 0

ARGS = {
    "X": X
}
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 EstimatedProduct — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EstimatedProduct 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
GradGraft Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("93609d76fab31875")
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 an instance of its own class, GradGraft: the run constructed the object and did not call it, so no result was computed. 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)

# GradGraft.forward takes X and Y tensors
# GradGraft.backward uses grad_output
# The forward method returns X unchanged
# The backward method returns (None, grad_output.clone())

# Create small test tensors
X = torch.randn(2, 4, requires_grad=True)
Y = torch.randn(2, 3, requires_grad=True)

ARGS = {
    'X': X,
    'Y': Y,
}
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 GradGraft — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GradGraft 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
LRLayer Ran
ran on a synthesized input
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("b060a5edd6bfc4b8")
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; 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 collections import defaultdict

INIT_ARGS = {
    'n': 3,
    'input_dim': 4,
}

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

if __name__ == '__main__':
    from collections import defaultdict
    
    class LRLayer(nn.Module):
        """The LR layer is used to learn the linear part of the data."""

        def __init__(self, n, input_dim):
            super(LRLayer, self).__init__()
            self.n = n
            self.input_dim = input_dim
            self.output_dim = self.n
            self.layer_type = 'linear'
            self.rid2dim = None
            self.rule2weights = None
            self.fc1 = nn.Linear(self.input_dim, self.output_dim)

        def forward(self, x):
            return self.fc1(x)

        @torch.no_grad()
        def binarized_forward(self, x):
            return self.forward(x)

        def clip(self):
            for param in self.fc1.parameters():
                param.data.clamp_(-1.0, 1.0)

        def l1_norm(self):
            return torch.norm(self.fc1.weight, p=1)

        def l2_norm(self):
            return torch.sum(self.fc1.weight ** 2)

        def get_rule2weights(self, prev_layer, skip_connect_layer):
            prev_layer = self.conn.prev_layer
            skip_connect_layer = self.conn.skip_from_layer
            always_act_pos = prev_layer.node_activation_cnt == prev_layer.forward_tot
            merged_dim2id = prev_dim2id = {k: (-1, v) for k, v in prev_layer.dim2id.items()}
            if skip_connect_layer is not None:
                shifted_dim2id = {k + prev_layer.output_dim: (-2, v) for k, v in skip_connect_layer.dim2id.items()}
                merged_dim2id = defaultdict(lambda: -1, {**shifted_dim2id, **prev_dim2id})
                always_act_pos = torch.cat([always_act_pos, skip_connect_layer.node_activation_cnt == skip_connect_layer.forward_tot])
            Wl, bl = list(self.fc1.parameters())
            bl = torch.sum(Wl.T[always_act_pos], dim=0) + bl
            Wl = Wl.cpu().detach().numpy()
            self.bl = bl.cpu().detach().numpy()
            marked = defaultdict(lambda: defaultdict(float))
            rid2dim = {}
            for label_id, wl in enumerate(Wl):
                for i, w in enumerate(wl):
                    rid = merged_dim2id[i]
                    if rid == -1 or rid[1] == -1:
                        continue
                    marked[rid][label_id] += w
                    rid2dim[rid] = i % prev_layer.output_dim
            self.rid2dim = rid2dim
            self.rule2weights = sorted(marked.items(), key=lambda x: max(map(abs, x[1].values())), reverse=True)

    model = LRLayer(**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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
OriginalConjunctionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("594fd0ac318dc6a8")
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 an instance of its own class, OriginalConjunctionLayer: the run constructed the object and did not call it, so no result was computed. 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 = {
    'n': 3,
    'input_dim': 4,
    'use_not': False,
    'estimated_grad': 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 OriginalConjunctionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a OriginalConjunctionLayer 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
OriginalDisjunctionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("be2aa191b6026f5b")
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 an instance of its own class, OriginalDisjunctionLayer: the run constructed the object and did not call it, so no result was computed. 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 = {
    'n': 3,
    'input_dim': 4,
    'use_not': False,
    'estimated_grad': 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 OriginalDisjunctionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a OriginalDisjunctionLayer 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
Product Ran
ran on a synthesized input · constructed an object; no result was computed
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("5b87f65501cf10d7")
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 an instance of its own class, Product: the run constructed the object and did not call it, so no result was computed. 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)

# Product.forward expects X to be a tensor with shape (batch_size, dim)
# It computes: y = -1.0 / (-1.0 + torch.sum(torch.log(X), dim=1))
# This means X should have positive values (for log to be valid)
# The backward pass uses X in division, so it needs to be positive

# Create a small batch of positive values
X = torch.tensor([
    [0.5, 0.6, 0.7, 0.8],
    [0.3, 0.4, 0.5, 0.6]
], dtype=torch.float32, requires_grad=True)

# Ensure all values are positive and > EPSILON to avoid division issues
X = torch.abs(X) + 0.1

ARGS = {
    'X': X
}
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 Product — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Product 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
MyDistributedDataParallel Not yet run
unverified (harvested, no recorded run)
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("e81cc7b8c239a9a0")
How it ran

no invocation recorded.

Net Not yet run
unverified (harvested, no recorded run)
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("0bca4dc82b4fabd2")
How it ran

no invocation recorded.

RRL Not yet run
unverified (harvested, no recorded run)
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("97c2a3e5f6fcc94b")
How it ran

no invocation recorded.

UnionLayer Not yet run
unverified (harvested, no recorded run)
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("913ac707af861532")
How it ran

no invocation recorded.

extract_rules Not yet run
unverified (harvested, no recorded run)
12wang3/rrl/rrl/models.py
code served (permissive licence) · get_code("f1e9d09179a189c0")
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, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 11 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
Binarize
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.04270 (2026-04)
A Logical-Rule Autoencoder for Interpretable Recommendations
EstimatedProduct
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.04270 (2026-04)
A Logical-Rule Autoencoder for Interpretable Recommendations
GradGraft
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.04270 (2026-04)
A Logical-Rule Autoencoder for Interpretable Recommendations
Product
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2604.04270 (2026-04)
A Logical-Rule Autoencoder for Interpretable Recommendations

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

Rule-based models, e.g., decision trees, are widely used in scenarios demanding high model interpretability for their transparent inner structures and good model expressivity. However, rule-based models are hard to optimize, especially on large data sets, due to their discrete parameters and structures. Ensemble methods and fuzzy/soft rules are commonly used to improve performance, but they sacrifice the model interpretability. To obtain both good scalability and interpretability, we propose a new classifier, named Rule-based Representation Learner (RRL), that automatically learns interpretable non-fuzzy rules for data representation and classification. To train the non-differentiable RRL effectively, we project it to a continuous space and propose a novel training method, called Gradient Grafting, that can directly optimize the discrete model using gradient descent. A novel design of logical activation functions is also devised to increase the scalability of RRL and enable it to discretize the continuous features end-to-end. Exhaustive experiments on ten small and four large data sets show that RRL outperforms the competitive interpretable approaches and can be easily adjusted to obtain a trade-off between classification accuracy and model complexity for different scenarios. Our code is available at: https://github.com/12wang3/rrl.

For agents

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

get_harvested_code_for_paper("2310.14336")
get_code_for_paper("2310.14336")
have("2310.14336")

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

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

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

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

Connect an agent — have() is free.