SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.12704 · ACL · 2020

Semantic Graphs for Generating Deep Questions

Yansong Feng, Tat-Seng Chua, Yuxi Xie, Min-Yen Kan, Liangming Pan

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2004.12704.json · badge: /api/ran/2004.12704.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
WING-NUS/SG-Deep-Question-Generation marked official in Papers with Code
Papers with Code archive
3 ran · 1 no recorded run
FunctionStatusWhere it lives
GraphAttention Ran
ran on a synthesized input · constructed an object; no result was computed
WING-NUS/SG-Deep-Question-Generation/src/onqg/models/Encoders.py
code served (permissive licence) · get_code("237245c0dd0c21c1")
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 an instance of its own class, GraphAttention: the run constructed the object and did not call it, so no result was computed. 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)

# Set up dimensions
batch_size = 2
node_num = 3
d_hidden = 4
d_model = 5
alpha = 0.2

# Create query tensor: [batch_size, node_num * node_num, d_hidden]
query = torch.randn(batch_size, node_num * node_num, d_hidden)

# Create value tensor: [batch_size, node_num * node_num, d_model]
value = torch.randn(batch_size, node_num * node_num, d_model)

# Create mask tensor: [batch_size, node_num, node_num]
# Mask should have values > 0 for valid positions
mask = torch.ones(batch_size, node_num, node_num)
# Set some positions to 0 to test masking
mask[0, 0, 1] = 0
mask[1, 2, 2] = 0

# Define arguments for GraphAttention.__init__
ARGS = {
    'd_q': d_hidden,
    'd_v': d_model,
    'alpha': alpha,
    'dropout': 0.1
}
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 GraphAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphAttention 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
GraphEncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
WING-NUS/SG-Deep-Question-Generation/src/onqg/models/Encoders.py
code served (permissive licence) · get_code("e7cd36ff6b490bb8")
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 an instance of its own class, GraphEncoderLayer: the run constructed the object and did not call it, so no result was computed. 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)

# Define dimensions
batch_size = 2
node_num = 3
d_hidden = 4
d_model = 5
alpha = 0.2

# Create input tensors
# nodes: [batch_size, node_num, d_hidden]
nodes = torch.randn(batch_size, node_num, d_hidden)

# mask: list of 2 masks, each [batch_size, node_num, node_num]
mask = [
    torch.ones(batch_size, node_num, node_num),
    torch.ones(batch_size, node_num, node_num)
]

# node_type: [batch_size, node_num] with values in range [2, 2+edge_num)
# edge_num = 3, so values should be in [2, 5)
node_type = torch.randint(2, 5, (batch_size, node_num)).float()

# feat_hidden: optional, set to None
feat_hidden = None

ARGS = {
    'd_hidden': d_hidden,
    'd_model': d_model,
    'alpha': alpha,
    'feature': False,
    'dropout': 0.1,
    'attn_dropout': 0.1
}
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 GraphEncoderLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphEncoderLayer 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
Propagator Ran
ran on a synthesized input · constructed an object; no result was computed
WING-NUS/SG-Deep-Question-Generation/src/onqg/models/Encoders.py
code served (permissive licence) · get_code("9b730878081b6ce6")
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 an instance of its own class, Propagator: the run constructed the object and did not call it, so no result was computed. 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)

# Define the Propagator class
class Propagator(nn.Module):

    def __init__(self, state_dim, dropout=0.1):
        super(Propagator, self).__init__()
        self.reset_gate = nn.Sequential(nn.Linear(state_dim * 3, state_dim), nn.Sigmoid(), nn.Dropout(dropout))
        self.update_gate = nn.Sequential(nn.Linear(state_dim * 3, state_dim), nn.Sigmoid(), nn.Dropout(dropout))
        self.transform = nn.Sequential(nn.Linear(state_dim * 3, state_dim), nn.Tanh())

    def forward(self, cur_state, in_vec, out_vec):
        """
        cur_state - [batch_size, node_num, d_model]
        in_vec - [batch_size, node_num, d_model]
        out_vec - [batch_size, node_num, d_model]
        """
        a = torch.cat([in_vec, out_vec, cur_state], dim=2)
        r = self.reset_gate(a)
        z = self.update_gate(a)
        joined_input = torch.cat([in_vec, out_vec, r * cur_state], dim=2)
        h_hat = self.transform(joined_input)
        output = (1 - z) * cur_state + z * h_hat
        return output

# Setup arguments
state_dim = 4
batch_size = 2
node_num = 3

# Create an instance of Propagator
propagator = Propagator(state_dim=state_dim, dropout=0.1)

# Create tensor inputs
# cur_state: [batch_size, node_num, state_dim]
cur_state = torch.randn(batch_size, node_num, state_dim)
# in_vec: [batch_size, node_num, state_dim]
in_vec = torch.randn(batch_size, node_num, state_dim)
# out_vec: [batch_size, node_num, state_dim]
out_vec = torch.randn(batch_size, node_num, state_dim)

ARGS = {
    "state_dim": state_dim,
    "dropout": 0.1
}
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 Propagator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Propagator 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
GraphEncoder Not yet run
unverified (harvested, no recorded run)
WING-NUS/SG-Deep-Question-Generation/src/onqg/models/Encoders.py
code served (permissive licence) · get_code("86df33d346709e8e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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.

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

Repositories linked to this paper

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

Abstract

This paper proposes the problem of Deep Question Generation (DQG), which aims to generate complex questions that require reasoning over multiple pieces of information of the input passage. In order to capture the global structure of the document and facilitate reasoning, we propose a novel framework which first constructs a semantic-level graph for the input document and then encodes the semantic graph by introducing an attention-based GGNN (Att-GGNN). Afterwards, we fuse the document-level and graphlevel representations to perform joint training of content selection and question decoding. On the HotpotQA deep-question centric dataset, our model greatly improves performance over questions requiring reasoning over multiple facts, leading to state-of-theart performance. The code is publicly available at https://github.com/WING-NUS/ SG-Deep-Question-Generation.

For agents

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

get_harvested_code_for_paper("2004.12704")
get_code_for_paper("2004.12704")
have("2004.12704")

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

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

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

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

Connect an agent — have() is free.