---
title: "Context-dependent word representation for neural machine"
description: "This paper tests source-sentence masks for word embeddings and typed placeholders for numbers, names and acronyms in neural translation."
canonical: "https://research.elamur.ai/free/en/papers/choi-2017-context-dependent-word-representation-neural/"
---
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/choi-2017-context-dependent-word-representation-neural/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2017](https://md.research.elamur.ai/free/en/papers/2017/) / Context-dependent word representation for neural machine translation

# Context-dependent word representation for neural machine translation

Paper · 2017 · Heeyoul Choi, Kyunghyun Cho and Yoshua Bengio

**Authors:** [Heeyoul Choi](https://md.research.elamur.ai/free/en/authors/heeyoul-choi/), [Kyunghyun Cho](https://md.research.elamur.ai/free/en/authors/kyunghyun-cho/) and [Yoshua Bengio](https://md.research.elamur.ai/free/en/authors/yoshua-bengio/) · **Year:** 2017 · **Venue:** Computer Speech & Language · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**100** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2465346528) · [Cited by **21** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/choi-2017-context-dependent-word-representation-neural/cited-by/) · [Computer Speech & Language](https://openalex.org/S91252481) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1607.00578)
- [DOI 10.1016/j.csl.2017.01.007](https://doi.org/10.1016/j.csl.2017.01.007)
- [arXiv 1607.00578](https://arxiv.org/abs/1607.00578)
- [OpenAlex](https://openalex.org/W2465346528)

Citations: OpenAlex, 2026-10-14.

## Summary

A word can have several plausible translations, and the rest of the sentence often tells us which one fits. A number or a name creates a different problem. Its exact form can matter even when a nearby value or a similarly spelled name would fit the sentence just as well. This paper asks whether neural [machine translation](https://md.research.elamur.ai/free/en/topics/machine-translation/) can handle those demands better by changing how it represents words. The authors start from a common design in which a vocabulary entry has a fixed [word embedding](https://md.research.elamur.ai/free/en/concepts/word-embeddings/), a learned vector that can reflect several kinds of similarity at once. They propose letting the source sentence decide which parts of those vectors should carry the most weight.

The first change is contextualization. The system transforms the source word vectors and averages the results to obtain a sentence summary. From that summary it learns separate masks for source and target embeddings. Each mask scales the coordinates of the vectors it applies to. The source mask acts before the encoder reads the words in order, and the target mask gives the source sentence a direct influence on target word representations. The translation system also retains its ordinary attention mechanism, which can emphasize different source positions as it produces the translation.

The second change is symbolization. The authors use typed, numbered placeholders for certain digit strings, capitalized names and acronyms. A placeholder lets the translation system decide where an item belongs while a rule dictionary helps recover its surface form. The rules come from matching source and target expressions in the training data. The authors compare this procedure with byte pair encoding, a way to represent words as smaller units, and also test the two procedures together.

On the English-to-French test set, the paper reports a gain of 2 [BLEU](https://md.research.elamur.ai/free/en/concepts/bleu/) points for each proposed change on its own and 4 points when both are used. For English-to-German, the authors report gains of 1–2 BLEU points individually and 2.5 points together. Contextualization also improves the systems that use sub-word units. Examples show a French word choice that better preserves the meaning of its English counterpart and German outputs that better preserve particular names and a numerical value. The aggregate scores support the usefulness of the changes in the tested systems. The examples illustrate possible reasons for the gains, while the behavior of individual embedding coordinates remains an open question.

## Deep dive: Context-dependent word representation for neural machine translation

This paper tests source-sentence masks for word embeddings and typed placeholders for numbers, names and acronyms in neural translation. · about 35 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 a fixed word vector asks of the rest of the system

A translator needs to keep track of the identity of a word and make use of what it has learned about other, related words. The starting representation described in the paper handles identity cleanly. Every vocabulary entry has its own index, and that index selects a vector from a learned table. The choice of vector depends on which word occurred. If the word appears in different sentences, the lookup initially returns the same values. The rest of the translation system must turn that common starting point into something appropriate for each occurrence.

Learning the lookup table gives the system a way to share information across words. Representing vocabulary items by their indices alone tells the system which items differ, with no information about how they differ. In a learned continuous space, words can resemble one another to varying degrees. That makes it possible for training on some expressions to help with related expressions, including ones encountered less frequently. The paper traces this motivation through earlier work on distributed representations and a neural [language model](https://md.research.elamur.ai/free/en/concepts/language-model/) that used similarities between words to generalize to rare or unseen [n-grams](https://md.research.elamur.ai/free/en/concepts/n-gram/). It also mentions work that learned representations for use in supervised language tasks. [A Neural Probabilistic Language Model](https://md.research.elamur.ai/free/en/papers/bengio-2003-neural-probabilistic-language-model/) · [Word Representations: A Simple and General Method for Semi-Supervised Learning](https://md.research.elamur.ai/free/en/papers/turian-2010-word-representations-simple-general-method/)

A single location in a continuous space can express several relationships. The paper uses *notebook* to illustrate the point. In one direction through its neighborhood are words for things people write in. In another are words for portable computers. A fixed vector can keep both relationships available. This is desirable when learning a vocabulary, since the spelling alone gives the system no reason to favor one use of the word for every occurrence. The difficulty comes when a particular translation requires the system to give those relationships different weight.

The same issue appears on the target side. When the system chooses a word to continue the translation, several candidates can be related to the meaning it needs. A candidate may carry the general meaning of the source expression while missing a more specific distinction. The decoder already has some evidence for choosing among such candidates. It has a state influenced by the target words produced so far, and its attention mechanism supplies information from the source. The question is whether the source can also help shape the representations of the target words themselves.

The authors connect this question to the older observation, attributed to Weaver, that surrounding words can help resolve ambiguity in translation. In the recurrent architecture they study, an encoder passes information along the source sequence, and a decoder keeps track of the translation as it develops. The authors argue that leaving all such disambiguation to those networks places an extra demand on their states. A state may need to preserve evidence for a lexical choice while also representing how phrases and clauses fit together. Contextualization is their proposal for making some sentence-wide evidence available through a shorter route. The suggestion that this frees recurrent capacity for composition is a motivation for the design.

#### What the encoder and decoder already had available

The paper describes neural translation against the background of phrase-based statistical translation, which works directly with discrete symbols. The neural systems it discusses map the source sequence into continuous representations, use a network to manipulate those representations, and generate discrete symbols on the target side. The authors distinguish earlier encoder–decoder systems that represented the input with a single context vector from systems that produced a sequence of source representations. Both arrangements put the learned source embedding lookup at the beginning of the encoder. [Statistical Phrase-Based Translation](https://md.research.elamur.ai/free/en/papers/koehn-2003-statistical-phrase-based-translation/) · [Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation](https://md.research.elamur.ai/free/en/papers/cho-2014-learning-phrase-representations-rnn-encoder/) · [Sequence to Sequence Learning with Neural Networks](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/)

The attention-based approach gives the decoder access to a representation at each source position. When it prepares to generate a target word, it scores those positions and uses the scores to combine their representations. The relevant part of a sentence can change during generation. A weighted combination that serves a lexical choice early in the translation can give way to a different combination later. The paper describes this approach as widely used by the time of the study. It also notes that research had been improving attention itself and addressing the cost of working with a large target vocabulary. [Neural Machine Translation by Jointly Learning to Align and Translate](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/) · [Effective Approaches to Attention-based Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/luong-2015-effective-approaches-attention-based-neural/)

Attention and contextualization therefore use source evidence at different points. The existing encoder can make each position sensitive to what surrounds it, and the decoder’s attention can retrieve a different mix of those position-specific representations at each step. The proposed mask operates on the embedding coordinates and is available before the encoder has built those representations. Its evidence is the collection of source words. Its value for the encoder would come from priming the recurrent computation with information about the sentence that the encoder has yet to read in order.

This distinction also clarifies what the paper means by a context-dependent representation. A recurrent state in the original architecture already depends on context. The new proposal is to let the input sentence affect the scale of the embedding coordinates directly. The resulting representation of a word occurrence can differ across sentences even though both occurrences start from the same vocabulary entry. The paper studies whether that additional point of intervention matters when attention and recurrence are already available.

#### Why some strings call for a different treatment

A difficulty with infrequent words is that their vectors receive little evidence during training. A vocabulary limit makes the problem more direct. A word outside the retained vocabulary is represented by a shared unknown-word symbol. That symbol permits the system to process a sentence containing an unfamiliar word, but by itself it gives a reader no way to recover the intended word from the output. The same issue arises when several distinct names are reduced to the same marker.

Numbers present a related problem for a different reason. Numerical proximity can make two values seem related, yet a translation reporting a total generally needs the value in the source. The exact string may have to change to fit a convention for punctuation or spacing. The identity of the value still matters. For names, the authors likewise emphasize the need to preserve the entity. A spelling that resembles the source name can still designate the wrong thing or fail to give the reader a recognizable name.

Earlier work had already separated the generation of a placeholder from the recovery of the original word. In the approach the paper attributes to Jean and colleagues, a generated unknown marker is linked to the source position receiving the highest attention weight at that decoding step. A dictionary supplies a translation for the source word, which can then replace the marker. The link to the source is chosen during generation using the attention distribution. [On Using Very Large Target Vocabulary for Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/jean-2015-very-large-target-vocabulary-neural/)

The approach the paper attributes to Luong and colleagues obtains source–target links from an external word aligner during training. The linked items receive numbered unknown markers, so the target can retain a reference to the source item even when translation changes the word order. At test time, the marker identifies an item to look up in a dictionary. The paper extends this positional scheme by giving the markers types. A marker can express that the intended item is a digit string, a proper name or an acronym, as well as identifying which occurrence to recover. [Addressing the Rare Word Problem in Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/luong-2015-addressing-rare-word-problem-neural/)

The two proposals start from different problems with lexical representation. A common word may need several types of similarity during training and a more selective representation in a particular sentence. A rare name may need an exact link to an item in the source despite having little training evidence of its own. Contextualization preserves the continuous representation and adapts it. Symbolization preserves a reference to the item and lets a separate procedure handle its form.

### The method, step by step

#### From the source sentence to the translation

A translation begins with a source sentence split into symbols. In a word-based setting, these are normally tokenized words. In a setting that uses [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/), common pieces of words can also be the units that the network reads and predicts. With symbolization enabled, matched kinds of expressions have been represented in training by typed markers. At generation time, the source undergoes the corresponding preparation, and the output can contain those markers alongside ordinary vocabulary symbols.

Each source symbol has an embedding. The contextualization path takes those embeddings before the ordered encoder has read them. It sends each vector through the same feedforward function and averages the resulting vectors. An affine transformation followed by a sigmoid turns the average into a mask for the source embeddings. Another transformation of the same average produces the target mask. Multiplying by the masks scales the coordinates individually.

The encoder receives the source embeddings with their coordinates scaled. It reads them in source order in both directions. The decoder then attends to the encoder’s position-specific representations as it generates the target sequence. It also has access to target embeddings conditioned on the same source sentence. Where the output contains placeholders, postprocessing uses their type and source index to recover the corresponding expressions. If the system generates sub-word units, those units are joined before placeholder recovery.

Translation with contextualization and symbolization The steps in order.

The sentence average and the encoder’s sequence serve different purposes. Averaging gives every source occurrence the same route into the sentence summary, including occurrences far from the word whose representation is being scaled. The average does lose the order of the words. The encoder receives an ordered sequence and can represent distinctions that require that order. The design combines an inexpensive, order-insensitive signal for adjusting embeddings with the usual ordered processing for building a translation.

#### Representing the source and target

The paper begins its formal account with the conditional distribution that the system is trained to estimate.

```
p(Y = (wʸ₁, wʸ₂, …, wʸₜ′) | X)
```

Here `p` is probability, `X` is the source sentence, and `Y` is a possible translation. The vertical bar means that the probability is conditioned on `X`. The tuple in parentheses gives the target sequence, and `wʸ` denotes a target symbol. The subscripts identify positions, the ellipsis stands for the intervening positions, and the final subscript `ₜ′` represents `T′`, the target length. In the equations below, lower-case `t′` instead denotes the current decoding position. The source sentence has `T` positions, and `wˣₜ` denotes its symbol at position `t`.

The representation of a source word starts with a one-hot vector. In this representation each vocabulary entry has a dedicated coordinate.

```
1(wˣₜ)ⱼ = { 1 if j = wˣₜ, 0 otherwise }
```

The bold-one operation in the paper is written here as `1(·)`. It constructs the one-hot vector for its argument, the source word `wˣₜ` at source position `t`. The subscript `j` selects a coordinate, using the vocabulary indices as coordinate labels. The first `1` on the right means the selected coordinate is active, and `0` is the value at any other coordinate. The braces group the cases. The equality between `j` and `wˣₜ` uses the word’s vocabulary index.

```
xₜ = Eˣ 1(wˣₜ)
```

Here `xₜ` is the embedding of the source occurrence at position `t`. The matrix `Eˣ` contains the source embeddings. Its shape is `E × |V|`, where `E` is the number of coordinates in an embedding and `|V|` is the number of entries in the source vocabulary `V`. Multiplication by `1(wˣₜ)`, the one-hot vector for the current word, selects the matching column of `Eˣ`. In an implementation this is an embedding lookup.

The lookup is useful because the learned vectors can reflect relationships that the one-hot vectors treat uniformly. Geometry enters through the learned table. The proposed change uses that table as a starting point and gives a source occurrence a sentence-dependent scale on each coordinate. The base vector lives in the same vocabulary table in every sentence. The vector passed onward depends on which source words were available when the scales were computed.

#### Computing and applying the masks

The authors build the mask input by applying a nonlinear function separately to every source embedding. They pool the transformed vectors by taking their mean.

```
cˣ = (1/T) ∑ₜ₌₁ᵀ NNΘ(xₜ)
```

Here `cˣ` is the pooled source context, `T` is the source length, and `t` indexes source positions. The sum `∑` includes every position from `1` to `T`, and `1/T` divides that sum by the number of positions. The function `NNΘ` is a feedforward neural network with trainable parameters `Θ`. Its input `xₜ` has embedding dimension `E`, and its output has the dimension of the pooled context. The paper calls that dimension `C` in its description of this function. Earlier it uses upper-case `C` for the tuple of encoder annotations, which is a separate object.

The nonlinearity acts on each embedding before pooling. In particular, the paper's design can learn what to extract from each word for the purpose of making the sentence context. After that transformation, pooling is symmetric in the positions. Permuting the same set of word occurrences leaves the pooled vector unchanged, while repeating a word includes another copy of its transformed vector in the mean. Every word used to build the mask is also among the words to which the source mask can apply.

```
xₜ ← xₜ ⊙ σ(Wₓ cˣ + bₓ)
```

On the right, `xₜ` is the original source embedding at position `t`. The left arrow `←` assigns the contextualized value to that embedding for subsequent processing. The symbol `⊙` means elementwise multiplication. The matrix `Wₓ` transforms the context `cˣ` to source embedding coordinates, `bₓ` is the source bias vector, and `+` adds that bias. The sigmoid `σ` acts coordinate by coordinate and yields values on the scale from `0` to `1`. A factor near `0` suppresses a coordinate, and one near `1` largely preserves it.

```
yₜ ← yₜ ⊙ σ(Wᵧ cˣ + bᵧ)
```

Here `yₜ` denotes a target embedding, with `t` used for its position in this masking equation. The assignment arrow replaces it with its contextualized value. The target parameters are the matrix `Wᵧ` and bias vector `bᵧ`. They act on the same pooled context `cˣ`, and `σ` and `⊙` again apply a coordinatewise sigmoid and coordinatewise multiplication. Separate parameters allow a source sentence to call for a different pattern of attenuation on the two sides.

The authors describe the gating as binary-like because a sigmoid factor can approach either end of its range. The equations use continuous values, so intermediate scales are possible. They also imply that a given sentence produces a common source mask for its source embeddings and a common target mask for its target embeddings. Different words still have different contextualized vectors because the masks act on different entries from the lookup tables. If a coordinate matters little in one word’s base representation, scaling it has little direct effect on that word.

The target mask is computed entirely from the source. It can therefore be formed before a translation has been generated, and it remains available while the target sequence grows. The changing history on the target side enters elsewhere, through the decoder state. A single mask can favor particular aspects of the target vocabulary throughout a sentence while the decoder continues to make different choices at different positions.

#### Building ordered source representations

The encoder processes the embeddings with a forward recurrence and a reverse recurrence. In the baseline the inputs are the ordinary lookups. With contextualization enabled, the encoder uses the updated source embeddings from the masking equation.

```
h⃗ₜ = φ⃗(h⃗ₜ₋₁, xₜ)
```

The right-pointing arrow marks the forward direction. The vector `h⃗ₜ` is the forward hidden state at source position `t`, and `h⃗ₜ₋₁` is the state carried from the previous source position. The function `φ⃗` is the forward recurrent update, and `xₜ` is the embedding for the current position. The initial forward state `h⃗₀` is a vector of zeros.

```
h⃖ₜ = φ⃖(h⃖ₜ₊₁, xₜ)
```

The left-pointing arrow marks the reverse direction. The state `h⃖ₜ` is produced by the reverse update `φ⃖` using the embedding `xₜ` and `h⃖ₜ₊₁`, the state from the source position immediately to the right. The reverse state beyond the final source position, `h⃖ₜ₊₁` with `t` set to the source length `T`, starts as a vector of zeros. The paper describes long short-term memory units and gated recurrent units as choices for the update functions. Its experiments use long short-term memory units.

```
hₜ = [h⃗ₜ ; h⃖ₜ]
```

Here `hₜ` is the encoder annotation at position `t`. The bracketed expression joins the forward state `h⃗ₜ` to the reverse state `h⃖ₜ`. The separator inside the brackets denotes concatenation, so each annotation retains the coordinates of both states.

```
C = (h₁, h₂, …, hₜ)
```

Here `C` is the collection of source annotations in their positional order, `h₁` and `h₂` are the annotations at the opening positions, and the ellipsis indicates the remaining annotations through the final one, `hₜ`, whose subscript here represents the source length `T`. An annotation thus depends on the recurrent reading of the sentence as well as on whatever adjustment the pooled sentence context made to the input embeddings. The decoder can work with these position-specific vectors throughout generation.

#### Selecting source evidence and predicting target words

The decoder estimates a distribution for the next target symbol given what it has already generated and the source it is translating.

```
p(wʸₜ′ | wʸ₍<ₜ′₎, X)
```

The symbol `p` again denotes probability. The expression `wʸₜ′` is the target symbol at decoding position `t′`, and `wʸ₍<ₜ′₎` is the target prefix, where `<` indicates positions strictly earlier than `t′`. The vertical bar introduces the conditioning information, consisting of the prefix and the source sentence `X`.

Attention begins by scoring each encoder annotation against the preceding decoder state.

```
e[t′, t] = f_ATT(zₜ′₋₁, hₜ)
```

The scalar `e[t′, t]` is the relevance score for source position `t` at decoding position `t′`. The function `f_ATT` is the feedforward attention scorer. Its inputs are `zₜ′₋₁`, the previous decoder state, and `hₜ`, the annotation of the source position it is scoring. Brackets distinguish the two indices of the score.

```
α[t′, t] = exp(e[t′, t]) / ∑ₖ₌₁ᵀ exp(e[t′, k])
```

Here `α[t′, t]` is the normalized attention weight on source position `t`. The exponential `exp` turns the relevance score `e[t′, t]` into a positive quantity. The denominator sums the exponentials of `e[t′, k]` as the source index `k` runs from `1` through the source length `T`. Dividing by the sum makes the weights across the source positions add to `1` for the current decoding step.

```
cₜ′ = ∑ₜ₌₁ᵀ α[t′, t] hₜ
```

The vector `cₜ′` is the attention context for current target position `t′`. The sum goes over source positions `t` from `1` to `T`. At each position, the scalar weight `α[t′, t]` multiplies the encoder annotation `hₜ`. This context can change from one target step to the next because its weights depend on the decoder state. The earlier vector `cˣ` is computed once from the source embeddings and used for the masks.

The earlier rare-word method discussed in the paper takes the strongest of these attention weights to select an alignment for an unknown word.

```
argmaxₜ α[t′, t]
```

Here `argmaxₜ` returns a source position `t` that maximizes the weight `α[t′, t]` for the target position `t′`. The returned position can identify the source word for a dictionary lookup. This expression describes the earlier attention-based replacement method. In the paper’s positional symbolization, the generated marker itself supplies the source-side reference.

The recurrent decoder combines the current attention context with the previous target symbol’s vector.

```
yₜ′₋₁ = Eʸ 1(wʸₜ′₋₁)
```

Here `wʸₜ′₋₁` is the target symbol at the preceding position `t′−1`, and `1(·)` forms its one-hot vector in the target vocabulary. The target embedding table is `Eʸ`. In the lookup notation, multiplication selects the vector for that symbol, giving `yₜ′₋₁`. The target mask in the contextualized system adjusts the target embedding using the source context.

```
zₜ′ = φ_z(zₜ′₋₁, yₜ′₋₁, cₜ′)
```

Here `zₜ′` is the updated decoder hidden state for position `t′`, and `φ_z` is the decoder’s recurrent update function. Its inputs are `zₜ′₋₁`, the previous state, `yₜ′₋₁`, the vector for the previous target word, and `cₜ′`, the current weighted source context. The general description allows the same kinds of recurrent units as in the encoder. The experimental configuration uses long short-term memory units.

```
p(wʸₜ′ = i | wʸ₍<ₜ′₎, X) ∝ exp(Eʸᵢ zₜ′ + cᵢ)
```

This expression gives the relative probability that the current target symbol `wʸₜ′` is vocabulary entry `i`, conditional on the earlier target symbols `wʸ₍<ₜ′₎` and source `X`. The candidate index `i` ranges over the target vocabulary, which the paper denotes by `V′`. The notation `Eʸᵢ` in this equation is the output row vector for candidate `i`. Its product with `zₜ′` is the candidate’s score from the current decoder state, and `cᵢ` is its scalar bias. The exponential gives a positive score, and the proportionality sign `∝` indicates that the scores must be normalized across target candidates to obtain probabilities.

The paper uses `Eʸ` in both the target lookup expression and the output scoring notation. The former treats an embedding as the vector retrieved for a previous symbol. The latter writes the vector for a candidate as a row for scoring the decoder state. The centralized description of the proposed change gives a target mask at the embedding level and presents contextualization as applying to the source and target sides. The displayed probability equation is the description of ordinary output scoring. The paper gives the mask equation separately.

During generation, a candidate word changes the target prefix and thus the state from which later candidates are scored. Generation proceeds until the end-of-sequence symbol. In the reported evaluation, the system uses beam search, which retains several competing partial translations as it extends them. This procedure approximates the search for the translation with highest probability under the system.

#### Preparing placeholders and restoring expressions

Symbolization starts with parallel sentences, where both the source and its translation are available. The authors look for eligible pairs of expressions and replace paired items with the same typed marker. The marker’s index follows the item’s position among occurrences on the source side. Its target position can differ. This is what lets the target sequence refer back to the source item even after reordering.

For digit strings, the rules identify consecutive digits and separate material such as a unit attached directly to them. The paper uses `137Kg` to illustrate the boundary between the digits and the letters. This allows the number and the unit to be handled as separate pieces. Matching also accounts for differences in decimal marks and digit grouping. The system can thereby identify two written forms as corresponding even when their punctuation or spaces differ. The paper illustrates a special spacing indicator for pieces that should be joined again without an intervening blank when the output is restored.

For proper names, the rules use capitalization. A candidate is a maximal run involving more than one capitalized word, and the phrase must correspond across the source and target for the training replacement. Some lower-case function words are ignored for the purpose of spotting the phrase, so a name structured like *World of Warcraft* can be recognized as a unit. The method is designed to exploit orthographic cues in the European languages under study. Within that setting a multiword name can be represented by one typed marker, allowing the decoder to place the phrase as a whole.

Acronyms are matched in passes. The procedure first replaces acronym pairs that already match. If exactly one all-capital word remains on each side, it treats those two as corresponding. This gives it a way to learn substitutions such as English *IMF* and French *FMI*, where the acronym changes with the language. The restriction on leftovers matters. If several upper-case candidates remained on both sides, the fact that they are upper-case alone would offer little evidence about how to pair them.

For the matched items, the authors build a rule dictionary linking the source form and its target counterpart. At test time a generated marker refers back to a source item, and the dictionary supports restoring the corresponding target expression. A rule can preserve the original form or give an appropriate transformed form. The authors use rules obtained from the parallel data in their experiments. They mention the possibility of supplementing the dictionary with external rules and leave that option outside the evaluation.

This changes what the network has to learn about an eligible expression. Several different names, for instance, can give training evidence about when a proper-name marker should appear in the output. The index lets the marker distinguish the intended occurrence within a given sentence. The dictionary then handles surface information that would otherwise be distributed among many sparsely observed word forms. The translation still depends on the network predicting a suitable marker in the right place and on the restoration procedure recovering the intended item.

#### Learning the translation and applying the same preparation at test time

The translation network is trained on parallel sentences to assign high conditional log-probability to the reference translations. Gradients are computed by back-propagation. The same training objective tunes the translation network, its embeddings and the parameters used to compute the masks. The paper does not give the masks labeled word senses to reproduce. The evidence that guides their learning is whether the reference target sequence receives higher probability.

Symbolization enters this training procedure as a change to the sequences. It is applied after initial tokenization. In configurations that use both symbolization and byte pair encoding, the sub-word segmentation is applied to the corpus after the symbolization step. The corresponding output operations reverse that order. Sub-word pieces are rejoined before the special symbols are restored. This allows a system to learn ordinary sub-word representations and use explicit source references in the same translation.

The core attention and recurrent updates are shared across the experimental settings. The authors change which symbol sequences reach that architecture and whether the embedding masks are used. The result is a comparison of interventions at the input, output and embedding levels within a common translation setup.

### Experiments and results

#### The corpora and the scoring procedure

The authors test English-to-French, abbreviated En-Fr, and English-to-German, abbreviated En-De. The parallel corpora come from the public WMT'14 data. The authors follow different cited preparation procedures for the two language pairs. After tokenization, the English side of the En-Fr corpus contains approximately 250M words. The prepared En-De corpus contains roughly 100M words on its English side. These counts describe the source-language portions of the training corpora. The paper uses the Moses tokenization script in preparing the corpora. [Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation](https://md.research.elamur.ai/free/en/papers/cho-2014-learning-phrase-representations-rnn-encoder/) · [On Using Very Large Target Vocabulary for Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/jean-2015-very-large-target-vocabulary-neural/)

For En-Fr, `newstest-2014` is the development set and `newsdiscusstest2015` is the test set. For En-De, `newstest-2013` is the development set and `newstest2015` is the test set. Development scores determine when to stop training. The test sets are used to report the resulting translation quality. Keeping those roles distinct matters because the reported test behavior follows a training procedure that makes its stopping decision on a separate set.

The vocabulary is capped at the 30k most frequent symbols, which are either tokenized words or byte-pair-encoded sub-word units depending on the setting. Byte pair encoding, or BPE, can make some rare words representable through pieces that occur elsewhere. The paper therefore uses it as a comparison for symbolization and also tests configurations that combine the two. The authors report that symbolization reduces the number of distinct tokens and improves coverage by a 30k-word vocabulary by as much as 3 percentage points. This is a vocabulary-coverage result for the corpora and is distinct from the test BLEU gains. [Improving Neural Machine Translation Models with Monolingual Data](https://md.research.elamur.ai/free/en/papers/sennrich-2016-improving-neural-machine-translation-models/)

Training keeps sentence pairs in which both sentences are up to 50 symbols long. The paper describes filtering pairs after symbolization by their proportion of out-of-vocabulary words, with removal above 10% for En-Fr and above 30% for En-De. These rules restrict which parallel examples contribute to learning. In particular, the meaning of a length measured in symbols depends on what the tokenizer, placeholders and any sub-word segmentation have made into a symbol.

The systems use the attention-based architecture with long short-term memory units in place of gated recurrent units. The authors optimize with Adam in place of Adadelta, and use gradient clipping with a threshold of 1. Clipping controls the size of the update signal passed to the optimizer when the gradient becomes large. Training stops once the development set’s BLEU score ceases to improve. The authors use this training configuration across the compared systems. [Adam: A Method for Stochastic Optimization](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) · [ADADELTA: An Adaptive Learning Rate Method](https://md.research.elamur.ai/free/en/papers/zeiler-2012-adadelta-adaptive-learning-rate-method/)

The evaluation description specifies forward beam search with a width of 12. The results table caption refers to scores under two beam widths and puts development scores in parentheses. The reported metric is BLEU, calculated on tokenized output and references with the `multi-bleu.perl` script from Moses. BLEU compares sequences of tokens in the generated and reference translations. It provides a corpus-level way to compare systems under the same evaluation procedure. A translation can improve on a contested word while differing elsewhere, so the paper uses examples alongside BLEU to discuss the changes it observes.

#### What improves over the baseline

The baseline is an attention-based neural translation system using the ordinary embedding and vocabulary treatment. The contextualization comparison adds source-dependent masks. The symbolization comparison adds the typed-placeholder procedure. The joint configuration uses both. Comparisons involving BPE ask how these changes behave when the system is already able to represent words with smaller units.

The headline En-Fr numbers are gains over the baseline on the test task. The authors report that contextualization alone adds 2 BLEU points, symbolization alone adds 2, and the two used together add 4. Those figures describe changes in BLEU, so the chart uses the gain as its metric. An absolute score would answer a different question about the level of performance of the system on `newsdiscusstest2015`.

Reported BLEU gains over the baseline on English-to-French newsdiscusstest2015 The system using contextualization and symbolization together has the largest reported gain.

**The numbers**

| System or setting | BLEU points gained |
| --- | --- |
| Contextualization | 2 |
| Symbolization | 2 |
| Contextualization and symbolization (this paper) | 4 |

For the En-De test task on `newstest2015`, the paper describes improvements of 1–2 BLEU points for the individual changes and 2.5 BLEU points for their combination. That range expresses how the paper reports the individual gains. The results discussion identifies the joint use of contextualization and symbolization as the largest improvement among the direct comparisons with the ordinary attention baseline.

In the comparisons with BPE, the authors describe symbolization alone as having a similar effect on BLEU to sub-word segmentation alone in both language pairs. Contextualization also raises translation quality when the representation already uses BPE. That comparison extends the result beyond the word-vocabulary setting. It shows that the pooled source information can help even when ordinary words may be split into pieces and the sub-word system can already construct forms beyond a fixed list of full words.

The two languages supply separate tests of the changes. Each has its own training corpus, filtering threshold and development and test sets. The reported gains belong to those particular comparisons. The similarity in direction across the tasks supports the authors’ conclusion that the interventions can help in more than one setting. The magnitude in one task cannot be read as a direct estimate of the magnitude in the other, since the tasks differ in both data and language.

### What the ablations show

#### What the system comparisons isolate

The paper’s main controlled comparison comes from switching contextualization and symbolization on separately and together. The gains from contextualization alone show that changing the embedding calculation can improve translation with the original symbol inventory treatment still in place. The gains from symbolization alone show that typed placeholders and their restoration can improve output while ordinary embeddings remain in use. The joint comparison shows that the gains are compatible in the reported setup. A system can benefit from adjusting continuous representations and from taking selected items through explicit source references.

Each switch covers a group of changes. Contextualization computes a nonlinear sentence summary and applies separate source and target masks. Its overall gain measures that package. Symbolization includes detection rules, a change to the training vocabulary, the use of indexed markers and a restoration step. Its overall gain measures the effect of using those parts together. This scope matters when interpreting why the BLEU changes. The experiments connect the gains to the complete interventions more directly than they connect them to any single internal operation.

The BPE comparisons provide another controlled distinction. When BPE is used alone, smaller units let the network assemble some uncommon forms from available pieces. When symbolization is used alone, eligible rare items share typed vocabulary entries and can be restored from a reference to the source. The paper reports similar aggregate effects for these alternatives. Their aggregate similarity leaves room for different behavior on particular strings. A sub-word system has to generate the correct sequence of pieces. A symbolized system has to predict the appropriate type and index and then restore the form.

Contextualization’s improvement in the BPE setting is important to the paper’s explanation. If the effect had appeared only when each vocabulary entry corresponded to a full word, it would have been harder to know whether the design depended on that granularity. The sub-word result shows that the tested use of pooled source context also works with a different type of input unit. In such a setup, the pooled context is computed over the symbols the network actually reads. The result supports using the same operation there, while leaving open how different kinds of pieces contribute to it.

#### Why the authors looked at local embedding neighborhoods

The authors use principal component analysis, or PCA, to illustrate a property of fixed embeddings that motivates the masks. They take a word of interest and find its `N−1` nearest neighbors in an embedding table. Here `N` is the number of vectors in the local group after including the original word. PCA identifies directions of variation within that group. The authors inspect which neighboring words lie along different directions. The vectors in this analysis come from continuous bag-of-words training, where the neighborhood of words contributes to a representation learned from context. The paper makes the code for the local-neighborhood analysis publicly available. [Efficient Estimation of Word Representations in Vector Space](https://md.research.elamur.ai/free/en/papers/mikolov-2013-efficient-estimation-word-representations-vector/)

For *notebook*, the reported directions correspond to writing materials and portable computers. For *power*, they correspond to social or political authority and physical energy. These cases illustrate why an embedding can be useful precisely because it expresses several relationships, while a translation for a particular use may depend strongly on one relationship. The neighborhood is local to the word being inspected. A direction found around *notebook* is evidence about the arrangement of that group of words.

The PCA directions are computed for inspection. The translation procedure learns a sigmoid mask over its own embedding coordinates. The authors propose that nonlinear context extraction and joint training could organize the learned coordinates so that masking selects the useful information. The analysis motivates that possibility by showing different forms of similarity in word-vector neighborhoods. The translation scores then test whether the intervention helps. The paper keeps the claim about a useful intervention on firmer empirical ground than the claim about how the learned space organizes meaning.

#### What changes in particular translations

The French example compares a BPE system with its contextualized counterpart. In a sentence about the Scorsese–DiCaprio pairing and *Shutter Island*, the first system uses *retrouvé* for English *rediscovered*. The contextualized system uses *redécouvert*. The paper treats the first as a defensible translation and the second as a closer match to the particular English verb. The contrast is useful because lexical ambiguity in translation includes choices between semantically related words. A system can convey that something was found again and still lose the more specific idea of rediscovery.

The comparison illustrates a possible target-side benefit from the source context. Both outputs are generated through sentences with other differences, including in how they handle names and the title. The case is therefore evidence about the observed verb choice in that example. It does not isolate a particular mask coordinate or show that the mask by itself accounts for every difference between the generated sentences. The corpus scores supply the broader system comparison.

The German BPE example involves a total of `13,435` cases. The system without contextualization gives `13.335`, whereas the contextualized system gives `13.435`. In the presentation of this result, the difference between the comma in the English source and the period in the German output is a matter of formatting. The change to a digit in `13.335` alters the value. The authors interpret the correction as an example of contextualization helping the system distinguish numerically close items. It illustrates how a translation error can be serious for the meaning of a sentence even if it is small as a difference between strings.

The names example asks whether a system can preserve an uncommon name and a hyphenated expression. The German BPE output renders *Trakhtenberg* as *Trakttenberg* and breaks up *Hali-Gali* into a different form. With contextualization and symbolization enabled together, the output retains *Trakhtenberg* and puts *Hali-Gali* into the translated expression *Hali-Gali-Zeiten*. The comparison shows the surface forms a combined system can produce even when the sub-word system by itself produces plausible-looking pieces with errors. Because the combined system changes both contextualization and symbolization relative to that BPE example, this particular comparison illustrates their joint behavior.

The word-based versions give a more direct contrast for the same sentence. Both use contextualization. Without symbolization, the translation has unknown markers where the names would appear. Adding symbolization restores *Trakhtenberg* and produces *Hali-Gali-Zeiten*. The output still has an unknown marker elsewhere. The improvement is specific and visible. Expressions that were previously lost to the unknown-word vocabulary entry recover recognizable forms, and the surrounding translation can still have other errors.

Together, the analyses operate at different levels. The score comparisons ask whether the interventions improve performance aggregated across test sentences. The embedding neighborhoods illustrate the representational problem that motivated the masks. The translated examples show what a change can look like for a near-synonym, a value or a name. The examples are especially informative about the kind of mistake at issue, while the aggregate comparisons carry the claim about overall translation quality.

### Limitations

#### Limits identified by the authors

The authors explicitly regard their explanation of the learned geometry as difficult to verify. They suggest that the nonlinear context function can find projections appropriate for the embedding space and that learning the embeddings jointly with the masks may help separate different forms of similarity. Their evidence consists of local neighborhoods from a separate embedding analysis and improved translation from the contextualized system. Tracing a particular translation decision to the suppression of a particular type of similarity is a further empirical step.

The paper also identifies character-level translation as future work. The experiments use tokenized words and BPE-based sub-word symbols. In principle, the source pooling and masking equations can act on other kinds of embeddings, but the effect at character granularity remains open in the study. This matters because a character can carry a different kind of evidence about sentence meaning than a word or a larger piece of a word. The conclusion about flexibility is supported for the tested symbol types.

The authors limit their rule dictionary to evidence obtained in the parallel data. They note that external rules could be added and choose to evaluate the method without those resources. Their account of proper-name recognition also makes its linguistic scope clear. It relies on capitalization patterns characteristic of the European languages they consider. Even within that scope, the procedure uses a particular rule for multiword names and a restricted rule for unmatched acronyms.

#### Limits visible in the experimental design

The source mask has access to the whole sentence as a collection of symbol occurrences, so it can exploit clues on either side of a word. It has only the mean of their transformed embeddings as its summary. Source sequences with the same occurrences in different orders give the same pooled vector. Some ambiguities can be resolved from the words present, while others require information about which word modifies which or how the parts of a sentence are ordered. The encoder and attention provide routes for such information in the full system. The limitation pertains to what the mask itself can represent.

The shared mask also gives all the occurrences in one sentence the same scale on each source coordinate. If a word recurs in distinct uses in one sentence, its base embedding and the sentence-level operation are identical at those positions. Their recurrent annotations can still differ because the encoder sees them in different surroundings. The mask, however, cannot by itself choose one scale for one occurrence and another for the second. The target-side mask likewise stays fixed across decoding steps while the recurrent and attention states vary.

The controlled comparisons establish the effect of the contextualization package. The paper gives no separate translation scores for source-only masks, target-only masks or alternative pooling functions. The relative contribution of the two embedding sides is therefore unresolved. The same applies to the benefit of the nonlinear transform before averaging compared with other ways to summarize a sentence. Nor do the reported experiments measure the amount of recurrent capacity used for lexical disambiguation or composition. The improvements are consistent with the authors’ motivation, while the capacity account remains an interpretation of how the change may help.

For symbolization, the test results combine coverage, prediction and restoration. Replacing several surface strings with a typed marker can reduce the number of vocabulary entries the network needs to represent. Predicting an indexed marker can make source identity recoverable after reordering. The dictionary can then supply a surface form. The comparisons do not give separate corpus-level effects for digits, proper names and acronyms. A name example can illustrate the effect of the name rule, but it does not estimate how frequently that rule succeeds or how much of the overall BLEU gain it explains.

The heuristics also set boundaries on which strings receive special treatment. A capitalization rule can miss a name outside the pattern it expects. The acronym fallback relies on a unique remaining all-capital item on each side. The digit rules target matching strings and variations in punctuation and grouping, with newly attached material separated for later handling. A reference can make exact recovery easier once a match has been established. Coverage of eligible matches depends on the forms present and on whether the rules can connect them.

Vocabulary limits and training filters belong to the setting in which the reported gains were observed. A rule that converts uncommon strings into frequent placeholders can affect both how much of the corpus the retained vocabulary covers and which items the translation network learns to predict. Thus the comparison is meaningful as an evaluation of the preprocessing and restoration procedure under the stated training setup. It leaves open how much of the score improvement comes from better training coverage, better prediction of placeholders or better recovery of the forms at test time.

BLEU is an overall score against references. The title, the exact quantity and the selected verb in the examples each concern a different kind of correctness. A dedicated measurement would be needed to estimate the frequency of each change across a test set. The paper gives qualitative examples of those effects and reports aggregate BLEU comparisons. The score discussion also leaves variability across repeated training runs and statistical uncertainty around the reported gains unspecified.

Finally, the direct experimental scope is translation from English into French and German with an attention-based recurrent architecture. The paper explains how the embedding and preprocessing changes could be used with other encoder–decoder designs, and it evaluates the method across two symbol granularities. The measured conclusions attach to the parallel corpora, word and BPE settings, vocabulary restrictions and evaluation splits used here. Together those tests support a fairly specific result. A sentence-wide embedding adjustment and typed source references can both improve this family of systems, and their joint use can improve the same system further.

### What came after

#### Context beyond the source sentence

[Exploiting Cross-Sentence Context for Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/wang-2017-exploiting-cross-sentence-context-neural/) cites the paper and takes up a different scope of context in the same task. The method examined here defines context for its masks from the words of one source sentence. Cross-sentence context brings other sentences into the translation problem. This makes the relationship between the papers clearest at the level of the question they ask about context. The embedding study asks how clues already inside a source sentence can reach lexical representations. The citing work’s stated focus is evidence that crosses a sentence boundary.

That difference in scope matters for the original proposal. The pooled vector has an explicit input boundary, so information beyond that boundary cannot affect it directly. A cross-sentence study takes up a broader question about what text is available to condition a translation. The citation and title establish the connection and the broader focus. They leave the later work’s particular architecture, results and any reuse of the embedding masks unspecified.

#### Contextual representations for comparing Arabic questions

[Deep Contextualized Pairwise Semantic Similarity for Arabic Language Questions](https://md.research.elamur.ai/free/en/papers/al-bataineh-2019-deep-contextualized-pairwise-semantic-similarity/) cites the translation study in connection with a different task. Its stated subject is [semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/) between pairs of Arabic questions. In translation, the system chooses a sequence of target symbols given the source. In a pairwise similarity task, the object of comparison is the meaning of the two questions. The shared issue is that the contribution of a word can depend on the text in which it appears.

The relation can be stated at that level without assuming that the later work adopted the same mechanism. The translation paper’s masks come from a source sentence and are learned through the probability of a target translation. The later title identifies contextualized similarity for Arabic questions as its subject. Its citation records a connection to the earlier study, while its implementation and measurements remain unspecified here. Taken together, the two citing works show the paper being cited in research that changes either the scope of the context under consideration or the task for which contextual representations are used.

## Cite

Cite as Heeyoul Choi, Kyunghyun Cho and Yoshua Bengio. 2017. Context-dependent word representation for neural machine translation. Computer Speech & Language.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1016/j.csl.2017.01.007](https://doi.org/10.1016/j.csl.2017.01.007) · [arXiv 1607.00578](https://arxiv.org/abs/1607.00578)

```bibtex
@inproceedings{choi2017context,
  title = {{Context-dependent word representation for neural machine translation}},
  author = {Heeyoul Choi, Kyunghyun Cho and Yoshua Bengio},
  booktitle = {Computer Speech \& Language},
  year = {2017},
  doi = {10.1016/j.csl.2017.01.007},
  eprint = {1607.00578},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1016/j.csl.2017.01.007}
}
```

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