---
title: "Procedural Reasoning Networks for Understanding Multimodal"
description: "Procedural Reasoning Networks track ingredients through a recipe and use their changing representations to answer visual questions about…"
canonical: "https://research.elamur.ai/free/en/papers/amac-2019-procedural-reasoning-networks-understanding-multimodal/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/amac-2019-procedural-reasoning-networks-understanding-multimodal/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/) / Procedural Reasoning Networks for Understanding Multimodal Procedures

# Procedural Reasoning Networks for Understanding Multimodal Procedures

Paper · 2019 · Mustafa Sercan Amac, Semih Yagcioglu, Aykut Erdem et al.

**Authors:** Mustafa Sercan Amac, Semih Yagcioglu, [Aykut Erdem](https://md.research.elamur.ai/free/en/authors/aykut-erdem/) and [Erkut Erdem](https://md.research.elamur.ai/free/en/authors/erkut-erdem/) · **Year:** 2019 · **Venue:** Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/K19-1041/)
- [PDF](https://aclanthology.org/K19-1041.pdf)
- [DOI 10.18653/v1/k19-1041](https://doi.org/10.18653/v1/k19-1041)

## Summary

A recipe can refer to a patty before and after cooking with the same word, even though its appearance has changed. A reader has to connect those mentions, understand what the intervening instruction did, and recognize how the resulting patty fits into the next step. The paper studies whether a system can learn some of that continuity from a task that combines written recipes with images. In RecipeQA, the system reads the instructions and uses them to fill a gap in an image sequence, find a picture that is out of place, or choose the correct order for a set of pictures. These are tasks in [vision and language](https://md.research.elamur.ai/free/en/topics/multimodal/) where an answer can depend on how the ingredients change as the recipe progresses.

The authors introduce Procedural Reasoning Networks, or PRN. The approach gives each identified ingredient a slot in memory. The slot begins with a representation of the ingredient’s name and can change as the system reads each instruction. During an update, the slots can draw information from one another as well as from the current instruction. That design lets the representation of an ingredient depend on what happens to the other ingredients around it. To answer a question, the system relates the question images both to words in the recipe and to the ingredient representations at the end of the procedure. It uses the resulting information to rank the candidate answers.

When trained separately for each RecipeQA task, PRN reaches 56.31% accuracy on visual cloze, 53.64% on visual coherence, and 62.77% on visual ordering. It improves on the adapted reading-comprehension system without ingredient memory in all of those comparisons. A heuristic that uses images alone still scores higher on visual coherence, showing how useful visual similarity can be for finding an outlier. When a single system is trained across the tasks, PRN and a version with fixed ingredient representations perform comparably overall. The advantage of updating memory is clearest in the separate-task experiments.

Training uses correct answers to the visual questions. Ingredient names are supplied to initialize the memory, while changes such as chopping and pouring are left for the system to represent internally. The authors examine the resulting vectors and find cases where similar preparations occupy nearby regions, and where a change observed for one ingredient retrieves plausible states for another. Those examples give the accuracy results a more concrete interpretation. They suggest that the visual questions can encourage the memory to retain information about changes in the recipe, even though the training objective rewards answer selection and provides no labels for those changes.

## Deep dive: Procedural Reasoning Networks for Understanding Multimodal Procedures

Procedural Reasoning Networks track ingredients through a recipe and use their changing representations to answer visual questions about cooking. · about 37 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### A procedure changes the things it describes

A recipe describes how a situation develops. Each instruction starts from a situation established by earlier ones and contributes to the next. Reading an instruction in isolation may tell you what action is being taken. Understanding the procedure also requires knowing what that action is being applied to at this point, what else is involved, and which consequences matter later. The same word can be used throughout, while the thing it refers to undergoes several changes.

The cheeseburger example in the paper makes that distinction concrete. The ground beef is prepared as a patty, seasoned, and heated. The reader who encounters the patty again has to carry forward what happened during cooking. Keeping track of the referent supplies continuity. Updating what is known about it supplies the difference between seeing the same name early in the recipe and seeing it later. The example also involves ingredients coming together. When the seasoning is applied, the relevant event concerns the patty and the seasonings jointly. An account that dealt only with isolated mentions would have to recover that connection elsewhere.

The tomato in the same recipe illustrates another kind of continuity. A whole tomato is sliced, and the slices are later placed on the bun. The pictures can make the change in form visible, while the written steps explain the actions and where they belong in the procedure. Each source of information helps with a different ambiguity. The word identifies the ingredient across changes in appearance. The image can help distinguish stages that share a name. Their correspondence gives the authors a way to study procedural [reasoning](https://md.research.elamur.ai/free/en/topics/reasoning/) through an observable task.

For the paper, the role of an entity is practical. An entity is a participant that the system can keep track of, usually a basic ingredient in these recipes. Its state is whatever information about its current situation ought to survive as the instructions are read. A change in state may be visible, as when something is chopped or stirred, or it may matter for interpreting the next action. The representation proposed in the paper is a vector that can change over time. The motivating examples give names to changes a person can recognize, while the architecture leaves the contents of that vector to be learned.

#### Earlier work made state changes explicit

The authors describe a line of work that trains systems to predict what happens to individual participants at particular steps. Bosselut and colleagues studied changes to ingredients in cooking instructions. Dalvi and colleagues studied states in descriptions of scientific processes. Both examples bring the entities to the foreground and make their changes the direct subject of prediction. That setup gives a training procedure a clear target at each step. It also requires people to supply the corresponding state information.

Local predictions create a further problem. A prediction can seem plausible at the point where it is made and still fit poorly with another prediction elsewhere in the process. The introduction cites this tension between local accuracy and consistency over the full sequence. Tandon and colleagues used hard and soft constraints to rule out unlikely changes or give more weight to plausible ones. Du and colleagues pursued consistency during training, encouraging similar predictions in similar procedural situations. Das and colleagues represented changing states through a [knowledge graph](https://md.research.elamur.ai/free/en/concepts/knowledge-graph/) constructed as the text was read. These approaches differ in how they represent a process and how they try to make its description hold together across steps.

PRN shifts the target from state prediction to [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/). Whether a candidate picture completes a sequence is something the training data can tell the system. Whether a particular ingredient vector should encode a category such as sliced is left implicit. An intermediate state representation is valuable insofar as it helps answer the question. This is an attractive change when detailed annotation is costly, but it also changes what a good score establishes. Answer accuracy can show that the learned representation is useful for the task. Assessing the accuracy of the underlying states calls for separate evidence.

#### Memory and attention supplied different pieces

The paper also situates PRN among systems that use memory to keep track of participants. Henaff and colleagues updated entity representations with a gating mechanism as text arrived. In this context, a gate controls how much of a stored representation is retained and how much new information enters it. Bansal and colleagues assigned memory space to entities and to their relationships. Pavez and colleagues used relationships between attended memory entries when representing the current situation. The PRN authors emphasize the interaction that occurs during an update. A stored ingredient representation can acquire information from the other slots at that moment, so the update is conditioned on more than the ingredient and the incoming instruction.

Related work in reading comprehension had also addressed the problem of linking mentions. The paper notes work on [coreference resolution](https://md.research.elamur.ai/free/en/topics/coreference-resolution/), the problem of determining when expressions refer to the same participant. It cites evidence for the value of coreference signals in comprehension and describes a recurrent layer that used annotated links between mentions. Ji and colleagues incorporated entities into a system that could update their representations over time, with applications including coreference and the prediction of entities. PRN takes a narrower route to identifying participants. It starts with ingredient names derived from the recipe and investigates what the associated representations learn as the instructions unfold. [Dynamic Entity Representations](https://md.research.elamur.ai/free/en/papers/ji-2017-dynamic-entity-representations-neural-language/).

The other architectural starting point is BiDAF, or bidirectional attention flow. In its original reading-comprehension setting, the system selected an answer span from a passage. Attention gives a way to assign different relevance weights to candidate pieces of information. Here, the material to be read is a recipe, the question is visual, and the answer comes from a supplied set. The useful part of BiDAF is its way of comparing the context and the question in both directions. PRN adapts that operation to words and pictures, then applies a parallel comparison to ingredient memory and pictures. [Bidirectional Attention Flow for Machine Comprehension](https://md.research.elamur.ai/free/en/papers/seo-2016-bidirectional-attention-flow-machine-comprehension/).

The two uses of attention solve different problems. Attention inside the recurrent memory helps determine how stored participants influence one another while a recipe is read. Attention in the comprehension stage helps determine which parts of the recipe and which stored participants matter for the particular question. The distinction matters when interpreting the design. An ingredient can interact with others during reading even if the question later directs attention elsewhere. Conversely, a question can make use of an ingredient whose final state summarizes several earlier instructions.

#### What the visual questions ask a reader to recover

The tasks in RecipeQA expose different parts of the relationship between pictures and instructions. A missing picture has to fit at a particular position among other pictures. A picture in a coherence question has to be judged against the surrounding visual sequence and the procedure. Ordering requires the system to evaluate several arrangements of the same kind of material. The common format is multiple choice, so each task can be trained by rewarding the right selection. The kinds of evidence that make a selection easy can vary substantially across tasks.

Those distinctions explain the paper’s experimental choice. If the goal is to see whether the visual side of the task is useful, the most relevant questions are ones that put pictures in the query and the candidate answers. The textual cloze task in RecipeQA falls outside the authors’ experiments because a question in that task may be answerable without combining modalities. Focusing on the visual tasks puts the interaction between written instructions and pictures at the center of the evaluation. The comparison with an image-only heuristic then gives a way to examine how far visual cues can carry the answer by themselves.

### The method, step by step

#### Following a recipe before judging the answer

The network is easiest to follow by separating the record of the procedure from the judgment of a candidate answer. To build the record, PRN reads the recipe at two levels. It keeps representations for individual words so they can later be compared with question images. It also represents each complete step so the memory can be updated once per instruction. A step update sees the current instruction and the preceding memory. After the final step, the ingredient slots contain the results of those successive updates.

The question helps determine which parts of the record should influence the answer. PRN compares its images with the recipe words and with the final ingredient slots. A word can thereby be represented alongside visual features relevant to it. An ingredient can likewise be represented in relation to the question. The network summarizes the recipe and ingredient branches and joins them into a vector. It scores candidate answers against that vector. During training, a correct candidate is encouraged to score above an incorrect one.

How PRN reads a recipe and selects an answer The steps in order.

#### Identifying the ingredients

The initial step of a RecipeQA recipe commonly contains an ingredient list. The authors use that regularity to locate the entities. They build an ingredient dictionary with the help of Recipe1M and Kaggle Whats Cooking Recipes, alongside the ingredients most commonly used in the RecipeQA training set. They then try to extract ingredients from the first step of each recipe using the dictionary. For the 20 recipes in which automatic extraction returned no entity, the authors supplied the ingredients manually.

This stage chooses the participants for which PRN will maintain dedicated memory. A slot is given an identity at initialization through the representation of the ingredient name. For a multiword name such as minced garlic, the paper uses the average of the constituent word vectors. For a word outside the pretrained vocabulary, the fallback word vector is an average across the vocabulary. The character-based information used by the architecture provides another way to represent a spelling even when a pretrained entry is unavailable.

Ingredient extraction and state tracking therefore receive different forms of guidance. The dictionary and the manual fallback identify what to track. The successive vectors for a tracked ingredient are learned through the task. A person supplies the fact that a recipe should have an entry for a particular ingredient in the fallback cases, while the training objective leaves the subsequent contents of that slot to the network. A word that lacks a dedicated slot is still available through the ordinary recipe representation.

#### Encoding words, steps, and pictures

A sample is written as a triple.

```
(R, Q, A)
```

Here R is the written recipe, Q is the question as a sequence of pictures, and A is one candidate answer. The commas separate the components of the sample. The recipe has N words, the question has M pictures, and the answer contains L pictures. For visual cloze and visual coherence, L is 1 because each candidate is a single picture. For ordering, a candidate consists of a sequence.

To represent a recipe word, the input module uses both its characters and a pretrained [word embedding](https://md.research.elamur.ai/free/en/concepts/word-embeddings/). An embedding is a vector of numerical features that downstream operations can compare or combine. At the character level, PRN uses a convolutional network, which applies learned filters to local patterns in the character sequence. This produces a vector for the word’s spelling. At the word level, PRN looks up its pretrained [GloVe](https://md.research.elamur.ai/free/en/concepts/glove/) vector. The sources serve complementary purposes. The word vector supplies information associated with a vocabulary entry, and the character encoder gives the architecture a way to represent forms that lack such an entry. The paper attributes its convolutional choice to Kim. [Convolutional Neural Networks for Sentence Classification](https://md.research.elamur.ai/free/en/papers/kim-2014-convolutional-neural-networks-sentence-classification/).

The character and word features are concatenated, meaning that they are placed next to each other in a longer vector. A two-layer highway network transforms that vector into the representation used for the recipe word. A highway layer can learn to carry parts of its input forward while transforming others. The result has a column for each word of the recipe. [Highway Networks](https://md.research.elamur.ai/free/en/papers/srivastava-2015-highway-networks/).

```
R⁰ ∈ ℝ^(2d×N)
```

R⁰ is the matrix of encoded recipe words. The superscript ⁰ identifies this input representation, before the question conditions it. The membership symbol ∈ says that the matrix belongs to the real-valued space denoted by ℝ. The expression 2d×N gives its shape, with 2d features per word and N columns for the N words. The symbol d denotes the underlying width used in the paper’s dimensions, and × separates the feature and column dimensions.

The step-level representation has a different job. For each instruction, the system feeds the word and character information for that step through a bidirectional long short-term memory network, abbreviated BiLSTM. An LSTM is a recurrent network that carries a state from one position to the next. A bidirectional version reads the sequence in both directions. For a given instruction, the final state of the step encoder gives the summary used to update memory. This makes the instruction available to the update as a whole, while the separate word matrix preserves the individual positions.

```
S = (s₁, s₂, …, sₜ, …, sₜₒₜₐₗ)
```

S here denotes the ordered sequence of step vectors. The equals sign defines it as the sequence in parentheses. A lower-case s denotes a step embedding. The subscripts ₁ and ₂ indicate the first and second steps, ₜ indicates a step at position t, and ₜₒₜₐₗ denotes the final step, whose index the paper calls T. The ellipses indicate the intervening recipe steps. The paper uses T for the total number of steps and sᵢ when discussing the vector for an arbitrary step i.

Each question or answer picture begins with image features from a ResNet-50 pretrained on ImageNet. The authors take a 2048-dimensional vector from the average-pooling layer just before the final layer. A multilayer perceptron then transforms the image features. This is a network of successive learned transformations applied to the vector. A BiLSTM handles successive images where the input is a sequence. For the question, the cell states furnish a representation at each image position, collected as columns of the question matrix.

```
Q⁰ ∈ ℝ^(2d×M)
```

Q⁰ is the encoded question before it is compared with other inputs. The superscript ⁰ marks that stage, ∈ denotes membership, and ℝ denotes real-valued entries. The shape 2d×M means 2d features for each of the M question pictures. The symbol d is the width used in the architecture’s dimension notation, and × separates the matrix dimensions. Each image column can be compared with each recipe word column during attention.

An answer needs a single vector regardless of its length so that the same scoring rule can be used across tasks. In ordering, the authors use an additional BiLSTM for the candidate sequence and add its cell states together. The states being added have already been produced by processing the images as a sequence. Thus the construction can retain information about how an image was situated in its candidate ordering. For a question with single-image candidates, the answer vector represents the individual image.

```
a ∈ ℝ^(2d×1)
```

The lower-case a is the encoded candidate A. The symbol ∈ indicates membership in the real-valued space ℝ. The dimensions 2d×1 indicate a single column of width 2d, with d the architecture’s width parameter and × separating the two dimensions. The shared output shape allows the ordering task and the single-image tasks to use the same kind of similarity score.

#### Updating an ingredient in relation to the others

The memory starts with a slot for each of the K identified ingredients. The authors denote the memory matrix by E and its per-ingredient width by dₑ. The matrix collects the ingredient vectors so the recurrent update can process them together. Each slot starts from the character and pretrained word representations of its ingredient. The paper describes the recurrence by indexing an individual slot, an approach that makes it possible to follow one ingredient across the procedure.

The recurrent component comes from the relational memory architecture of Santoro and colleagues. It is based on an LSTM whose state is organized as a matrix. At each recipe step, multiheaded self-attention allows the memory entries to take information from other entries as well as from the instruction. An attention head is a learned way of assigning relevance weights. Several heads can make different weight assignments during the same update. The entry for an ingredient can therefore depend on several other parts of memory at once. The paper draws on the attention mechanism associated with [Transformer and attention](https://md.research.elamur.ai/free/en/concepts/transformer/). [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/).

```
φᵢ,ₜ = R-RNN(φᵢ,ₜ₋₁, sₜ)
```

The symbol φ denotes the recurrent state associated with a memory slot. The index i identifies the ingredient, and t identifies the recipe step. The left-hand side is the slot state after step t. On the right, R-RNN denotes the relational recurrent neural network. It takes the previous state of the slot, written with t − 1 in the subscript, and the current step embedding sₜ. The equals sign defines the updated state, and the comma inside the parentheses separates the inputs displayed by the recurrence. The equation follows one slot for readability. The operation itself allows the other memory slots to influence that slot through attention.

```
φᵢ,ₜ = (hᵢ,ₜ, eᵢ,ₜ)
```

The symbols i and t again identify the ingredient and step. The equals sign defines the recurrent state φᵢ,ₜ as the pair in parentheses. Its first component hᵢ,ₜ is the hidden state for the ingredient’s slot. Its second component eᵢ,ₜ is the dynamic representation of that ingredient at that point in the procedure. The commas in the subscripts separate the indices, and the comma between the two terms separates the components of the state.

Consider what the update can do when several ingredients are involved in one instruction. The step vector carries information about the action and the way it is described. The memory already contains representations developed from earlier instructions. An ingredient’s next vector can depend on both sources and on the states of the ingredients around it. A preparation step that puts ingredients together can therefore affect what is stored for each participant. The architecture defines this access to other entries. The answer-selection training determines whether, and in what way, the network learns to use it.

Intermediate memories are available for the paper’s analysis. The answer mechanism uses the last ingredient representations, together with the recipe words. This division of labor gives the answer two ways to draw on the history. The final memory can preserve consequences of earlier instructions, while the word branch retains the instructions at their original positions. A question about a picture from the middle of a procedure can still be compared with words from that part of the recipe.

#### Relating the question to words and ingredients

The comprehension stage takes the encoded question Q⁰, the encoded recipe R⁰, and the memory E produced after reading the recipe. It builds a question-aware representation of the recipe and a question-aware representation of the ingredient slots. The paper describes attention in both directions for each branch. One direction asks which pieces of the question are relevant to an item in the recipe or memory. The other provides a summary emphasizing the items on the recipe or memory side that find a strong match in the question.

For the recipe branch, the system first makes a grid of word–image scores. The same grid is used for both attention directions. A score combines features from the word by itself, from the question image by itself, and from their feature-by-feature product. The product gives the learned scoring function access to interactions between the two representations.

```
Sᴿᵢ,ⱼ = wᴿᵀ[R⁰ᵢ; Q⁰ⱼ; R⁰ᵢ ∘ Q⁰ⱼ]
```

Sᴿ is the affinity matrix for the recipe branch. Its entry with indices i and j is the score for recipe word i and question image j. The subscript on R⁰ᵢ selects the word column of the encoded recipe, and the subscript on Q⁰ⱼ selects the image column of the encoded question. The superscript ⁰ marks those input encodings. The symbol ∘ denotes multiplication of corresponding vector components. Square brackets enclose the concatenated vector, and the semicolons inside them separate its segments. The vector wᴿ holds learned scoring weights. The superscript ᵀ transposes it so that multiplying it by the concatenated vector gives a scalar. The equals sign defines the resulting grid entry.

For each recipe word, the system normalizes that word’s scores over the images. A softmax converts scores to non-negative weights that sum to one and gives larger weights to higher-scoring inputs.

```
aᵢ = softmax(Sᴿᵢ)
```

Here aᵢ is the vector of attention weights for recipe word i. The symbol Sᴿᵢ denotes row i of the recipe affinity matrix, containing a score for each question image. The function softmax normalizes that row. The equals sign assigns the result to aᵢ. Though the paper also uses a for an answer embedding, aᵢ in this formula refers to an attention row. Its components weight the image columns in the next operation.

```
Q̃ᵢ = Σⱼ aᵢⱼ Q⁰ⱼ
```

Q̃ᵢ is the question vector attended to by recipe word i. The tilde marks a representation formed by attention. The summation sign Σⱼ adds contributions over the question-image index j. A contribution is the image column Q⁰ⱼ multiplied by the scalar weight aᵢⱼ for word i and image j. The equals sign defines the attended vector. There is an attended question column for each word, so the information drawn from the pictures can differ across the recipe.

The other direction of the recipe branch uses a different reduction of the grid. It takes the highest image score for each word, then normalizes the resulting word scores. This gives words greater influence when at least one picture is a close match. The result summarizes the recipe positions most related to the question as a whole.

```
b = softmax(max_col(Sᴿ))
```

Here b is the vector of attention weights over recipe words, and Sᴿ is the matrix of word–image affinities. The function max_col takes the maximum across image columns separately for each word row. The outer softmax converts those maxima into normalized weights over the recipe words. The equals sign defines b. This reduction yields a single set of recipe weights, whereas the recipe-to-question operation supplied an image-weight vector for every word.

```
r̃ = Σᵢ bᵢ R⁰ᵢ
```

The symbol r̃ is the attended recipe summary. Its tilde again indicates an attention-derived vector. The summation Σᵢ runs over the recipe-word index i. The component bᵢ weights the original recipe column R⁰ᵢ, and the equals sign defines the summary as the sum of the weighted columns. The system copies this same summary into the columns of R̃ so it can be combined with each word representation.

```
Gᵢ = [R⁰ᵢ; Q̃ᵢ; R⁰ᵢ ∘ Q̃ᵢ; R⁰ᵢ ∘ R̃ᵢ]
```

Gᵢ is column i of the question-aware recipe representation G. The equals sign defines it using the concatenation in square brackets. The first segment R⁰ᵢ is the original encoded word. The second segment Q̃ᵢ is the weighted picture information specific to that word. The third segment is their elementwise product, indicated by ∘. In the fourth segment, the same operator lets the word interact with R̃ᵢ, the copy of the shared attended recipe summary at position i. The semicolons separate segments. The representation consequently preserves the encoded word and supplies both local visual information and information from the question-conditioned recipe as a whole.

The ingredient branch follows the same general logic with a separate affinity matrix. Its comparisons are between the entries in E and the question-image vectors. Attention going from ingredient slots towards images makes different image information available to different ingredients. Attention in the other direction emphasizes memory entries relevant to the question. The resulting question-aware ingredient representation is Y. The paper specifies this branch by analogy with the recipe branch. It gives the explicit affinity and combination equations for the word branch and describes the ingredient branch in terms of its own affinity matrix and resulting representation.

The separate branches let the same picture interact with different kinds of evidence. Its match with a recipe word concerns a particular position in the instructions. Its match with a stored ingredient concerns a vector that has been updated repeatedly. In either branch, a high affinity is a learned relevance score for answering the question. The training signal is the correctness of the candidate answer, so the paper interprets the attention operations through the task and through examples of what the memory retains.

#### Turning the two branches into a candidate score

The next module summarizes each question-aware representation with a BiLSTM. A two-layer BiLSTM reads G, the sequence of enriched recipe words. The output uses the final hidden state from each reading direction. Those states together give the recipe summary c. A separate BiLSTM runs over Y, the question-aware ingredient entries, and produces the ingredient summary f. The architecture can consequently keep the summaries separate until it has finished processing their respective inputs.

```
o = ϕₒ([c; f]) ∈ ℝ^(2d×1)
```

The vector o is the combined representation used to judge candidates. The equals sign defines it from the recipe summary c and the ingredient summary f. Square brackets with a semicolon concatenate those vectors. The function ϕₒ is the output projection, a multilayer perceptron with a hyperbolic tangent activation. The subscript ₒ identifies the projection for this output. The notation ∈ ℝ^(2d×1) says that o is a real-valued column of width 2d, with d the architecture’s width parameter and × separating the dimensions. This gives o the same shape as a candidate vector.

The output module uses cosine similarity. It measures the alignment of the combined vector and the answer vector by their directions. A larger score makes the candidate preferable. For an ordering question, the candidate is represented as a whole sequence, so the score ranks that proposed ordering against the other supplied orderings.

Training uses a hinge ranking loss, a rule that penalizes a pair when the score of the correct answer fails to clear the incorrect answer’s score by a chosen margin. The paper adopts this type of objective from earlier work and from the setup used with RecipeQA. [Natural Language Processing (almost) from Scratch](https://md.research.elamur.ai/free/en/papers/collobert-2011-natural-language-processing-almost-scratch/).

```
L = max{0, γ − cos(o, a⁺) + cos(o, a⁻)}
```

Here L denotes the loss, a separate use of the letter L from the earlier notation for answer length. The equals sign defines it. The function max chooses the larger of the terms inside braces, with the comma separating 0 from the margin expression. The parameter γ is the required margin. The function cos computes cosine similarity between its two arguments, separated by a comma. The vector o represents the question-conditioned recipe and memory. The answer embedding a⁺ is for the correct candidate, and a⁻ is for an incorrect candidate. Subtracting the correct candidate’s score and adding the incorrect candidate’s score makes the penalty larger when the two are ranked poorly. If the correct answer is sufficiently far ahead, the loss is 0.

The equations show where the training signal enters. It is applied at the level of candidate scores. Earlier components contribute by making the representation more useful for that ranking, from the encoding of a cooking instruction to the interaction between memory entries. The system can thus learn a pattern associated with a state change without receiving a target vector or a state label for that particular update.

#### Training separately and across tasks

The paper trains separate systems for each visual task and also trains a shared system on all the visual tasks. In the shared setting, it draws batches from the tasks in round-robin order. Each batch contains examples from a single task, so task changes occur between batches. The comparison asks whether a common set of learned representations serves the several question formats as effectively as training each one separately.

The PRN architecture has roughly 12M trainable parameters. The authors implemented it with PyTorch and AllenNLP. They used Adam with a learning rate of 1e-4, a batch size of 32, and early stopping with patience set to 10. Their description says training stops after 10 iterations without improvement. They report that a run for a single system took around 2 hours on a machine with four NVIDIA GTX-1080Ti GPUs. The same hyper-parameter settings were used for the baselines trained in the paper.

The authors also considered pretrained ELMo embeddings. They judged the performance gain too small for the computational overhead and used GloVe in the described setup. The paper gives this as an implementation choice without reporting a numerical embedding comparison. The authors made PRN code and a demonstration available through the project website. [Deep Contextualized Word Representations](https://md.research.elamur.ai/free/en/papers/peters-2018-deep-contextualized-word-representations/).

### Experiments and results

#### The dataset and what counts as correct

RecipeQA supplies cooking instructions and associated images. In the visual tasks used here, the context is the written recipe. The question and candidate answers are constructed from pictures. This gives the evaluation a common response format even though the visual evidence has a different role in each task. Accuracy is the percentage of questions on which the chosen candidate is correct. For ordering, correctness concerns the selected ordering as a whole.

In visual cloze, the question presents four positions drawn from consecutive recipe steps, with one image replaced by a placeholder. The system chooses from four candidate images for the missing position. A suitable image needs to fit the surrounding sequence at that point. The recipe can provide evidence about what should happen there, and the observed pictures can indicate which stages have already been shown. That makes the task a test of how well the network can relate the written progression to the visual one.

In visual coherence, the question contains four images and the system identifies the one inconsistent with the recipe. An outlying picture may be evident from appearance. In other cases, interpreting the instructions may help decide whether a picture of a plausible cooking action belongs in this particular sequence. As the image-only baseline shows, the benchmark separates neither of these routes to a correct answer in its accuracy metric. Both lead to credit when the selected picture is right.

In visual ordering, the question supplies four images in a jumbled order. The system scores candidate sequences and chooses one. Here, the informative relation is between the stages shown in the pictures. The recipe already provides the order of the written instructions, so aligning visual stages with textual ones can help establish a candidate order. The resulting accuracy measures sequence choice under the multiple-choice setup.

The human figures have separate provenance. They come from 100 questions sampled randomly from the RecipeQA validation set and are included as a point of reference. The reported human accuracies are 77.60% for cloze, 81.60% for coherence, and 64.00% for ordering, with an average of 74.40%. The quantitative table identifies that validation sample for the human row. The system results below are identified by their task and training regime because the paper’s account of the table leaves their split unspecified.

#### What the comparisons control for

Hasty Student is a heuristic based on distances in visual feature space. It sees the question and candidate answers and ignores the recipe. Its scores indicate how much can be accomplished using relationships among the pictures alone. Its success on coherence is especially important because that task explicitly asks for an outlier, which may be conspicuous in image features.

Impatient Reader attends to the recipe repeatedly, doing so after each image in the question. It offers a comparison with a system that can revisit the text as it encounters visual evidence. The paper takes the results for Hasty Student and Impatient Reader from the earlier RecipeQA study. [Teaching Machines to Read and Comprehend](https://md.research.elamur.ai/free/en/papers/hermann-2015-teaching-machines-read-comprehend/).

The adapted BiDAF baseline relates the visual question to the text and chooses among candidates. It supplies the main comparison for the incremental value of ingredient memory because it already has bidirectional attention over the recipe and question. A further version adds static ingredient memory. It supplies ingredient slots based on GloVe representations and leaves their values fixed throughout the recipe. The static variant tests how far the inclusion of ingredient identities can go on its own, while PRN adds representations that evolve with the instructions and interact through the recurrent memory.

#### Separate training produces different rankings across tasks

In visual cloze, PRN gets 56.31% accuracy, compared with 53.95% for adapted BiDAF and 51.82% for BiDAF with static memory. The scores for the published Hasty Student and Impatient Reader comparisons are both much lower. In this task, the branch with dynamic memory helps the BiDAF-style system choose a picture for a specific gap in the procedure. The static-memory result also shows that giving the system an ingredient list alone can fail to improve on the recipe branch.

Separate training on RecipeQA visual cloze, accuracy PRN leads the system comparisons, and the static-memory variant scores below adapted BiDAF.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Hasty Student | 27.35 |
| Impatient Reader | 27.36 |
| BiDAF | 53.95 |
| BiDAF with static memory | 51.82 |
| PRN (this paper) | 56.31 |

The single-task coherence comparison gives a different picture. PRN reaches 53.64%, ahead of adapted BiDAF at 48.82% and the static-memory variant at 45.88%. Hasty Student, however, attains 65.80%. The best result among the trained comprehension systems belongs to PRN, while the strongest system in the comparison is the heuristic. That ordering is important for interpreting the paper’s claim about improving previous neural approaches. Within that group, updating ingredient representations helps. The task also strongly rewards information available from the images alone.

Separate training on RecipeQA visual coherence, accuracy PRN leads the trained comprehension systems, while the image-only heuristic has the highest system accuracy.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Hasty Student | 65.80 |
| Impatient Reader | 28.08 |
| BiDAF | 48.82 |
| BiDAF with static memory | 45.88 |
| PRN (this paper) | 53.64 |

On visual ordering, PRN scores 62.77% in the separate-training setting. Adapted BiDAF reaches 62.42%, and the static-memory variant reaches 60.90%. Hasty Student scores 40.88%, and Impatient Reader scores 26.74%. The systems built around the adapted BiDAF attention mechanism lead the earlier system baselines in this task. The results for PRN and adapted BiDAF sit close together, and the contribution of dynamic memory appears smaller here than the ranking of systems alone would suggest.

The single-task average reported for PRN is 57.57%, the highest system average in the table. Adapted BiDAF averages 55.06%, and the static-memory variant averages 52.87%. The published baselines average 44.68% for Hasty Student and 27.39% for Impatient Reader. The average summarizes the task results, so it brings together several different patterns. The image-only heuristic is strongest on coherence, adapted BiDAF is already close to PRN on ordering, and PRN leads the systems on cloze. Reading the average alongside those results gives a more complete account of where the advantage is found.

#### Shared training changes where memory helps

With round-robin training across the tasks, the reported all-task accuracy is 50.17% for PRN. Adapted BiDAF reaches 48.67%, and BiDAF with static memory reaches 50.59%. The dynamic and static variants remain close, with the fixed ingredient representations having the higher aggregate in this regime. The paper describes the two memory variants as comparable in shared training. The table reports the joint setting for these systems and leaves the corresponding entries for the human comparison and the previously published baselines empty.

Shared training across the RecipeQA visual tasks, all-task accuracy The static and dynamic ingredient memories give close aggregate results, both above adapted BiDAF.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| BiDAF | 48.67 |
| BiDAF with static memory (this paper) | 50.59 |
| PRN | 50.17 |

The joint per-task scores show how those aggregates arise. For cloze, the static-memory variant leads at 47.81%, followed by PRN at 46.45% and adapted BiDAF at 44.62%. For coherence, PRN scores 40.58%, the static variant scores 40.23%, and adapted BiDAF scores 36.00%. For ordering, adapted BiDAF leads at 63.93%, with static memory at 62.94% and PRN at 62.67%. Shared training therefore changes which memory configuration is preferable, and the answer again depends on the task.

The paper characterizes shared training as generally weaker than separate training. The clearest declines in the reported task scores are on cloze and coherence. Ordering has a different pattern. Adapted BiDAF’s 63.93% with shared training exceeds its 62.42% with separate training, and the static variant’s 62.94% exceeds its separate-training score of 60.90%. PRN’s ordering scores remain close, at 62.67% and 62.77% for the respective settings. These details give the training comparison a more specific interpretation. The weaker aggregate picture coexists with a task where some systems gain from training across question formats.

The authors conjecture that the tasks differ in difficulty in ways that affect shared training. They suggest that choosing a curriculum, meaning a deliberate schedule for the training material, might help. Their experiments use the round-robin schedule, so the curriculum is a proposed direction. The connection they make is to earlier work framing a variety of tasks as question answering. [The Natural Language Decathlon](https://md.research.elamur.ai/free/en/papers/mccann-2018-natural-language-decathlon-multitask-learning/).

### What the ablations show

#### Fixed ingredient names and evolving ingredient states

The static-memory baseline is the paper’s main controlled comparison for the memory design. All the BiDAF-derived systems can attend to the relationship between the recipe and visual questions. The static version adds an ingredient branch whose initial vectors stay fixed as the procedure is read. PRN supplies ingredient representations shaped by the succession of recipe steps. In separate training, the dynamic version scores above the static version on every visual task. The static variant also falls below adapted BiDAF on each of those tasks. Together these results suggest that the ingredient branch helps in that setting when its contents reflect what happened in the recipe.

The shared-training comparison qualifies that interpretation. Fixed ingredient representations are competitive with PRN and lead the all-task aggregate. A fixed representation still carries information about ingredient identity, which can be relevant to the images and the candidate answer even when the memory does not encode the sequence of changes. In this regime, inclusion of ingredient information is associated with an aggregate gain over adapted BiDAF, while the result gives little basis for preferring the dynamic variant overall. The controlled comparison thus identifies a benefit that depends on the way the tasks are trained.

The static comparison changes more than the use of attention between memory entries. The static entries use GloVe vectors, whereas PRN describes initialization using character and word information and performs recurrent updates. A separate comparison holding initialization fixed and giving each ingredient an independent recurrent update would be needed to isolate the contribution of interaction among slots. The reported comparison tests the dynamic relational memory as an architectural package against the fixed alternative. It supports that package most clearly in the separate-task setting.

The plain BiDAF and image-only comparisons answer different questions. The former shows what happens when the comprehension architecture has one less route for representing ingredients. The latter shows how useful appearances can be even without reading the recipe. Visual coherence is the clearest case where task success and reliance on the text come apart. That baseline makes a strong result on coherence less informative about the amount of procedural knowledge the system had to use for any given item. The comparison between fixed and updated ingredient memories still tells us about those architectures under the same supervised question format.

#### Watching the memory receive an instruction

The authors visualize attention inside the recurrent memory over the steps of a sample recipe. Each display includes the weights between ingredient slots and the weights assigned to the current step. The darker entries indicate higher attention weights. The display lets the reader see which parts of the memory and the instruction can contribute when the ingredients are updated, and how that pattern changes as the recipe continues.

In the example, the attention maps change relatively little after the third step. The paper describes the remaining instructions in that recipe as mostly repeating information about the completed preparation. This gives a plausible reading of the visualization. The pattern of memory interactions evolves while the recipe is changing in consequential ways and becomes steadier when the late steps supply less new information. The observation is about the example shown. It illustrates the recurrence at work and supplies a qualitative pattern to examine alongside the accuracy results.

An attention weight identifies a route by which information can be combined. Interpreting what traveled along that route is harder. For example, an ingredient can take information from another slot without there being a single verbal label for the relation between them. A stable pattern can also coexist with changes to the values being combined. The authors acknowledge that individual weights are often difficult to interpret. Their visualization is therefore most directly informative about when and where the network attends during an update.

#### Looking for state information in the vectors

A second analysis takes the stored vectors themselves as the object of study. The authors collect ingredient representations from the memory after successive recipe steps for visual cloze. They use t-SNE to project those embeddings from a 200-dimensional space to a 3-dimensional display. A projection places many-dimensional vectors into a space that can be visualized, so that nearby points offer a view of some similarities among the original representations. The paper colors the result by recipe category.

The authors observe clustering by recipe category and more local groups with similar state characteristics. In the parts of the figure they enlarge, chopped and sliced ingredients appear near each other. Stirred and whisked ingredients also appear nearby. This matters because the memory starts with a named ingredient and learns through answer ranking. The pattern suggests that what the vector represents depends in part on the ingredient’s preparation, in addition to the recipe it came from and the name used to initialize it.

The projection provides qualitative evidence of organization. The categories visible in the display can reflect ingredients that recur in similar recipes, descriptions of similar actions, or features that jointly help answer visual cloze questions. The plot lets these relationships be inspected and gives examples compatible with a state-sensitive representation. Quantifying how much state information transfers across different recipe categories would require evaluating that property directly in the original representations.

#### Transferring a change from one ingredient to another

The vector arithmetic analysis asks whether a change can be separated, approximately, from the ingredient on which it was observed. The authors take the vector for an ingredient after a change and subtract its earlier vector. They then add the resulting direction to a vector for a different ingredient. Using cosine distance, they inspect the stored representations nearest to that result. The analysis uses Gensim for the comparisons.

Their chopping example takes a change associated with onions and applies it to the representation of raw tomatoes. Their pouring example takes the change associated with water and applies it to milk. The displayed nearest states are plausible in context. The intended interpretation is that the vector direction associated with a change can, in these examples, carry useful information across ingredient identities. That is a more specific observation than finding several prepared ingredients grouped together in a visualization.

The arithmetic is performed on stored states after training. The network’s own answer procedure applies recurrent memory updates and ranks pictures, while this analysis asks what structure those operations left in the vectors. A successful example means that a simple operation on the vectors can recover plausible states held elsewhere in memory. It gives a concrete reason to treat a memory slot as a representation of an ingredient in context, instead of reading its contents solely as a representation of the ingredient’s name.

Taken together, the analyses address different aspects of the mechanism. The static comparison concerns whether an evolving memory helps answer questions. The attention displays concern how updates can use information from the steps and other participants. The projection and arithmetic concern what can be recovered from the representations after those updates. The question-answering scores are the quantitative evidence. The examples support an interpretation of those scores by showing what kinds of state information the learned space can express.

### Limitations

#### Limits the authors identify

The authors acknowledge room to improve relative to the human figures in RecipeQA. The reference sample covers 100 questions from the validation set, and its human scores are higher than PRN’s corresponding separate-task results. The human ordering score is closer to the system scores than the human cloze and coherence scores are. The sample provenance matters when using those figures. They provide a useful point of reference for the task formats, while a matched evaluation on the same questions would give a firmer account of the human–system gap.

The paper confines its experiments to the visual tasks. The authors exclude textual cloze because that task can be solved without necessarily using information across modalities. The decision fits their research question and narrows its reach. The findings concern visual multiple-choice questions with written recipes. Whether the architecture helps with purely textual comprehension or with other kinds of sequential visual questions remains a matter for separate evaluation.

The authors also call attention to the difficulty of explaining the memory’s attention weights. Gradual changes in the example late in a recipe are intelligible in light of its remaining instructions. Individual weight assignments are harder to connect to named relations. The vector analyses give further evidence about what the memory stores, but the training procedure itself leaves the representation implicit. Accordingly, the paper’s examples are easier to interpret at the level of recognizable patterns than as explanations of individual answer choices.

Shared training falls short of the gains the authors might have hoped for from using the visual tasks together. They raise differences in task difficulty as a possible explanation and suggest a curriculum as a possible response. The demonstrated evidence concerns the round-robin training procedure they actually ran. Establishing which task interactions matter, or whether a curriculum improves them, would require a scheduling comparison.

#### Limits that follow from the setup

The ingredient inventory starts from the first step and relies on that step’s common use as an ingredient list. The method is well suited to recipes in that format. Its handling of processes that introduce important participants later depends on what the text branch can recover, because the ingredient branch is initialized with its inventory at the beginning. The manual fallback covers cases in which extraction returned nothing. A partially extracted list is a different situation. The paper reports the count of recipes needing manual help, while coverage of partially matched recipes would require its own extraction analysis.

The nature of the supervision also sets a boundary on the result. The architecture receives ingredient identities through the dictionary procedure and, in a few cases, manually supplied identities. It is also trained with correct answers to the questions. The unsupervised aspect is specific to the states of the ingredients within the procedure. To learn whether those states are systematically accurate, an evaluation would need observations of the states at particular steps. The paper instead provides answer accuracy and examples from the learned vector space.

The path taken by the visual information matters to claims about why the approach works. In the architecture, text step vectors and previous memory drive the step-by-step state updates. Images enter the question alignment and answer scoring stages, and visual answers provide the training objective. The memory is therefore learned for visual question answering, while its recipe-by-recipe update is driven by text. A comparison with a suitable text-only training objective would be needed to estimate how much of the structure found in the memory arises from the visual signal specifically.

The architecture offers a plausible way to capture relationships among ingredients, but the accuracy results combine several possible contributions. Encoding a recipe in steps, maintaining ingredient representations, using character information at initialization, and allowing memory entries to interact can all affect what information reaches the scorer. The reported baselines compare useful configurations. Identifying which part of the relational update produces the gains would require keeping more of those ingredients of the architecture fixed while changing that part in isolation.

Multiple-choice accuracy also has a particular scope. A system can use whatever cues distinguish the correct option from the alternatives. In visual coherence, the strength of Hasty Student demonstrates that visual distances already offer a productive route. In ordering, the candidate format asks the system to recognize the correct sequence given a supplied set of alternatives. Generating the sequence independently, explaining why each image belongs where it does, and predicting the effect of changing an instruction would each require a different evaluation. The paper shows that the architecture can help solve the questions as posed.

Finally, both the t-SNE figure and the vector arithmetic are based on illustrative patterns. Similar-looking states in a projection can encourage a hypothesis about the original space. Plausible nearest neighbors after a vector operation can make the hypothesis more concrete. A broader test would have to measure how reliably changes transfer across ingredients and steps, including cases where similar actions produce different consequences. The evidence here is strongest for task performance and for the existence of recognizable state information in some learned representations.

### What came after

Subsequent work building on PRN is undocumented in the paper’s account. The authors close by proposing that the architecture could be applied to other sequential tasks combining pictures and text. The proposal follows from the design’s division of labor. The recurrent memory records changes to participants as instructions arrive, and the attention and scoring stages use that record to judge visual evidence. Applying the design beyond RecipeQA would test how well that division works when participants, procedures, and question formats differ from those in cooking recipes.

## Cite

Cite as Mustafa Sercan Amac, Semih Yagcioglu, Aykut Erdem and Erkut Erdem. 2019. Procedural Reasoning Networks for Understanding Multimodal Procedures. Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/k19-1041](https://doi.org/10.18653/v1/k19-1041)

```bibtex
@inproceedings{amac2019procedural,
  title = {{Procedural Reasoning Networks for Understanding Multimodal Procedures}},
  author = {Mustafa Sercan Amac, Semih Yagcioglu, Aykut Erdem and Erkut Erdem},
  booktitle = {Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)},
  year = {2019},
  doi = {10.18653/v1/k19-1041},
  url = {https://doi.org/10.18653/v1/k19-1041}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
