SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.findings-emnlp.1023 · EMNLP Findings · 2023

QADYNAMICS: Training Dynamics-Driven Synthetic QA Diagnostic for Zero-Shot Commonsense Question Answering

Xin Liu, Yangqiu Song, Tianqing Fang, Weiqi Wang, Wenxuan Ding, Baixuan Xu, Haochen Shi

Code that ran

9 of 14 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 5 have no contract verdict; 1 failure of our instrument; 5 no recorded run), measured 2026-11-24; 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/2023.findings-emnlp.1023.json · badge: /api/ran/2023.findings-emnlp.1023.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
HKUST-KnowComp/QaDynamics canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
FunctionStatusWhere it lives
format_question Ran
ran on a synthesized input
HKUST-KnowComp/QaDynamics/src/Data_generation/generate_from_CWWV.py
code served (permissive licence) · get_code("6a37a5935f56b90a")
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 random

random.seed(0)

ARGS = {
    'q': 'What is the capital of France?',
    'a': 'Paris',
    'distractors': ['London', 'Berlin'],
    'q_id': 'question_001',
    'head_label': 'Geography',
    'template': 'capital_city',
    'source': 'wikipedia',
    'rel': 'capital_of'
}
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
get_answer Ran
ran on a synthesized input
HKUST-KnowComp/QaDynamics/src/Data_generation/filter_CWWV.py
code served (permissive licence) · get_code("47e378f51ba3827d")
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)

data = {
    'question': {
        'choices': [
            {'label': 'A', 'text': 'First option'},
            {'label': 'B', 'text': 'Second option'},
            {'label': 'C', 'text': 'Third option'},
        ]
    },
    'answerKey': 'B'
}

ARGS = {
    'data': data
}
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_lm_score Ran
ran on a synthesized input
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_GPT2.py
code served (permissive licence) · get_code("63b489a8306ffa6e")
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 ndarray, ndim 1, dtype family float, 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
import torch.nn as nn
from torch.nn import CrossEntropyLoss

torch.manual_seed(0)

class DummyLanguageModel(nn.Module):
    """Minimal language model that returns logits matching the expected shape"""
    def __init__(self, vocab_size=10, hidden_dim=4):
        super().__init__()
        self.vocab_size = vocab_size
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, input_ids, attention_mask=None):
        # input_ids: (num_choices, max_length)
        # output: tuple where [0] is logits of shape (num_choices, max_length, vocab_size)
        embedded = self.embedding(input_ids)
        logits = self.linear(embedded)
        return (logits,)

# Set up parameters
batch_size = 2
max_length = 5
vocab_size = 10
pad_token_id = 0

# Create model
model = DummyLanguageModel(vocab_size=vocab_size, hidden_dim=4)

# Create batch of token IDs - shape (num_choices, max_length)
batch = torch.randint(1, vocab_size, (batch_size, max_length))

# Create attention mask - shape (num_choices, max_length)
att_mask = torch.ones((batch_size, max_length), dtype=torch.long)

ARGS = {
    "model": model,
    "batch": batch,
    "pad_token_id": pad_token_id,
    "att_mask": att_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 ndarray, ndim 1, dtype family float, 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
prepare_input Ran
ran, honoured the contract we drafted
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_DeBERTa.py
pointer only (licence: MIT); the stored copy get_code serves, from tqfang/complex-commonsense-reasoning, is pointer only (licence: NONE) · get_code("c16130fd76be29d9")
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 tqfang/complex-commonsense-reasoning, 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.

read_data Ran
ran on a synthesized input
HKUST-KnowComp/QaDynamics/src/Data_generation/generate_from_ATOMIC.py
code served (permissive licence) · get_code("d08593bd98bcb5ea")
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 json
import tempfile
import os

# Create a temporary file with JSONL content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.jsonl")

# Write sample JSONL data
with open(temp_file, 'w') as f:
    f.write(json.dumps({"id": 1, "text": "hello"}) + "\n")
    f.write(json.dumps({"id": 2, "text": "world"}) + "\n")
    f.write(json.dumps({"id": 3, "text": "test"}) + "\n")

ARGS = {
    "filename": temp_file
}
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 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
score_task Ran
ran, honoured the contract we drafted
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_DeBERTa.py
pointer only (licence: MIT); the stored copy get_code serves, from tqfang/complex-commonsense-reasoning, is pointer only (licence: NONE) · get_code("b1f6ebefe5be87cd")
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 tqfang/complex-commonsense-reasoning, 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.

score_task Ran
ran, honoured the contract we drafted
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_RoBERTa.py
code served (permissive licence) · get_code("7ca6ae6a08e06259")
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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Minimal tokenizer stand-in
class SimpleTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.mask_token_id = 1
        self.sep_token_id = 2
    
    def encode(self, text, add_prefix_space=False):
        # Return a simple sequence of token ids
        tokens = [3, 4, 5]  # Simple fixed token sequence
        if add_prefix_space:
            return [self.pad_token_id] + tokens + [self.sep_token_id]
        return tokens + [self.sep_token_id]

# Minimal language model
class SimpleLanguageModel(nn.Module):
    def __init__(self, vocab_size=10, hidden_size=4):
        super().__init__()
        self.embeddings = nn.Embedding(vocab_size, hidden_size)
        self.lm_head = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, attention_mask=None):
        # input_ids: (batch_size, seq_length)
        embedded = self.embeddings(input_ids)  # (batch_size, seq_length, hidden_size)
        logits = self.lm_head(embedded)  # (batch_size, seq_length, vocab_size)
        return (logits,)

# Create instances
device = "cpu"
tokenizer = SimpleTokenizer()
model = SimpleLanguageModel(vocab_size=10, hidden_size=4)
model.eval()

question = "What is the capital?"
choices = ["Paris", "London"]

ARGS = {
    "question": question,
    "choices": choices,
    "tokenizer": tokenizer,
    "device": device,
    "model": model,
}
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 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
select_distractors_noaf Ran
ran on a synthesized input
HKUST-KnowComp/QaDynamics/src/Data_generation/generate_from_CWWV.py
code served (permissive licence) · get_code("3f74afe23c386fad")
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. 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 random

torch.manual_seed(0)

# The function needs:
# - data: something iterable that can be converted to a list
# - head_label: a string with space-separated labels
# - heads: something indexable with [neg, rel] that returns a set
# - correct_answer: a value that can be compared with items from data
# - rel: an index/key for heads

# Create a small dataset
data = ['item_0', 'item_1', 'item_2', 'item_3', 'item_4']

# head_label is a space-separated string of labels
head_label = 'label_a label_b'

# heads needs to support indexing with [key, rel] and return a set
# We'll use a dict-based approach
class HeadsDict:
    def __init__(self):
        self.data = {
            'item_0': {0: {'head_x', 'head_y'}},
            'item_1': {0: {'head_z'}},
            'item_2': {0: {'label_a'}},
            'item_3': {0: {'other_head'}},
            'item_4': {0: {'label_b'}},
        }
    
    def __getitem__(self, key):
        neg, rel = key
        if neg in self.data and rel in self.data[neg]:
            return self.data[neg][rel]
        return set()

heads = HeadsDict()

# correct_answer should be one of the items from data
correct_answer = 'item_0'

# rel is used as the second index into heads
rel = 0

ARGS = {
    'data': data,
    'head_label': head_label,
    'heads': heads,
    'correct_answer': correct_answer,
    'rel': rel
}
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 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
text_standardize Ran
ran; our contract draft was wrong, not the code
HKUST-KnowComp/QaDynamics/src/Data_generation/generate_from_ATOMIC.py
code served (permissive licence) · get_code("e7b249125afc51f2")
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 text_standardize(text):
    """
	Borrowed from COMET repo 
	"""
    text = text.replace('—', '-')
    text = text.replace('–', '-')
    text = text.replace('―', '-')
    text = text.replace('…', '...')
    text = text.replace('´', "'")
    text = re.sub('(-+|~+|!+|"+|;+|\\?+|\\++|,+|\\)+|\\(+|\\\\+|\\/+|\\*+|\\[+|\\]+|}+|{+|\\|+|_+)', ' \\1 ', text)
    text = re.sub('\\s*\\n\\s*', ' \n ', text)
    text = re.sub('[^\\S\\n]+', ' ', text)
    return text.strip()

ARGS = {
    'text': 'Hello—world! This is a test… with special characters: (~!@#$%)'
}
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
accuracy Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/QaDynamics/src/Training/data_utils.py
code served (permissive licence) · get_code("104a4b57d08a2b41")
How it ran

no invocation recorded.

init_model Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_GPT2.py
code served (permissive licence) · get_code("7fdbc39e94fce716")
How it ran

no invocation recorded.

overlap_exist Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/QaDynamics/src/Data_generation/generate_from_ATOMIC.py
code served (permissive licence) · get_code("2beeea12ce7b81cd")
How it ran

no invocation recorded.

token_wise_scoring Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_DeBERTa.py
pointer only (licence: MIT); the stored copy get_code serves, from tqfang/complex-commonsense-reasoning, is pointer only (licence: NONE) · get_code("83d4b85ceeddb59c")
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 tqfang/complex-commonsense-reasoning, 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.

token_wise_scoring Not yet run
unverified (harvested, no recorded run)
HKUST-KnowComp/QaDynamics/src/Evaluation/evaluate_RoBERTa.py
code served (permissive licence) · get_code("32bfca6e9b3a158d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 later) and 7 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
prepare_input 1 other paper
1 later
2403.07398 (2024-03)
Complex Reasoning over Logical Queries on Commonsense Knowledge Graphs
read_data 1 other paper
1 later
2024.findings-emnlp.123 (2024 (year only))
INTENTIONQA: A Benchmark for Evaluating Purchase Intention Comprehension Abilities of Language Models in E-commerce
score_task 1 other paper
1 later
2403.07398 (2024-03)
Complex Reasoning over Logical Queries on Commonsense Knowledge Graphs
text_standardize 1 other paper
1 later
2607.22136 (2026-07)
Dynamic Commonsense Coordination for Empathetic Response Generation
token_wise_scoring 1 other paper
1 later
2403.07398 (2024-03)
Complex Reasoning over Logical Queries on Commonsense Knowledge Graphs

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Zero-shot commonsense Question-Answering (QA) requires models to reason about general situations beyond specific benchmarks. Stateof-the-art approaches fine-tune language models on QA pairs constructed from Common-Sense Knowledge Bases (CSKBs) to equip the models with more commonsense knowledge in a QA context. However, current QA synthesis protocols may introduce noise from the CSKBs and generate ungrammatical questions and false negative options, which impede the model's ability to generalize. To address these issues, we propose QADYNAM-ICS, a training dynamics-driven framework for QA diagnostics and refinement. Our approach analyzes the training dynamics of each QA pair at both the question level and option level, discarding machine-detectable artifacts by removing uninformative QA pairs and mislabeled or false-negative options. Extensive experiments demonstrate the effectiveness of our approach, which outperforms all baselines while using only 33% of the synthetic data, even including LLMs such as ChatGPT. Moreover, expert evaluations confirm that our framework significantly improves the quality of QA synthesis. Our code and model checkpoints are available at https://github.com/HKUST-KnowComp/QaDynamics. Question Candidates Confidence MISLABELED OPTION Flynn is cleaning out Flynn's garage. As a result, Flynn felt A: confused. B: elated.

For agents

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

get_harvested_code_for_paper("2023.findings-emnlp.1023")
get_code_for_paper("2023.findings-emnlp.1023")
have("2023.findings-emnlp.1023")

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

curl https://syntology.ai/api/ran/2023.findings-emnlp.1023.json

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

[![Syntology run record](https://syntology.ai/api/ran/2023.findings-emnlp.1023.svg)](https://syntology.ai/paper/2023.findings-emnlp.1023)

Connect an agent — have() is free.