SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.12659 · 2023

Posthoc Interpretation via Quantization

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; 3 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure 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/2303.12659.json · badge: /api/ran/2303.12659.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
speechbrain/speechbrain canonical (classifier label)
classifier basis not recorded on the link
8 ran · 0 no recorded run
FunctionStatusWhere it lives
get_padding_elem Ran
ran, honoured the contract we drafted
speechbrain/speechbrain/speechbrain/nnet/CNN.py
code served (permissive licence) · get_code("4b4b5018fc969e7d")
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 int; 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 math

ARGS = {
    "L_in": 64,
    "stride": 2,
    "kernel_size": 3,
    "dilation": 1,
}
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 list, ndim 1, dtype family int — 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
get_padding_elem_transposed Ran
ran, honoured the contract we drafted
speechbrain/speechbrain/speechbrain/nnet/CNN.py
code served (permissive licence) · get_code("0548ca44c40bfefe")
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 int, ndim 0, dtype family int, 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

torch.manual_seed(0)

ARGS = {
    "L_out": 28,
    "L_in": 14,
    "stride": 2,
    "kernel_size": 3,
    "dilation": 1,
    "output_padding": 0,
}
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 int, ndim 0, dtype family int, 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
is_layer_adaptable Ran
ran on a synthesized input
speechbrain/speechbrain/speechbrain/nnet/adapters.py
code served (permissive licence) · get_code("2e3e212a167f97cb")
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 bool, 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

torch.manual_seed(0)

# Test case 1: all_linear=True, should match Linear layers
name_1 = "layer1.0"
module_1 = nn.Linear(4, 8)
all_linear_1 = True
all_conv_1 = False
target_layers_1 = []

# Test case 2: all_conv=True, should match Conv layers
name_2 = "conv_layer"
module_2 = nn.Conv2d(3, 16, kernel_size=3)
all_linear_2 = False
all_conv_2 = True
target_layers_2 = []

# Test case 3: target_layers with fnmatch pattern
name_3 = "encoder.layer.0"
module_3 = nn.ReLU()
all_linear_3 = False
all_conv_3 = False
target_layers_3 = ["encoder.layer.*", "decoder*"]

# Test case 4: Conv1d
name_4 = "conv1d_layer"
module_4 = nn.Conv1d(3, 16, kernel_size=3)
all_linear_4 = False
all_conv_4 = True
target_layers_4 = []

# Test case 5: Conv3d
name_5 = "conv3d_layer"
module_5 = nn.Conv3d(3, 16, kernel_size=3)
all_linear_5 = False
all_conv_5 = True
target_layers_5 = []

# Use the first test case as ARGS
ARGS = {
    "name": name_1,
    "module": module_1,
    "all_linear": all_linear_1,
    "all_conv": all_conv_1,
    "target_layers": target_layers_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 bool, 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
masks_union Ran
ran on a synthesized input
speechbrain/speechbrain/speechbrain/nnet/attention.py
code served (permissive licence) · get_code("013f6005d19b72de")
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 4, dtype family float, shape (2, 3, 4, 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)

bsz = 2
klen = 4
num_heads = 3

# attn_mask: (L, S) where L is target sequence length, S is source sequence length
# For this case, both are klen, so shape is (klen, klen)
attn_mask = torch.tensor([
    [False, False, True, True],
    [False, False, False, True],
    [False, False, False, False],
    [False, False, False, False]
], dtype=torch.bool)

# key_padding_mask: (B, S) where B is batch size, S is source sequence length
key_padding_mask = torch.tensor([
    [False, False, True, False],
    [False, False, False, True]
], dtype=torch.bool)

ARGS = {
    "bsz": bsz,
    "klen": klen,
    "num_heads": num_heads,
    "attn_mask": attn_mask,
    "key_padding_mask": key_padding_mask,
}
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 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 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
memoise_at_least Ran
ran on a synthesized input
speechbrain/speechbrain/speechbrain/nnet/attention.py
code served (permissive licence) · get_code("b507b2249a7f7026")
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 math

# Define a simple round_up function that rounds to the nearest multiple of some value
def round_up_fn(size):
    """Round up to the nearest multiple of 8"""
    return math.ceil(size / 8) * 8

# Define a simple function to be memoised
def sample_function(size, multiplier=1, offset=0):
    """A simple function that takes a size and other args"""
    return size * multiplier + offset

ARGS = {
    "round_up": round_up_fn,
}
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
pack_padded_sequence Ran
ran; our contract draft was wrong, not the code
speechbrain/speechbrain/speechbrain/nnet/RNN.py
code served (permissive licence) · get_code("727d7f7d333b34d5")
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 PackedSequence. 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)

# Create tiny tensors for testing
# inputs: (batch_size=2, sequence_length=5, feature_dim=4)
inputs = torch.randn(2, 5, 4)

# lengths: (batch_size=2,) with values in [0, 1] representing relative lengths
# These will be multiplied by inputs.size(1) which is 5
lengths = torch.tensor([0.8, 0.6])

ARGS = {
    "inputs": inputs,
    "lengths": lengths,
}
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 PackedSequence — a PackedSequence 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
pad_packed_sequence Ran
ran, honoured the contract we drafted
speechbrain/speechbrain/speechbrain/nnet/RNN.py
code served (permissive licence) · get_code("b73add3b1d461d88")
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 3, dtype family float, shape (2, 4, 3) 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

torch.manual_seed(0)

# Create a PackedSequence object
# First, create some sample data
batch_size = 2
seq_length = 4
input_size = 3

# Create sequences with different lengths
data = torch.randn(6, input_size)  # Total of 6 elements (lengths 4 + 2)
batch_sizes = torch.tensor([2, 2, 1, 1])  # First timestep has 2 sequences, second has 2, etc.
sorted_indices = torch.tensor([0, 1])
unsorted_indices = torch.tensor([0, 1])

# Create a PackedSequence manually
packed_sequence = torch.nn.utils.rnn.PackedSequence(
    data=data,
    batch_sizes=batch_sizes,
    sorted_indices=sorted_indices,
    unsorted_indices=unsorted_indices
)

ARGS = {
    "inputs": packed_sequence
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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_timesteps Ran
ran on a synthesized input
speechbrain/speechbrain/speechbrain/nnet/diffusion.py
code served (permissive licence) · get_code("30b8049b4d787157")
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 int, 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)

# Create a small tensor with batch size 2 and feature dimension 4
x = torch.randn(2, 4)

# Set num_timesteps to a reasonable value
num_timesteps = 10

ARGS = {
    "x": x,
    "num_timesteps": num_timesteps,
}
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 int, 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

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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
get_padding_elem 3 other papers
3 dated earlier
2005.07143 (2020-05)
ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification
2106.04624 (2021-06)
SpeechBrain: A General-Purpose Speech Toolkit
2207.09747 (2022-07)
Transfer Learning of wav2vec 2.0 for Automatic Lyric Transcription
get_padding_elem_transposed 3 other papers
3 dated earlier
2005.07143 (2020-05)
ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification
2106.04624 (2021-06)
SpeechBrain: A General-Purpose Speech Toolkit
2207.09747 (2022-07)
Transfer Learning of wav2vec 2.0 for Automatic Lyric Transcription
pack_padded_sequence 3 other papers
3 dated earlier
2005.07143 (2020-05)
ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification
2106.04624 (2021-06)
SpeechBrain: A General-Purpose Speech Toolkit
2207.09747 (2022-07)
Transfer Learning of wav2vec 2.0 for Automatic Lyric Transcription
pad_packed_sequence 3 other papers
3 dated earlier
2005.07143 (2020-05)
ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification
2106.04624 (2021-06)
SpeechBrain: A General-Purpose Speech Toolkit
2207.09747 (2022-07)
Transfer Learning of wav2vec 2.0 for Automatic Lyric Transcription

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

In this paper, we introduce a new approach, called Posthoc Interpretation via Quantization (PIQ), for interpreting decisions made by trained classifiers. Our method utilizes vector quantization to transform the representations of a classifier into a discrete, class-specific latent space. The class-specific codebooks act as a bottleneck that forces the interpreter to focus on the parts of the input data deemed relevant by the classifier for making a prediction. Our model formulation also enables learning concepts by incorporating the supervision of pretrained annotation models such as state-of-the-art image segmentation models. We evaluated our method through quantitative and qualitative studies involving black-and-white images, color images, and audio. As a result of these studies we found that PIQ generates interpretations that are more easily understood by participants to our user studies when compared to several other interpretation methods in the literature.

For agents

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

get_harvested_code_for_paper("2303.12659")
get_code_for_paper("2303.12659")
have("2303.12659")

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

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

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

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

Connect an agent — have() is free.