SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1901.04713 · 2019

Global-to-local Memory Pointer Networks for Task-Oriented Dialogue

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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 8 have no contract verdict; 1 failure of our instrument; 2 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/1901.04713.json · badge: /api/ran/1901.04713.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
scoyer/fg2seq community (classifier label)
classifier basis not recorded on the link
9 ran · 2 no recorded run
FunctionStatusWhere it lives
cross_entropy Ran
ran on a synthesized input
scoyer/fg2seq/utils/masked_cross_entropy.py
pointer only (licence: MIT); the stored copy get_code serves, from jasonwu0731/ToD-BERT, is pointer only (licence: BSD-2-Clause) · get_code("e155e413c186170f")
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 jasonwu0731/ToD-BERT, and BSD-2-Clause, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). 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.

generate_entity_from_context Ran
ran on a synthesized input
scoyer/fg2seq/utils/utils_Ent_cam.py
code served (permissive licence) · get_code("72af408d531d87b9")
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 torch

torch.manual_seed(0)

# Construct arguments for generate_entity_from_context
# The function expects:
# - context_arr: a list of sentences, where each sentence is a list of entities (strings)
# - global_entity: a dict mapping entity types to lists of entities
# - entity_set: a list to accumulate found entities
# - entity_type_set: a list to accumulate entity types

context_arr = [
    ["apple", "banana", "cherry"],
    ["dog", "cat", "elephant"],
    ["red", "blue", "green"]
]

global_entity = {
    "fruit": ["apple", "banana", "orange"],
    "animal": ["dog", "cat", "lion"],
    "color": ["red", "blue", "yellow"]
}

entity_set = []
entity_type_set = []

ARGS = {
    "context_arr": context_arr,
    "global_entity": global_entity,
    "entity_set": entity_set,
    "entity_type_set": entity_type_set
}
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, 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
generate_indicator Ran
ran on a synthesized input
scoyer/fg2seq/utils/utils_Ent_cam.py
code served (permissive licence) · get_code("829bbf0eec4ae1cf")
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 2, dtype family int; 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)

# The function iterates through context_arr as a list/iterable of questions
# and checks if each entity in entity_set appears in each question.
# Both appear to be collections where 'in' operator works.

# Create context_arr: a list of strings (questions)
context_arr = [
    "what is the capital of France",
    "who is the president of the United States"
]

# Create entity_set: a set/list of strings (entities to check for)
entity_set = ["France", "capital", "president", "United States"]

ARGS = {
    "context_arr": context_arr,
    "entity_set": entity_set
}
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 2, dtype family int — 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
masked_cross_entropy Ran
ran on a synthesized input
scoyer/fg2seq/utils/masked_cross_entropy.py
code served (permissive licence) · get_code("65711d37e56e3636")
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. 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, 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
from torch.autograd import Variable

torch.manual_seed(0)

# Define small tensors for the function
batch_size = 2
max_len = 4
num_classes = 3

# logits: (batch, max_len, num_classes)
logits = Variable(torch.randn(batch_size, max_len, num_classes), requires_grad=True)

# target: (batch, max_len) with class indices in range [0, num_classes)
target = Variable(torch.randint(0, num_classes, (batch_size, max_len)))

# length: (batch,) with sequence lengths
length = Variable(torch.LongTensor([3, 2]))

ARGS = {
    'logits': logits,
    'target': target,
    'length': length
}
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
read_langs Ran
ran on a synthesized input
scoyer/fg2seq/utils/utils_Ent_cam.py
code served (permissive licence) · get_code("396cd957d7c1282b")
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 tempfile
import os

# Create a temporary file with sample data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')

# Write sample data in the expected format
sample_data = """1 restaurant name Alice @restaurant
1 restaurant type chinese @restaurant
1 restaurant address downtown @restaurant

2 what is the address of restaurant
2 the address is downtown
3 tell me about alice
3 alice is a chinese restaurant downtown

"""

temp_file.write(sample_data)
temp_file.close()

ARGS = {
    'file_name': temp_file.name,
    'max_line': None
}
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
read_langs Ran
ran on a synthesized input
scoyer/fg2seq/utils/utils_Ent_kvr.py
code served (permissive licence) · get_code("56929b62b81fbc90")
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 json
import torch
import torch.utils.data as data
import ast
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory and minimal data files
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'KVR')
os.makedirs(data_dir, exist_ok=True)

# Create minimal kvret_entities.json
entities_data = {
    "poi": [
        {"type": "restaurant", "name": "pizza_hut", "address": "123_main"},
        {"type": "gas", "name": "shell", "address": "456_oak"}
    ],
    "distance": ["1_mile", "2_miles"],
    "traffic_info": ["light", "heavy"],
    "monday_weather": ["sunny", "rainy"],
    "time": ["9am", "10am"],
    "date": ["tomorrow", "today"],
    "party": ["1", "2", "3"],
    "room": ["conference_a", "conference_b"]
}

entities_file = os.path.join(data_dir, 'kvret_entities.json')
with open(entities_file, 'w') as f:
    json.dump(entities_data, f)

# Create a minimal test data file
test_file = os.path.join(temp_dir, 'test_kvret.txt')
with open(test_file, 'w') as f:
    f.write("# weather\n")
    f.write("1 user: what is the weather\tsystem: it is sunny\t['sunny']\n")
    f.write("2 user: what time\tsystem: it is 9am\t['9am']\n")

# Monkey patch the open to use our temp directory for kvret_entities.json
original_open = open
def patched_open(file_name, *args, **kwargs):
    if 'kvret_entities.json' in file_name:
        return original_open(entities_file, *args, **kwargs)
    return original_open(file_name, *args, **kwargs)

import builtins
builtins.open = patched_open

ARGS = {
    'file_name': test_file,
    'max_line': 2
}
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
sequence_mask Ran
ran; our contract draft was wrong, not the code
scoyer/fg2seq/utils/masked_cross_entropy.py
pointer only (licence: MIT); the stored copy get_code serves, from jasonwu0731/ToD-BERT, is pointer only (licence: BSD-2-Clause) · get_code("45176015bba52028")
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 jasonwu0731/ToD-BERT, and BSD-2-Clause, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). 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.

sequence_mask Ran
ran on a synthesized input
scoyer/fg2seq/utils/utils_general.py
code served (permissive licence) · get_code("0f2697a45991dfde")
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 2, dtype family float, shape (4, 5) 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

torch.manual_seed(0)

# Create a small tensor of sequence lengths
# These represent the actual lengths of sequences in a batch
lengths = torch.tensor([3, 5, 2, 4], dtype=torch.long)

# Optional: max_len can be None (will be computed from lengths.max())
# or can be explicitly set to a value
max_len = None

ARGS = {
    "lengths": lengths,
    "max_len": max_len,
}
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 2, dtype family float, shape (4, 5) — shape (4, 5) 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
wer Ran
ran on a synthesized input
scoyer/fg2seq/utils/measures.py
code served (permissive licence) · get_code("65dff947bbcbac08")
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 float, 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 numpy

# The wer function takes two parameters: r and h
# Both should be sequences (lists) of words/tokens
# r is the reference (ground truth) sequence
# h is the hypothesis (predicted) sequence
# The function implements edit distance (Levenshtein distance) to calculate WER

ARGS = {
    "r": "what is it".split(),  # reference: ["what", "is", "it"]
    "h": "what is".split(),      # hypothesis: ["what", "is"]
}
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 float, 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_seq Not yet run
unverified (harvested, no recorded run)
scoyer/fg2seq/utils/utils_general.py
code served (permissive licence) · get_code("369119304dae292a")
How it ran

no invocation recorded.

moses_multi_bleu Not yet run
unverified (harvested, no recorded run)
scoyer/fg2seq/utils/measures.py
code served (permissive licence) · get_code("d70c18871844e378")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 8 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
sequence_mask 3 other papers
2 dated earlier, 1 later
1804.08217 (2018-04)
Mem2Seq: Effectively Incorporating Knowledge Bases into End-to-End Task-Oriented Dialog Systems
1811.00239 (2018-11)
Progressive Memory Banks for Incremental Domain Adaptation
2004.06871 (2020-04)
TOD-BERT: Pre-trained Natural Language Understanding for Task-Oriented Dialogue
wer 3 other papers
1 dated earlier, 2 later
1804.08217 (2018-04)
Mem2Seq: Effectively Incorporating Knowledge Bases into End-to-End Task-Oriented Dialog Systems
1905.10033 (2019-05)
Personalizing Dialogue Agents via Meta-Learning
1908.07687 (2019-08)
MoEL: Mixture of Empathetic Listeners
cross_entropy 1 other paper
1 later
2004.06871 (2020-04)
TOD-BERT: Pre-trained Natural Language Understanding for Task-Oriented Dialogue

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

End-to-end task-oriented dialogue is challenging since knowledge bases are usually large, dynamic and hard to incorporate into a learning framework. We propose the global-to-local memory pointer (GLMP) networks to address this issue. In our model, a global memory encoder and a local memory decoder are proposed to share external knowledge. The encoder encodes dialogue history, modifies global contextual representation, and generates a global memory pointer. The decoder first generates a sketch response with unfilled slots. Next, it passes the global memory pointer to filter the external knowledge for relevant information, then instantiates the slots via the local memory pointers. We empirically show that our model can improve copy accuracy and mitigate the common out-of-vocabulary problem. As a result, GLMP is able to improve over the previous state-of-the-art models in both simulated bAbI Dialogue dataset and human-human Stanford Multi-domain Dialogue dataset on automatic and human evaluation.

For agents

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

get_harvested_code_for_paper("1901.04713")
get_code_for_paper("1901.04713")
have("1901.04713")

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

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

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

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

Connect an agent — have() is free.