SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1804.08217 · 2018

Mem2Seq: Effectively Incorporating Knowledge Bases into End-to-End Task-Oriented Dialog Systems

arXiv · PDF · Open in the Atlas

Code that ran

4 of 9 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 3 have no contract verdict; 1 failure of our instrument; 5 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/1804.08217.json · badge: /api/ran/1804.08217.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
HLTCHKUST/Mem2Seq canonical (classifier label)
classifier basis: census
4 ran · 5 no recorded run
FunctionStatusWhere it lives
hasNumbers Ran
ran on a synthesized input
HLTCHKUST/Mem2Seq/utils/utils_babi_mem2seq.py
code served (permissive licence) · get_code("6dee9d5e2ef61908")
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 torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "inputString": "hello123world"
}
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 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
read_langs Ran
ran on a synthesized input
HLTCHKUST/Mem2Seq/utils/utils_kvr_mem2seq.py
code served (permissive licence) · get_code("bef35f44e6e32abb")
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 dialogue data in the expected format
sample_data = """# weather
1 what is the weather	weather forecast	["weather_entity_1"]
2 user message	system response	[]

# schedule
1 schedule my meeting	meeting scheduled	["calendar_entity_1"]
2 check calendar	event found	[]

# navigate
1 find restaurant	restaurant found	["nav_entity_1"]
2 directions	route ready	[]
"""

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
sequence_mask Ran
ran; our contract draft was wrong, not the code
HLTCHKUST/Mem2Seq/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.

wer Ran
ran on a synthesized input
HLTCHKUST/Mem2Seq/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
collate_fn Not yet run
unverified (harvested, no recorded run)
HLTCHKUST/Mem2Seq/utils/utils_babi_mem2seq.py
code served (permissive licence) · get_code("55b92d7c12a28efb")
How it ran

no invocation recorded.

collate_fn Not yet run
unverified (harvested, no recorded run)
HLTCHKUST/Mem2Seq/utils/utils_kvr_mem2seq.py
code served (permissive licence) · get_code("035599ac95970472")
How it ran

no invocation recorded.

masked_cross_entropy Not yet run
unverified (harvested, no recorded run)
HLTCHKUST/Mem2Seq/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("c43122df579b6d8b")
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. No invocation recorded.

moses_multi_bleu Not yet run
unverified (harvested, no recorded run)
HLTCHKUST/Mem2Seq/utils/measures.py
code served (permissive licence) · get_code("310d80260b624e59")
How it ran

no invocation recorded.

read_langs Not yet run
unverified (harvested, no recorded run)
HLTCHKUST/Mem2Seq/utils/utils_babi_mem2seq.py
code served (permissive licence) · get_code("f12bf9fe4e9605ea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 6 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
3 later
1811.00239 (2018-11)
Progressive Memory Banks for Incremental Domain Adaptation
1901.04713 (2019-01)
Global-to-local Memory Pointer Networks for Task-Oriented Dialogue
2004.06871 (2020-04)
TOD-BERT: Pre-trained Natural Language Understanding for Task-Oriented Dialogue
wer 3 other papers
3 later
1901.04713 (2019-01)
Global-to-local Memory Pointer Networks for Task-Oriented Dialogue
1905.10033 (2019-05)
Personalizing Dialogue Agents via Meta-Learning
1908.07687 (2019-08)
MoEL: Mixture of Empathetic Listeners
masked_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 dialog systems usually suffer from the challenge of incorporating knowledge bases. In this paper, we propose a novel yet simple end-to-end differentiable model called memory-to-sequence (Mem2Seq) to address this issue. Mem2Seq is the first neural generative model that combines the multi-hop attention over memories with the idea of pointer network. We empirically show how Mem2Seq controls each generation step, and how its multi-hop attention mechanism helps in learning correlations between memories. In addition, our model is quite general without complicated task-specific designs. As a result, we show that Mem2Seq can be trained faster and attain the state-of-the-art performance on three different task-oriented dialog datasets.

For agents

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

get_harvested_code_for_paper("1804.08217")
get_code_for_paper("1804.08217")
have("1804.08217")

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

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

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

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

Connect an agent — have() is free.