Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Hierarchical Neural Story Generation

Hierarchical generation writes stories by planning a premise before the text

  • Problem Language models drift off the prompt when writing long stories, because a seq2seq model given a prompt often degenerates into a plain language model that ignores it.
  • Method The hierarchical model first writes a premise with a convolutional language model, then a fused seq2seq model writes the story from it. Its gates read a fixed pretrained model's hidden states.
  • Results In a blind comparison of 400 story pairs, human raters chose the hierarchical model's stories 67.32% of the time over the language model's stories.

Why long story generation strains standard models

Story generation asks a model to keep a plot consistent over a long document, to be creative, and to hold a high-level plan. A plain language model emits one word at a time, so it has no explicit place to keep such a plan. Conditioning on a premise gives the story a grounding and makes it less likely to drift off topic.

A seq2seq model given a writing prompt often degenerates into a language model that pays little attention to the prompt. The authors trace this to the link between a prompt and its story, which is more complex and underspecified than the local dependencies that language modelling captures. Length adds a second difficulty. Stories average 734.5 words in the dataset, and recurrent architectures process tokens sequentially, which makes such documents slow to model.

Building a prompt-story dataset from a writing forum

The stories come from a Reddit writing community in which users post premises and others reply with stories. Each prompt can have several story responses. Over three years of posts were collected through the official Reddit API. Bot posts, deleted posts, announcements, moderator comments and stories shorter than 30 words were removed, and the text was tokenized with NLTK.

The collection contains 303,358 human-written stories paired with writing prompts. Five percent of the prompts form the validation set and five percent the test set. The training split has 272,600 stories, the test split 15,138 and the validation split 15,620, with 7.7M prompt words and 200M story words in total.

Stories are capped at 1000 words in the experiments. The authors note that the many rare words and misspellings from the forum make the full vocabulary costly to model.

Splitting generation into a prompt stage and a story stage

The first stage produces a premise with a self-attentive GCNN language model. The premise sketches the structure of the story before any story text exists. The second stage is a seq2seq model that writes the story from that premise. Conditioning on the premise keeps the story consistent and gives it structure beyond single phrases.

Prompts are sampled with top-k random sampling from the 10 most likely candidates at each step, and generation stops when the language model emits the end of prompt token. The prompt language model reaches a validation perplexity of 63.06, and it uses the same prompt-side vocabulary as the story-generation models.

Convolutional seq2seq with gated multi-scale self-attention

The base model is a convolutional seq2seq network built on the work of Gehring et al. (2017). Its encoder and decoder are stacks of convolutional layers, so positions within a sequence can be computed in parallel. Attention modules link the encoder and decoder at each decoder layer by taking a weighted sum over the encoder outputs.

Convolutions only see a bounded window, so the decoder is supplemented with self-attention over the words it has already generated. Self-attention can then pick up long-range context while keeping the computation parallel. Each attention head takes its queries, keys and values from gated deep networks built on Gated Linear Units rather than from plain linear projections.

The authors credit this gating with giving the mechanism the capacity to make fine-grained selections.

Each head works at its own time scale. The first head sees every input position, the second every other position, the third every third position, and so on. Downsampling reduces the number of tokens each head attends over, which makes the attention maps sharper and pushes the heads toward different information.

Each head's output combines a gated value representation of the earlier hidden states with softmax attention weights computed from query and key representations, followed by a linear layer. Two changes from the original self-attention design are made. The model may attend to a zero vector at a timestep, which lets it ignore past positions when they add only noise, and the current timestep is excluded so that only earlier positions are attended to.

The zero-vector option lets the model fall back to the architecture without self-attention, according to the authors.

Fusing a second seq2seq model with a fixed pretrained one

The fusion model is motivated by the observation that a seq2seq model tends to learn the local regularities of language and miss the subtler dependency on the prompt. Training a second model on top of a pretrained one lets that second model concentrate on what the first failed to learn. The pretrained model is a Conv seq2seq with self-attention trained on WRITING PROMPTS.

Its parameters are held fixed while the second model trains.

The method modifies cold fusion. Cold fusion gates a seq2seq model with the final hidden layer of a pretrained language model, whereas here the gate reads the hidden states of a second seq2seq model. A gate is computed from the concatenated hidden states of the training model and the pretrained model, with a linear projection, a weight matrix W and a bias b, and it is passed through a sigmoid.

The gate scales the concatenated hidden states elementwise, and the gated result feeds fully connected layers with Gated Linear Unit activations, with layer normalization after each fully connected layer.

\[ g_t = \sigma(W [h^{Training}_t ; h^{Pretrained}_t] + b) \] \[ h_t = g_t \circ [h^{Training}_t ; h^{Pretrained}_t] \]

Training and sampling choices

The models are implemented in fairseq-py on PyTorch. Training uses Nesterov accelerated gradient with gradient clipping, and hyperparameters are chosen by random search cross-validated on the validation set. The architectures are given in the appendix.

Stories are sampled with top-k random sampling. At each step one word is drawn from the k = 10 most likely candidates, and this is the sampling used for story generation.

Each model has its softmax temperature tuned at generation time. Evaluation stories are 150 words long, and unknown word tokens are not generated.

Perplexity gains from self-attention and fusion

Among the baselines, the GCNN LM reaches a test perplexity of 54.79, the LSTM seq2seq 46.79 and Conv seq2seq 45.54, with Conv seq2seq plus self-attention at 37.94.

The ablation chain in Table 2 adds one component at a time to Conv seq2seq. Test perplexity moves from 45.54 to 42.32 with self-attention, to 40.39 with multiple heads, to 38.91 with multiple scales and to 37.94 with gating. The validation values follow the same order, from 45.27 for Conv seq2seq down to 37.37 with gating.

The fusion model improves on the ensemble in test perplexity while using fewer parameters, which the authors read as evidence that training a second model on top of the first encourages it to learn dependencies on the source. Perplexity measures how fluently a model predicts the next word, so these numbers reflect fluency on the test set rather than dependence on the prompt, which is covered by the prompt-relevance evaluations.

Prompt ranking and human pairing

Prompt ranking decodes each story under ten prompts, nine random and one true, and records the share of stories for which the true prompt gives the highest likelihood. Each model is scored on 1000 test stories.

In the human study, stories and prompts are shuffled and judges must select the correct pairing for all three prompts. Each model contributes 105 stories grouped into questions, and each question is answered by 15 judges on Amazon Mechanical Turk. Adding model fusion improves the pairing accuracy of the human judges by 7%, according to the authors, while ensembling has no effect on that accuracy.

The fusion model matches nearest neighbour search on how closely a story relates to its prompt. Nearest neighbour retrieval loses relevance quickly as the rank of the retrieved story increases, while the generative model can produce an unlimited number of stories.

Human preference for hierarchical stories

Stories from the self-attentive GCNN language model are compared with stories from the hierarchical fusion model given prompts from the language model, with 400 stories generated per side. The comparison used 400 pairs of stories, each judged by 5 raters in a blind test on Amazon Mechanical Turk, and raters chose the story they preferred reading.

Raters chose the hierarchical model's story 67.32% of the time and the language model's story 32.68% of the time. The result is a preference between two stories for the same readers in one blind pairing. It does not measure how the hierarchical approach compares with a seq2seq model that has no generated prompt.

Copying, repetition and prompt quality

In an analysis of 500 generated stories of 150 words from test-set prompts, the fusion model reaches an average longest common subsequence of 8.9 with training text.

Random sampling sometimes splits tokens, for example producing ca n't from can't and sometimes emitting the first token but not the second. After one line of dialogue, the model can continue with another line without emitting a newline token. Repetition is a further problem, because the model focuses on what it has recently produced and so repeats similar text.

Prompts from the GCNN language model are generic compared with human prompts. Many generated prompts begin with the man, and the model rarely produces the specific vocabulary of fantasy settings such as those in Harry Potter and Game of Thrones.

What the fusion model's attention attends to

Decoder self-attention could reach words generated far in the past, but at many timesteps it focuses on the recent past.

Limitations

All experiments use the WRITING PROMPTS dataset built from one forum, and the perplexity and prompt-ranking results are measured on that test set. The human studies use stories of 150 words, while the dataset allows stories up to 1000 words, so longer generation is outside the evaluated range.

Random sampling can produce tokenization errors and missing newline tokens, and the fusion model tends to repeat recently produced text. Prompts from the GCNN language model are more generic than human prompts, so the premise stage is weaker than the human prompts in the dataset.

Paper info

Authors
Angela Fan, Mike Lewis, Yann Dauphin
Venue
arXiv · Preprint
First published
2018-5-13
Added
2026-11-13
Updated
2018-5-13
Version
v1
arXiv
1805.04833
Category
cs.CL
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Angela Fan, Mike Lewis, Yann Dauphin (2018). Hierarchical Neural Story Generation. arXiv:1805.04833v1. https://arxiv.org/abs/1805.04833v1

BibTeX
@misc{fan2018hierarchical,
  title = {{Hierarchical Neural Story Generation}},
  author = {Angela Fan and Mike Lewis and Yann Dauphin},
  year = {2018},
  eprint = {1805.04833},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.04833v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up