SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.04612 · ICML · 2020

Concept Bottleneck Models

Percy Liang, Wei Pang, Koh, Thao Nguyen, Yew Tang, Stephen Mussmann, Emma Pierson, Been Kim

arXiv · PDF · Open in the Atlas

Code that ran

9 of 19 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, 1 violated it and 4 have no contract verdict; 3 failures of our instrument; 10 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/2007.04612.json · badge: /api/ran/2007.04612.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
yewsiang/ConceptBottleneck canonical (classifier label)
classifier basis: census
6 ran · 7 no recorded run
mateoespinosa/concept-quality extension (classifier label)
classifier basis: classifier_2025
3 ran · 3 no recorded run
FunctionStatusWhere it lives
assign_value_to_bins Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yewsiang/ConceptBottleneck/analysis.py
pointer only (licence: MIT); the stored copy get_code serves, from ssbin4/closer-intervention-cbm, is pointer only (licence: NONE) · get_code("6f6a066db48a5839")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ssbin4/closer-intervention-cbm, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

convert_continuous_back_to_ordinal Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yewsiang/ConceptBottleneck/analysis.py
pointer only (licence: MIT); the stored copy get_code serves, from ssbin4/closer-intervention-cbm, is pointer only (licence: NONE) · get_code("7d6319bafb29a83d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ssbin4/closer-intervention-cbm, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

find_max_alignment Ran
ran, honoured the contract we drafted
mateoespinosa/concept-quality/concepts_xai/evaluation/metrics/oracle.py
code served (permissive licence) · get_code("c55626b02da843fc")
How it ran

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

# Create a matrix with more rows than columns (at least as many rows as columns)
# Using 5 rows and 3 columns to make it distinct and satisfy the constraint
matrix = np.array([
    [0.9, 0.2, 0.1],
    [0.3, 0.8, 0.4],
    [0.1, 0.5, 0.9],
    [0.6, 0.3, 0.2],
    [0.2, 0.1, 0.3]
])

ARGS = {
    'matrix': matrix
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — 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_attr_groups Ran
ran on a synthesized input
yewsiang/ConceptBottleneck/CUB/generate_new_data.py
code served (permissive licence) · get_code("7363ec8e1dc1e2bc")
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 tempfile
import os

# Create a temporary file with attribute names
# The function reads lines, splits them, takes the second element,
# and uses the first 10 characters as a prefix to group attributes
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')

# Write test data with different prefixes
# Format: each line should have at least 2 space-separated elements
# Second element will have its first 10 chars used as prefix
temp_file.write("index1 color_red_attr_001 extra_data\n")
temp_file.write("index2 color_red_attr_002 extra_data\n")
temp_file.write("index3 color_red_attr_003 extra_data\n")
temp_file.write("index4 texture_sm_attr_001 extra_data\n")
temp_file.write("index5 texture_sm_attr_002 extra_data\n")
temp_file.write("index6 shape_rect_attr_001 extra_data\n")

temp_file.close()

ARGS = {
    'attr_name_file': temp_file.name
}
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_conv_layer_substring Ran
ran on a synthesized input
yewsiang/ConceptBottleneck/OAI/template_model.py
code served (permissive licence) · get_code("f799ff74497d86d8")
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 str. 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 takes a string parameter 'name' and performs string operations on it
# It checks if name starts with 'layer', splits by '.', joins the first 3 parts,
# and checks if 'conv' is in the substring

# Valid test cases for the function:
# 1. A name that starts with 'layer' and contains 'conv' in the first 3 parts
# 2. A name that starts with 'layer' but doesn't contain 'conv'
# 3. A name that doesn't start with 'layer'

# For the first case (should return a substring):
name_with_layer_and_conv = "layer.0.conv.weight"

ARGS = {
    "name": name_with_layer_and_conv
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_places Ran
ran on a synthesized input
yewsiang/ConceptBottleneck/CUB/gen_cub_synthetic.py
code served (permissive licence) · get_code("55a1a81bf8682a6e")
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

# Create a temporary file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("image1.jpg 0\n")
temp_file.write("image2.jpg 1\n")
temp_file.write("image3.jpg 0\n")
temp_file.write("image4.jpg 2\n")
temp_file.close()

ARGS = {
    'fname': temp_file.name
}
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 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
max_alignment_matrix Ran
ran, violated the contract we drafted
mateoespinosa/concept-quality/concepts_xai/evaluation/metrics/oracle.py
code served (permissive licence) · get_code("4f3310d325613028")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (3, 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 numpy as np

# Create a small matrix with more rows than columns (as required by the function)
# Using 5 rows and 3 columns to make it distinct and satisfy the constraint
np.random.seed(42)
matrix = np.random.rand(5, 3)

ARGS = {
    'matrix': matrix
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 3) — shape (3, 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
niche_completeness Ran
ran; our contract draft was wrong, not the code
mateoespinosa/concept-quality/concepts_xai/evaluation/metrics/niching.py
code served (permissive licence) · get_code("8095a4f6f683e5f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 numpy as np
from sklearn.linear_model import LogisticRegression

np.random.seed(0)

n_samples = 10
n_concepts = 6
n_tasks = 3

c_pred = np.random.rand(n_samples, n_concepts)
y_true = np.zeros((n_samples, n_tasks))
for i in range(n_samples):
    y_true[i, np.random.randint(0, n_tasks)] = 1

niches = np.random.randint(0, 2, size=(n_concepts, n_tasks))

class StandInPredictor:
    def __init__(self):
        self.fitted = True
    
    def predict_proba(self, X):
        n_samples = X.shape[0]
        n_tasks = 3
        return np.random.rand(n_samples, n_tasks)

predictor_model = StandInPredictor()

ARGS = {
    'c_pred': c_pred,
    'y_true': y_true,
    'predictor_model': predictor_model,
    'niches': niches
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, scipy, sklearn — 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
parse_arguments Ran
ran on a synthesized input
yewsiang/ConceptBottleneck/CUB/hyperopt.py
code served (permissive licence) · get_code("d65244603db1c967")
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 Namespace. 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 argparse
import sys

# Mock sys.argv to provide command line arguments
sys.argv = ['script.py', '--save_dir', '/tmp/test_save_dir']

def parse_arguments(parser=None):
    if parser is None:
        parser = argparse.ArgumentParser(description='PyTorch Training')
    parser.add_argument('--save_dir', type=str, required=True, help='directory to the data used for evaluation')
    return parser.parse_args()

ARGS = {
    'parser': None
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
assess_performance Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/analysis.py
pointer only (licence: MIT); the stored copy get_code serves, from ssbin4/closer-intervention-cbm, is pointer only (licence: NONE) · get_code("81e8146056025ecb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ssbin4/closer-intervention-cbm, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

combine_and_mask Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/CUB/gen_cub_synthetic.py
code served (permissive licence) · get_code("fe49a67591e2b166")
How it ran

no invocation recorded.

concept_similarity_matrix Not yet run
unverified (harvested, no recorded run)
mateoespinosa/concept-quality/concepts_xai/evaluation/metrics/oracle.py
code served (permissive licence) · get_code("af4bce600242a9fb")
How it ran

no invocation recorded.

crop_and_resize Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/CUB/gen_cub_synthetic.py
code served (permissive licence) · get_code("e2f8b1a98dec9723")
How it ran

no invocation recorded.

extract_data Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/CUB/data_processing.py
code served (permissive licence) · get_code("fb9f011b98a5be6f")
How it ran

no invocation recorded.

inception_v3 Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/CUB/template_model.py
code served (permissive licence) · get_code("3adfc15ac6dd7d81")
How it ran

no invocation recorded.

inference Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/CUB/generate_new_data.py
code served (permissive licence) · get_code("11b5a291d1cf99bd")
How it ran

no invocation recorded.

inference_no_grad Not yet run
unverified (harvested, no recorded run)
yewsiang/ConceptBottleneck/CUB/generate_new_data.py
code served (permissive licence) · get_code("03eae1235a58b502")
How it ran

no invocation recorded.

niche_completeness_ratio Not yet run
unverified (harvested, no recorded run)
mateoespinosa/concept-quality/concepts_xai/evaluation/metrics/niching.py
code served (permissive licence) · get_code("099f946666b64813")
How it ran

no invocation recorded.

niche_impurity Not yet run
unverified (harvested, no recorded run)
mateoespinosa/concept-quality/concepts_xai/evaluation/metrics/niching.py
code served (permissive licence) · get_code("b34032fc514199d9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 13 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
combine_and_mask 4 other papers
4 later
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
2405.04715 (2024-05)
Causality Pursuit from Heterogeneous Environments via Neural Adversarial Invariance Learning
2510.02818 (2025-10)
Mitigating Spurious Correlation via Distributionally Robust Learning with Hierarchical Ambiguity Sets
and 1 more not named here
crop_and_resize 4 other papers
4 later
2310.06161 (2023-10)
Mitigating Simplicity Bias in Deep Learning for Improved OOD Generalization and Robustness
2403.03375 (2024-03)
Complexity Matters: Dynamics of Feature Learning in the Presence of Spurious Correlations
2510.02818 (2025-10)
Mitigating Spurious Correlation via Distributionally Robust Learning with Hierarchical Ambiguity Sets
and 1 more not named here
inception_v3 2 other papers
2 later
aaai_29295 (2024 (year only))
Language-Guided Transformer for Federated Multi-Label Classification
ijcai2025_1147 (2025 (year only))
Explainability Through Human-Centric Design for XAI in Lung Cancer Detection
assess_performance 1 other paper
1 later
2302.14260 (2023-02)
A Closer Look at the Intervention Procedure of Concept Bottleneck Models
assign_value_to_bins 1 other paper
1 later
2302.14260 (2023-02)
A Closer Look at the Intervention Procedure of Concept Bottleneck Models
convert_continuous_back_to_ordinal 1 other paper
1 later
2302.14260 (2023-02)
A Closer Look at the Intervention Procedure of Concept Bottleneck Models

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

We seek to learn models that we can interact with using high-level concepts: if the model did not think there was a bone spur in the x-ray, would it still predict severe arthritis? State-of-the-art models today do not typically support the manipulation of concepts like "the existence of bone spurs", as they are trained end-to-end to go directly from raw input (e.g., pixels) to output (e.g., arthritis severity). We revisit the classic idea of first predicting concepts that are provided at training time, and then using these concepts to predict the label. By construction, we can intervene on these concept bottleneck models by editing their predicted concept values and propagating these changes to the final prediction. On x-ray grading and bird identification, concept bottleneck models achieve competitive accuracy with standard end-to-end models, while enabling interpretation in terms of high-level clinical concepts ("bone spurs") or bird attributes ("wing color"). These models also allow for richer human-model interaction: accuracy improves significantly if we can correct model mistakes on concepts at test time.

For agents

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

get_harvested_code_for_paper("2007.04612")
get_code_for_paper("2007.04612")
have("2007.04612")

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

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

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

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

Connect an agent — have() is free.