SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.00748 · 2020

Asking Questions the Human Way: Scalable Question-Answer Generation from Text Corpus

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 1 failure of our instrument; 1 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/2002.00748.json · badge: /api/ran/2002.00748.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
bangliu/ACS-QG canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
vijayakuruba/IFT6010_Applying_Answer-Clue-Style_Approach_to_VQG extension (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
NMTLoss Ran
ran on a synthesized input
bangliu/ACS-QG/loss/text_generation_losses.py
code served (permissive licence) · get_code("e497bfb3e5a79325")
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 NLLLoss. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# The function NMTLoss takes a single parameter: vocabSize
# It expects an integer representing the vocabulary size
# The function uses this to create a weight tensor and NLLLoss criterion

vocabSize = 100

ARGS = {
    "vocabSize": vocabSize
}
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 NLLLoss — a NLLLoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NLLLoss 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
QGLoss Ran
ran on a synthesized input
bangliu/ACS-QG/loss/text_generation_losses.py
code served (permissive licence) · get_code("0c599636d7bd4df1")
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 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)

# Parameters needed:
# g_prob_t: tensor used in operations with expand_as, log, view
# g_targets: tensor passed to crit and contiguous().view(-1)
# c_outputs: tensor used with * and expand_as
# c_switch: tensor used with unsqueeze(2) and expand_as
# c_gate_values: tensor used with expand_as
# c_targets: tensor passed to copyCrit and contiguous().view(-1)
# crit: callable that takes (tensor, tensor) and returns a scalar loss
# copyCrit: callable that takes (tensor, tensor) and returns a scalar loss

batch_size = 2
vocab_size = 4
seq_len = 3

# g_prob_t: shape (batch, seq, vocab) - probability distribution
g_prob_t = torch.nn.functional.softmax(torch.randn(batch_size, seq_len, vocab_size), dim=-1)

# g_targets: shape (batch, seq) - target indices
g_targets = torch.randint(0, vocab_size, (batch_size, seq_len))

# c_outputs: shape (batch, seq, vocab) - output probabilities
c_outputs = torch.nn.functional.softmax(torch.randn(batch_size, seq_len, vocab_size), dim=-1)

# c_switch: shape (batch, seq) - binary switch values
c_switch = torch.randint(0, 2, (batch_size, seq_len)).float()

# c_gate_values: shape (batch, 1, 1) - gate values to broadcast
c_gate_values = torch.sigmoid(torch.randn(batch_size, 1, 1))

# c_targets: shape (batch, seq) - target indices
c_targets = torch.randint(0, vocab_size, (batch_size, seq_len))

# crit: loss function for g (generator) - NLLLoss expects log probabilities and target indices
crit = nn.NLLLoss()

# copyCrit: loss function for c (copy) - NLLLoss expects log probabilities and target indices
copyCrit = nn.NLLLoss()

ARGS = {
    'g_prob_t': g_prob_t,
    'g_targets': g_targets,
    'c_outputs': c_outputs,
    'c_switch': c_switch,
    'c_gate_values': c_gate_values,
    'c_targets': c_targets,
    'crit': crit,
    'copyCrit': copyCrit
}
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 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
SoftQGLoss1 Ran
ran on a synthesized input
bangliu/ACS-QG/loss/text_generation_losses.py
code served (permissive licence) · get_code("d2f6eae830c59871")
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 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)

# Batch size: 2, sequence length: 3, vocab/output size: 4
batch_size = 2
seq_len = 3
vocab_size = 4

# g_prob_t: probability distribution for generator
# Shape: (batch_size, seq_len, vocab_size)
g_prob_t = torch.rand(batch_size, seq_len, vocab_size)

# g_targets: target indices for generator
# Shape: (batch_size, seq_len)
g_targets = torch.randint(0, vocab_size, (batch_size, seq_len))

# c_outputs: copy mechanism outputs (probabilities)
# Shape: (batch_size, seq_len, vocab_size)
c_outputs = torch.rand(batch_size, seq_len, vocab_size)

# c_switch: binary switch between copy and generate (0 or 1)
# Shape: (batch_size, seq_len)
c_switch = torch.randint(0, 2, (batch_size, seq_len)).float()

# c_gate_values: gate values for mixing
# Shape: (batch_size, seq_len, 1)
c_gate_values = torch.rand(batch_size, seq_len, 1)

# c_targets: target indices for copy mechanism
# Shape: (batch_size, seq_len)
c_targets = torch.randint(0, vocab_size, (batch_size, seq_len))

# crit: loss criterion for generator (NLLLoss)
crit = nn.NLLLoss(reduction='mean')

# copyCrit: loss criterion for copy mechanism (NLLLoss)
copyCrit = nn.NLLLoss(reduction='mean')

# soft_g_outputs: soft copy outputs (not used in function body but in signature)
soft_g_outputs = torch.rand(batch_size, seq_len, vocab_size)

# new_g_outputs: revised generator outputs after soft copy
# Shape: (batch_size, seq_len, vocab_size)
new_g_outputs = torch.rand(batch_size, seq_len, vocab_size)

ARGS = {
    'g_prob_t': g_prob_t,
    'g_targets': g_targets,
    'c_outputs': c_outputs,
    'c_switch': c_switch,
    'c_gate_values': c_gate_values,
    'c_targets': c_targets,
    'crit': crit,
    'copyCrit': copyCrit,
    'soft_g_outputs': soft_g_outputs,
    'new_g_outputs': new_g_outputs,
}
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 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
get_perplexity Ran
ran on a synthesized input
bangliu/ACS-QG/DE_main.py
code served (permissive licence) · get_code("064999a28f4d0b4b")
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 math

torch.manual_seed(0)

class MockTokenizer:
    def tokenize(self, sentence):
        return ["hello", "world"]
    
    def convert_tokens_to_ids(self, tokens):
        return [101, 102]

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(2, 1)
    
    def forward(self, input_ids, labels=None):
        batch_size = input_ids.shape[0]
        loss_value = torch.tensor([0.5])
        if labels is not None:
            return (loss_value,)
        return loss_value

tokenizer = MockTokenizer()
model = MockModel()

ARGS = {
    "sentence": "hello world"
}
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
normalize_text Ran
ran on a synthesized input
bangliu/ACS-QG/DA_main.py
code served (permissive licence) · get_code("d53579a101181ef7")
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 normalize_text takes a single parameter 'text' which should be a string
# It performs string replacements on special characters

text_input = "This is a test'' with special\t``characters and\ttabs"

ARGS = {
    "text": text_input
}
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
post_process Ran
ran on a synthesized input
bangliu/ACS-QG/QG_postprocess_seq2seq.py
code served (permissive licence) · get_code("04dfc0720567cfda")
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

ARGS = {
    'input': 'hello world hello foo bar world'
}
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
top_filtering Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from thu-coai/CDial-GPT
pointer only · get_code("695eaa24be6f2a1d")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

sample_sequence Not yet run
unverified (harvested, no recorded run)
vijayakuruba/IFT6010_Applying_Answer-Clue-Style_Approach_to_VQG/GPT2_QG/interact.py
pointer only (licence: NONE) · get_code("65e4d15139e1f262")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, vijayakuruba/IFT6010_Applying_Answer-Clue-Style_Approach_to_VQG 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.

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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 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
top_filtering 7 other papers
3 dated earlier, 1 the same month, 3 later
1901.08149 (2019-01)
TransferTransfo: A Transfer Learning Approach for Neural Network Based Conversational Agents
1904.09751 (2019-04)
THE CURIOUS CASE OF NEURAL TEXT DeGENERATION
1911.00536 (2019-11)
DialoGPT: Large-Scale Generative Pre-training for Conversational Response Generation
and 4 more not named here

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

The ability to ask questions is important in both human and machine intelligence. Learning to ask questions helps knowledge acquisition, improves question-answering and machine reading comprehension tasks, and helps a chatbot to keep the conversation flowing with a human. Existing question generation models are ineffective at generating a large amount of high-quality question-answer pairs from unstructured text, since given an answer and an input passage, question generation is inherently a one-to-many mapping. In this paper, we propose Answer-Clue-Style-aware Question Generation (ACS-QG), which aims at automatically generating high-quality and diverse question-answer pairs from unlabeled text corpus at scale by imitating the way a human asks questions. Our system consists of: i) an information extractor, which samples from the text multiple types of assistive information to guide question generation; ii) neural question generators, which generate diverse and controllable questions, leveraging the extracted assistive information; and iii) a neural quality controller, which removes low-quality generated data based on text entailment. We compare our question generation models with existing approaches and resort to voluntary human evaluation to assess the quality of the generated question-answer pairs. The evaluation results suggest that our system dramatically outperforms state-of-the-art neural question generation models in terms of the generation quality, while being scalable in the meantime. With models trained on a relatively smaller amount of data, we can generate 2.8 million quality-assured question-answer pairs from a million sentences found in Wikipedia.

For agents

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

get_harvested_code_for_paper("2002.00748")
get_code_for_paper("2002.00748")
have("2002.00748")

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

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

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

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

Connect an agent — have() is free.