Discourse-Aware Neural Rewards for Coherent Text Generation
Paper · 2018 · Antoine Bosselut, Asli Celikyilmaz, Xiaodong He et al.
Summary
A recipe can make sense from one phrase to the next and still lead a cook astray. It might explain how to thicken a sauce, then repeat the same instruction several times and never say what to do with the sauce. The paper asks how to train a text generation system to connect actions across sentences. Its answer is to learn a training reward from the order of sentences in human-written recipes. The reward gives the generator feedback about how it organizes a whole procedure as well as how closely it matches the wording of a reference.
The authors train separate scorers, which they call teachers, before using them to guide a generator. A teacher learns to give different representations to a human-written sequence and the same sentences read backward. Reversal preserves the words and the contents of each sentence, so the teacher has to attend to how sentences follow one another. One teacher reads an entire recipe and assigns a shared reward to all its words. The other compares shorter stretches of instructions and assigns each sentence its own reward. The generator learns by sampling a recipe and comparing the feedback it receives with the feedback for a recipe produced by choosing the most probable word at each step. It continues to practice predicting the words in human-written recipes during this stage.
The experiments use Now You’re Cooking, where the system receives a dish title and an ingredient list and writes the instructions. On the test set, the local teacher raised BLEU-4 over cooking actions, a measure of matching runs of actions, from 4.83 with word prediction alone to 5.60. Combining the local reward with a word-overlap reward gave the strongest result on several measures of the actions and changes that a recipe describes. In pairwise judgments, readers preferred this combination to word prediction alone on fluency, use of ingredients, fulfillment of the title and ordering of actions. Against a stronger baseline trained for word overlap, preferences were mixed. For references longer than 100 words, the combined system was preferred on action order by a proportion of 0.442, compared with 0.433 for the word-overlap baseline.
Individual outputs show both the gains and their limits. The local teacher helped a casserole recipe progress from making a sauce to assembling and baking the dish, where the word-prediction baseline kept returning to the cheese. A generated strawberry pie recipe, however, added a baking step even though the reference used an already baked shell and chilled the assembled pie. The teacher makes it possible to reward patterns that extend across sentences. Those patterns can help a recipe reach its intended conclusion, but they can also favor a familiar procedure when a particular dish calls for something else.
Deep dive: Discourse-Aware Neural Rewards for Coherent Text Generation
Discourse-aware rewards teach a recipe generator to put cooking steps in a sensible order by comparing its instructions with human-written recipes. · about 37 minutes to read
The problem and its context
A plausible sentence can be the wrong next step
A recipe is a good test of whether sentences do their jobs together. Each instruction changes what the cook can do next. A sauce needs to reach the right consistency before it can be poured. A mixture has to be in a dish before the instructions can sensibly tell the cook to bake it there. Even a sentence that describes a familiar kitchen action can interrupt the procedure if it assumes work that the preceding sentences never described. And a fluent instruction can make a recipe worse by telling the cook to do something that is already done.
The task in the paper starts with sparse input. A recipe title tells the system what the reader wants to make. The ingredient list identifies the materials, sometimes with a preparation detail. Together they leave many decisions open. The system must supply the operations, decide when each belongs, and carry enough information across the instructions for the operations to make sense. The authors relate this setting to data-to-document generation, where a structured input likewise has to become a longer piece of writing. Some of what belongs in that writing must be inferred from the input and the examples seen during training.
It is possible to recognize a familiar phrase without knowing why it belongs in a recipe. An instruction to stir until thickened sounds ordinary on its own. Whether it is useful depends on what is being stirred and what happened to it in the preceding steps. If the recipe gives the same instruction again after reporting that the sauce has thickened, the individual sentences may remain grammatical while the process stops advancing. This distinction motivates the paper’s use of discourse analysis. The relevant structure is the way the sentences work together over a stretch of text. For recipes, sentence order is one observable clue to that structure.
What the training objective rewards
The paper describes a common approach in which a recurrent generator learns from examples by predicting each reference word given the words before it. The penalty, called cross-entropy or negative log likelihood in this setting, rises when the generator gives the observed word low probability. Training this way provides feedback throughout the text. Given a title, ingredients and the beginning of a reference recipe, the system can learn how recipe instructions are phrased and which words tend to follow a given prefix. The paper places this approach in the tradition of recurrent encoder–decoder systems used for tasks such as machine translation and text summarization. Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation
A system writing its own recipe conditions each new word on what it has already produced. If it has omitted an ingredient or introduced the wrong action, its next decision starts from a prefix that differs from the reference. The related work calls the mismatch between training on reference prefixes and generating from the system’s own prefixes exposure bias. The paper describes earlier efforts to help systems recover from their own errors by exposing them during training to generated material. It also notes that some generators add specialized structural support, such as a checklist for tracking what has been covered. That work changes what the generator can easily keep track of. Here, the authors focus on the feedback the generator receives for the sequences it produces. Globally Coherent Text Generation with Neural Checklist Models
A further line of earlier work made evaluation scores part of training. Rather than ending the training calculation at the probability of each observed word, it sampled candidate sequences and rewarded them according to a score for the completed output. The paper discusses applications to translation, image captioning and summarization. Scores used in this way include the BLEU score, ROUGE and CIDEr. They offer different ways to measure agreement with a reference, and optimizing them gives a generator direct experience of which of its own outputs score well. The paper adopts the sampling and feedback framework developed in this tradition. Its question is what score should supply the feedback when a text has to remain coherent across many sentences. Self-critical Sequence Training for Image Captioning · A Deep Reinforced Model for Abstractive Summarization
An n-gram is a run of consecutive items. In an ordinary word-overlap evaluation, the items are words. Matching short runs can capture useful similarities, but those matches offer limited evidence about what a text accomplishes from beginning to end. A recipe can recover much of a reference’s vocabulary while omitting a decisive step. It can also use different words for related cooking actions. The authors discuss earlier reports of evaluation scores diverging from other desired properties of generated text. The problem becomes especially salient when the system is trained to pursue the score, because the score then shapes which behaviors the generator practices. A Method for Automatic Evaluation of Machine Translation · Deep Reinforcement Learning for Dialogue Generation
How sentence order became a training signal
The authors draw on earlier research that treats ordering as evidence about the organization of a document. Work on local coherence and probabilistic accounts of document content gave them precedent for using the sequence of sentences as a tractable stand-in for richer discourse structure. They also relate their recipe experiments to research on scripts, the recurring patterns of events that make a familiar activity intelligible. In cooking, a script can include such dependencies as making a mixture before transferring it and heating it after assembly. A scorer that prefers typical progressions can provide useful feedback even when it has no explicit statement of those dependencies. Modeling Local Coherence · Catching the Drift · Unsupervised Learning of Narrative Schemas
Earlier work also offered a precedent for learning a score with a neural network. In the dialogue evaluation work the authors discuss, the target was human judgment of response quality. Training such an evaluator ties the score to the people who supplied those judgments. The recipe teachers use a different source of supervision. A human author has already chosen the order of the sentences. The training procedure creates a contrasting order automatically by reading the same sentences backward. Human judgments enter later, when the paper evaluates the recipes that the system writes. Towards an Automatic Turing Test
The related work also includes learned and embedding-based rewards for short outputs in dialogue, image captioning, simplification and paraphrasing. The paper distinguishes its design by locating the reward in the relations among sentences. Previous recipe research supplies a more specific connection. It had already treated instructions as descriptions of a procedure from which recurring structure could be extracted. The authors use recipe order as an indirect way to learn enough about such structure to guide generation. The teacher’s immediate task is to tell an observed order from a reversal. The downstream question is whether a generator that seeks the resulting reward writes instructions that fit together better. Mise en Place · Sentence Simplification with Deep Reinforcement Learning
The method, step by step
Teach a scorer what changes when sentences move
The training procedure has separate jobs for a teacher and a generator. The teacher reads examples of finished recipes and learns a representation that responds to their sentence order. The generator sees recipe titles and ingredients and learns to write instructions. Once the teacher is trained, its parameters are fixed. The generator can change the recipes it produces in response to the score, while the scoring rule remains stable through this stage.
Training a recipe generator with sentence order feedback
The steps in order.
The teacher treats each sentence as a collection of words. It replaces each word with a vector and adds the vectors together. A word embedding is the numerical vector used to represent a word in this calculation. Adding the embeddings preserves information about which words occur and how frequently they contribute. It gives the same result if those words trade places within the sentence. Thus the teacher has access to the vocabulary of each instruction, while the recurrent part of the teacher sees variation in the order of sentences.
sⱼ = ∑ᵢ₌₁ᴸʲ xᵢⱼ
Here sⱼ is the vector for sentence j, and xᵢⱼ is the word embedding at position i in that sentence. Lⱼ, displayed as the upper limit Lʲ in the sum, is the number of words in sentence j. The sum starts at the first word and includes each word position through Lⱼ.
A gated recurrent unit, or GRU, reads those vectors in sequence. The unit maintains a hidden state, a vector that carries information from one reading step to the next. When it receives a sentence vector, it updates that state using both the new sentence and the state left by the preceding sentences. The resulting document representation can therefore depend on the order in which the sentence vectors arrived.
hⱼ = GRU(sⱼ, hⱼ₋₁)
Here j is a position in the reading order, sⱼ is the sentence vector at that position, and hⱼ₋₁ is the previous hidden state. GRU denotes the gated recurrent update. Its output hⱼ is the state after processing the sentence at position j.
f(S) = hₙ
Here S is the sequence of sentences supplied in a specified order, n is the number of sentences read, and f is the encoder for the sequence. The state hₙ is the GRU’s final output. It is used as the vector representation of the whole input to the teacher, whether that input is a recipe or a passage from one.
The absolute order teacher gets both readings of a complete training recipe. In one reading, the sentences arrive in the order in which the author wrote them. In the other, the last sentence arrives first and the first sentence arrives last. The teacher is trained to minimize the cosine similarity of the resulting vectors. Cosine similarity measures whether vectors point in similar directions. Reducing it encourages the encoder to represent the two readings differently, even though both readings contain the same sentence vectors.
Lₐᵦₛ = ⟨f(S→), f(S←)⟩ / (‖f(S→)‖ ‖f(S←)‖)
Here Lₐᵦₛ is the absolute order teacher’s loss. S→ is the reference recipe in its original order and S← is the same recipe with the sentence order reversed. The function f encodes each reading. Angle brackets denote a dot product, and the double bars denote vector lengths. Dividing by those lengths gives the cosine similarity that the teacher minimizes. The loss trains the representation to separate readings of a recipe. Later, the generator’s reward gives those readings distinct roles as a positive reference and a contrasting reference.
Train a second teacher on passages
The relative order teacher uses the same architecture for shorter, contiguous passages. A recipe can contain a plausible section even when later instructions are repetitive or misplaced. A score for the entire recipe spreads the resulting penalty over both the coherent and the troublesome parts. A passage scorer gives the generator more precise feedback, since a sentence can receive a reward based on how well it fits with neighboring instructions. In a recipe, that neighborhood might contain the preparation of a mixture and the immediate uses of that mixture.
f(Sⱼ:ⱼ₊ℓ) = GRU(sⱼ₊ℓ, hⱼ₊ℓ₋₁)
Here j is the starting position of the passage, and ℓ marks the offset to its last position in the paper’s notation. Sⱼ:ⱼ₊ℓ is the passage from sⱼ through sⱼ₊ℓ under that endpoint convention. The function f gives its final representation. The state hⱼ₊ℓ₋₁ summarizes the preceding sentences of the passage in the current reading order, sⱼ₊ℓ is its final input in the displayed forward reading, and GRU gives the state after that input. The state immediately before the start of a passage, hⱼ₋₁, is initialized to a vector of zeros. Each passage is thus read from its own initial state.
Lᵣₑₗ = ⟨f(S→ⱼ:ⱼ₊ℓ), f(S←ⱼ:ⱼ₊ℓ)⟩ / (‖f(S→ⱼ:ⱼ₊ℓ)‖ ‖f(S←ⱼ:ⱼ₊ℓ)‖)
Here Lᵣₑₗ is the relative order teacher’s loss. The indices j and j+ℓ identify the passage, with ℓ giving the endpoint offset. The arrows distinguish its forward and reverse readings. The encoder f represents each reading, the brackets give their dot product, and the bars give the lengths used to normalize it. The objective again minimizes cosine similarity. The training samples determine which stretches of recipe discourse the encoder practices distinguishing.
For the relative teacher, the authors sample 20 passages per training recipe and describe the eligible lengths as 3 to 6 sentences. The teachers use a recurrent hidden size of 100 and word vectors of dimensionality 100. Dropout is applied between the sentence representation and the recurrent layer at a rate of 0.3. Dropout temporarily suppresses some of the values passed through a layer during training. The development data are used to tune the settings. Both teachers are learned from the human-written recipes before their outputs become rewards for the generator.
Give the writer its title and ingredients
The generator uses an encoder and a decoder adapted from the earlier recipe generation work. The encoder represents the dish name by grouping its word embeddings into a single vector. Each ingredient entry likewise gets a vector built from its words. An entry may consist of a single ingredient name or include further wording about how that ingredient has been prepared. A bidirectional GRU reads the ingredient vectors, which lets the ingredient representation take account of the list in both directions. The title and ingredient representations are then joined.
hₑ = [g, e]
Here hₑ is the final encoder output, g is the bag-of-embeddings representation of the title, and e is the representation produced by the recurrent ingredient encoder. The brackets indicate concatenation, so the values of both vectors are available to the decoder.
A separate GRU writes the recipe one token at a time. It starts from the encoder output, and the encoder output is also available during subsequent decoding steps. A learned gate controls how much of that information is passed into each next recurrent update. The gate takes account of the representation of the current input token and the decoder state left by the previous step. The system can therefore draw on the title and ingredient list throughout generation.
aₜ = σ(W₁ hᵈₜ₋₁ + W₂ xₜ + b₁)
Here t is a decoder step and aₜ is the gate at that step. The vector hᵈₜ₋₁ is the preceding decoder state and xₜ is the input token embedding. W₁ and W₂ are learned projection matrices for those respective inputs, and b₁ is a learned bias vector. The sigmoid function σ turns the projected values into gating values.
zₜ = aₜ hₑ
Here zₜ is the contribution from the encoder that is passed to the decoder at step t. The operation applies the gate aₜ to the encoder representation hₑ, scaling the information derived from the title and ingredients.
x̃ₜ = [xₜ, zₜ]
Here x̃ₜ is the combined input to the decoder’s recurrent unit at step t. It concatenates xₜ, the embedding of the decoder’s input token, with zₜ, the gated representation of the recipe input. The recurrent state can thus respond to the current token and refresh its access to the information about the recipe being written.
The generator first learns by maximum likelihood. It is trained to give high probability to the next token of a human-written recipe in the context of the earlier tokens and the encoded input. The paper uses xₜ in the likelihood expression for the token being predicted, and xₜ in the decoder description for the embedding supplied as input at a decoding step. The shared notation describes related, distinct roles in feeding the decoder and in scoring its prediction.
Lₘₗₑ = − ∑ₜ₌₁ᵀ log P(xₜ | x₀, …, xₜ₋₁, hₑ)
Here Lₘₗₑ is the negative log likelihood for the reference recipe, T is the number of words in that recipe, and t indexes a prediction. The conditional probability P is the generator’s probability for reference token xₜ given the preceding tokens x₀ through xₜ₋₁ and encoder output hₑ. The logarithm converts the probabilities into terms that can be summed, and the minus sign turns higher probability for the reference into a smaller loss.
The generator’s encoder and decoder have a hidden size of 256 each. The embeddings for titles, ingredient entries and recipe text are learned separately, and the appendix gives a size of 256 for each set’s vectors. The recurrent networks are single-layer and the dropout rate is 0.3. Recipes are batched by their token and ingredient counts, with a minibatch size of 32. For pretraining, the authors use Adam with learning rate 0.0003. They also use scheduled sampling, which exposes the decoder during training to words from its own output. The schedule is described as a linear decay of 5% every 5 epochs, with a maximum of 50%.
Compare a sampled recipe with the greedy alternative
The next stage uses self-critical sequence training. For each example, the generator writes a candidate by sampling from its current token probabilities. A token can be selected even when it is less probable than another option. Repeating this procedure over an entire recipe gives the generator a chance to try continuations outside its most likely path. In parallel, the same generator writes a greedy recipe by taking the most probable token at each step. The greedy sequence provides a baseline specific to the input and to what the generator currently tends to write.
The teacher scores both recipes. If a sampled token receives greater reward than the baseline used at its step, the update reinforces the decision that produced it. A lower reward pushes in the opposite direction. The effect is relative to the current greedy output. Improving a sample over a poor greedy recipe and improving it over a strong greedy recipe are different demands, even if the teacher itself is fixed. As the generator changes, the comparison recipe can change as well.
Lᵣₗ = − ∑ₜ₌₁ᵀ (r(ŷₜ) − r(y*ₜ)) log P(ŷₜ | ŷ₀, …, ŷₜ₋₁, hₑ)
Here Lᵣₗ is the reinforcement-learning loss, and t indexes positions through the training sequence of length T in this expression. The hats identify tokens of the sampled recipe, while the star identifies tokens of the greedy recipe. The function r supplies the reward assigned to each token. P gives the probability of sampling ŷₜ under the current generator, conditioned on the sampled prefix ŷ₀ through ŷₜ₋₁ and the encoded input hₑ. The reward difference weights the log probability of the sampled action. With the leading minus sign, minimizing the loss increases support for a sampled choice with a positive reward difference and decreases support when the difference is negative. The teacher evaluates a finished output, so this update uses the probabilities of the decisions that produced the text.
The appendix reports a temperature coefficient of β = 2, which the authors use to make the token distribution more concentrated and restrict exploration during sampling. For policy learning, they keep the generator settings from pretraining, reinitialize Adam, and use a learning rate of 3 × 10⁻⁵. They use scheduled sampling in pretraining and drop it for policy learning, where the system already generates the sampled and greedy recipes from their own prefixes.
Turn the teacher’s comparisons into word rewards
A teacher sees a sequence of sentences rather than a stream of decoder tokens. The generator tracks sentence boundaries through delimiter tokens such as a period. These boundaries identify the sentence to which a generated word belongs. The absolute teacher uses the boundaries to form a representation of the complete recipe, while the relative teacher uses them to locate the windows that contribute to a sentence’s score.
rₐᵦₛ(y) = ⟨f(S′), f(S→)⟩ / (‖f(S′)‖ ‖f(S→)‖) − ⟨f(S′), f(S←)⟩ / (‖f(S′)‖ ‖f(S←)‖)
Here y is a generated token sequence and S′ is its sequence of sentences. S→ is the reference recipe in its original order and S← is that reference read backward. The encoder f gives the absolute teacher’s vector representation. Angle brackets denote a dot product and double bars the vector lengths used to calculate each cosine similarity. The first term rewards resemblance to the forward reference. The second subtracts resemblance to the reversal. Each similarity is bounded in [−1, 1], so a generated representation can also gain reward by pointing away from the reversed reference.
r(yₜ) = rₐᵦₛ(y)
Here yₜ is the token at position t in the generated recipe y. The function r assigns the token’s reward, and rₐᵦₛ is the absolute teacher’s score for the recipe as a whole. Every token receives the same score. The decision to write a repeated phrase and the decision to write a well-placed instruction are therefore weighted by the same recipe-level assessment.
For the relative reward, the corresponding comparison is made with passages that end at the sentence being scored. The teacher considers different amounts of immediately preceding context, compares each generated passage with the matching reference passage in both orders, and pools the resulting differences. This lets the same sentence receive feedback based on several views of nearby instructions. A passage that includes an earlier preparation step can give the teacher a different view of a sentence from a passage focused on the immediate transition.
rᵣₑₗ(sⱼ) = (1/L) ∑ℓ₌ℓₘᵢₙ…ℓₘₐₓ [⟨f(S′ⱼ₋ℓ:ⱼ), f(S→ⱼ₋ℓ:ⱼ)⟩ / (‖f(S′ⱼ₋ℓ:ⱼ)‖ ‖f(S→ⱼ₋ℓ:ⱼ)‖) − ⟨f(S′ⱼ₋ℓ:ⱼ), f(S←ⱼ₋ℓ:ⱼ)⟩ / (‖f(S′ⱼ₋ℓ:ⱼ)‖ ‖f(S←ⱼ₋ℓ:ⱼ)‖)]
Here rᵣₑₗ is the relative reward for generated sentence sⱼ at position j. The offset ℓ determines how far the passage extends back from that position, and ℓₘᵢₙ and ℓₘₐₓ bound the offsets in the sum. S′ⱼ₋ℓ:ⱼ is the generated passage, and the corresponding reference passage is read forward as S→ⱼ₋ℓ:ⱼ and backward as S←ⱼ₋ℓ:ⱼ. The relative teacher’s encoder is f. The brackets give the dot products and the bars give the vector lengths. Their ratios compare the directions of the encoded passages. L is the normalization divisor for pooling the comparisons. The equation gives that divisor as L without separately specifying its value or spelling out how the calculation handles a passage that would extend past the beginning of the recipe.
r(yₜ) = ∑ⱼ₌₁^|S| 𝟙(yₜ ∈ ŝⱼ) rᵣₑₗ(ŝⱼ)
Here r(yₜ) is the reward of the generated token at position t, and |S| is the number of sentences in that output. The index j ranges over the generated sentences, with ŝⱼ denoting the sentence at position j. The indicator 𝟙 is one when the token at position t belongs to that sentence and zero otherwise. Membership refers to the token’s location, so a word that occurs in several sentences receives the reward for the sentence containing this occurrence. The summation selects that sentence’s relative order reward rᵣₑₗ.
The authors also train a system with both the relative teacher and BLEU-4. For each token, the reward from its own sentence is added to the BLEU-4 reward for the completed recipe. This means that a token’s sentence can receive credit for fitting into its local passage, while all tokens still get feedback on the wording of the full recipe. The paper calls this setting RO + B4. It is distinct from the use of a mixed training loss, which determines how strongly the generator learns from rewards in the first place.
Keep reference-word prediction active during policy learning
A generator can increase the score from an order teacher by finding a pattern the teacher favors, even if that pattern is an inadequate recipe. The authors encounter this problem when the reward has sole control over training. Their remedy is to continue the reference-word prediction objective alongside the policy objective. The reference contributes both to the reward comparisons and to a direct training term that favors the words of an actual recipe. The two uses of the reference provide different signals about the desirability of a generated output.
Lₘᵢₓ = γ Lᵣₗ + (1 − γ) Lₘₗₑ
Here Lₘᵢₓ is the combined training loss, Lᵣₗ is the policy loss calculated from the sampled and greedy outputs, and Lₘₗₑ is the negative log likelihood of the reference. The coefficient γ is chosen in [0, 1]. It weights policy learning, and the complementary coefficient on Lₘₗₑ determines how much direct reference-word prediction remains. The authors report γ = 0.97 for their best teacher-trained systems.
The absolute and relative systems are selected by their average development reward. For the combined reward, the authors use a development criterion that favors recipes with both word overlap and a strong relative score. The paper describes the selection calculation as a geometric mean. Its displayed expression gives the product of the whole-recipe BLEU-4 score and the mean of the token-level relative rewards.
r̄ = (rᵦ₄(y) / T) ∑ₜ₌₁ᵀ rᴿᴼ(yₜ)
Here r̄ is the displayed per-recipe selection score, y is the generated recipe, rᵦ₄(y) is its whole-recipe BLEU-4 reward, and T indexes the length over which the token rewards are averaged. The index t identifies token yₜ, and rᴿᴼ(yₜ) is the reward assigned by the relative teacher to that token through its sentence. The prose describes a geometric mean, while the formula displays a product without a root. The selection is performed on the development recipes. It serves a separate purpose from the sum of the two rewards applied at each step during training.
Experiments and results
What the recipes were compared against
For the Now You’re Cooking dataset, the authors adopt the same splits used in prior work on recipe generation. There are 109,567 training recipes, 1000 development recipes and 1000 test recipes. The development data are used to tune settings and select checkpoints. The test data supply the references for automatic evaluation and the pool from which the recipes for human judgment are sampled. Each evaluation starts with the same kind of information used during training, a dish title and an ingredient list.
The comparison begins with a generator trained only by maximum likelihood, abbreviated MLE. It establishes what the architecture can do when trained through the reference-word objective. The authors also implement baselines whose policy rewards come from established automatic measures. The original settings they adapt use high policy weights, γ = 1 in the image-captioning approach and γ = 0.9984 in the summarization approach. On recipes, the authors observe fluency problems with such settings. They therefore also evaluate variants in which more weight remains on reference-word prediction. Self-critical Sequence Training for Image Captioning · A Deep Reinforced Model for Abstractive Summarization
For each tuned baseline, the authors choose γ according to development performance on the metric being optimized. BLEU-1, CIDEr and ROUGE-L each select γ = 0.97. The tuned BLEU-4 baseline selects γ = 0.99. Checkpoint selection also follows the particular reward, with MLE selected for low loss. This evaluation design matters because the original high-policy-weight versions can give a misleadingly weak picture of what a word-based reward is capable of on this task. The tuned versions provide the more informative comparison for gains attributed to sentence order.
The teacher-trained systems are absolute ordering, abbreviated AO, relative ordering, abbreviated RO, and the combination RO + B4. All use the recipe generation setup. Their differences concern the scores used to train the generator and how those scores are assigned to the sampled decisions. AO tests feedback drawn from the entire document. RO tests rewards attached to sentences through nearby context. RO + B4 asks whether keeping explicit feedback on wording alongside the local teacher produces a better balance.
Overlap at the level of words and cooking events
The automatic evaluation compares a recipe with its reference after representing the recipes in several ways. First, it evaluates their words directly. BLEU-1 reflects agreement at the level of individual words. BLEU-4 is sensitive to longer runs of consecutive words. ROUGE-L uses a longest common subsequence, which can give credit to items that occur in the same order with gaps between them. The authors compute the scores at the example level on the test set. ROUGE: A Package for Automatic Evaluation of Summaries
The second representation keeps words that can be mapped to known cooking actions. The authors reduce words to their lemmas, or base forms, and look for entries in a cooking lexicon. Matching entries are retained in their order of occurrence. The evaluation applies the same overlap measures to the resulting action sequences. The labels AB1 and AB4 refer to BLEU-1 and BLEU-4 over actions. AR-L refers to ROUGE-L over actions. The measures look at related properties, from the presence of expected operations to shared runs of actions and their ordering over a longer span.
The third representation maps the actions to categories of change in the lexicon. A cooking action may indicate a change of location, composition, cookedness, temperature, shape or cleanliness. Different actions can indicate the same broad type of change. The codes SCB1, SCB4 and SCR-L denote the corresponding BLEU-1, BLEU-4 and ROUGE-L scores for the state-change sequences. These measures allow some agreement even when a generated instruction and its reference use different cooking actions to describe a similar development. They also discard information about which ingredient changed and how, so the resulting sequence is a coarse comparison of what the recipes imply.
On test-set word overlap, MLE scores 26.86 on BLEU-1, 4.74 on BLEU-4 and 28.86 on ROUGE-L. RO improves each of those scores, reaching 27.75, 4.88 and 29.60 on the same respective metrics. The combined RO + B4 setting reaches 29.58, 5.26 and 29.78. AO, with 23.70 on BLEU-1, 4.25 on BLEU-4 and 28.43 on ROUGE-L, scores below MLE on all of these word-level comparisons. Learning to represent whole-recipe sentence order by reversal thus does not by itself produce the gains seen with the relative teacher.
The highest test-set word BLEU scores belong to the tuned BLEU-1 baseline. It scores 31.16 on BLEU-1 and 5.60 on BLEU-4. The tuned BLEU-4 baseline scores 30.56 and 5.42 on those word metrics. With a word-overlap measure at evaluation time, it matters that those systems were trained with direct feedback about word overlap. The combined teacher setting leads the word ROUGE-L column at 29.78, where the tuned BLEU-1 baseline records 29.53 and the tuned ROUGE-L baseline 29.49. Which generator appears strongest therefore depends even on the particular measure of agreement used for the words.
Connecting actions and changes
The action scores favor training with the relative teacher. RO + B4 scores 35.13 on test-set action BLEU-1, compared with 34.37 for RO and 31.23 for MLE. The tuned CIDEr baseline reaches 33.93 on this measure. The combined system leads the reported settings on the presence of reference actions. When the evaluation asks for runs of actions or the ordered action subsequence, RO alone has the strongest scores. On action ROUGE-L, it records 29.36, compared with 29.33 for RO + B4, 29.34 for the tuned BLEU-1 baseline and 28.51 for MLE. The leading values on that metric are close, even though the comparison of consecutive actions separates the settings more clearly.
Cooking action BLEU-4 on the Now You’re Cooking test set
The relative order reward gives the strongest match to consecutive reference actions.
The numbers
| System or setting | action BLEU-4 |
|---|---|
| Maximum likelihood | 4.83 |
| Tuned BLEU-1 reward | 5.09 |
| Tuned BLEU-4 reward | 4.99 |
| Absolute ordering | 4.44 |
| Relative ordering (this paper) | 5.60 |
| Relative ordering and BLEU-4 | 5.55 |
In state-change BLEU-1, RO + B4 reaches 59.13, RO reaches 58.31 and MLE reaches 51.92 on the test set. The tuned CIDEr baseline reaches 57.00. The combined system also has the highest state-change BLEU-4. RO alone leads state-change ROUGE-L at 53.08, followed by RO + B4 at 52.46. The tuned ROUGE-L baseline scores 51.88 and MLE scores 50.21 on that measure. The joint reward and the relative-only reward thus lead on different projections of the same task. The combined reward has the edge on matching runs of implied changes, while the relative-only reward leads when agreement is measured through a longer ordered subsequence.
State-change BLEU-4 on the Now You’re Cooking test set
The combined reward leads the reported settings in matching consecutive changes.
The numbers
| System or setting | state-change BLEU-4 |
|---|---|
| Maximum likelihood | 26.35 |
| Tuned BLEU-1 reward | 25.43 |
| Tuned CIDEr reward | 27.55 |
| Absolute ordering | 24.47 |
| Relative ordering | 29.14 |
| Relative ordering and BLEU-4 (this paper) | 29.19 |
These outcomes give the paper evidence at a level distinct from wording. The teacher itself was trained to separate sentence orders. During evaluation, the lexicon extracts a sequence of cooking events without referring to the teacher’s score. A gain there means that the generated output more often contains event patterns also found in its reference. The state-change comparison provides a related test at a coarser level. Because both tests are derived from the same text and lexicon, they offer complementary readings of agreement with the reference rather than independent demonstrations that a cook could follow the instructions.
What people preferred
The authors sample 100 test recipes for human evaluation. For each example, three judges recruited through Amazon Mechanical Turk see a pair of outputs for the same recipe input. One comparison places RO + B4 against MLE. The other places RO + B4 against the tuned BLEU-1 system, which performed strongly on word overlap. The comparisons are pairwise, and the results allow ties.
The questions direct readers towards different aspects of the task. Fluency concerns the quality of the writing. Ingredient use asks which recipe correctly incorporates more of the listed ingredients. Title completion asks which one better delivers the dish named in the title. The action-order question asks which output better connects the parts of the procedure. A recipe can be favored on one question and lose on another. The paper accordingly reports a separate proportion of wins for each criterion instead of combining them into a single score.
Against MLE on the sampled test recipes, RO + B4 receives a fluency win proportion of 0.447, compared with 0.330 for MLE and 0.223 ties. On ingredient use, the proportions are 0.440 for RO + B4, 0.350 for MLE and 0.210 ties. On title completion, they are 0.430, 0.347 and 0.223, respectively. On action order, the combined system receives 0.453, the baseline 0.377 and ties 0.170. The direction of the preference is consistent across the questions. For each criterion, some readers still favor the MLE output or judge the two outputs equally good.
Against the tuned BLEU-1 baseline, the all-recipe comparison is mixed. On ingredient use, RO + B4 receives 0.363, versus 0.327 for BLEU-1 and 0.310 ties. On title completion the proportions are 0.377 for RO + B4, 0.353 for BLEU-1 and 0.270 ties. The BLEU-1 system leads on fluency at 0.387 versus 0.373 for RO + B4, with 0.240 ties. It also leads on action order at 0.410 versus 0.403, with 0.187 ties. This comparison shows the value of training for word overlap on a recipe dataset. It also shows why the result against MLE alone cannot establish broad superiority for the teacher reward.
The paper then separates out examples whose human-written reference was longer than 100 words. The threshold concerns the reference, so this analysis asks about prompts associated with longer procedures, regardless of the lengths of their generated answers. On these examples, RO + B4 has a fluency win proportion of 0.383 against 0.391 for BLEU-1. It leads for ingredient use at 0.392 against 0.267, and for title completion at 0.418 against 0.325. On action order, it also takes the lead. Its relative standing improves across the criteria, although the word-overlap baseline retains a slight advantage in fluency.
Action-order judgments on Now You’re Cooking test examples with references longer than 100 words
Readers favored the combined reward setting slightly more often than the tuned word-overlap baseline.
The numbers
| System or setting | proportion of judgments |
|---|---|
| Tuned BLEU-1 reward | 0.433 |
| Relative ordering and BLEU-4 (this paper) | 0.442 |
In that long-reference comparison with BLEU-1, the action-order tie proportion is 0.125. Against MLE, the combined system also leads on each criterion in the long-reference group. Its win proportions are 0.425 on fluency, 0.458 on ingredient use, 0.450 on title completion and 0.483 on action order. The corresponding MLE proportions are 0.317, 0.342, 0.358 and 0.367. The authors interpret the long-reference results as evidence that the teacher helps preserve coherence when the procedure has more to cover. The human judgments support that interpretation most directly on action order, with ingredient use and title completion showing other ways in which the combined system better fulfills those prompts.
What the ablations show
Where the reward lands matters
The comparison between absolute and relative ordering changes both the teacher’s input and where its feedback goes. The absolute teacher reads complete recipes and supplies a common reward. The relative teacher reads passages and makes a separate assignment to each sentence. The latter improves all the reported word, action and state-change measures relative to the former. The absolute teacher also falls below MLE on all those measures. A recipe-wide comparison of sentence orders is therefore an ineffective reward in this experiment, despite training the teacher to recognize an important distinction between original and reversed texts.
The authors interpret the relative teacher’s advantage in terms of credit assignment. With a single score, a strong opening and a poor ending are reinforced or weakened together. With sentence-specific feedback, a locally appropriate instruction can retain credit even when another part of the recipe causes trouble. The comparison supports the effectiveness of the relative design as a whole. It changes the teacher’s training passages and its reward windows along with the distribution of feedback, so the results do not provide a separate estimate of the effect of each decision. The window-size analysis offers some finer evidence about how much context that design benefits from.
Combining RO with BLEU-4 changes the kind of feedback available while keeping sentence-level credit for the relative part. Relative ordering alone leads on action BLEU-4, action ROUGE-L and state-change ROUGE-L. The combination leads on action BLEU-1, state-change BLEU-1 and state-change BLEU-4, and improves each of the relative system’s word scores. The daily use of familiar language and the ordering of familiar events are coupled in a recipe, but the numbers show that they respond differently to the two rewards. In the reported comparison, adding word feedback favors vocabulary overlap and some forms of event agreement while giving up the lead on other measures of order.
What happens when the teacher is easier to please
The authors analyze what the generator does when the forward comparison is used without the comparison to reversed text. In that condition, the generator can get attractive scores from very short outputs that resemble conventional recipe language. Examples include a bare serving instruction and a brief announcement of directions that supplies no procedure. A phrase can therefore appear compatible with the forward reference in the teacher’s representation without doing the work required of a recipe.
Subtracting similarity to the reversed reference reduces this behavior. A generic fragment that resembles both representations gets less benefit than it receives from the forward comparison alone. The reverse pass supplies a second test of the same generated text using the same teacher. The paper describes the effect through outputs and qualitative observations. It establishes the presence of a failure mode and shows that the richer comparison dampens it. It leaves the frequency of the failure under each condition unmeasured.
The pressure from an inadequately constrained reward also appears when the generator learns without the likelihood term. For Chili Grits, the paper shows an output consisting only of a word announcing something and a full stop. The output has scarcely any role as an instruction, let alone a full procedure using the listed ingredients. The example shows how an objective that encodes aspects of order can still reward an output with almost no content. Maintaining reference-word prediction helps preserve the generator’s ability to form extended, recognizable recipe text while the policy updates emphasize discourse.
How much context the relative reward needs
The authors vary the upper extent of the relative teacher’s windows and the balance between reward and likelihood. They keep the minimum at 3 sentences and vary the maximum over [3, 6]. They examine γ settings of 0.95, 0.97 and 0.98. The analysis tracks BLEU scores on the sequences of actions and state changes. Within this range, the policy weight matters in both directions. A lower setting gives the teacher too little influence to guide the generator effectively, while a high setting gives it enough influence to degrade the generator’s word prediction.
The window analysis also indicates that extending the available context helps the measures of coherence. A sentence can depend on an earlier preparation step even when the immediately preceding instruction is innocuous in isolation. Including more prior sentences gives the teacher a chance to capture that dependency. This finding is compatible with the advantage of sentence-specific credit. A reward can consider a substantial passage and still be assigned to the sentence at its endpoint. The experiment varies the size of that passage within the reported range, so it establishes a benefit from more context there.
Where the sampled recipes improve and where they go wrong
The casserole comparison illustrates a change in the trajectory of a recipe. The MLE output moves through a recognizable sauce preparation and then repeatedly adds cheese or gives another instruction involving melted cheese. Its later wording offers little progress toward assembling the named dish. The RO output eventually transfers the mixture into a greased casserole dish and proceeds to baking. Those operations also appear in the reference. The teacher-trained version can therefore share more of the reference’s procedure even when its ingredient use and wording differ from the original.
The sauerkraut comparison shows another kind of improvement. The word-prediction baseline produces a short preparation centered on soup, wine and butter and leaves out the dish’s titular ingredient. The relative teacher’s output brings sauerkraut into the procedure and describes heating and simmering it with wine. It also repeats part of the wine instruction and adds a serving suggestion outside the reference. The example shows that paying more attention to recurring event patterns can restore a central ingredient and a plausible progression while leaving room for unnecessary or unsupported steps.
The strawberry pie illustrates the cost of relying on common progressions. The relative system generates a glaze, adds berries and puts the result in the prepared shell. It then sends the assembled pie to the oven. In the reference, the shell is already baked, and chilling sets the glaze. Baking is a recognizable step for pies in general but is misplaced in this particular recipe. This is the counterpart of the casserole example. A familiar action can help the system complete the procedure when it belongs, and familiarity can invite the same action when the ingredients and reference call for a different finish.
Limitations
Limits the authors identify
The authors explicitly describe sentence order as an approximation to discourse structure. The teacher represents the words within an instruction as a sum and learns from the succession of those sums. This design makes the chronology of the instructions accessible to the reward. Word order within each instruction is left to the generator and the other training signals. A sentence can therefore be flawed in a way the teacher’s representation cannot distinguish if it preserves the same words.
The paper also identifies a weakness in using familiar temporal patterns as evidence of quality. Typical cooking steps can guide a generator toward a process that resembles its reference. A step can still be an error for the actual dish. The strawberry example makes that failure concrete. Learning the pattern that a pie is often baked is easier than learning all the conditions under which the assembled pie should stay out of the oven. The teacher rewards arrangements of instructions that appear familiar in context, and this can favor common procedures over exceptions.
The authors’ experiments with very short outputs identify a further limit of the reward itself. A generator can learn to exploit recognizable language without supplying a complete recipe. The reverse comparison and likelihood term address the problem from different directions. One reduces credit for text that looks similar to both readings of the reference. The other preserves an incentive to write the kinds of token sequences seen in real recipes. Their use is integral to the reported training procedure. The fluent teacher-trained outputs are evidence for that procedure with those components present.
What follows from the experimental setup
The evidence is specific to recipe generation. A title and ingredients define a constrained writing task, and cooking offers many instructions with clear temporal relationships. Other kinds of documents can organize material around contrasts, explanations or themes. A reversal may be a less informative comparison for those texts, where several arrangements of paragraphs can serve a reader equally well. The experiments demonstrate what the reward does in this recipe setting. Establishing its effect on other kinds of long text would require evaluation in those settings.
Even within recipes, comparison with a single reference can favor the published sequence over another valid method. Some preparatory operations can be reordered if each prerequisite is satisfied by the time it is needed. A teacher trained on original and reversed sequences can learn useful temporal regularities while having little direct practice distinguishing an equivalent rearrangement from a subtle procedural error. Reversal supplies a strong and easily generated contrast. The paper does not report an independent test of whether the teacher separates these finer cases.
The automatic tests map vocabulary to actions and map actions to broad types of change. Consequently, their unit of comparison is an implied event or category as identified through the lexicon. A recipe can match several such events while applying them to the wrong ingredient. It can describe the expected heating and mixing yet leave out what should be heated or what the mixture should contain. These metrics show that the generated text agrees more closely with reference event sequences under the chosen representation. The paper does not test physical execution of the recipes, or verify all the conditions a cook would need for a successful outcome.
A similar distinction applies to the use of the word state. The state-change scores compare ordered labels derived from text. The evaluation does not follow the condition of a particular ingredient through a series of explicit updates. The paper’s evidence for knowledge of the cooking process is behavioral. It lies in the types of changes the generator mentions and in their agreement with references, together with the judgments and examples. Claims about knowing exactly what has happened to each ingredient would require different evidence.
The human evaluations add evidence about readability and usefulness as judged from recipe text. The pairwise design supports relative statements about the compared systems. A preferred answer can still be incomplete, and a tie does not reveal whether both recipes are adequate. The overall sample is 100 test recipes, and the long-reference sample is a subset whose size is not reported alongside the results. The small action-order preference over tuned BLEU-1 in that subset warrants a descriptive reading of the observed judgments. The paper presents proportions without a precision estimate for that comparison.
Finally, the comparison of long references groups examples by how much the human author wrote. A longer reference may involve more actions to connect, but it can also differ in other respects from a shorter one. The analysis gives evidence that the relative teacher is especially useful for those inputs in the sampled judgments. It does not isolate reference length as the cause of the difference, and the reward comparison was not repeated with matched recipes whose only change was the amount of text. The strongest conclusion combines what the tests actually measure. The local teacher changes the action patterns apparent in generated recipes, and the combined reward improves several aspects of their perceived quality under the reported conditions.
What came after
Later citations reach several areas in which relations across sentences matter. Some stay close to the problem of representing discourse, while others concern how to evaluate longer generated documents. A citation establishes that a work refers back to the recipe paper. The later works’ subjects support the connections below, while details of whether they reuse its reward, teach an order scorer, or compare against its system remain unspecified.
Evaluation of Text Generation: A Survey (2020) places the citation in a survey of how generated text is evaluated. The recipe paper is relevant to that subject because it uses scores in two roles. A score can serve as feedback during training, and a separate score can supply evidence about what came out of training. Its comparisons with word overlap, lexicon-based event overlap and pairwise human judgment make those roles visible in a single experiment. The citation connects the recipe study to the wider evaluation literature.
Two citing works approach discourse through parsing and relation recognition. A Regularization Approach for Incorporating Event Knowledge and Coreference Relations into Neural Discourse Parsing (2019) concerns the use of knowledge about events and about expressions that refer to the same entity in identifying discourse structure. The link to the recipe study is the role of event information across sentence boundaries. DiscoPrompt (2023) uses path prediction and prompt tuning for recognizing implicit discourse relations. Its task concerns identifying a relationship that a passage leaves unstated, while the recipe study obtains its training signal from the observed order of the sentences. These are related ways of treating a transition between sentences as something an automated system can learn from or predict.
Exploring the Potential of ChatGPT on Sentence Level Relations (2024) examines temporal, causal and discourse relations at sentence level. The temporal part is especially close to the recipe paper’s concern with which events belong before or after others. The inclusion of causal and discourse relations also illustrates the breadth of the problem behind the original approximation. Sentence order gives the recipe teacher a readily available signal. Readers may need several kinds of relationship to explain why that order works.
The citation also appears in work on producing and evaluating long documents. AutoSurvey (2024) concerns the automatic writing of surveys. It shares the broad problem of producing a document in which material has to fit together over many sentences, although a survey organizes claims and research topics where a recipe organizes actions. A Comprehensive Survey on Long Context Language Modeling (2025) brings the citation into a survey concerned with long context. The original study gives a concrete example of a training decision about context length, through the use of different spans of preceding sentences for a reward that remains local to an instruction.
Bloom-Eval (2026) takes up evaluation for automatic survey generation through a hierarchical benchmark based on Bloom’s Taxonomy. The connection is the need to assess properties that are not settled by local agreement in wording. The recipe paper compared words, actions, changes and human judgments. The later benchmark’s stated subject is evaluation of a different kind of long document, organized by a different hierarchy. Together these citations show where the original question recurs. Once individual sentences sound plausible, training and evaluation still need evidence about how those sentences contribute to the document’s purpose.
Cite
Cite as Antoine Bosselut, Asli Celikyilmaz, Xiaodong He, Jianfeng Gao, Po-Sen Huang and Yejin Choi. 2018. Discourse-Aware Neural Rewards for Coherent Text Generation. Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers).
@inproceedings{bosselut2018discourse,
title = {{Discourse-Aware Neural Rewards for Coherent Text Generation}},
author = {Antoine Bosselut, Asli Celikyilmaz, Xiaodong He, Jianfeng Gao, Po-Sen Huang and Yejin Choi},
booktitle = {Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers)},
year = {2018},
doi = {10.18653/v1/n18-1016},
url = {https://doi.org/10.18653/v1/n18-1016}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bosselut-2018-discourse-aware-neural-rewards-coherent/