SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.12850 · ICLR · 2021

CoCo: Controllable Counterfactuals for Evaluating Dialogue State Trackers

Caiming Xiong, Nazneen Rajani, Yingbo Zhou, Shiyang Li, Semih Yavuz, Kazuma Hashimoto, Jia Li, Tong Niu, Xifeng Yan

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 2 violated it and 1 has no contract verdict; 5 failures of our instrument; 1 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/2010.12850.json · badge: /api/ran/2010.12850.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
salesforce/coco-dst canonical (classifier label)
classifier basis: classifier_2025
6 ran · 0 no recorded run
wise-east/checkdst community
Papers with Code archive
3 ran · 1 no recorded run
FunctionStatusWhere it lives
adjust_length_to_model Ran
ran, honoured the contract we drafted
salesforce/coco-dst/coco-dst/run_demo.py
code served (permissive licence) · get_code("440751480098ee7d")
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 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
import numpy as np

MAX_LENGTH = int(10000)

def adjust_length_to_model(length, max_sequence_length):
    if length < 0 and max_sequence_length > 0:
        length = max_sequence_length
    elif 0 < max_sequence_length < length:
        length = max_sequence_length
    elif length < 0:
        length = MAX_LENGTH
    return length

ARGS = {
    "length": 50,
    "max_sequence_length": 100
}
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 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
counterfactual_goal_generator Ran
ran; our contract draft was wrong, not the code
salesforce/coco-dst/coco-dst/utility/slot_value_ctrl.py
code served (permissive licence) · get_code("ac5eceaffcbcc5af")
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 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
import copy
import random

# Set seed for reproducibility
np.random.seed(0)
random.seed(0)

# Build minimal valid arguments for counterfactual_goal_generator

turn = {
    'transcript': 'I need a taxi to arrive by 5:30 pm',
    'system_transcript': 'What time would you like to arrive?',
    'turn_label': [
        ['taxi-arriveby', '17:30'],
        ['taxi-type', 'black']
    ],
    'belief_state': [
        {
            'slots': [['taxi-arriveby', '17:30']],
            'act': 'inform'
        },
        {
            'slots': [['taxi-type', 'black']],
            'act': 'inform'
        }
    ],
    'domain': 'taxi'
}

match_value = True

change_slot = True

drop_slot = True
max_drop = 1

add_slot = True
max_add = 2
max_slot = 5

slot_value_dict = {
    'taxi-arriveby': ['17:30', '18:00', '19:15', '20:45'],
    'taxi-type': ['black', 'white', 'red'],
    'taxi-leaveat': ['16:00', '16:30', '17:00'],
    'hotel-area': ['north', 'south', 'east', 'west'],
    'hotel-pricerange': ['cheap', 'moderate', 'expensive']
}

slot_occur_dict = {
    'taxi-arriveby': ['taxi-leaveat', 'taxi-type'],
    'taxi-type': ['taxi-arriveby'],
    'taxi-leaveat': ['taxi-arriveby'],
    'hotel-area': ['hotel-pricerange'],
    'hotel-pricerange': ['hotel-area']
}

ARGS = {
    'turn': turn,
    'match_value': match_value,
    'change_slot': change_slot,
    'drop_slot': drop_slot,
    'max_drop': max_drop,
    'add_slot': add_slot,
    'max_add': max_add,
    'max_slot': max_slot,
    'slot_value_dict': slot_value_dict,
    'slot_occur_dict': slot_occur_dict
}
Setup block drafted by
a language model, Claude Haiku 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 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
extract_slot_from_string Ran
ran; our contract draft was wrong, not the code
wise-east/checkdst/src/checkdst/checkdst_class.py
code served (permissive licence) · get_code("20284934c6549d67")
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 numpy as np
from typing import Dict, List, Tuple, Set

# Define ARGS dictionary with valid arguments for extract_slot_from_string
ARGS = {
    "slots_string": "hotel name the grand budapest, restaurant book time 19:00, taxi departure london, train destination cambridge,"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
loguru, 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
fix_commonsense Ran
ran; our contract draft was wrong, not the code
salesforce/coco-dst/coco-dst/utility/slot_value_ctrl.py
code served (permissive licence) · get_code("0d250791b826533a")
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 numpy as np
import random

# Set seeds for reproducibility
np.random.seed(0)
random.seed(0)

# Create a sample turn_label_dict that includes both taxi and train time constraints
turn_label_dict = {
    'taxi-arriveby': '3:45 pm',
    'taxi-leaveat': '3:20 pm',
    'train-arriveby': '5:30 pm',
    'train-leaveat': '5:00 pm',
    'other-slot': 'other-value'
}

ARGS = {
    'turn_label_dict': turn_label_dict
}
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 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
gen_time_pair Ran
ran on a synthesized input
salesforce/coco-dst/coco-dst/utility/slot_value_ctrl.py
code served (permissive licence) · get_code("e53db5f608c2b832")
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 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 numpy as np
import random

# Set seeds for reproducibility
np.random.seed(0)
random.seed(0)

# The function gen_time_pair() takes no parameters
ARGS = {}
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 1, 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
is_proper_slot_format Ran
ran, violated the contract we drafted
wise-east/checkdst/src/checkdst/checkdst_class.py
code served (permissive licence) · get_code("893a9888cdee1f62")
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 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

ARGS = {
    "slot": "domain--intent--value"
}
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 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
normalize_dial_ids Ran
ran; our contract draft was wrong, not the code
wise-east/checkdst/src/checkdst/checkdst_class.py
code served (permissive licence) · get_code("7694471c3bd27d3f")
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 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.

ARGS = {
    'dial_id': 'MUL003-6.json'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
re_match Ran
ran, violated the contract we drafted
salesforce/coco-dst/coco-dst/utility/slot_value_ctrl.py
code served (permissive licence) · get_code("f23b946820bfadae")
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 re

def re_match(utter, value):
    search_span = re.search('[?,.! ]' + value + '[?,.! ]', ' ' + utter + ' ')
    if search_span:
        return True
    else:
        return False

# Setup code
utter = "hello world, how are you?"
value = "world"

ARGS = {
    "utter": utter,
    "value": value
}
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 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
update_turn Ran
ran; our contract draft was wrong, not the code
salesforce/coco-dst/coco-dst/utility/slot_value_ctrl.py
code served (permissive licence) · get_code("f769384231a88de1")
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 copy

# Construct a valid turn dict matching the function's expectations
turn = {
    'turn_label': [
        ['hotel-area', 'centre'],
        ['hotel-pricerange', 'expensive']
    ],
    'belief_state': [
        {
            'slots': [['hotel-area', 'centre']],
            'act': 'inform'
        },
        {
            'slots': [['hotel-pricerange', 'moderate']],
            'act': 'inform'
        }
    ],
    'system_transcript': 'The expensive hotel is in the centre of town.'
}

# Construct new_turn_label_dict with updates and new slots
new_turn_label_dict = {
    'hotel-area': 'north',
    'hotel-pricerange': 'expensive',
    'hotel-stars': '4'
}

ARGS = {
    'turn': turn,
    'new_turn_label_dict': new_turn_label_dict
}
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
CheckDST Not yet run
unverified (harvested, no recorded run)
wise-east/checkdst/src/checkdst/checkdst_class.py
code served (permissive licence) · get_code("1b22a71e80815e81")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 9 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
adjust_length_to_model 3 other papers
1 dated earlier, 2 later
2009.06367 (2020-09)
GeDi: Generative Discriminator Guided Sequence Generation
2023.emnlp-industry.17 (2023 (year only))
Investigating Table-to-Text Generation Capabilities of LLMs in Real-World Information Seeking Scenarios
2306.14870 (2023-06)
Composing Parameter-Efficient Modules with Arithmetic Operations

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

Dialogue state trackers have made significant progress on benchmark datasets, but their generalization capability to novel and realistic scenarios beyond the heldout conversations is less understood. We propose controllable counterfactuals (COCO) to bridge this gap and evaluate dialogue state tracking (DST) models on novel scenarios, i.e., would the system successfully tackle the request if the user responded differently but still consistently with the dialogue flow? COCO leverages turn-level belief states as counterfactual conditionals to produce novel conversation scenarios in two steps: (i) counterfactual goal generation at turnlevel by dropping and adding slots followed by replacing slot values, (ii) counterfactual conversation generation that is conditioned on (i) and consistent with the dialogue flow. Evaluating state-of-the-art DST models on MultiWOZ dataset with COCO-generated counterfactuals results in a significant performance drop of up to 30.8% (from 49.4% to 18.6%) in absolute joint goal accuracy. In comparison, widely used techniques like paraphrasing only affect the accuracy by at most 2%. Human evaluations show that COCO-generated conversations perfectly reflect the underlying user goal with more than 95% accuracy and are as human-like as the original conversations, further strengthening its reliability and promise to be adopted as part of the robustness evaluation of DST models. 1

For agents

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

get_harvested_code_for_paper("2010.12850")
get_code_for_paper("2010.12850")
have("2010.12850")

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

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

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

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

Connect an agent — have() is free.