Year: 2021

Abstract:
Large pre-trained language models (LMs) have demonstrated impressive capabilities in generating long, fluent text; however, there is little to no analysis on their ability to maintain entity coherence and consistency. In this work, we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories. First, we propose a set of automatic metrics for measuring model performance in terms of entity usage. Given these metrics, we quantify the limitations of current LMs. Next, we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory. We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window. Finally, we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories.

text: Large pre-trained language models (LMs) have demonstrated impressive capabilities in generating long, fluent text; however, there is little to no analysis on their ability to maintain entity coherence and consistency. In this work, we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories. First, we propose a set of automatic metrics for measuring model performance in terms of entity usage. Given these metrics, we quantify the limitations of current LMs. Next, we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory. We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window. Finally, we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories.

heading: 1 INTRODUCTION
text: Large pre-trained language models (LMs) (such as GPT-2 (Radford et al., 2019), GPT-3 (Brown et al., 2020), and models based on the Transformer-XL architecture (Dai et al., 2019)) have radically improved text generation, producing seemingly fluent text – Clark et al. (2021) even showed that non-expert human judges cannot distinguish between machine-written and human-authored texts, based on surface cues. Assuming the quality of generated text as given, most recent efforts have then focused on trying to control generation with a desired topic, factual information, or specific style (Keskar et al., 2019; Dathathri et al., 2019; Shin et al., 2020; Li & Liang, 2021). However, anecdotally, there are still common failure cases of machine generated text in terms of entity coherence and consistency, which are fundamental properties of language.
In this work, we specifically focus on the task of narrative generation in order to analyse and improve entity coherence and consistency. Entities play a central role in narratives, since they guide the plot, and all events revolve around them (Fludernik, 2002; Jannidis, 2009; Frow, 2014; Bamman et al., 2013). Despite the importance of entities, recent work has mainly emphasised on controlling the topic of the generated stories using outlines, keywords or other relevant knowledge (Xu et al., 2020; Rashkin et al., 2020; Fan et al., 2019; Goldfarb-Tarrant et al., 2020). At the same time, entity-related structure in narrative generation has been largely understudied for large-scale pre-trained LMs.
First, we propose a set of metrics for automatically measuring entity coherence and consistency. Based on these metrics, we observe that the current LMs fail to follow the patterns of entity usage we find in human-written narratives. Overall, the generated stories present significantly lower coherence and consistency, and this is especially evident for stories with complex events and many named entities. We further validate these observations by performing a human evaluation study, showing that our automatic metrics correlate with human judgment of entity coherence.
Next, in order to improve these properties in narrative generation, we propose augmenting a pretrained LM with a dynamic entity memory. Motivated by prior work on language modeling (Clark et al., 2018; Ji et al., 2017), which uses dynamic entity representations for improving generation on smaller RNN-based models, we augment the LM with an entity memory and cross-attention blocks at each layer of the model for attending to entities that participate in the narrative.
In contrast with prior work, we introduce an end-to-end trainable network with soft attention for performing reads and writes to the memory instead of separately training models to predict entity detection and reference. We also relax the hard constraints of Clark et al. (2018) and Ji et al. (2017), who only condition on one entity per step and update an entity representation only when encountering one of its mentions. Instead, in order to increase both efficiency in the context of transformerbased networks and flexibility of the entity-token mapping, we instead perform soft reads from the entity memory based on a cross-attention mechanism. Thus, our model can condition on multiple relevant entities, and update all slots depending on the cross-attention scores after regular intervals within the narrative. Moreover, we exploit token-level entity annotations in order to regularize the cross-attention scores and better guide the reads and writes to the entity memory.
We perform experiments on two narrative datasets, WritingPrompts (Fan et al., 2018) and WikiPlots,1 and find that utilizing an entity memory especially increases entity coherence according to both automatic metrics and human judges. Moreover, we experiment with different scenarios, where the LM has access to a limited narrative context (i.e., varying smaller context windows), in order to simulate model behavior in settings with much longer narratives, such as books or screenplays. Since narratives of this length cannot fit into the LM’s short-term memory, we investigate the loss of entity-related information as we move to later narrative sections. By measuring perplexity and uncertainty on entity mentions on the original stories, we find that the dynamic entity memory is able to preserve significantly more entity-related information in limited context settings.

heading: 2 TASK FORMULATION
text: This work aims at the exploration of entity coherence and consistency in the context of narrative generation. Entities play a central role in narratives and are crucial for the development and quality of the story (Jannidis, 2009; Frow, 2014; Bamman et al., 2013). According to Fludernik (2002), there can even be narratives without plot, but not without a human experiencer in their center. Narrative theories have also studied character archetypes with specific attributes and actions as a means for analysing them (Fludernik, 2002; Jung, 2014).
We formulate the task of entity-driven generation as conditional text generation on a set of given entities. Specifically, we identify and provide the gold entities that participate in a narrative via an entity prompt. Each entity may consist of more than one token and different entities are separated with a special separator token. Examples of entity prompts are presented in Figure 1a and details about their construction are given in Section 4.3. Our objective is to investigate the patterns of entity usage in generated stories in comparison with human-written ones.
More formally, we consider a LM that is conditioned on an entity prompt P and learns the distribution p(x|P) for generating narratives. The LM is trained on sequences of raw narrative text prepended with the corresponding entity prompts. The LM operates autoregressively; that is, given P and the context generated so far x≤t = {x0, x1, ..., xt}, the LM computes a distribution for the next word in the narrative. Next, we define metrics for automatically measuring entity coherence and consistency in both human-written and generated stories. We evaluate the proposed metrics against human ratings in Section 5.3.
1https://github.com/markriedl/WikiPlots
Entity coherence Various local entity coherence metrics have been suggested in literature, such as distance-based clustering and linkage coefficients (Lioma et al., 2016) and local entity coherence (Barzilay & Lapata, 2008; Mesgar & Strube, 2014; Guinaudeau & Strube, 2013). However, current LMs present high local coherence when compared with human-written stories, giving the impression that coherence has been achieved. In contrast, during preliminary analysis of longer narratives, we observed that LMs still struggle with maintaining long-range entity coherence (see Figure 1b for a short incoherent example and Tables 7, 8, and 9 of the Appendix for longer examples of real generated text). Our main observation from generated stories is that LMs tend to drop the initial protagonists after a while and instead introduce new, irrelevant entities (details in Section 5). For quantifying this observation, we propose a new metric. We consider the protagonists of the narrative (i.e. the entities with the most mentions) and divide the narrative into L equal sections. Next, we compute the maximum span of mentions for each protagonist i as the maximum interval of sections where i appears in: Ci = sli − sfi . Here, sfi and sli are the indices of the sections containing the first and last mentions respectively of entity i.
Entity consistency Another important aspect that we evaluate in the context of entity usage is the attributes that are given to each entity throughout the narrative (see Figure 1b for an inconsistent example). Traditionally, narratives use archetypes for the protagonists (e.g., the “hero” and the “trickster”; Fludernik 2002; Jung 2014) with rich and diverse features, personalities and consistent actions. As a measure of how well-developed and consistent each entity is within the narrative, we measure attribute consistency. Specifically, given all mentions per entity in a story, we consider as the attributes of the entity all verbs and adjectives that appear in the same sentence as each of its mentions. Next, we compute the percentage of unique attributes Ui for the ith entity as follows:
Ui = | ⋃N j=1,i∈Ej Aj | − ∣∣⋃N j=1,i∈Ej Aj ⋂ ⋃N j=1,i/∈Ej Aj ∣∣
| ⋃N
j=1,i∈Ej Aj | (1)
where N is the number of sentences in the story, Ej are the entities that are mentioned in the jth sentence, Aj is the set of all attributes that appear in the jth sentence, and | · | is the size of the set.

heading: 3 METHOD
text: Our base LM is a pre-trained Transformer-XL (T-XL) model (Dai et al., 2019) conditioned on P . The T-XL LM allows us to consider an extended context window within the narrative when computing token representations in self-attention by using a cache memory, where all intermediate representations of the M tokens prior to the current context are stored and used for as context. In this work, we propose augmenting the pre-trained base LM with an entity memory (MNEMELM). For attending to the entity memory, we add new, randomly initialized cross-attention blocks in parallel with self-attention per layer resembling the architecture of adapters2 (Houlsby et al., 2019). We propose using the entity memory together with the prompt for richer entity representations and to better preserve entity-related information over a long time horizon. This addresses two limitations of prompts:
1. They do not allow for more meaningful entity representations. For example, given a named entity such as “Sarah King”, the tokens from the prompt do not provide any information related to who Sarah King is, or which the attributes of Sarah King are within the context of the narrative. In contrast, our dynamic entity memory can store attributes of the entity as they appear in the text, which offers more information beyond the surface form.
2. LMs eventually forget about the prompt when given long enough narratives (i.e. the prompt will fall out of the short-term memory of the LM). In contrast, our method can efficiently store entity-related information in a fixed-size memory and independently of the current context window. We demonstrate this empirically in Section 5.1.
Memory initialization We first initialize the entity memory based on the information given in the prompt P . Specifically, each memory slot Mj , j ∈ [1, Z] represents one of the Z − 1 entities that participate in the narrative or corresponds to non-entity information (i.e. the Zth slot is reserved for entity-irrelevant information). Each of the entity-related slots is initialized based on the prompt
2In contrast to adapters, we find that just training the new parameters is insufficient for narrative generation.
tokens that correspond to this entity (i.e. tokens allocated within two special separator tokens). For contextualizing the entity tokens before the memory initialization, we process the prompt via the LM and consider the output token-level embeddings. Next, the final representation for the jth slot is: Mj = 1K ∑K k=1 yk, where K is the number of tokens that correspond to the j
th entity and yk is the output embedding of the kth token.
Conditioning on a dynamic entity memory (D-MNEMELM) Each slot Mj = [Kj , Vj ] of the entity memory contains a static key Kj (i.e. a fixed surface entity representation) and a dynamic value Vj (i.e. a frequently updated representation based on narrative context), initialised as described above. To update the memory, we divide the narrative into equal-length chunks, update the entity memory after processing each chunk, and use the T-XL memory to store the previous chunks.
At each layer of the pre-trained LM, we add a new, randomly initialized cross-attention block that operates in parallel with the pre-trained self-attention one. The cross-attention block takes as input the representation xi of the ith token (either an embedding or intermediate representation) and all memory slots M = [K,V ], and computes an entity-aware representation ei as follows:
ait = softmax
( W tQxiW t KM T
√ dM
) , t ∈ [1, H] (2)
Mattit =W t MaitM ei =WE [M att i1 ; ...;M att iH ] (3)
where H is the number of attention heads in cross-attention, [·; ·] denotes the concatenation operation, ait ∈ RZ , and ei ∈ Rdh . Next, we combine the entity-aware hidden representations ei with the self-attended hidden representations hi via a gating mechanism:
gi = σ(WR[hi; ei]) h ′ i = (1− gi)hi + giei (4)
We use the final representation h′ as the output of the modified attention block.
After processing each chunk in the narrative, we compute a weighted average representation of the current chunk per memory slot given the cross-attention weights of the final layer aijt for token i, slot j and head t, and update the memory value Vj accordingly via a gating mechanism:
hj = softmax(max H t=1aijt/τ)h (5)
wj = max T i=1max H t=1aijt gj = sigmoid(WU [hj , Vj ]) (6)
V ′j = (1− wjgj)Vj + wjgjhj , (7)
where τ is a temperature hyperparameter, wj is the maximum contribution of the jth memory slot to the current chunk across all tokens T and heads H for the last layer, gj is a gate vector for updating the slot, and M ′j is the new updated value of the memory slot. Note that in addition to the gate value gj that the model computes, we also include an extra weight wj for updating the memory slots. This is used to discourage the model from updating all slots at each step and reflects which entities were used the most during reading from the memory.
We also consider a variation of our model (S-MNEMELM) with a static entity memory. For this variation, we only consider the static keys per memory slot and do not perform any updates.
Regularization of cross-attention scores Finally, although the soft attention during reading and writing to the memory allows the model to explore all entity slots, we still guide the reads and writes via an auxiliary regularization loss in the objective function. Specifically, we want to encourage the model to attend to the correct entities per token during reading from the memory, and update those slots when writing to the memory. We label every token in the context (i.e. in the same sentence) of an entity mention with that entity; if a context contains multiple entities, we allow multiple labels.
Given the entity labels per token i, we construct a few-hot distribution qi over all entities that participate in the narrative by attributing equal probabilities to all entities assigned to token i. Next, we minimize the per-token KL divergence loss DKL between the computed cross-attention weights aitl, where t ∈ [1, H], l ∈ [1, L], H the number of attention heads, and L the number of layers, and the ground-truth distribution qi for the ith token. Hence, our extra regularization loss is: R = DKL(aitl||qi), and our final objective is the weighted sum of the individual losses:
L = 1 T T∑ i=1 ( − log p(xi|x<i;P) + λ 1 LH L∑ l=1 H∑ t=1 DKL(aitl||qi) )
(8)

heading: 4 EXPERIMENTAL SETUP

heading: 4.1 EXPERIMENTAL SETTINGS
text: For our experiments, we use two datasets containing short narratives. We emphasise on the different nature of the two datasets, since we expect to see significantly different patterns in entity usage:
1. WritingPrompts (Fan et al., 2019): This dataset consists of Reddit stories, written by anonymous authors. It contains everyday, stream-of-consciousness stories that include a lot of pronouns as entities and several stories are written in first person.
2. WikiPlots: This dataset consists of Wikipedia synopses of movies, books, and TV shows. The stories of this dataset are significantly more complex containing intervening events and non-linearities in comparison with WritingPrompts. Moreover, the stories of this dataset contain more named entities with elaborate and diverse attributes.
In our main experimental setup we compare the (base) VANILLALM with our model variants MNEMELM augmented with a static or dynamic entity memory. All models have access to a long enough context (considering both the current context and the T-XL memory) in order to fit the entity prompt and the whole narrative. However, we also consider experimental settings where the models have access to a limited narrative context. We investigate such settings as a simulation of the model behavior when processing much longer narratives, e.g. books or screenplays (Kočiský et al., 2018; Rae et al., 2020). When processing longer narratives, part of the prior context will eventually fall out of the T-XL memory. Therefore, the LM will eventually forget about the entity prompt and early entity attributes as it processes later parts of the narrative. We simulate this behavior in our shorter narratives by gradually decreasing the T-XL memory size from 500 tokens to 100, 50 or 10, while keeping a fixed sequence length of 512 tokens.

heading: 4.2 EVALUATION METRICS
text: Apart from our main metrics proposed in Section 2 for measuring entity coherence and consistency, we also measure model performance on language modelling metrics: specifically, we report perplexity, and uncertainty of entity mentions. We consider as uncertainty of entity mentions the average negative log probability for all entity mentions − log(pi), where token i is (part of) an entity mention. This metric specifically probes the LM for entity-centric information. We also compute
the uncertainty on entity mentions per narrative section when dividing the narrative into L equal sections. This metric measures the loss of entity-related information over time.
Finally, we measure whether the LM uses the entities from the prompt when generating narratives. Given all generated entities, we measure the exact and the subset match with the gold ones. We compute the number of gold entities that are mentioned with the same surface form and at least partially in the generated story for the exact and subset match, respectively.

heading: 4.3 IMPLEMENTATION DETAILS
text: We identify all unique entities in human-written and automatically generated narratives via an endto-end coreference tool (Lee et al., 2018), similarly to Fan et al. (2019). As our base LM, we use a transformer-XL LM (∼300M parameters) pre-trained on WMT (Barrault et al., 2020). By adding the entity memory, we increase model parameters by 16.67%. For generating stories, we use nucleus sampling with p=0.8 and temperature 1. We provide further details in the Appendix A.1.

heading: 5 RESULTS AND DISCUSSION

heading: 5.1 AUTOMATIC EVALUATION
text: When comparing VANILLALM with the memory-augmented models based on perplexity and uncertainty of entity mentions, we observe that the biggest advantage of using an entity memory comes when considering a limited narrative context. Specifically, there is no significant difference in performance between VANILLALM and D-MNEMELM for a full narrative context (see Table 1). When comparing D-MNEMELM and S-MNEMELM for the same setting, we observe that having dynamic representations of entities is crucial for a competitive model performance.
In contrast, when we reduce the size of the T-XL memory (i.e. 10 to 100 tokens), we observe that D-MNEMELM performs significantly better than VANILLALM, especially for the WikiPlots dataset (Figure 3a). In order to validate that the advantage of D-MNEMELM indeed comes from better preserving entity-related information, we also present the uncertainty of both models over entity mentions for a variable context length (Figure 3b). Here, the advantage of D-MNEMELM is illustrated more prominently for both datasets, indicating that using an entity memory is helpful for reducing the loss of entity-related information.
Lastly, we also measure the uncertainty of entity mentions per narrative section (Figure 4) and draw two main conclusions. First, we observe the tendencies of the models that have access to the full narrative context (upper part of Figures 4a and 4b). Although the prompt-related information is always within the T-XL memory, both LMs still lose information as they move to later narrative sections by presumably paying gradually less attention to the prompt. This tendency is intensified for a limited T-XL memory of 100 tokens (i.e., percentage degradation in lower part of Figures 4a and 4b). However, when comparing VANILLALM and D-MNEMELM in this setting, we again conclude that the dynamic entity memory helps with preserving entity-related information and closes the performance gap between full and limited context scenarios.
We also perform an ablation study on D-MNEMELM and present in Table 1 the performance of the model when either the entity memory is randomly initialized or we exclude the entity-specific auxiliary loss from the objective. We find that both types of information are crucial for model
performance. However, regularizing the cross-attention scores is especially important in order to guide training, otherwise we observe significantly higher perplexity and unstable training.

heading: 5.2 ANALYSIS OF GENERATED STORIES
text: Next, we generate stories based on VANILLALM, S-MNEMELM, and D-MNEMELM with a full narrative context and compare them against the patterns of the human-written stories (Table 2). We use 500 entity prompts from the test sets, and generate 5 samples of length 1000 tokens per prompt.
The patterns of entity usage differ between the two datasets. For WikiPlots, which contains a lot of named entities (i.e., rare tokens), the generated stories contain many more unique entities in comparison with HUMAN and mention each entity far less. This indicates that LMs struggle to stay on track and do not manage to reuse already mentioned entities. The opposite holds for WritingPrompts, where stories contain a lot of pronouns and common words (e.g., “the soldier”, “the family”) as entities. In this case, the generated stories contain significantly fewer unique entities (which are easier to mention more) in comparison with HUMAN. However, although the difficulties in entity usage are different depending on the dataset, the memory-augmented models consistently imitate better the gold entity usage compared to VANILLALM.
One main observation of our analysis is that VANILLALM struggles to maintain long-range entity coherence (C). This behavior is especially prominent in WikiPlots, which contains named entities and complex events. In comparison with HUMAN, where the protagonists are mentioned on average for a maximum span of 5.65 sections out of 10, VANILLALM mentions the protagonists only for an average maximum span of 3.29, and each entity is only mentioned a few times overall (see Table 2/Mentions). This indicates that VANILLALM overall fails to keep track of the protagonists of a story and quickly shifts to new, irrelevant entities. This behavior is largely fixed when using the
entity memory (both S-MNEMELM and D-MNEMELM), where entity coherence is much closer to the gold standard and entities are mentioned both more times and for larger spans.
Our second main observation is that higher entity coherence challenges attribute consistency (U). We consider this as a limitation of the consistency metric, which is meaningful only when coherence is satisfactory. For example, when mentioning an entity only once, consistency is guaranteed but not meaningful. For WikiPlots, where VANILLALM fails in terms of coherence and the memoryaugmented models present a 57% relative improvement, there is a drop in consistency due to mentioning each entity more often and for longer spans of text. However, for WritingPrompts, where models are more comparable in terms of coherence, we observe that D-MNEMELM also improves consistency. Moreover, when we compare S-MNEMELM and D-MNEMELM for both datasets, we observe that the dynamic entity representations offer improvements in consistency.
Finally, in terms of control (i.e. exact and subset match), for WikiPlots VANILLALM is slightly better than the memory-augmented models. However, for WritingPrompts, we observe a significant improvement in performance for the memory-augmented models in comparison with VANILLALM.

heading: 5.3 HUMAN PREFERENCES
text: We also conduct a human evaluation experiment in order to determine human preference over the generated stories. We use the same stories analysed in the previous section for the WikiPlots dataset. We present human annotators with an entity prompt and three generated stories based on VANILLALM, S-MNEMELM and D-MNEMELM. After reading each story, we ask the judges to answer four questions related to control, coherence, consistency, and fluency by rating these aspects on a scale from 1 to 4, with 4 being the highest3 (see Section A.3 of the Appendix for details of the human evaluation setup). Finally, we also ask the annotators to select the best and worst story for each prompt according to both their intermediate answers and overall preference.
We present the human evaluation results in Table 3. Most importantly, we validate that the memoryaugmented models significantly improve entity coherence in comparison with VANILLALM. A second advantage of the memory-augmented models according to human judges is the significantly higher control given the entity prompt. In the remaining aspects (consistency, fluency), differences between models are not significant. All generated stories are fluent, while consistency seems to be the most difficult aspect to judge. However, according to the human annotators consistency does not drop with the improvement of coherence (i.e. mentioning the protagonists more and for longer spans of text) for the memory-augmented models. Hence, the evaluation results indicate that by using an entity memory we can significantly improve entity coherence without hurting attribute consistency.
3The scale for coherence is 1 to 3.
Automatic Metric Human Aspect r ↑ Exact match Control 0.17 Subset match Control 0.19 C Coherence 0.32 U Consistency 0.08
Table 4: Pearson correlation coefficient between automatic metrics and human ratings.
Human Aspect r ↑ Control 0.22 Coherence 0.22 Consistency 0.09 Fluency 0.19
Table 5: Pearson correlation coefficient between human ratings and overall preference.
Finally, we observe that S-MNEMELM is more often selected as best and least often as worst. In contrast, VANILLALM is significantly more often selected as worst and least often as best. This indicates that entity coherence significantly influences the quality of the generated stories and is an important aspect of language that we should consider in language modeling.
Finally, we evaluate our automatic metrics by measuring the Pearson correlation coefficient (r) between the proposed metrics and the human ratings per aspect (Table 4). We observe that our coherence metric C is moderately correlated with human judgement (i.e. 0.32) and therefore can serve as a good automatic indicator. The correlation for the metrics measuring control (i.e. exact and subset match) is positively weak (i.e. 0.17 and 0.19). The lowest correlation appears for consistency U (i.e. 0.08), suggesting that it is the most difficult aspect to define. Although correlation for consistency is low, human-written stories still present very high consistency in comparison with generated stories according to our metric (Table 2) and we wish to close this gap. We also explore the importance of the human-rated aspects for the quality of generated stories (Table 5). As suspected, coherence and control mostly influence human preference. In contrast, consistency has the smallest impact in human decisions, which suggests that it is the most difficult aspect to define and judge.

heading: 6 RELATED WORK
text: Previous work has utilized memory networks for natural language understanding (Henaff et al., 2017) and language modeling (Sukhbaatar et al., 2015). Our work is most closely related to Ji et al. (2017) and Clark et al. (2018). They also address language modeling by focusing on entity-related dynamic representations. However, they use smaller RNN-based models and make a series of hard assumptions and discrete decisions regarding entity mentions which we relax in this work.
Most recent work on narrative generation focuses on controlling the topic of generated stories via keywords or outlines, fed to the pre-trained LM as a prompt (Xu et al., 2020). Our work is most related to Rashkin et al. (2020), who also use a pre-trained LM augmented with a memory. However, they store individual tokens in the memory, rather than entity information, and condition on key phrases from the text (which they call outlines). In addition, Rashkin et al. condition on only the previously generated paragraph, and perform memory updates at paragraph level. On the other hand, we condition on the entire story context so far, and update the memory more frequently. Finally, Ghazarian et al. (2021) recently proposed evaluating story generation based on a plot-driven approach instead of the entity-centric methods used in this work.
Recent work has also experimented with two-step approaches which first produce a plan and then use a sequence-to-sequence model to generate the full story (Fan et al., 2019; Goldfarb-Tarrant et al., 2020). Both approaches generate very detailed plans extracted from the original stories via semantic role labeling. Each plan element corresponds to a sentence in the story, which might be limiting when transitioning to much longer stories, such as books or screenplays. In comparison with Fan et al. (2019), Goldfarb-Tarrant et al. (2020) also score the intermediate plans based on coherence between events and anonymized character mentioned in order to improve fluency.

heading: 7 CONCLUSIONS
text: In this work we systematically analyse narrative generation in terms of entity coherence and consistency by providing a set of automatic metrics. We demonstrate that current large pre-trained LMs still struggle with maintaining these properties when generating longer text. This behavior is intensified when simulating situations where the context is long enough and cannot fit into the LM’s short-term memory. For addressing these limitations, we propose to augment the pre-trained LM with a dynamic entity memory. Our model presents significantly higher entity coherence according to both automatic and human judgment, and helps preserving entity-related information especially in cases with a limited context window within the narrative.

heading: A APPENDIX
text: A.1 IMPLEMENTATION DETAILS
For constructing entity prompts, we identify all unique entities and coreference chains per entity (via the end-to-end coreference tool (Lee et al., 2018)) and consider the first mention per entity, which commonly is more descriptive and complete, as the canonical representation to be included in the prompt. As our base LM, we use a transformer-XL LM pre-trained on WMT (Barrault et al., 2020). The model consists of 18 layers, 16 heads per layer for the self-attention and 1024 hidden dimension (i.e., approximately 300M parameters). For the new cross-attention blocks that we add in MNEMELM per layer, we use 4 heads and the same hidden dimension as for the self-attention. By adding the entity memory and the cross-attention blocks to the pre-trained LM, we overall increase the number of parameters to approximately 350M. For updating the entity memory in D-MNEMELM, we consider intervals of 64 tokens in the narrative per update. Moreover, we set the temperature in Equation 5 to 0.1 for encouraging the model to produce distinct representations for different entity memory slots. For measuring long-range entity coherence (i.e., C), we consider as protagonists the top 3 characters that are mentioned the most throughout the story and divide the narrative into L = 10 equal sections. We also utilize the same number of sections for measuring uncertainty of entity mentions per section in Figure 4.
In our main experimental setting, where we consider that all LMs have access to the full narrative context, we set the sequence length to 512, and the T-XL memory to 500, having a total context window of 1012. Next, we start decreasing the T-XL memory for simulating scenarios with a limited narrative context, and investigate sizes in the set: [100, 50, 10]. For generating stories for all models, we use nucleus sampling with p = 80 and temperature equals to 1. Finally, we use 32 TPU-v3 chips for training our models for 450k steps and 1 TPU-v3 chip for evaluation, when the batch size per core is 2.
A.2 MODEL OUTPUTS
We present examples of generated stories for the VANILLALM, S-MNEMELM, and D-MNEMELM in Tables 7, 8, and 9. Since stories are long, we present snippets from the beginning and end of the stories in each case. Tables 7 and 8 include examples from the WikiPlots dataset, which were also presented to human judges, and Table 9 presents an example from the WritingPrompts dataset. We have also marked with different colours when entities from the prompt are mentioned in the generated stories (i.e. green), when new entities are introduced which are different from the gold ones but still relevant to the story/topic (i.e. orange), and when irrelevant entities appear in later narrative sections (i.e. red).
Although the VANILLALM starts generating stories by (partially) utilizing the entities from the prompt, it quickly drops them and instead introduces new, irrelevant ones. This was quantitatively measured in our experiments, but we also empirically validate it via the provided examples. For example, in Table 7 the story generated by VANILLALM revolves around a three-part novel, but later on the model focuses on volcanos that are irrelevant to the prior context of the story. Similarly, in Table 8 the VANILLALM introduces a new, irrelevant entity (i.e., ”Mayor Bill Breen”) in the later narrative sections.
In contrast, S-MNEMELM stays faithful to the provided prompt and the entities generated from the beginning of the story. This results in highly coherent stories (see example in Table 7). However, in some cases the static memory in S-MNEMELM may also lead to repetitions and overuse of the same entities, such as the example provided in Table 8 (see the last sentences, where the entity ”Daffy” is mentioned inconsistently multiple times). On the other hand, we observe that having a dynamic memory in D-MNEMELM is able to correct this issue. Although the stories generated by D-MNEMELM still present high long-range entity coherence in comparison with the VANILLALM, they do not suffer as much from repetitions and overuse of the same entities. D-MNEMELM may also generate new entities that are not given in the prompt (e.g. see Table 7, where controlability is lower), but it keeps mentioning them consistently throughout the story. In some cases, the entities generated by D-MNEMELM may also be synonyms or closely related to the ones provided in the prompt (e.g. it generates the ”man in uniform”, when ”police officers” is a gold entity in the prompt in Table 9). Moreover, D-MNEMELM presents a more natural pattern of entity usage, where many mentions of an entity are pronouns and their usage is more consistent, in comparison with S-MNEMELM.
A.3 HUMAN EVALUATION DETAILS
We also performed a human evaluation experiment for judging the quality of the generated stories. We asked human judges to first read an entity prompt, which was used for generating stories. Next, they were presented with three generated stories. Immediately after reading each story, a human judge should identify and write the main protagonists of the narrative (see Figure 5a). Next, they should answer to four multiple-choice questions per story related to control, coherence, consistency, and fluency. We present the questions asked during human evaluation in Figure 5b. Finally, after reading all stories and answering to all questions, human judges were asked to select the best and worst story based on both their intermediate answers and overall enjoyment. Overall, we collected
judgements for 494 stories from the test set of the WikiPlots dataset, where two different judges evaluated each story.

Review summaries:
This work focuses on improving the long-range entity coherence and consistency when generating long narrative stories. The authors proposed two metrics to measure the entity coherence and consistency in terms of entity usage in generated narratives. They also propose to augment a pre-trained LM with a dynamic entity memory and cross-attention to improve the entity usage.

In this paper, the main contributions are 1)analyze the entity coherence of  pretrained LMs by leveraging some existing metrics and also four newly proposed metrics 2) propose a new generative model to have a higher quality generated narratives from entity coherence and consistency perspectives. Authors develop a model by adding a dynamic entity memory to the existing pretrained LMs. The cross attention between input text and entity memory alongside the self-attention coming from pretrained-LM helps to not forget the previous entities and their attributes during generating narratives.

The authors of this paper propose to tackle the problem of coherency and the consistent use of entities for the task of narrative generation. To achieve this, the authors propose an approach of augmenting pretrained language models with entity memory and cross attention blocks that places an emphasis on the entities in the narrative. The proposed approach is evaluated on the WritingPrompts and the WikiPlots datasets. From an evaluation perspective, the authors propose two new evaluation metrics for measuring entity coherence and consistency. To measure entity coherence, the authors propose dividing the narrative into L equal sections and computing the maximum interval span of each entity as the difference between first and last mention respectively. Similarly for entity consistency, the authors propose measuring entity consistency through the concept of measuring attribute consistency within the narrative.  Contributions: 1. A new approach of augmenting language models with entity memory that helps in entity consistency and coherence across narrative generation tasks 2. Two new metrics to evaluate consistency and coherency in the generated outputs.