E MERGENT T RANSLATION IN M ULTI -A GENT C OMMUNICATION
A BSTRACT
While most machine translation systems to date are trained on large parallel corpora, humans learn language in a different way: by being grounded in an environment and interacting with other humans.
In this work, we propose a communication game where two agents, native speakers of their own respective languages, jointly learn to solve a visual referential task.
We ﬁnd that the ability to understand and translate a foreign language emerges as a means to achieve shared goals.
The emergent translation is interactive and multimodal, and crucially does not require parallel corpora, but only monolingual, independent text and corresponding images.
Our proposed translation model achieves this by grounding the source and target languages into a shared visual modality, and outperforms several baselines on both word-level and sentence-level translation tasks.
Furthermore, we show that agents in a multilingual community learn to translate better and faster than in a bilingual communication setting.
I NTRODUCTION
Building intelligent machines that can converse with humans is a longstanding challenge in artiﬁcial intelligence.
Remarkable successes have been achieved in natural language processing (NLP) via the use of supervised learning approaches on large-scale datasets (Bahdanau et al., 2015; Wu et al., 2016;
Gehring et al., 2017; Sennrich et al., 2017).
Machine translation is no exception: most translation systems are trained to derive statistical patterns from huge parallel corpora.
Parallel corpora, however, are expensive and difﬁcult to obtain for many language pairs.
This is especially the case for low resource languages, where parallel texts are often small or nonexistent.
We address these issues by designing a multi-agent communication task, where agents interact with each other in their own native languages and try to work out what the other agent meant to communicate.
We ﬁnd that the ability to translate foreign languages emerges as a means to achieve a common goal.
Aside from the beneﬁt of not requiring parallel data, we argue that our approach to learning to translate is also more natural than learning from large corpora.
Humans learn languages by interacting with other humans and referring to their shared environment, i.e., by being grounded in physical reality.
More abstract knowledge is built on top of this concrete foundation.
It is natural to use vision as an intermediary: when communicating with someone who does not speak our language, we often directly refer to our surroundings.
Even linguistically distant languages will, by physical and cognitive necessity, still refer to scenes and objects in the same visual space.
We compare our model against a number of baselines, including a nearest neighbor method and a recently proposed model (Nakayama & Nishida, 2017) that maps languages and images to a shared space, but lacks communication.
We evaluate performance on both word- and sentence-level translation, and show that our model outperforms the baselines in both settings.
Additionally, we show that multilingual communities of agents, comprised of native speakers of different languages, learn faster and ultimately become better translators.
P RIOR W ORK
Recent work has used neural networks and reinforcement learning in multi-agent settings to solve a variety of tasks with communication, including simple coordination (Sukhbaatar et al., 2016), logic riddles (Foerster et al., 2016), complex coordination with verbal and physical interaction (Lowe et al., 2017), cooperative dialogue (Das et al., 2017) and negotiation (Lewis et al., 2017).
At the same time, there has been a surge of interest in communication protocols or languages that emerge from multi-agent communication in solving these various tasks.
Lazaridou et al.
ﬁrst showed that simple neural network agents can learn to coordinate in an image referential game with single-symbol bandwidth.
This work has been extended to induce communication protocols that are more similar to human language, allowing multi-turn communication (Jorge et al., 2016), adaptive communication bandwidth (Havrylov & Titov, 2017) and multi-turn communication with a variable-length conversation (Evtimova et al., 2017), and simple compositionality (Kottur et al., 2017; Mordatch & Abbeel, 2017).
Meanwhile, Andreas et al.
(2017) proposed a model to interpret continuous message vectors by “translating” them.
Our work is related to a long line of work on learning multimodal representations.
Several approaches proposed to learn a joint space for images and text using Canonical Correlation Analysis (CCA) or its variants (Hodosh et al., 2013; Andrew et al., 2013; Chandar et al., 2016).
Other works minimize pairwise ranking loss to learn multimodal embeddings (Socher et al., 2014; Kiros et al., 2014; Ma et al., 2015; Vendrov et al., 2015; Kiela et al., 2017).
Most recently, others extended this work to learn joint representations between images and multiple languages (Gella et al., 2017;
Calixto et al., 2017b; Rajendran et al., 2016).
In machine translation, our work is related to image-guided (Calixto et al., 2017a; Elliott & K ´ ad ´ ar, 2017; Caglayan et al., 2016) and pivot-based (Firat et al., 2016; Hitschler et al., 2016) approaches.
It is also related to previous work on multiagent translation for low-resource language pairs (without grounding)
(He et al., 2016a).
At word-level, there has been work on translation via a visual intermediate (Bergsma & Van Durme, 2011), including with convolutional neural network features (Kiela et al., 2015; Joulin et al., 2016).
It was recently shown that zero-resource translation is possible by separately learning an image encoder and a language decoder (Nakayama & Nishida, 2017).
The main difference to our work is that their models do not perform communication.
T ASK AND M ODELS 3. C OMMUNICATION T ASK
We let two agents communicate with each other in their own respective languages to solve a visual referential task.
One agent sees an image and describes it in its native language to the other agent.
The other agent is given several images, one of which is the same image shown to the ﬁrst agent, and has to choose the correct image using the description.
The game is played in both directions simultaneously, and the agents are jointly trained to solve this task.
We only allow agents to send a sequence of discrete symbols to each other, and never a continuous vector.
Our task is similar to Lazaridou et al.
(2017), but with the following differences: communication (1) is bidirectional and (2) of variable length; (3) the speaker is trained on both the listener’s feedback and ground-truth annotations; and (4) the speaker only observes the target image and no distractors.
Let P A and P B be our agents, who speak the languages L A and L B respectively.
We have two disjoint sets of image-annotation pairs: ( I A , M A ) in language L A and ( I B , M B ) in language L B .
Task in language L A : P A is the speaker and P B is the listener.
A target image and annotation ( i, m ) ∈ { I A , M A } is drawn from the training set in L A .
Given i , the speaker ( P A ) produces a sequence of symbols ˆ m in language L A to describe the image and sends it to the listener.
The speaker’s goal is to produce a message that is both an accurate prediction of the ground-truth annotation m , and helps the listener ( P B ) identify the target image.
K − 1 distracting images are drawn from I A at random.
The target image i is added to this set and all K images are shufﬂed.
Given the message ˆ m and the K images, the listener’s goal is to identify the target image.
Task with language
L B : The agents exchange the roles and play similarly.
We explore two different settings: (1) a word-level task where the agents communicate with a single word, and (2) a sentence-level task where agents can transmit a sequence of symbols.
3. M ODEL A RCHITECTURE AND T RAINING
Each agent has an image encoder, a native speaker module and a foreign language encoder.
In
English-Japanese communication, for instance, the English-speaking agent P A consists of an image encoder
E
A IMG , a native English speaker module S A EN , and a Japanese encoder E A JA .
Similarly, the
Japanese
[Figure]
We now illustrate the architecture of our model using the English part of the communication task as an example (upper half of Figure 1a).
We ﬁrst describe the sentence-level model.
Speaker ( P A ) Given an image-annotation pair ( i, m ) ∈ { I EN , M EN } sampled from the English training set, let i be represented as a D img -dimensional vector.
P A ’s speaker encodes i into a D hiddimensional vector with a feedforward image encoder:
h 0 =
E A IMG ( i ) .
Our speaker module S A EN is a recurrent neural network (RNN) with gated recurrent units (GRU, (Cho et al., 2014)).
Our RNN takes the image representation h 0 as initial hidden state and updates its state as h t +1 =
GRU ( h t , m t ) where m t is the t -th token in m .
The output layer projects each hidden state h t over the English vocabulary V EN , followed by a softmax to predict the next token: p t = softmax ( W o h t
+ b o ) .
The speaker’s predictions are trained on the ground truth English annotation m using the cross entropy loss:
[Equation]
where N EN is the size of the English training set, and T m is the length of m .
To generate a sequence of tokens, we sample from the categorical distribution Cat ( p t ) .
However, sampling is a non-differentiable computation.
To allow our model to be end-to-end differentiable, we use the straight-through Gumbel-softmax estimator (Jang et al., 2017; Maddison et al., 2017) to sample from Cat ( p t ) and let the gradient ﬂow, while the speaker sends a sequence of discrete symbols.
The message ˆ m is a sequence of one-hot vectors: ˆ m = { y t } T m t =1 , where y t =
Gumbel ST ( p t ) is discretized in the forward pass.
Listener ( P B )
The Japanese-speaking agent P B encodes the K images into D hid -dimensional multimodal space with its own feedforward image encoder: { E B IMG ( i k ) }
Kk =1 .
It also feeds each token from ˆ m into its English encoder RNN with D hid -dimensional hidden states: s t +1 =
GRU ( s t , ˆ m t ) .
Taking the last hidden state, the representation of ˆ m is a D hid -dimensional vector: E B EN ( ˆ m ) =
s T m .
Note, that encodings of the images and the message have the same dimensionality.
To encourage the listener to align the message representation closest to the target image, it is trained using a cross entropy loss where the logits are given by the reciprocal of the mean squared error (MSE) between the target image and the message representation: { 1 / (cid:0) E B EN ( ˆ m ) − E B IMG ( i k ) (cid:1) 2 } Kk =1 .
[Equation]
i [Equation] [Table] [Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
where the softmax operation is performed over K images.
We observed that optimization signiﬁcantly slows down after the initial stage of learning when training with the standard MSE loss.
In order to ensure fast convergence throughout training, we use this modiﬁed form of MSE as a loss function whose slope gets steeper as the loss is minimized.
See Appendix A for a discussion and a more thorough comparison and analysis.
Training These two agents are jointly trained by minimizing the sum of speaker and listener loss:
[Equation]
Note that the listener is only trained on J lsn , while the speaker is trained on both J lsn and J spk .
Word-level model
The word-level model has a similar architecture to the sentence-level one: instead of an RNN, the speaker module S A EN is a feedforward layer that projects h 0 over the native vocabulary.
We again use a straight-through Gumbel-softmax to sample a one-hot vector.
Similarly, the foreign language encoder consists simply of the D hid -dimensional foreign word embeddings.
General training details In both word- and sentence-level experiments, we use 2048 -dimensional pre-softmax features from a pre-trained ResNet with 50 layers (He et al., 2016b), instead of raw images.
Our models are trained using stochastic gradient descent with the Adam optimizer (Kingma &
Ba, 2014).
The norm of the gradient is clipped with a threshold of 1 (Pascanu et al., 2013).
Gumbelsoftmax temperature is tuned on the validation set, but ﬁxed throughout training, not annealed or learned.
3. H OW T RANSLATION A RISES
To translate an English sentence m src to Japanese, we let the Japanese-speaking agent P B encode m src with its English encoder, and decode this representation using its Japanese speaker module: m hyp = S B JA ( E B EN ( m src ))
(see Figure 1b).
Solving the image referential task requires aligning the foreign (source) sentence representation with the representation of the correct image, which will allow the speaker module to describe the source sentence in its native (target) language, as though it were an image.
W ORD - LEVEL E XPERIMENTS
Task and dataset We train our model on a word-level communication task, where the agent P A is given an image and needs to ﬁnd the right word to communicate it so that the agent P B can pick the right image from a set of distractors.
We use the Bergsma500 dataset (Bergsma & Van Durme, 2011), a collection of up to 20 image search results per concept and language, for 500 common concepts across 6 languages: English, Spanish, German, French, Italian and Dutch.
We train on 80% of the images, and choose the model with the best communication accuracy on the 20% validation set when reporting translation performance.
As the Bergsma500 is an extremely small dataset, we do not have a separate test set to report the communication accuracy on.
We only report the translation performance instead.
Note that the translation task involves translating 500 words from the vocabulary, therefore the data split of images is not relevant for this task.
Baselines For our baselines, we use a variety of nearest neighbor methods based on similarity metrics in the ConvNet feature space (Kiela et al., 2015).
Given a set of 20 ResNet image vectors per concept and language, we can either average them (CNN-Mean) or take the dimension-wise maximum (CNN-Max) to derive a single aggregated image vector.
To ﬁnd the German word for dog , for instance, we rank all German words based on cosine similarity between the image vector of dog and their image vectors.
We then examine precision in retrieving the correct German word, Hund .
Alternatively, we also consider the similarities between individual image vectors instead of their aggregation: Bergsma & Van Durme (2011) propose taking the average of the maximum similarity scores (CNN-AvgMax) and the maximum of the maximum similarity scores (CNN-MaxMax).
Experimental settings We train with 1 distractor ( K = 2 ) 2 , learning rate 3e − 4 , and minibatch size 128.
The embedding and hidden state dimensionalities are set to 400.
When the validation accuracies of both the speaker and the listener stop improving, training terminates and we evaluate the performance on the word-level translation task, as described in § 3.3.
We consider all 15 language pairs in both directions, reporting results averaged across 30 translation cases.
Results In all 15 language pairs, we observe that translation performance improves with communication performance (Figure 3).
In translation, our model outperforms all the nearest neighbor baselines (Table 2).
This shows that our agents can learn foreign word representations that are not only effective in solving referential tasks, but also more meaningful than raw image features in translation.
It also demonstrates that communication helps to identify and learn correspondences between concepts in different languages.
[Figure]
Qualitative analysis As our agents learn foreign words by grounding them in visual space, we expect the learned foreign word embeddings to be semantically similar to corresponding images.
We inspect the nearest neighbors of foreign word embeddings in each language, and ﬁnd that concepts 2 We experimented with more distractors, but found this setting to be optimal. See Appendix D for a discussion. with similar images indeed have close word embeddings.
See Appendix B for a discussion and relevant examples.
S ENTENCE - LEVEL E XPERIMENTS
Task We next train our models on a sentence-level communication task where agent P A is given an image, and needs to communicate its content in a sentence in its language L A to allow agent P B to identify the right image from a set of distractors (see § 3.1).
Datasets and preprocessing We use three datasets of images with annotations in multiple languages.
The Multi30k (Elliott et al., 2016) dataset contains 30k images and two types of bilingual annotations for two different tasks:
• (Task 1) English-German translation task, where this can be aided by images; and • (Task 2) German image captioning task, where this can be helped with English captions.
Training data for Task 1 consists of 1 English caption and its German translation for every image, translated by a professional translator.
For Task 2, ﬁve English and ﬁve German captions are collected independently for every image.
We use the original data split: 29k training, 1k validation and 1k test images.
We experiment with another language pair: English-Japanese.
We use MS COCO (Lin et al., 2014; Chen et al., 2015), which contains 120k images and 5 English captions per image, and
STAIR (Yoshikawa et al., 2017), a collection of Japanese annotations of the same dataset (alsoper image).
Following Karpathy & Li (2015), we use 110k training, 5k validation and 5k test images.
To ensure no parallel corpus is used to train our models, we partition the images in the training set into two parts (one for each langauge) and only use captions in one language for each half and not the other.
With Multi30k, for instance, we have 14.5k English training images (whose German captions we discard) and 14.5k German training images.
We use tokenized Japanese captions in STAIR.
3 We lowercase, normalize and tokenize English and German captions using preprocessing scripts from Moses.
In addition, we tokenize German captions into subword symbols using the byte pair encoding (BPE) algorithm with 10k merge operations (Sennrich et al., 2015).
Baselines We compare against several baselines that similarly only make use of disjoint imagedescription data.
In increasing order of sophistication:
Nearest neighbor To translate an English sentence into German, we use its corresponding image to ﬁnd the closest image in our German training set.
We then retrieve all corresponding German captions and compute BLEU score against the ground truth German test captions.
This model is similar to our word-level nearest neighbor baselines.
NMT with neighboring pairs Given our non-aligned training set of English and German image captions, without any overlapping images, we can form new EN-DE sentence pairs by ﬁnding the closest German training image for every English training image.
We then pair every corresponding German caption with every corresponding English caption, and train a standard NMT model without attention (Cho et al., 2014; Sutskever et al., 2014) on these pairs.
We do not compare against an NMT model with attention because our models do not use attention (since incorporating attention would mean that agents have access to each other’s hidden states, which is no longer a multi-agent setting).
N&N We implement and train end-to-end models from (Nakayama & Nishida, 2017).
Their twoway model learns separate encoders to align the source language and images in a multimodal space.
Then, a captioning model in the target language is trained on image representations, and is used to decode source representations to translate them.
Their three-way models -captionshttps align both source and target languages with images using a target language encoder.
Their models are similar to our models, with two key differences: (1) they are trained on a ﬁxed corpus, without interaction between agents or learned communication, and (2) their model unit-normalizes the output of every encoder and is trained on pairwise ranking loss.
In order to speciﬁcally examine the effectiveness of communication in learning to translate, we train these baselines using both their original loss function and our own loss function (see
Appendix A).
Models In our base model, the agents learn to speak their native languages simultaneously as they learn to communicate with each other (not pretrained) .
In a sense, this can be seen as a tabula rasa situation where both agents start from a blank slate.
However, we also experiment with agents who already speak their languages, by using the weights from pretrained image captioning models in both languages to initialize our speaker modules and image encoders.
Furthermore, we can freeze the parameters of image encoders or speaker modules to investigate their impact on communication and translation performance.
In the most extreme case, where we pretrain and ﬁx the speaker modules and image encoders (pretrained, spk & enc ﬁxed) , we only train the foreign language encoder, using only the listener loss.
All other models are trained on both the speaker and listener loss.
Experimental settings We train with 1 distractor ( K = 2 ) 5 and minibatch size 64.
The hidden state size and embedding dimensionalities are 1024 and 512, respectively.
The learning rate and dropout rate are tuned on the validation set for each task.
The vocabulary sizes of each language used in our experiments are: EN (4k) and DE (5K) for Multi30k Task 1, EN (8k) and DE (13k) for
Multi30k Task2 and EN (10k) and JP (13k) for MS COCO.
We train the model on the communication task, and early stop when the validation translation BLEU score stops improving.
We use beam search at inference time, with beam width tuned on the validation set.
[Equation]
[Table]
& STAIR
[Table]
n a li [Table]
M od
[Table] l s [Table]
Nearest neighbor
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table]
[Table] [Table] [Table] [Table]
[Table]
[Table] [Table] [Table] [Table]
[Table] [Table]
[Table] [Table] [Table] [Table]
[Table] [Table]
, not ﬁxed
[Table]
Results
We ﬁnd that na¨ıvely looking up the nearest training image and retrieving its captions gives relatively poor BLEU scores (Table 1, Nearest neighbor).
On the other hand, training an NMT model on these visually closest neighbor pairs gives much better translation performance
[Table] From the results of baselines from (Nakayama & Nishida, 2017), it is clear that our loss function gives better performance than the pairwise ranking loss with unit-normalized encoder outputs.
We note that these baselines perform worse than our models even when our loss function is used, an indication that communication helps in learning to translate.
We conjecture that our listeners become better at aligning multimodal representations compared to these baselines, as our listeners are trained on speaker’s output, and hence are exposed to a bigger and more diverse set of image descriptions.
In contrast, the N&N models only make use of the ground truth captions.
We also note that their 3-way models have an additional encoder for the target language, which our models lack.
Although this is not used at test time, their 3-way models have 33% more parameters to train (97m) than our models (73m).
In contrast to (Nakayama & Nishida, 2017), where the best performance was obtained with endto-end trained models, we ﬁnd that our models beneﬁt from initializing weights with pretrained captioning models.
The model with ﬁxed speaker modules and non-ﬁxed image encoders gave best results in two out of three datasets, even outperforming the (spk & enc ﬁxed) model, which only produces messages that are trained to predict ground truth captions.
This shows that learning to send messages differently from the pretrained image captioning models achieves better translation performance than learning to send ground truth captions.
We provide sample translations for our baselines and models in Appendix C. We also qualitatively examine completely zero-resource
German-Japanese translation in Appendix F.
We compare our results with a standard non-attentional NMT model trained on parallel data (Cho et al., 2014; Sutskever et al., 2014).
On COCO & STAIR, we observe a gap of approximately
BLEU compared to our best models On Multi30k Task 2, which is slightly smaller, the gap grows up to 5 BLEU scores.
On Multi30k Task 1, where the dataset is the smallest and also of the highest quality (annotated by professional translators), the gap is around 11 BLEU.
In other words, we ﬁnd that our approach performs closer to supervised NMT as more training data is available, but that there still is a gap, which is unsurprising given the lack of parallel data.
Qualitative analysis We conjecture that our models learn to translate by having a shared visual space to ground source and target languages onto.
Indeed, we show that our translation system fails without a common visual modality (see Appendix D).
We note that using a larger number of distractors helps the model learn faster initially, but does not affect translation performance (see also
Appendix D).
As expected, our models struggle with translating abstract sentences, although we observe that they can capture some visual elements in the source sentence (see Appendix E).
This observation applies to most current grounded NMT systems, and it is an avenue worth exploring in future work but beyond the scope of the current work.
Inspired by the movie Arrival (2016), we show that our agents can learn to play the referential game, and learn to translate, using an alien language (Klingon) with only a small number of captions (see
Appendix G).
This example is meant to illustrate the point that our models can learn to translate even in situations where there is no knowledge whatsoever of the other language, and where training a professional translator would potentially take a long time.
M ULTILINGUAL C OMMUNITY OF A GENTS
Task and dataset Humans learn to speak languages within communities.
We next investigate whether we can learn to translate better in a community of different language speakers, where every agent interacts with every other agent.
We use the recently released multilingual Multi30k Task 1, which contains annotations in English, German and French for 30k images (Elliott et al., 2017).
We train a community of three agents (each speaking one language) and let each agent learn the other two languages simultaneously.
We again partition the set of images into two halves (M1 and M2 in Figure 4), and ensure that the speaker and the listener do not see the same set of images (see Figure 4a for example).
We experiment with two different settings: 1) a full community model, where having a multilingual community allows us to expose agents to more data than in the single-pair model while maintaining disjoint sets of images between agents (Figure 4c); and 2) a fair community model where the agents are trained on exactly the same number of training examples (Figure 4b).
We point out that the difference in training data should mainly affect the speaker module; the image encoder and foreign language encoder are trained on the same number of examples in all the models.
[Figure]
Experimental settings We train our base model (not pretrained) on a three-way sentence-level communication task.
We sample a language pair with an equal probability every minibatch and let the two agents communicate.
Every agent has one image encoder, one native speaker module and two foreign language encoders.
We tokenize every corpus using BPE with 10k merge operations.
We use the same architecture for the three models: D emb = 128 , D hid =
and we use a learning rate of 3e-4 and batch size of 128.
[Table]
Results We observe that multilingual communities learn better translations.
By having access to more target-side data, the full community model achieves the best translation performance in every language pair (Table 2).
The fair community model achieves comparable performance to the single pair model.
We show the learning curves of different models in Figure 5.
The full community model clearly learns much faster than the other two.
The fair community also learns faster than the single-pair model, as it learns with equivalent speed but with less exposure to individual language pairs, since we sample a language pair for each batch, rather than always having the same one.
C ONCLUSIONS AND F UTURE W ORK
In this paper, we have shown that the ability to understand a foreign language, and to translate it in the agent’s native language, can emerge from a communication task.
We argue that this setting is natural, since humans learn language in a similar way: by trying to understand other humans while being grounded in a shared environment.
We empirically conﬁrm that the capability to translate is facilitated by the fact that agents have a shared visual modality they can refer to in their respective languages.
Our experiments show that our model outperforms recently proposed baselines where agents do not communicate, as well as several nearest neighbor based baselines, in both sentence- and word-level scenarios.
In future work, we plan to examine how we can enrich our agents with the ability to understand and translate abstract language, possibly through multi-task learning. A CKNOWLEDGEMENT
KC thanks support by eBay, TenCent, Facebook, Google and NVIDIA.
We thank our colleagues from FAIR for helpful discussions.
A C HOICE OF L ISTENER L OSS F UNCTION
We compare two alternatives for training the listener: (1) a pairwise ranking loss, as used in Havrylov & Titov (2017) and Nakayama & Nishida (2017), and (2) the MSE loss, in addition to the one (Eq.
(1)) used in this paper.
Pairwise ranking loss Denoting the message vector, the target image and the k -th distractor image as ˆ m, i and i k , respectively, this cost function is expressed as:
[Equation]
where α is a margin hyperparameter and sim ( · ) is a function that computes the similarity between two vectors.
The most common choice for sim ( · ) in practice is cosine similarity (Nakayama &
Nishida, 2017).
Note, however, that this only aligns the direction of the message and the target image vectors, not the magnitude.
To facilitate translation, the speaker module should take as input a normalized image vector.
We found this use of normalized image vectors to consistently hurt performance in all our experiments.
MSE loss It has been found that minimizing the MSE loss can be effective in learning visually grounded representations of language (see, e.g., Chrupala et al., 2015).
While our loss function is very similar to minimizing the MSE loss, there is an important distinction.
Letting x = E B EN ( ˆ m ) − E B IMG ( i ) , the MSE loss function is given by x 2 , with a derivative of 2 x .
Our loss function is − log(1 /x 2 ) , of which the derivative is 2 /x .
Note that the gradient is initially small, when x is large, but grows larger in magnitude as the listener loss is minimized.
In Figure 6, we show the learning curve of our model on Multi30k Task 2 EN-DE trained using either our listener loss function or the MSE loss.
At the initial stage of learning, the listener trained using our loss function learns very slowly due to a small gradient.
As the listener becomes better at aligning target images and sentences, it begins to learn much more quickly.
On the other hand, we observe that the listener trained using the MSE loss immediately starts to learn, but learning slows down quickly.
Our loss term − log(1 /x 2 ) is not deﬁned at 0.
In practice, x is almost never 0 , and we further add small noise to x both to avoid x = 0 and to regularize learning.
Empirically, we observe our formulation gives much better translation performance than both the pairwise ranking loss and the
MSE loss.
B W ORD -L EVEL N EAREST N EIGHBOR A NALYSIS
Table 3 showcases three concepts in English and German, where for each concept, the most representative image is shown, as well as the ﬁve nearest neighboring words (by cosine similarity).
We note that nearest neighbors for most words correspond to our semantic judgments: galaxy is closest to universe in English and Galaxie to Universum in German.
Similarly, plant or Pﬂanze
[Table]
is closest to leaf or Blatt .
For concepts that evoke different senses across languages, however, we observe different nearest neighbors.
For example, most images for Fox in the dataset contain a person [Table] whereas images for Fuchs contain an animal.
This encourages the German agent to associate
Fox closely with Celebrity and Girl , whereas the English agent learns that Fuchs is a furry animal, similar to K¨anguru or L¨owe .
C S ENTENCE -L EVEL S AMPLE T RANSLATIONS
[Table]
In Table we compare sample translations from our nearest neighbor and NMT baselines, as well as the best model from (Nakayama & Nishida, 2017) and our best model.
We observe that the nearest neighbor baseline generates translations that are mostly unrelated to the reference sentence.
The NMT baseline, on the other hand, often generates the correct subject of the sentence, and seems capable of capturing the main actor in the scene.
The 3-way, both decoder model from (Nakayama & Nishida, 2017) captures the main actors and the environment in the scene.
Our model appears to capture even the minor details, such as quantity (number of dogs) and speciﬁc activity (parasailing, skateboarding).
D S ENTENCE - LEVEL Q UALITATIVE A NALYSIS
We conjectured that grounding the native and foreign languages into a shared visual space allows agents to understand foreign languages.
To verify this, we trained our base model (not pretrained) on COCO & STAIR, where agents have language-speciﬁc image encoders, e.g. the English agent has two separate image encoders: one for the English speaking module and another for the Japanese encoder.
We compare this with our original model with the same architecture.
We plot the communication accuracy and JA-EN validation BLEU scores in Figure 7.
Red curves indicate validation communication accuracy (left axis), and green curves indicate BLEU score (right axis).
Solid lines denote the standard model and dotted lines denote the model without sharing the image encoder.
We observe no signiﬁcant difference in the communication performance: the model that does not share the image encoder performs just as well in the communication task.
However, translation performance greatly suffers without access to the shared visual modality.
In Figure 8, we show the learning curve of four base models, with different number of distractors ( K ).
We observe that a larger number of distractors helps the model learn faster initially, but otherwise gives no performance beneﬁt.
E T RANSLATION IN N ON - CONCRETE D OMAINS
As our agents understand foreign languages through grounding in the visual modality, we investigate their ability to generalize to non-visual, abstract domains.
We train our (pretrained, spk ﬁxed) model on Multi30k Task 2, and let it translate German sentences from WMT’15 DE-EN validation and test set.
See Table 5.
We note that our model is able to capture some visual elements in a sentence, such as snow or mountain , but generally produces poor quality translations.
We observe that most words in the source sentence from WMT’15 do not occur in Multi30k’s training set, hence our model mostly receives < UNK > vectors.
F Z ERO - RESOURCE T RANSLATION
To showcase our models’ ability to learn to translate without parallel corpora, we train our base model on a communication task between a low-resource language pair: German and Japanese.
We take the German corpus from Multi30k Task2, the Japanese corpus from STAIR, and train two models on a sentence-level communication task between the two languages.
In Tables 6 and 7, we show the Japanese source sentence (src), the model output in German (hyp), and their translation to
English using Google Translate.
We observe that our model mostly generates reasonable sentences, and captures properties such as color and action in the scene.
Src
Schnee liegt insbesondere auf den Straßen im Riesengebirge und im Gebirge Orlick´e hory.
Ref
Snow is particularly affecting the roads in the Krkonose and Orlicke mountains.
Hyp a man is standing on a snow covered mountain .
Src
Das Tote Meer ist sogar noch w¨armer und dort wird das ganze Jahr ¨uber gebadet.
Ref
The Dead Sea is even warmer, and people swim in it all year round.
Hyp a man is surﬁng in the ocean .
Src
Es folgten die ersten Radfahrer und L¨aufer um 10 Uhr.
Ref
Then it was the turn of the cyclists and runners, who began at 10 am.
Hyp a man in a red and white uniform is riding a dirt bike in front of a crowd .
Src
Das Baby, das
so ergreifend von einem Spezialeinsatzkommando in Sicherheit getragen wurde
[Table]
The baby who was carried poignantly to safety by a special forces commando
Hyp a baby in a yellow shirt is sleeping .
[Table] [Table]
G A LIEN L ANGUAGE T RANSLATION
To demonstrate our models’ ability to learn to translate only with monolingual captions
[Figure]
we experiment with a language for which no parallel corpus exists
[Figure]
nor the knowledge of the language itself: Klingon.
As no image captions are available in Klingon
[Figure]
we translate 15k English captions in Multi30k Task 1 into Klingon pIqaD 6 using Bing Translator.
We tokenize the Klingon captions and discard words occurring less than 5 times in the training data.
We then train our base model (no pretraining) on English and Klingon communication.
In Tables 9 and 10, the source sentence in
English is shown as src , the Klingon model output in hyp , and the English translation of the output in hyp (en) (using Bing Translator).
Although the Klingon training data is noisy and imperfect, we observe that our model learns to translate only with 15k Klingon captions.
This example illustrates how we can learn to translate even if there is no knowledge of the other language
[Figure]
and where a professional translator would take a long time to ﬁrst acquire the other language
[Figure]
[Figure]