Papers › Learning Neural Templates for Text Generation

Learning Neural Templates for Text Generation

30 Aug 2018EMNLP 2018 10arXiv:1808.10122archive 2025-07-28

Sam Wiseman, Stuart M. Shieber, Alexander M. Rush

While neural, encoder-decoder models have had significant empirical success in text generation, there remain several unaddressed problems with this style of generation. Encoder-decoder models are largely (a) uninterpretable, and (b) difficult to control in terms of their phrasing or content. This work proposes a neural generation system using a hidden semi-markov model (HSMM) decoder, which learns latent, discrete templates jointly with learning to generate. We show that this model learns useful templates, and that these templates make generation both more interpretable and controllable. Furthermore, we show that this approach scales to real data sets and achieves strong performance nearing that of encoder-decoder text generation models.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1808.10122")

Code

Syntology Ran 0 of 12 code samples harvested from 1 repository linked to this paper; 12 have no recorded run.

By repository: community (archive-listed): 12 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

harvardnlp/neural-template-gen officialmentioned in papermentioned on GitHubpytorch report
TobeyYang/S2S_Temp mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 0 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

12unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from TobeyYang/S2S_Temp. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

beam_search TobeyYang/S2S_Temp/generate.py community (archive-listed) unverified Apache-2.0 (permissive) · 2b7644a99136563a · report
extract_from_tagged_data TobeyYang/S2S_Temp/template_extraction.py community (archive-listed) unverified Apache-2.0 (permissive) · 464279c212e57c11 · report
group_by_template TobeyYang/S2S_Temp/template_extraction.py community (archive-listed) unverified Apache-2.0 (permissive) · 99bdea19216d009b · report
just_state2phrases TobeyYang/S2S_Temp/template_extraction.py community (archive-listed) unverified Apache-2.0 (permissive) · 12ad11fe4b8855eb · report
logsumexp0 TobeyYang/S2S_Temp/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 46e836256359dfaf · report
logsumexp1 TobeyYang/S2S_Temp/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 254795c0c53f7f18 · report
logsumexp2 TobeyYang/S2S_Temp/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · bd2a32a50de1f458 · report
make_targs TobeyYang/S2S_Temp/chsmm_without_src.py community (archive-listed) unverified Apache-2.0 (permissive) · cb8a408338d9f761 · report
recover_bps TobeyYang/S2S_Temp/infc.py community (archive-listed) unverified Apache-2.0 (permissive) · 236f6cf621a3485a · report
sort_hyps TobeyYang/S2S_Temp/generate.py community (archive-listed) unverified Apache-2.0 (permissive) · 40eb2e0e8d291cca · report
validation TobeyYang/S2S_Temp/gan.py community (archive-listed) unverified Apache-2.0 (permissive) · 78be13a6d800db69 · report
viterbi TobeyYang/S2S_Temp/infc.py community (archive-listed) unverified Apache-2.0 (permissive) · 3ae4408089e66362 · report

Tasks

DecoderText Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections