SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.00938 · 2022

Interpretable by Design: Learning Predictors by Composing Interpretable Queries

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 0 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/2207.00938.json · badge: /api/ran/2207.00938.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
ryanchankh/VariationalInformationPursuit canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
adaptive_sampling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ryanchankh/VariationalInformationPursuit/main_mnist.py
code served (permissive licence) · get_code("ba5d1616173e56be")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. 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
import numpy as np

torch.manual_seed(0)

# Define a minimal querier model that takes patch_mask and mask as inputs
# and returns query scores
class MinimalQuerier(nn.Module):
    def __init__(self, num_patches):
        super().__init__()
        self.num_patches = num_patches
    
    def forward(self, patch_mask, mask):
        # patch_mask shape: (N, C, H, W)
        # mask shape: (N, num_patches)
        # Return shape: (N, num_patches) - scores for each patch
        N = patch_mask.shape[0]
        return torch.randn(N, self.num_patches)

# Set up dimensions
batch_size = 2
channels = 3
height = 5
width = 4
patch_size = 2

# Create input image tensor
x = torch.randn(batch_size, channels, height, width)

# Calculate number of patches
num_patches = (height - patch_size + 1) * (width - patch_size + 1)

# Create querier model
querier = MinimalQuerier(num_patches)

# Create num_queries array - specifies how many queries each batch element should do
# Values should be between 0 and max_queries
max_queries = 3
num_queries = torch.tensor([1, 2], dtype=torch.long)

ARGS = {
    'x': x,
    'num_queries': num_queries,
    'querier': querier,
    'patch_size': patch_size,
    'max_queries': max_queries
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — 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
get_patch_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ryanchankh/VariationalInformationPursuit/main_mnist.py
code served (permissive licence) · get_code("aa20d3cb92a1d972")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 5, 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

torch.manual_seed(0)

# Analyze the function:
# - mask: tensor with size(0) = batch_size, indexed with [batch_index], compared to 1
# - x: tensor with size(0) = batch_size, size(3) = width dimension, indexed with [batch_index, :, index_i + row, index_j + col]
# - patch_size: scalar used in arithmetic and range()

# x needs to be 4D: (batch, channels, height, width)
# mask needs to be 2D: (batch, num_positions) where num_positions relates to patch positions
# The function computes index_i and index_j from positive_indices using x.size(3)

batch_size = 2
channels = 4
height = 5
width = 6
patch_size = 3

# Create x tensor: (batch, channels, height, width)
x = torch.randn(batch_size, channels, height, width)

# For mask: positive_indices are divided/modulo by (x.size(3) - patch_size + 1)
# x.size(3) = 6, patch_size = 3, so (6 - 3 + 1) = 4
# This means mask should have shape (batch, num_positions) where num_positions <= 4
# Let's create a mask with some 1s and 0s
num_positions = 4
mask = torch.zeros(batch_size, num_positions)
mask[0, 0] = 1
mask[0, 2] = 1
mask[1, 1] = 1

ARGS = {
    "mask": mask,
    "x": x,
    "patch_size": patch_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 5, 6) — shape (2, 4, 5, 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

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 0 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
adaptive_sampling 1 other paper
1 later
2302.02876 (2023-02)
Variational Information Pursuit for Interpretable Predictions
get_patch_mask 1 other paper
1 later
2302.02876 (2023-02)
Variational Information Pursuit for Interpretable Predictions

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

There is a growing concern about typically opaque decision-making with high-performance machine learning algorithms. Providing an explanation of the reasoning process in domain-specific terms can be crucial for adoption in risk-sensitive domains such as healthcare. We argue that machine learning algorithms should be interpretable by design and that the language in which these interpretations are expressed should be domain- and task-dependent. Consequently, we base our model's prediction on a family of user-defined and task-specific binary functions of the data, each having a clear interpretation to the end-user. We then minimize the expected number of queries needed for accurate prediction on any given input. As the solution is generally intractable, following prior work, we choose the queries sequentially based on information gain. However, in contrast to previous work, we need not assume the queries are conditionally independent. Instead, we leverage a stochastic generative model (VAE) and an MCMC algorithm (Unadjusted Langevin) to select the most informative query about the input based on previous query-answers. This enables the online determination of a query chain of whatever depth is required to resolve prediction ambiguities. Finally, experiments on vision and NLP tasks demonstrate the efficacy of our approach and its superiority over post-hoc explanations.

For agents

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

get_harvested_code_for_paper("2207.00938")
get_code_for_paper("2207.00938")
have("2207.00938")

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

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

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

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

Connect an agent — have() is free.