Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Convolutional Sequence to Sequence Learning

Convolutional networks replace recurrence in sequence to sequence translation

  • Problem Recurrent sequence to sequence models process one step at a time, so training cannot run in parallel across the positions of a sentence.
  • Method ConvS2S replaces the recurrent encoder and decoder with stacked convolutional blocks using gated linear units and residual connections. It also adds an attention module to every decoder layer.
  • Results ConvS2S beats the deep LSTM setup of Wu et al. (2016) on WMT'14 English-German and English-French translation and runs an order of magnitude faster on GPU and CPU.

Why drop recurrence for sequence to sequence learning

Sequence to sequence models for translation and summarization usually pair bidirectional recurrent encoders with recurrent decoders, joined by a soft attention mechanism. Because each recurrent state depends on the state before it, the computation for one sentence cannot be spread across its positions, which limits how well training uses parallel hardware.

Convolutions compute each state from a fixed window and do not depend on earlier time steps, so all positions of a sequence can be computed together. Stacking layers enlarges the window that a state covers, so the depth of the network sets how far apart two dependent elements can be. The authors argue that this hierarchy gives a shorter path between distant elements than the chain of steps in a recurrent network.

A gated convolutional translation model was tested only on a small dataset and was used together with a count-based model, and partially convolutional systems kept a recurrent decoder.

Embeddings and convolutional blocks in ConvS2S

Each input token is looked up in an embedding matrix, and an absolute position embedding is added to it, so the model knows where each element sits in the sequence. The decoder applies the same procedure to the target elements it has already generated, and feeds these representations back as its inputs.

A gated linear unit then halves this output by multiplying one half by the sigmoid of the other half, which lets the gate choose which inputs of the current context pass through. \[ v([A\,B]) = A \otimes \sigma(B) \] The authors choose this gate over a tanh-based variant because gated linear units performed better for language modelling in earlier work.

Each block adds its input to its output as a residual connection, which allows stacking many blocks. Encoder layers are padded so that the output length equals the input length, whereas decoder layers pad the input by \(k-1\) zero vectors on each side and drop \(k\) elements from the end, so no future target element reaches the decoder. Linear projections map between the embedding size \(f\) and the \(2d\) convolution outputs, and a final linear layer with a softmax gives a distribution over the target vocabulary.

Stacking six blocks with \(k=5\) gives a receptive field of 25 input elements, so the effective context depends on depth and kernel width together.

Attention in every decoder layer

Each decoder layer combines its current state with an embedding of the previous target element through a linear map, which forms a state summary used as the attention query. The attention weight of source element \(j\) for decoder position \(i\) in layer \(l\) is a softmax over dot products between that summary and the outputs of the last encoder block.

\[ a^{l}_{ij} = \frac{\exp(d^{l}_{i} \cdot z^{u}_{j})}{\sum_{t=1}^{m} \exp(d^{l}_{i} \cdot z^{u}_{t})} \]

\[ c^{l}_{i} = \sum_{j=1}^{m} a^{l}_{ij}\,(z^{u}_{j} + e_{j}) \]

Since the context of one layer feeds the next, the attention of earlier layers shapes what later layers attend to, which the authors describe as attention with multiple hops. The decoder also sees the conditional inputs of the previous \(k-1\) steps, because they are part of the states it receives, so it can track which inputs were already attended to.

The attention for all target positions of a layer is computed in one batch, so each decoder layer is batched separately.

Scaling and initialization for stable training

The sum of a residual block's input and output is multiplied by \(\sqrt{0.5}\) to halve the variance of the sum, which assumes both summands have equal variance. The conditional input is a sum of \(m\) weighted vectors, so it is multiplied by \(m\) and scaled by \(1/m\) to counteract the change of variance, assuming the attention scores are uniformly distributed.

The authors note that these assumptions are generally not true and say the scaling works well in practice. With several attention modules, the encoder layer gradients are scaled by the number of attention mechanisms, excluding the source word embeddings, because the encoder otherwise received too much gradient.

Layers followed by a gated linear unit are initialized with four times that variance, because the gate roughly reduces the output variance to a quarter of the input variance under small-variance, zero-mean assumptions. Biases are set to zero at construction.

Dropout with retain probability \(p\) multiplies the variance by \(1/p\), so the initialization is enlarged by \(p\): the weights of layers followed by a gated linear unit use a scale based on \(4p/n_l\), and the other layers use \(p/n_l\). Dropout is applied to the embeddings, to the decoder output and to the input of the convolutional blocks.

Datasets, optimization and decoding

WMT’16 English-Romanian uses 2.8M training sentence pairs and is evaluated on newstest2016, with word-based models that use a source vocabulary of 200K and a target vocabulary of 80K types, and with BPE of 40K types. WMT’14 English-German uses 4.5M training pairs, and WMT’14 English-French uses 35.5M pairs after filtering the 36M full training set; both use 40K BPE types and are evaluated on newstest2014.

Abstractive summarization trains on the Gigaword corpus with 3.8M examples and is evaluated on the DUC-2004 test data of 500 pairs and on a Gigaword test set of 2000 pairs.

Training uses Nesterov's accelerated gradient with momentum 0.99, a learning rate of 0.25 that is reduced by an order of magnitude once validation perplexity stops improving, and gradient renormalization when the norm exceeds 0.1. Translations are decoded with beam search of width 5, with log-likelihoods normalized by length, and the length normalization constant was tuned only for WMT’14 English-German.

Unknown words are replaced with the source word that has the highest attention score, using a dictionary built with fast align, and BLEU is computed case-sensitive and tokenized, or detokenized for WMT’16 English-Romanian. Each model is reported as an average over three runs with different random seeds.

Translation accuracy against recurrent systems

On WMT’16 English-Romanian, the comparison is with the GRU-based attention model of Sennrich et al. (2016b), which won this pair at WMT’16.

On WMT’14 English-German, GNMT results are quoted from Wu et al. (2016) rather than re-run, so the comparison uses their reported numbers. A larger ConvS2S configuration with 15 encoder and 15 decoder layers reached 25.39 BLEU for its best run, which the authors set against a sparse LSTM mixture reported at 26.03 BLEU for a single run.

On WMT’14 English-French, the ConvS2S model trained with a token-level likelihood objective averages 1.6 BLEU more than GNMT in the same setting. This large configuration was trained on 8 GPUs for about 37 days with batch size 32 per worker, and a single best run reached 40.70 BLEU. The authors report that a sparse mixture of experts reached 40.56 BLEU against this best single run.

These are compared with GNMT ensembles, which score 26.20 and 40.35 with likelihood training and 26.30 and 41.16 with reinforcement learning, and with Zhou et al. (2016) at 40.4 on English-French.

Generation speed on GPU and CPU

Speed is measured on the WMT’14 English-French development set of 6003 sentences, with batches of up to 128 sentences of equal length and with beams of size 5 and greedy search. To avoid recomputing unchanged convolution states, the decoder copies and shifts the activations from the previous time step.

The GNMT timings on a K80 GPU, a CPU of 88 cores and a TPU are quoted from Wu et al. (2016), so they were not measured on the same machines as the ConvS2S timings. On a K40 GPU, ConvS2S decodes with beam 1 in 327 seconds, against 3,028 seconds for GNMT on the K80, and reaches 9.3 times the speed with 2.25 higher BLEU. The speed-up is up to 13.7 times on an M40 and 21.3 times on a GTX-1080ti, and a beam of 5 gives better BLEU at a lower speed.

On CPU, the paper reports up to 9.3 times the speed of GNMT, but the GNMT CPU run used 88 cores while the ConvS2S run used 48 hyper-threaded cores, so the authors also give a per-core figure of 17 times. The authors also say their CPU speed is 2.7 times that of GNMT on a custom TPU chip, but they did not report TPU figures because they did not have access to that hardware.

Position embeddings and attention in several layers

Scores are averaged over three runs and BLEU is measured on newstest2014 before unknown word replacement. The full model has validation perplexity 6.64 and BLEU 21.7, against 6.68 and 21.2 when both source and target position embeddings are removed. Removing only the source positions gives 6.69 and 21.3, and removing only the target positions gives 6.63 and 21.5, so the source positions matter more to BLEU.

The authors expected output lengths to suffer without position information, but lengths stayed close to those of the model with positions, which they take to mean the model learns relative position within its visible context of up to 27 source and 25 target words. Recurrent models need no explicit positions because the hidden state carries order, whereas here the addition is a small overhead on the input embeddings.

With multi-step attention in all five decoder layers, validation perplexity is 6.65 and BLEU is 21.63; with attention in layer 1 only it is 7.15 and 21.26, and with attention in layer 5 only it is 7.66 and 20.24. The subsets do not order cleanly: layers 1, 2 and 3 give 6.95 perplexity, and layers 1 and 2 give 6.92, so fewer layers do not always mean worse perplexity.

Training with attention in all five decoder layers processes 3624 target words per second, against 3772 for attention in one layer, which the authors read as a 4% slowdown for four added attention modules. The authors conclude from this that attention is not the bottleneck, and they batch the attention of each layer over all target words, unlike recurrent decoders.

Depth and kernel width of the encoder and decoder

The layer sweep keeps kernel width 3 in the encoder and 5 in the decoder, and the decoder reaches good accuracy already with two layers. Encoder accuracy keeps increasing with depth until about 9 layers, after which it plateaus.

Narrow kernels with many layers do better than wide ones, and a kernel over 3 inputs costs less than half the work of one over 7 inputs.

Abstractive summarization results

The summarization model has six layers in the encoder and six in the decoder, hidden size 256 and batch size 128, and was trained on one GPU in one night with standard likelihood training.

Limitations

The 15-layer English-French model has an effective context of about 25 words and cannot access information beyond that window on the target side. The scaling rules rest on assumptions the authors say do not always hold, namely equal variance of residual summands and uniform attention scores.

Training cost is high: the English-French model used 8 GPUs for about 37 days, and the authors note their basic reference used 96 GPUs for 6 days, although they expect training time to fall in a multi-machine setup. The GPU comparison uses an older K40 instead of the K80 used by the GNMT measurements, and the CPU comparison uses 48 cores against 88.

Summarization uses only likelihood training and is not run with the task-specific objectives of the strongest systems. Reinforcement learning was not applied to ConvS2S, and the authors believe it would improve results, but this was not tested.

Paper info

Authors
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, Yann N. Dauphin
Venue
arXiv · Preprint
First published
2017-5-8
Added
2026-11-12
Updated
2017-7-25
Version
v3
arXiv
1705.03122
Category
cs.CL
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, Yann N. Dauphin (2017). Convolutional Sequence to Sequence Learning. arXiv:1705.03122v3. https://arxiv.org/abs/1705.03122v3

BibTeX
@misc{gehring2017convolutional,
  title = {{Convolutional Sequence to Sequence Learning}},
  author = {Jonas Gehring and Michael Auli and David Grangier and Denis Yarats and Yann N. Dauphin},
  year = {2017},
  eprint = {1705.03122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1705.03122v3}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up