---
title: "Learning to Order Graph Elements with Application to Multilingual"
description: "This paper shows how to recover sentence order from dependency trees by learning to arrange nearby words before assembling the full sentence."
canonical: "https://research.elamur.ai/free/en/papers/du-2019-learning-order-graph-elements-application/"
---
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/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/du-2019-learning-order-graph-elements-application/)

[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/) / Learning to Order Graph Elements with Application to Multilingual Surface Realization

# Learning to Order Graph Elements with Application to Multilingual Surface Realization

Paper · 2019 · Wenchao Du and Alan W Black

**Authors:** [Wenchao Du](https://md.research.elamur.ai/free/en/authors/wenchao-du/) and [Alan W Black](https://md.research.elamur.ai/free/en/authors/alan-w-black/) · **Year:** 2019 · **Venue:** Proceedings of the 2nd Workshop on Multilingual Surface Realisation (MSR 2019) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**4** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2985389286) · [Proceedings of the 2nd Workshop on Multilingual Surface Realisation (MSR 2019)](https://aclanthology.org/volumes/D19-6/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/D19-6302/)
- [PDF](https://aclanthology.org/D19-6302.pdf)
- [DOI 10.18653/v1/d19-6302](https://doi.org/10.18653/v1/d19-6302)
- [OpenAlex](https://openalex.org/W2985389286)

Citations: OpenAlex, 2026-10-14.

## Summary

A sentence’s grammatical structure can survive the loss of its word order. A dependency tree can still tell you which words modify a noun, which noun is the subject of a verb, and which word is the main verb. The question is whether those relationships give a system a better way to reconstruct the sentence than asking it to choose the next word from all the words that remain. Wenchao Du and Alan W Black study that question in multilingual surface realization, the task of turning an abstract linguistic representation into a sentence. Their starting point is a [Universal Dependencies](https://md.research.elamur.ai/free/en/topics/universal-dependencies/) tree whose words have been shuffled and reduced to their [lemmas](https://md.research.elamur.ai/free/en/concepts/lemma/), the forms used to identify them in a dictionary.

The system uses the tree twice. A graph attention encoder first builds a representation of each word by combining information from nearby words in the tree. A decoder then orders the root together with its immediate children and repeats the operation inside each child’s subtree. At each local step, it chooses among the nodes still available, using both the choices it has already made and the candidates it has yet to place. The resulting local orders determine how the subtrees are assembled into a sentence. A separate character-level component uses contextual representations from BERT and grammatical features such as tense and number to produce the final word forms.

On the English development data, with inflection excluded from scoring, the graph-to-graph system reached a [BLEU score](https://md.research.elamur.ai/free/en/concepts/bleu/) of 83.2 in the main comparison. A version that encoded the tree but decoded across the whole sentence scored 63.6. A version that retained local decoding but allowed every node to attend directly to every other node scored 79.9. These comparisons show that both the scope of attention and the way the ordering decisions are divided up mattered in this experiment. In the final development results, BLEU was 80.0 for English, 81.1 for Spanish, 75.4 for French and 67.1 for Japanese after inflection. Chinese scored 66.5 with the inflection stage omitted. The authors report placing second among 14 teams in the SR’19 shared task, with a large margin over the teams ranked below them.

The smaller search space comes with a structural restriction. The decoder assembles complete subtrees as contiguous spans, so it can produce only projective orders, in which a subtree’s words stay together. The authors report that about 2.5% of the English parses are non-projective. They suggest that this restriction, together with the smaller size of the Chinese dataset, may help explain the weaker Chinese result. The experiments establish the practical value of local tree ordering for the shallow realization task and motivate the broader idea of using a graph to organize the ordering decisions themselves.

## Deep dive: Learning to Order Graph Elements with Application to Multilingual Surface Realization

This paper shows how to recover sentence order from dependency trees by learning to arrange nearby words before assembling the full sentence. · about 36 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

#### What survives when word order disappears

Surface realization is a [text generation](https://md.research.elamur.ai/free/en/topics/text-generation/) problem. The system starts with a representation of a sentence and has to produce something a reader could recognize as the sentence itself. In the shared task studied here, that representation comes from an annotated sentence. The words are shuffled, and each word is supplied in its lemma form. Its grammatical relationships survive in the dependency tree. As a consequence, the work of realization starts with substantial information about what belongs in the sentence and how its words are related.

A dependency tree is a way of organizing grammatical relationships around words. An edge connects a dependent to the word that governs it, and the edge has a label for the kind of relation involved. The root is the node at the top of this structure. The children of a node are its immediate dependents. A subtree consists of a node and all its descendants, including dependents reached through intermediate nodes. In [dependency parsing](https://md.research.elamur.ai/free/en/topics/dependency-parsing/), this structure is typically something to recover from a sentence. The shared task supplies it and asks the realization system to recover the sequence.

Knowing that a word depends on another word answers a different question from knowing where it appears. A dependent can belong to a particular governor without coming immediately before or after it. Other dependents of that governor may also have to appear nearby. Some of those dependents head groups of their own. An ordering system therefore has choices to make about which elements precede the governor, which follow it, and how the elements on either side are arranged. A tree can make these decisions easier to organize even when the tree itself supplies no complete linear order.

The task also requires [morphology](https://md.research.elamur.ai/free/en/topics/morphology/), the aspect of word structure involved here in producing the appropriate inflected form. A verb’s lemma, for example, identifies the verb while leaving open which form should appear in context. The grammatical features available to the system can constrain that choice. Ordering and inflection are separate operations in the paper’s system, although the inflection component sees the result of ordering and can use it as context. This distinction also matters for evaluation because the authors score both the sequence of lemmas and, where they perform inflection, the sequence of realized forms.

#### What the shallow task supplies

The Multilingual Surface Realization challenge makes the reconstruction problem concrete through data derived from Universal Dependencies [treebanks](https://md.research.elamur.ai/free/en/topics/treebanks/). The annotations are intended to provide a consistent way to describe grammatical relations across languages. This gives the authors a common input format for multilingual experiments even though the languages can differ in how they order and inflect words. The ordering method can operate on the same kind of tree across the datasets because each graph supplies nodes and grammatical connections.

The challenge distinguishes a shallow track from a deep track. In the shallow track, the nodes needed for the sentence are already present. The system has to arrange them and supply their surface forms. In the deep track, the preparation procedure also removes function words that are leaves of the tree. A leaf has no children. Recovering a missing function word requires the system to introduce a node that is absent from the input. That additional operation makes the deep task partly a problem of completing a graph.

The paper studies the shallow setting. Its ordering procedure selects from the supplied nodes, then removes each selected node from the available candidates for that local decision. This matches the shallow input particularly well because a valid arrangement should use the existing elements. It also explains why the authors describe graph completion as a separate direction. In the deep setting, a permutation of the visible nodes can arrange everything the system has received while still leaving the sentence incomplete.

#### Why sorting calls for context

The authors begin with a broader problem than sentence generation. To order items by a known criterion, it can be enough to compare items locally and apply a sorting procedure. Learning an order becomes harder when there is no reliable comparison rule that can be applied to an isolated pair. The ranking approach discussed in the paper learns pairwise preferences and seeks an ordering that agrees with them. The difficulty for sentences is that a preference between words can depend on the other elements present. The words’ relationships to other parts of the sentence can matter to the decision.

A learner that generates an order sequentially has a way to use that context. Each decision can depend on what the system has already placed. The sequence-to-sequence framework discussed by the authors uses an encoder to represent the input and a decoder to predict outputs over successive steps. The decoder’s history makes its predictions autoregressive, meaning that later choices are conditioned on earlier ones. This provides a natural mechanism for expressing preferences that change as an ordering takes shape. [Sequence to Sequence Learning with Neural Networks](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/)

A sorting task also changes what counts as an output. A conventional sequence decoder can assign probabilities to items in a fixed output vocabulary. The required outputs in sorting are the elements of the current input, and that collection can vary in size. The pointer approach described in the paper addresses this by assigning probability to positions or indices associated with the elements themselves. A decision identifies which element to use next. If an input contains separate nodes with the same lemma, the decoder can still choose them as separate elements because the choices refer to nodes. [Pointer Networks](https://md.research.elamur.ai/free/en/papers/vinyals-2015-pointer-networks/)

An earlier set-to-sequence approach discussed by the authors uses repeated attention over an entire input set to obtain a representation of the collection. Treating the input as a set is useful when the order in which the items arrive is arbitrary. It avoids asking the learner to extract meaning from a sequence that may have no meaningful order. The dependency input has that same need for order independence, together with an extra source of information. Which nodes are connected is meaningful even when the sequence in which they are presented is arbitrary. The question is how to retain that information in the representation and in the decisions that construct the output. [Order Matters: Sequence to sequence for sets](https://md.research.elamur.ai/free/en/papers/vinyals-2015-order-matters-sequence-sequence-sets/)

#### What earlier work did with graphs and trees

The graph literature described in the paper offers a way to represent each node through its neighborhood. The basic operation is to update a node using information from itself and the nodes alongside it in the graph. Repeating the operation allows information to travel farther. A node that has received an update from a neighbor can, in the next update, receive information that the neighbor acquired from elsewhere. The paper relates this approach to previous graph classification and generation work and to methods that transform graphs and sequences into one another. [Semi-Supervised Classification with Graph Convolutional Networks](https://md.research.elamur.ai/free/en/papers/kipf-2016-semi-supervised-classification-graph-convolutional/)

A graph encoder can be paired with a sequence decoder. There is a direct reason for doing so in surface realization: the input is a graph, and the final output is a sequence. Under this division, the encoder can use the grammatical structure to represent the words, while the decoder predicts the full sentence in successive steps. The paper treats this as a relevant alternative because it retains a structured input representation and leaves the output ordering free to range over the nodes of the whole graph. [Graph-to-Sequence Learning using Gated Graph Neural Networks](https://md.research.elamur.ai/free/en/papers/beck-2018-graph-sequence-learning-gated-graph/)

The authors also place their work alongside structured language generation in translation, dialogue response generation and document summarization. Their account describes systems that serialize trees according to a prescribed traversal and then generate tree nodes autoregressively. A depth-first traversal proceeds down a branch before moving on to another branch. A breadth-first traversal visits nodes by level. Either can determine an order for visiting nodes during computation. In surface realization the desired left-to-right arrangement is itself unknown, so a traversal must leave room for the system to decide how the branches are ordered. [Towards String-To-Tree Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/aharoni-2017-string-tree-neural-machine-translation/)

Du and Black keep the hierarchy active during decoding. The decoder arranges a head and its children, then uses that predicted arrangement to decide in which order to visit the child subtrees. Each visit opens another local ordering problem. The ordering of the whole sentence is thus composed from decisions about parts of the tree. The claim that graph structure can help becomes testable at two distinct points: whether restricting what each node attends to improves its representation and whether restricting where the decoder makes its choices improves the resulting sequence.

### The method, step by step

#### From the input tree to a sentence

The input gives the system a collection of nodes, grammatical links between them, and attributes attached to each node. A node’s attributes start its representation. The encoder then updates that representation with information from adjacent nodes. After several updates, a node can carry information from beyond its immediate neighbors, even though each update operates locally. The decoder can therefore use a representation that reflects more of the sentence than the small group it is currently arranging.

Decoding begins at the root. The root is a candidate for placement alongside its children, so the system can learn where the head itself belongs among the groups it governs. Each child first stands for its entire subtree. When the decoder visits that child, it decides how to arrange the child’s own word and its dependents. The sentence emerges when those subtree orders have been expanded and joined. At that point the words are still lemmas. The inflection component uses the ordered sentence as context and predicts the character sequence of each required form.

From a shuffled dependency tree to a sentence The steps in order.

It helps to distinguish the two groups of neighbors used at different stages. In the encoder, a node can attend to itself, its children and, in the version favored by the authors, its parent. In a decoder call, the candidates are the head of the current subtree and its immediate children. The parent of that head belongs to a higher-level ordering decision. Information from the parent can therefore reach the representation used in the current call without giving the decoder permission to move that parent into the current subtree.

#### Defining the ordering and representing a node

The paper writes the general problem as ordering the vertices of a graph. A vertex is a node, and an edge is a connection between nodes. The notation for the input graph is:

```
G = (V, E)
```

Here `G` is the input graph, `V` is the set of vertices, and `E` is the set of edges. For surface realization, the vertices represent the supplied token instances and the edges represent their dependencies. The same formal starting point allows an ordering problem to be described without specifying that the vertices are words.

```
π: V → {n ∈ ℕ | 1 ≤ n ≤ |V|}
```

The symbol `π` denotes the ordering function, which assigns a position to each vertex in `V`. The symbol `n` is an integer position and `ℕ` is the set of natural numbers. The vertical bar inside the braces means that the condition to its right determines which numbers are included. The expression `|V|` is the number of vertices. For a complete ordering, each vertex gets a distinct position and every available position is filled. The decoder’s candidate mask enforces the distinct-choice part of that requirement as it goes.

Before the network can aggregate information, it needs to turn each node’s discrete attributes into vectors. The paper uses lexical information, [part-of-speech tags](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/), dependency relation types, depth in the tree, and relative position to the parent. A part-of-speech tag identifies a grammatical category. The relation type describes how the node depends on its governor, and depth locates the node in the hierarchy. The authors say that relative positions farther than 2 are grouped into a common category. They list relative position as an input feature while describing the original word order as hidden. The implications of that description matter when interpreting what the system has to infer.

An embedding is a learned vector associated with an attribute value. The initial representation adds the vectors for the values present at a node:

```
gᵢ⁰ = Σₐ E[a(vᵢ)]
```

Here `vᵢ` is the vertex indexed by `i`, and `a` ranges over the attribute types. The expression `a(vᵢ)` gives the value of attribute `a` at that vertex. In this formula, `E[·]` is an embedding lookup, a separate use of the letter `E` from the edge set above. The brackets indicate selection of the vector for the specified value. The symbol `Σₐ` adds these vectors across attributes, and `gᵢ⁰` is the initial vector of vertex `i`, at layer `0`. The paper uses both `h` and `g` for node representations in different parts of its description. Using `g` throughout the encoder keeps the initial vector distinct from the recurrent decoder state below.

This initial vector gives a node lexical and grammatical information before any exchange with its neighbors. The dependency type in that vector describes the node’s relation to its governor. Later attention operations decide how much of the governor’s own representation and the children’s representations to incorporate. The distinction matters because a relation label can identify a grammatical connection even when the vector of the other endpoint has yet to be incorporated. At layer `0`, nodes are represented from their own supplied features.

#### Updating nodes with graph attention

The encoder is based on a Graph Attention Network. The idea is to let each node learn how strongly to draw on different neighbors when it is updated. The neighbors supply different information, and their relevance can vary with the node being updated. An attention score expresses that relevance for the current layer. Normalizing the scores produces weights that the encoder uses to combine the neighbors’ vectors. [Graph Attention Networks](https://md.research.elamur.ai/free/en/papers/veli-vckovic-2017-graph-attention-networks/)

The aggregation includes a self-connection, so the node’s own vector participates in the same operation as the vectors of other eligible neighbors. The authors also favor using the dependency connections in both directions for attention. A parent can receive information from a child, and a child can receive information from its parent. The tree still has a root and a parent–child organization for decoding. The encoder’s choice about the directions in which information flows serves a different purpose from the decoder’s choice about which nodes to visit.

For the formulas, let `N(i)` denote the neighborhood eligible for attention at node `i`, including `i` itself. The paper uses scaled dot products for the score, with multiple attention heads. A head is a separate calculation that learns its own projection and produces its own set of weights. The head index is shown explicitly here:

```
eᵢⱼˡᵏ = ⟨Wˡᵏgᵢˡ⁻¹, Wˡᵏgⱼˡ⁻¹⟩ / √d
```

The indices `i` and `j` identify the node being updated and the eligible neighbor. The index `l` identifies the layer and `k` identifies the head. The vectors `gᵢˡ⁻¹` and `gⱼˡ⁻¹` come from the preceding layer, indexed by `l − 1`. The matrix `Wˡᵏ` learned for this layer and head projects each vector into the space used for comparison. The angle brackets denote the dot product, which returns a scalar. The divisor `√d` is the square root of the dimension used for the scaled comparison. The result `eᵢⱼˡᵏ` is the score of neighbor `j` when updating `i` in that head.

```
αᵢⱼˡᵏ = exp(eᵢⱼˡᵏ) / Σᵣ∈N(i) exp(eᵢᵣˡᵏ)
```

The value `αᵢⱼˡᵏ` is the normalized attention weight for the same nodes, layer and head. The function `exp` exponentiates each score. The sum in the denominator runs over `r`, every candidate neighbor in `N(i)`, and `eᵢᵣˡᵏ` is the corresponding score for `r`. This normalization is a softmax. It turns the scores for the eligible neighbors of `i` into weights whose total is one. The weight assigned to `j` thus depends on how its score compares with the other scores for this same update.

```
gᵢˡᵏ = Σⱼ∈N(i) αᵢⱼˡᵏ gⱼˡ⁻¹
```

The vector `gᵢˡᵏ` is the result of aggregation for node `i` in layer `l` and head `k`. Each term is the previous-layer vector `gⱼˡ⁻¹` of a neighbor `j`, multiplied by its weight `αᵢⱼˡᵏ`. The sum covers all neighbors in `N(i)`. A separate aggregation is performed for each head. Since the operation is a weighted sum over neighbors, changing the enumeration of those neighbors leaves the result for the corresponding node unchanged when its features and graph connections are held fixed.

```
gᵢˡ′ = Concatₖ(gᵢˡᵏ)
```

Here `gᵢˡ′` is the intermediate representation of node `i` at layer `l`. `Concatₖ` joins the head outputs `gᵢˡᵏ` along their vector dimensions, with `k` ranging over the heads. Joining the outputs preserves the separately computed contributions so that the next operation can act on them together. The paper relates its use of multiple heads to the Transformer. [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/)

```
gᵢˡ = gᵢˡ′ + FFNˡ(gᵢˡ′)
```

The symbol `FFNˡ` denotes the feed-forward transformation for layer `l`. It takes the intermediate vector `gᵢˡ′` as input. The output is added to that intermediate vector to obtain `gᵢˡ`, the node representation passed onward. The direct addition is a residual connection. It gives the layer an explicit path for retaining the intermediate information while learning a transformation of it.

Another attention layer can propagate information farther through the graph. The previous layer has already incorporated information from adjacent nodes into their representations. When those nodes contribute again, some of the information they collected can travel with them. The authors use representations from across the stack in the final node vector:

```
gᵢ = Σₗ gᵢˡ
```

Here `gᵢ` is the final vector for node `i`, `gᵢˡ` is its representation at layer `l`, and the sum ranges over the layer representations. The vector gives the decoder access to contributions from different stages of aggregation. The authors also tried concatenating the layer outputs and applying a linear transformation. They found that this alternative offered no improvement over addition.

#### How the decoder points to the next node

The decoder uses a recurrent neural network to represent the local ordering history. A recurrent state is updated as the network processes a sequence, so at each step it can encode information from the preceding choices. At the start of a local ordering call, the decoder receives a state from the tree procedure. It uses its current state to score available input elements, selects an element, and proceeds with the remaining ones. This operation is related to the published Pointer Network, whose attention score takes the following form:

```
uᵢₜ = vᵀ tanh(W₁eᵢ + W₂hₜ)
```

Here `uᵢₜ` scores element `i` at decoding step `t`, `eᵢ` is the representation of that element, and `hₜ` is the recurrent decoder’s state for the choice. The learned matrices `W₁` and `W₂` transform the two vectors into a common space. The function `tanh` applies a nonlinear transformation to their sum, and `vᵀ` is the transpose of a learned vector used to turn the result into a scalar. The score determines how much probability the pointer assigns to that element after normalization.

```
P(i | p<t) = softmaxᵢ(uᵢₜ)
```

Here `P(i | p<t)` is the probability of choosing node index `i` given the choices `p<t` made before step `t`. The vertical bar denotes conditioning. The notation `softmaxᵢ` means the share assigned to `i` when the scores `uᵢₜ` are normalized across the eligible alternatives. The index `i` identifies an input element, which is why the set of possible choices can change with the input and with the step.

Du and Black replace the original score calculation with a dot product involving the decoder state and add a term based on the candidates that remain:

```
uᵢₜ = ⟨gᵢ, W₁hₜ⟩ + Σⱼ∈Cₜ ⟨gᵢ, gⱼ⟩
```

Here `uᵢₜ` is the score of a candidate node `i` at step `t`. Its final graph representation is `gᵢ`, and the learned matrix `W₁` projects the decoder state `hₜ` for comparison with that representation. The dot product in the first term relates the candidate to the state built from the ordering history. The second term sums dot products between `gᵢ` and `gⱼ`, the representations of nodes `j` belonging to the current candidate set `Cₜ`. The sum gives the remaining group a direct influence on each score.

```
Cₜ = {j in the current local set | j ∉ {pₛ : s < t}}
```

Here `Cₜ` is the candidate set at step `t`. The index `j` ranges over nodes in the current local ordering call. The notation `∉` indicates that `j` is excluded if it belongs to the collection of earlier choices. In that collection, `pₛ` is the index chosen at step `s`, and `s < t` selects the preceding steps. As the decoder advances, its recurrent state changes and the sum over candidates changes with it. These are complementary sources of information about the same partial order. The state summarizes the history, and the candidate term explicitly represents which nodes are still in play.

The candidate term and candidate masking serve different functions. The term in the score lets the identities and representations of unselected nodes influence the relative preference among them. Masking gives already selected nodes zero probability, so they cannot be chosen again in the same call. Masking by itself would make an unavailable element impossible to select. Adding the candidate term also enables the presence of that element, before it is selected, to affect how the other alternatives are scored. The authors report an improvement from the modification involving the remaining candidates.

The training objective is the likelihood of the correct index choices. A reference word order determines the intended choices in each local ordering problem. The learner is rewarded for giving those choices high probability as it assigns probabilities over available candidates. The supervision is consequently about which node belongs next in the local arrangement. It does not depend on whether the node’s final spelling has already been produced. That task belongs to the inflection component, whose supervision is defined separately.

#### Making local orders into a sentence

The tree procedure starts with the root. In its ordering call, the root itself appears as a bare word alongside its children. The bare root stands for the word at that node, and each child stands for the subtree it heads. This arrangement lets the same pointer decide among the head and the branches. Choosing a child at this stage determines the position of its group relative to the head and the other child groups. It leaves the ordering inside that group to a later call.

The sorting operation takes the local set and an initial recurrent state as inputs. It returns an ordered list and the recurrent state at the end of the call. The recursion visits child subtrees from left to right in their predicted order, using the state returned by the local sort as described in the procedure. A leaf terminates the recursion because its subtree contains only the node itself. For a head that has children, the procedure can repeat the same operation at a smaller scale. The terminal state of the parent’s ordering gives the recursive call information about the context of that local problem.

The paper illustrates the visits with a sentence centered on *like*, with a group headed by *dogs* and another headed by *eating*. In the example, decisions about the words accompanying *dogs* belong to the subtree visit for that group. Their individual positions need not be decided while *like* and its immediate children are being arranged. Likewise, the word *sausages* can be placed inside the group headed by *eating*. The example shows how an early decision can place an entire phrase before the order of its words is worked out.

After these local lists have been recorded, the linearization procedure expands them into text. At a leaf it returns that node’s word. At a higher node it goes through the locally sorted list, expanding each subtree it encounters and joining the resulting strings with spaces. The bare copy of the head contributes the head word once. Since the output from each recursive call is inserted as a unit, all the words belonging to a subtree occupy a contiguous span in the result. That is the operation that imposes projectivity.

The authors use the example to compare the possible orders under whole-sentence decoding and under tree decoding. In their general account, unrestricted ordering has a factorial-sized hypothesis space:

```
|V|!
```

Here `|V|` is the number of vertices in the sentence graph, and `!` denotes the factorial operation. This expression counts the permutations of those vertices when the ordering can range over the whole input. It measures the number of possible complete arrangements, irrespective of how a decoder searches for one.

```
7! = 5040
```

In this example, `7` is the number of elements in the illustrated sentence, `!` again denotes factorial, and `5040` is the number of unrestricted permutations the authors report. A whole-sentence pointer may make choices incrementally, but the absence of local subtree constraints leaves those permutations in its hypothesis space.

```
(3!)³ = 216
```

Here `3!` is the number of possible orders for each local group of `3` elements in the example, and the superscript `³` represents the `3` local orderings whose possibilities are combined. The paper gives `216` as the resulting number of arrangements under its tree procedure. In general, the local list contains the head and its immediate children. The important quantity for each local call is therefore the size of that list. These counts compare possible orders. They give no timing measurement and do not imply that either decoder enumerates all orders at inference.

#### Recovering the final word forms

The output of tree linearization is an ordered sequence of lemmas. To turn those lemmas into the required [word forms](https://md.research.elamur.ai/free/en/concepts/word-form/), the authors obtain a contextual BERT embedding for each word in the ordered sentence. A contextual embedding represents the word in relation to the sequence in which it appears. So the information passed into the inflection stage depends on which order the first stage has produced.

The inflection component uses an attention-based, character-level sequence-to-sequence network. The source sequence is the characters of a lemma and the target sequence is the characters of the corresponding realization. Predicting characters allows the system to construct the form of a supplied word. The BERT vector helps initialize the decoder for that word. During character prediction, the decoder state is concatenated with embeddings of grammatical information such as tense and number. Thus the source spelling, the sentence context and the supplied grammatical features can all contribute to the output.

This division produces two legitimate scoring conditions. The ordering procedure can be assessed by comparing its lemma output with a lemmatized reference. The full pipeline can be assessed by comparing the realized sentence with the surface reference. The first condition is especially useful for evaluating graph attention and tree decoding because those experiments are about the arrangement of nodes. The second asks how the pipeline performs when a reference match depends on choosing forms as well as positions. The paper’s multilingual results use both views where inflection was performed.

### Experiments and results

#### Data, settings and scoring conditions

The experiments use the shallow track of SR’19. The challenge receives its underlying annotations from Universal Dependencies treebanks. The preparation shuffles words and hides their original order, while keeping the tree that relates them. The paper reports final development results for English, Chinese, Spanish, French and Japanese. Its detailed comparisons of encoder and decoder variants focus on English development data. The treebanks give the experiments a shared representation across languages, while the individual language datasets remain separate evaluation conditions. [CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies](https://md.research.elamur.ai/free/en/papers/zeman-2018-conll-2018-shared-task-multilingual/)

The authors implemented their system in PyTorch and identify the accompanying code as `wenchaodudu/MSR`. Each graph attention layer outputs a representation of size 512. The feed-forward networks have intermediate layers of dimension 1024, and the recurrent decoders have a hidden size of 512. The dropout rate is 0.5. Dropout is a training operation that suppresses part of the network’s activity during an update. The authors use Adam with a learning rate of 0.001 and omit learning-rate warm-up after finding little improvement from it. Warm-up would gradually bring the learning rate up at the start of training.

The paper evaluates word sequences with BLEU, NIST and DIST. BLEU looks at overlap between sequences of adjacent words, known as [n-grams](https://md.research.elamur.ai/free/en/concepts/n-gram/), in the output and reference. It rewards matching stretches of text, so a system can lose credit when it places a word incorrectly even if it includes all the required words. NIST also uses n-gram overlap and gives more weight to less frequent n-grams. It offers a different emphasis within the same general comparison of output and reference.

DIST is based on word-level edit distance, for which a word insertion, deletion or substitution counts as an edit. Movement of a word is reflected through the edits needed to match the reference. The paper describes the underlying edit operations and reports DIST as an evaluation score alongside BLEU and NIST. Its presentation gives the resulting DIST scores without spelling out the conversion from raw edit counts. In the reported comparisons, the authors treat higher DIST scores as favorable.

For the English architecture comparisons, the reference is lemmatized and the hypotheses are evaluated before inflection. Reading those experiments as tests of the ordering stage makes their conditions clear. A sequence can match the lemma reference even if the inflection component would later produce an incorrect ending. Conversely, an ordering error can affect the final inflection result if it changes the context seen by the character decoder. Evaluating with the original surface strings includes both stages in the result.

#### Comparing the ordering systems

The English development comparison varies how the input is represented or how the output is ordered. The set-to-graph configuration without attention starts with node features and retains the graph-based decoder. Its graph still matters when the decoder decides which group to order. The setup removes the encoder’s exchange of information between nodes. The set-to-graph configuration with global attention also retains local decoding, while its encoder allows every node to attend over the full input. In that case, the dependency edges cease to restrict the attention neighborhood.

The graph-to-sequence configuration retains the graph encoder and decodes the sentence as a single sequence. At each step, the choices can come from the nodes still available in the sentence as a whole. In the graph-to-graph configuration, the tree determines both which nodes can exchange information directly in the encoder and which groups are ordered together in the decoder. The four results therefore compare distinct uses of the same kind of input structure.

Ordering systems on the English shallow-track development set, lemma-only BLEU The system that uses dependency neighborhoods in both stages achieves the highest score.

**The numbers**

| System or setting | BLEU |
| --- | --- |
| Set-to-graph without attention | 76.4 |
| Set-to-graph with global attention | 79.9 |
| Graph-to-sequence | 63.6 |
| Graph-to-graph (this paper) | 83.2 |

In that comparison, graph-to-graph also reaches 91.4 DIST and 14.7 NIST on the English lemmatized development references. Global-attention set-to-graph scores 90.6 DIST and 14.5 NIST. The set-to-graph version without attention scores 85.3 DIST and 14.4 NIST. Together with BLEU, these results support the value of information exchange in the encoder and of restricting that exchange to dependency neighborhoods in the configuration tested.

The graph-to-sequence system scores 88.9 DIST and 13.7 NIST. Its relative position therefore depends on the metric. In BLEU and NIST, it falls below the setting that uses no encoder attention but retains tree decoding. In DIST, it is ahead of that setting. Whole-sentence decoding still trails graph-to-graph on every reported measure in this comparison. The metrics illuminate different properties of the output, so the size of the BLEU separation should be read as a result about BLEU under the English lemma-only condition.

The authors also give an English development sweep over encoder depth and head count. The 83.2 BLEU in the architecture comparison coincides with the configuration using 3 layers and 8 heads in that sweep. The final English lemma-only entry is 83.6 BLEU. Those figures come from different reported comparisons. The sweep concerns the choice of encoder settings, while the final multilingual results put lemma-sequence performance alongside the score after inflection.

#### Development results across languages

For the final development results, the authors report scores for the full system where it performs inflection and parenthesized scores for the corresponding condition without inflection. Chinese has a single result per metric because the authors omit inflection for that dataset. The final BLEU scores can therefore be compared as reported outputs, with the Chinese condition kept explicit.

Final development-set BLEU by language in the shallow track Spanish has the highest final score, and the Chinese result comes from a pipeline that omits inflection.

**The numbers**

| System or setting | BLEU |
| --- | --- |
| English, with inflection | 80.0 |
| Chinese, inflection omitted | 66.5 |
| Spanish, with inflection (this paper) | 81.1 |
| French, with inflection | 75.4 |
| Japanese, with inflection | 67.1 |

On the English development set, the lemma-only output scores 83.6 BLEU, 92.1 DIST and 14.7 NIST. With inflection, the corresponding DIST and NIST scores are 87.4 and 14.4. The Spanish development set has lemma-only scores of 83.2 BLEU, 85.2 DIST and 15.4 NIST. With inflection, Spanish scores 84.3 DIST and 15.2 NIST. The authors read the relatively close scores across the two conditions as evidence that inflection was easier for their system on English and Spanish than on the other evaluated languages with inflection.

The French lemma output reaches 85.5 BLEU, 88.6 DIST and 14.8 NIST on development data. The inflected output scores 86.0 DIST and 13.8 NIST, alongside the 75.4 BLEU in the chart. The Japanese lemma output reaches 84.3 BLEU, 72.9 DIST and 12.2 NIST on development data. The inflected output scores 72.5 DIST and 10.8 NIST, alongside 67.1 BLEU. The authors describe Japanese inflection as the hardest in these experiments and French as harder than English and Spanish. The Japanese BLEU scores show a pronounced separation between the two evaluation conditions, while the two Japanese DIST scores remain close.

The Chinese development output scores 63.4 DIST and 12.3 NIST, in addition to its 66.5 BLEU. The authors describe Chinese as their weakest result overall and propose two possible explanations: its dataset is smaller than the others, and it has more non-projective trees. The reported metrics have different language rankings. Japanese, for example, has a lower NIST score than Chinese in the final condition. The general characterization of Chinese therefore needs the distinction between metrics as well as the difference in whether inflection was run.

The paper separately reports the team’s shared-task standing. It placed second out of 14 teams at SR’19, and the authors describe the margin over the teams below them as large. That standing is a competition result. The English comparisons and the multilingual development scores describe specific experimental settings and scoring conditions. Each serves a different purpose: the standing situates the submission among participants, while the development results allow scrutiny of design choices and performance across the reported languages.

### What the ablations show

#### Several rounds of local attention help

The encoder sweep asks how the system changes when information can travel farther through the dependency tree. With `L` denoting the number of attention layers and `H` the number of heads per layer, the zero-layer setting starts from each node’s attributes and performs no graph attention. The remaining settings in the depth comparison keep 8 heads and vary the number of layers. Because the decoder continues to operate on graph neighborhoods, the test measures the contribution of propagation in the encoder within a system that already exploits the tree during decoding.

Graph attention depth on the English shallow-track development set, lemma-only BLEU BLEU rises with the first layers, with comparatively little change among the deeper settings.

**The numbers**

| System or setting | BLEU |
| --- | --- |
| No attention layers | 76.4 |
| 1 layer, 8 heads | 79.9 |
| 2 layers, 8 heads | 82.8 |
| 3 layers, 8 heads | 83.2 |
| 4 layers, 8 heads | 83.5 |
| 5 layers, 8 heads (this paper) | 83.6 |
| 6 layers, 8 heads | 83.3 |

The early rise is consistent with the reason for stacking attention layers. With a single layer, a node can directly incorporate the information in the initial representations of its neighbors. With another layer, those neighbors can pass along information they have already collected. In the English development results, 1 layer with 8 heads reaches 90.6 DIST and 14.5 NIST, up from 85.3 DIST and 14.4 NIST without attention. At 2 layers with 8 heads, DIST reaches 91.5 and NIST reaches 14.7. The graph-to-graph architecture comparison uses the result associated with the 3-layer, 8-head setting, where the three reported metrics are already close to the higher values in the sweep.

The deeper settings show why the authors describe improvements beyond 3 layers as marginal. BLEU stays in a narrow range for the deeper settings with 8 heads, and DIST varies across them. At 5 layers with 8 heads, DIST is 92.1. At 6 layers with the same head count, it is 91.0. Across the settings with 8 heads from 2 layers onward, NIST is reported as 14.7. The evidence supports several rounds of aggregation in this English setting. It gives weaker grounds for choosing among the deeper configurations or for predicting where a different language would reach the same point.

#### The head count depends on the measure

The authors compare 4, 8 and 16 heads while holding depth at 5 layers. All of these results are from the English shallow-track development set before inflection. With 4 heads, the system scores 82.3 BLEU, 91.3 DIST and 14.6 NIST. With 8 heads it scores 83.6 BLEU, 92.1 DIST and 14.7 NIST. With 16 heads it scores 83.9 BLEU, 92.0 DIST and 14.7 NIST.

The authors describe 8 heads as the preferable setting overall. The metric-level results qualify that description: 16 heads gives the highest BLEU in the sweep, 8 heads gives the highest DIST, and the two settings have the same NIST. The comparison favors either of those head counts over 4 in this setup. It also shows why the prose judgment about the best overall setting should be kept separate from a claim about the highest BLEU. There is no single winner across all the measures in the head-count comparison.

Depth and head count change different parts of the encoder. Depth changes how many rounds of neighborhood updates are available. Head count changes how many separately weighted aggregations occur within a round. The depth sweep reveals a clear gain from moving beyond isolated features and very shallow propagation. The head sweep tells a narrower story about the settings tested at a fixed depth. Reading them together preserves the stronger evidence about graph propagation without attributing the result to one particular head count.

#### Local and global access to the input

The two set-to-graph conditions make it possible to distinguish access to other elements from access organized by edges. The no-attention condition computes each node’s initial vector independently. The global-attention condition lets a node draw on the input collection as a whole. Since both conditions retain local decoding, their comparison shows that giving the representation access to other nodes helps even when the attention operation ignores graph locality. This is compatible with the idea that broad sentence context carries relevant information.

Graph-local attention yields a better result than global attention in the reported English comparison. In the local case, the structure supplies an immediate set of eligible nodes for each update, and additional layers can carry information over longer paths. In the global case, a node can draw on the whole input from the start. The results favor the combination of restricted initial access and repeated propagation on the evaluated settings. They do not measure which individual edges or attributes account for the difference. For instance, the comparison changes the neighborhood available to attention as a whole, instead of removing selected kinds of grammatical relationships.

The authors also report that attention in both directions worked better than attention flowing only from children to their parent. With the bidirectional arrangement, a child can incorporate information about the node that governs it as well as the nodes it governs. The paper gives this finding qualitatively. Similarly, adding layer representations worked at least as well as concatenating and projecting them in the reported trial, but the paper does not provide scores for that comparison. These observations explain architecture choices. The English depth sweep provides the more detailed quantitative picture of how graph attention contributed.

#### A structured encoder leaves a choice about decoding

The graph-to-sequence comparison keeps graph-aware representations available and changes the scope of the pointer’s choices. That difference is important to interpreting the result. A graph encoder can tell the whole-sentence decoder a great deal about the relationships among input nodes. It still needs to learn how to construct the full sequence from choices over everything that remains. The tree decoder delegates decisions about the interior of a subtree to a call dedicated to that subtree.

The authors attribute the graph-to-graph advantage to the smaller hypothesis space and to the value of exploiting sentence hierarchy. The experiment changes both together. Restricting the output to arrangements that can be assembled from local tree orders reduces the space of possibilities, while also making the hierarchy an explicit part of the process that predicts the sequence. The comparison establishes that this combined design improves the English development scores in the tested setup. It does not assign a separate share of the improvement to the reduced number of possible orders and to the grammatical information encoded by the local decisions.

The remaining-candidate term in the pointer score is another reported comparison. The authors say that incorporating the candidates still available improved performance. The paper gives no isolated numerical result for that change, and the decoder also switches from the original pointer score to a dot-product calculation. The description supports the authors’ qualitative conclusion about using candidate information. The tables establish the performance of larger configurations, without estimating the individual contribution of each change to the pointer.

The lemma and surface conditions also provide a diagnostic comparison, although they evaluate different outputs against different references. The contrast is especially informative for Japanese BLEU, where strong performance on the lemma sequence accompanies a much lower score on the realized sentence. It identifies the move to form-sensitive evaluation as consequential for that language. The design leaves open how much of the change comes from the character decoder itself, how much from the forms required by the reference, and how much from the ordering context on which inflection depends.

### Limitations

#### Limits identified by the authors

The clearest limit is projectivity. The tree linearizer inserts each subtree as a complete span. For a non-projective target, some words belonging to a subtree would need to be separated by words from outside it. A decoder could place every head and immediate child in a locally plausible relative order and still fail to reproduce the reference because the final assembly cannot interleave their groups. The restriction follows from the form of the output the decoder can represent. Training the same linearizer on more data would leave that restriction in place.

The authors report that about 2.5% of the English parses are non-projective and judge the resulting performance loss to be small in that dataset. They describe a possible alternative that would take the local decisions as ordering constraints and build the full sequence from those constraints. At each step the decoder would consider nodes whose required predecessors had already been chosen. This would give sentence construction a way to place words from different subtrees between one another while observing the predicted constraints. The paper presents this as a possible extension. The development scores come from the subtree assembly procedure.

The authors raise non-projectivity again when discussing Chinese. They hypothesize that a larger presence of non-projective trees and the smaller Chinese dataset help explain the results there. Those factors could have different effects. A larger share of non-projective references can increase the share of cases the decoder cannot reproduce exactly. A smaller dataset can limit the evidence available for learning choices within the permitted orders. The paper reports the two explanations as hypotheses and gives no comparison that varies either factor independently for Chinese.

The scope of graph completion is another limit the authors make explicit. The shallow task provides the nodes to be ordered. The deep task can require absent function words to be supplied. The authors identify joint completion and ordering as future work. They also identify generation that can handle both projective and non-projective trees in an integrated procedure. The two proposals address different missing capabilities: changing which nodes occur in the output and expanding the set of linear arrangements that the system can express.

#### What the experimental setup leaves open

The paper states the ordering problem for a general graph, but its tested decoder uses the organization of a rooted dependency tree. It assumes there is a root from which recursive visits can begin and a child structure that separates the work into subtrees. A graph in which a node belongs to several branches, or in which following edges can return to a node already visited, would require a definition of the local groups and a way to combine their orders. The general problem formulation and the graph encoder make broader applications conceivable. The experiments establish the decoder’s behavior on the particular tree structure the authors exploit.

The multilingual results show that the system was applied to several languages represented in the shared task. They are per-language development results. They give no direct measure of transfer to a language whose data was absent during training, nor do they establish that the same encoder depth or head count is preferable for each language. The detailed architecture sweep is specific to English, where the authors judge the projectivity restriction to affect relatively few parses. A reader can use the multilingual scores to see where the pipeline performed well under the reported conditions, with the individual datasets and the omission of Chinese inflection kept in view.

There is also a question about the information available at the input boundary. The paper describes the input as shuffled and the reference word order as hidden, yet it lists relative position to the parent among the encoder features. It specifies how farther relative positions are grouped but gives too little detail here to establish precisely how the position feature was obtained from the available input. The reported comparisons still show how the systems behaved under the paper’s feature setup. The ambiguity matters when using the paper to answer the more specific question of how much order could be recovered from grammatical relationships alone.

The metrics score closeness to a reference. A sequence with an acceptable alternative word order can receive lower overlap if it differs from the reference used in the experiment. Conversely, an improvement in overlap indicates a better match under the metric without directly measuring how a reader judges the resulting sentence. The edit-based and n-gram measures provide complementary descriptions of agreement, but the paper’s architecture comparisons give no human assessment that could distinguish acceptable alternative orders from grammatically faulty ones. The shared-task placing situates the submission competitively without resolving that distinction for the individual outputs.

The morphology results leave a related attribution problem. The system inflects words after ordering, and the contextual embeddings used for inflection depend on the predicted order. A weak final score can reflect errors in order, errors in word form, or effects of order on the context used to predict the form. Lemma-only scoring removes word-form requirements from the comparison, which makes the ordering component easier to examine. The paper does not report an inflection experiment in which the component receives the reference order and is scored only on its forms. Accordingly, the development contrasts support a difference in difficulty across the evaluated conditions more directly than they measure standalone inflection accuracy.

Finally, the factorial example quantifies representational restrictions on possible orderings. The resulting search space is smaller for the example, and the English comparison favors the local decoder. The paper does not give a measured runtime comparison or break out accuracy by tree shape and sentence length. Such evidence would be needed to establish how the structural restriction affects speed or where it accounts for the largest gains. The available experiment shows that dividing the decisions by dependency neighborhoods helped reconstruct English word order, even with a decoder whose possible outputs are restricted.

### What came after

No subsequent study is documented as directly extending this paper’s method. The authors close with two open directions. One is to integrate graph completion with ordering so that the same procedure can introduce missing function words and decide where their groups belong. The other is to keep the benefits of local ordering decisions while allowing the final sentence to interleave subtrees when the target calls for a non-projective order.

These directions follow from distinct choices in the original system. The pointer selects among supplied nodes, which fits a task where the words to be realized are already present. The recursive linearizer turns the resulting local orders into contiguous spans, which fits projective realizations. A deeper realization procedure would have to coordinate the creation of nodes with their placement. A procedure for non-projective outputs would have to assemble the sentence under a more flexible interpretation of the local decisions. Both remain proposals in the authors’ account.

## Cite

Cite as Wenchao Du and Alan W Black. 2019. Learning to Order Graph Elements with Application to Multilingual Surface Realization. Proceedings of the 2nd Workshop on Multilingual Surface Realisation (MSR 2019).

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

```bibtex
@inproceedings{du2019learning,
  title = {{Learning to Order Graph Elements with Application to Multilingual Surface Realization}},
  author = {Wenchao Du and Alan W Black},
  booktitle = {Proceedings of the 2nd Workshop on Multilingual Surface Realisation (MSR 2019)},
  year = {2019},
  doi = {10.18653/v1/d19-6302},
  url = {https://doi.org/10.18653/v1/d19-6302}
}
```

> 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)
