SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.04118 · ACL · 2020

Beyond Accuracy: Behavioral Testing of NLP Models with CheckList

Carlos Guestrin, Sameer Singh, Marco Ribeiro, Tongshuang Wu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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 6 have no contract verdict; 0 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/2005.04118.json · badge: /api/ran/2005.04118.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
marcotcr/checklist canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
clean_senses Ran
ran on a synthesized input
marcotcr/checklist/checklist/text_generation.py
code served (permissive licence) · get_code("38fb77d998e2e875")
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.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# def clean_senses(synsets):
#     return [x for x in set(synsets) if '_' not in x]
#
# The function takes 'synsets' as a parameter.
# It converts synsets to a set, iterates through it, and filters out strings containing '_'
# synsets should be an iterable of strings

synsets = [
    "synset1",
    "synset_2",
    "synset3",
    "synset_4_long",
    "synset5"
]

ARGS = {
    "synsets": synsets
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
iter_with_optional Ran
ran on a synthesized input
marcotcr/checklist/checklist/expect.py
code served (permissive licence) · get_code("1b86c6b7a8f3ceef")
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 zip. 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
import itertools

# Construct valid arguments for iter_with_optional

# Test case 1: data as list, preds as list, confs as list, labels as scalar, meta as scalar
data = [np.array([1, 2, 3, 4]), np.array([5, 6, 7, 8])]
preds = [np.array([0.1, 0.2, 0.3, 0.4]), np.array([0.5, 0.6, 0.7, 0.8])]
confs = [np.array([0.9, 0.85, 0.95, 0.88]), np.array([0.92, 0.87, 0.91, 0.89])]
labels = 1  # scalar, will be repeated
meta = {"source": "test"}  # scalar dict, will be repeated
idxs = None

ARGS = {
    "data": data,
    "preds": preds,
    "confs": confs,
    "labels": labels,
    "meta": meta,
    "idxs": idxs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type zip — a zip output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a zip 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
process_ret Ran
ran on a synthesized input
marcotcr/checklist/checklist/perturb.py
code served (permissive licence) · get_code("b01cb2044b6b11f9")
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 tuple, 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 numpy as np

np.random.seed(0)

# Construct valid arguments for process_ret
# The function expects:
# - ret: a list (checked with "if ret" and "len(ret)")
# - ret_m: optional list or None (checked with "if ret_m")
# - meta: boolean flag
# - n: integer for sampling threshold

# Create a list of items for ret (longer than n to test the sampling logic)
ret_value = [f"item_{i}" for i in range(15)]

# Create a corresponding list for ret_m (same length as ret)
ret_m_value = [f"meta_{i}" for i in range(15)]

# Test parameters
n_value = 10
meta_value = True

ARGS = {
    "ret": ret_value,
    "ret_m": ret_m_value,
    "meta": meta_value,
    "n": n_value,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple 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
recursive_apply Ran
ran on a synthesized input
marcotcr/checklist/checklist/editor.py
code served (permissive licence) · get_code("7119d0199094dd5f")
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 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 torch
import torch.nn as nn

torch.manual_seed(0)

def simple_transform(leaf, multiplier=1, add_value=0):
    """Simple function to apply to leaves"""
    if isinstance(leaf, str):
        return leaf.upper()
    elif isinstance(leaf, bytes):
        return leaf.upper()
    elif isinstance(leaf, torch.Tensor):
        return leaf * multiplier + add_value
    else:
        return leaf

# Test with nested structure containing strings, tensors, and mixed types
test_obj = {
    "text": "hello",
    "nested_list": [
        "world",
        torch.tensor([1.0, 2.0, 3.0, 4.0]),
        ("tuple_text", b"bytes_data")
    ],
    "tensor": torch.tensor([[1.0, 2.0], [3.0, 4.0]]),
    "plain_tuple": ("a", "b", "c"),
    "deep": {
        "level2": [
            "string_here",
            torch.tensor([5.0, 6.0, 7.0, 8.0])
        ]
    }
}

ARGS = {
    "obj": test_obj,
    "fn": simple_transform,
}
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 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
recursive_format Ran
ran on a synthesized input
marcotcr/checklist/checklist/editor.py
code served (permissive licence) · get_code("157c60c142af6297")
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 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 string
import re

class SafeFormatter(string.Formatter):

    def vformat(self, format_string, args, kwargs):
        args_len = len(args)
        tokens = []
        for lit, name, spec, conv in self.parse(format_string):
            lit = lit.replace('{', '{{').replace('}', '}}')
            if name is None:
                tokens.append(lit)
            else:
                conv = '!' + conv if conv else ''
                spec = ':' + spec if spec else ''
                fp = name.split('[')[0].split('.')[0]
                if not fp or fp.isdigit() or fp in kwargs:
                    tokens.extend([lit, '{', name, conv, spec, '}'])
                else:
                    tokens.extend([lit, '{{', name, conv, spec, '}}'])
        format_string = ''.join(tokens)
        return string.Formatter.vformat(self, format_string, args, kwargs)

def recursive_apply(obj, fn, *args, **kwargs):
    """Recursively applies a function to an obj

    Parameters
    ----------
    obj : string, tuple, list, or dict
        Object (leaves must be strings, regardless of type)
    fn : function
        function to be applied to the leaves (strings)

    Returns
    -------
    string, tuple, list, or dict
        Object of the same type as obj, with fn applied to leaves

    """
    if type(obj) in [str, bytes]:
        return fn(obj, *args, **kwargs)
    elif type(obj) == tuple:
        return tuple(recursive_apply(list(obj), fn, *args, **kwargs))
    elif type(obj) == list:
        return [recursive_apply(o, fn, *args, **kwargs) for o in obj]
    elif type(obj) == dict:
        return {k: recursive_apply(v, fn, *args, **kwargs) for k, v in obj.items()}
    else:
        return fn(obj, *args, **kwargs)

def add_article(noun):
    return 'an %s' % noun if noun[0].lower() in ['a', 'e', 'i', 'o', 'u'] else 'a %s' % noun

def recursive_format(obj, mapping, ignore_missing=False):
    """Formats all strings within an object, using mapping

    Parameters
    ----------
    obj : string, tuple, list, or dict
        Object (leaves must be strings, regardless of type)
    mapping : dict
        format dictionary, maps keys to values
    ignore_missing : bool
        If True, will not throw exception if a string contains a tag not
        present in mapping, and will keep the tag instead.

    Returns
    -------
    string, tuple, list, or dict
        Object of the same type as obj, with strings formatted (tags replaced
        by their value)

    """

    def formatfn(x, mapping):
        fmt = SafeFormatter()
        formatz = lambda x, m: x.format(**m) if not ignore_missing else fmt.format(x, **m)
        options = re.compile('{([^}]+):([^}]+)}')

        def mysub(match):
            options, thing = match.group(1, 2)
            ret = ''
            if 'a' in options:
                if ignore_missing and thing not in mapping:
                    return match.group()
                else:
                    word = formatz('{%s}' % thing, mapping)
                    ret += '%s ' % add_article(word).split()[0]
            ret += '{%s}' % thing
            return ret
        x = options.sub(mysub, x)
        return formatz(x, mapping)
    return recursive_apply(obj, formatfn, mapping)


# Setup code to construct valid arguments for recursive_format

obj = {
    "greeting": "Hello {name}",
    "description": "{a:object} is great",
    "nested": [
        "Value: {value}",
        ("Tuple with {key}", "{a:animal}")
    ]
}

mapping = {
    "name": "Alice",
    "object": "apple",
    "value": "42",
    "key": "data",
    "animal": "elephant"
}

ignore_missing = False

ARGS = {
    "obj": obj,
    "mapping": mapping,
    "ignore_missing": ignore_missing
}
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 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
replace_mask Ran
ran on a synthesized input
marcotcr/checklist/checklist/editor.py
code served (permissive licence) · get_code("43c9cb585e0725c1")
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 re

def replace_mask(text):
    """Replaces multiple instances of mask with indexed versions.

    Parameters
    ----------
    text : string
        masked input, e.g. "This is a {mask} {mask} and {mask}"

    Returns
    -------
    string
        multiple instances of the same mask are replaced with indexed versions
        e.g. "This is a {mask[0]} {mask[1]} and {mask[2]}

    """
    mask_finder = re.compile('\\{((?:[^\\}]*:)?mask\\d*)\\}')
    i = 0
    while mask_finder.search(text):
        text = mask_finder.sub('{\\1[%d]}' % i, text, 1)
        i += 1
    return text


ARGS = {
    "text": "This is a {mask} {mask} and {mask}"
}
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 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 3 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
recursive_apply 1 other paper
1 later
2106.14574 (2021-06)
Quantifying Social Biases in NLP: A Generalization and Empirical Comparison of Extrinsic Fairness Metrics
recursive_format 1 other paper
1 later
2106.14574 (2021-06)
Quantifying Social Biases in NLP: A Generalization and Empirical Comparison of Extrinsic Fairness Metrics
replace_mask 1 other paper
1 later
2106.14574 (2021-06)
Quantifying Social Biases in NLP: A Generalization and Empirical Comparison of Extrinsic Fairness Metrics

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

Although measuring held-out accuracy has been the primary approach to evaluate generalization, it often overestimates the performance of NLP models, while alternative approaches for evaluating models either focus on individual tasks or on specific behaviors. Inspired by principles of behavioral testing in software engineering, we introduce CheckList, a taskagnostic methodology for testing NLP models. CheckList includes a matrix of general linguistic capabilities and test types that facilitate comprehensive test ideation, as well as a software tool to generate a large and diverse number of test cases quickly. We illustrate the utility of CheckList with tests for three tasks, identifying critical failures in both commercial and state-of-art models. In a user study, a team responsible for a commercial sentiment analysis model found new and actionable bugs in an extensively tested model. In another user study, NLP practitioners with CheckList created twice as many tests, and found almost three times as many bugs as users without it.

For agents

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

get_harvested_code_for_paper("2005.04118")
get_code_for_paper("2005.04118")
have("2005.04118")

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

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

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

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

Connect an agent — have() is free.