Skip to main content
QUICK REVIEW

[Paper Review] Twin Networks: Matching the Future for Sequence Generation

Dmitriy Serdyuk, Nan Rosemary Ke|arXiv (Cornell University)|Aug 22, 2017
Speech Recognition and SynthesisComputer Science40 references30 citations
TL;DR

This paper introduces TwinNet, a training regularization technique for generative RNNs that improves long-term dependency modeling by training a backward RNN to predict sequences in reverse and aligning forward and backward hidden states. The method achieves a 9% relative improvement on speech recognition and significant gains on image captioning, with minimal inference overhead as the backward network is discarded post-training.

ABSTRACT

We propose a simple technique for encouraging generative RNNs to plan ahead. We train a "backward" recurrent network to generate a given sequence in reverse order, and we encourage states of the forward model to predict cotemporal states of the backward model. The backward network is used only during training, and plays no role during sampling or inference. We hypothesize that our approach eases modeling of long-term dependencies by implicitly forcing the forward states to hold information about the longer-term future (as contained in the backward states). We show empirically that our approach achieves 9% relative improvement for a speech recognition task, and achieves significant improvement on a COCO caption generation task.

Motivation & Objective

  • To address the challenge of modeling long-term dependencies in autoregressive sequence generation, where models often focus on local correlations due to one-step-ahead training objectives.
  • To improve global coherence in generated sequences by encouraging the forward RNN to anticipate future content through implicit planning.
  • To develop a simple, efficient regularization method that does not alter inference or sampling complexity.
  • To empirically validate the method across diverse tasks, including speech recognition, image captioning, language modeling, and sequential MNIST generation.

Proposed method

  • Train a separate backward RNN to predict the input sequence in reverse order, with no parameter sharing with the forward network.
  • Introduce a regularization loss that encourages the forward hidden state at time t to match the backward hidden state at the same time step.
  • Use a learned metric or L2 distance to compute the alignment loss between forward and backward hidden states.
  • Optimize the combined objective: standard cross-entropy loss for sequence generation plus the alignment loss between forward and backward states.
  • Discard the backward network during inference and sampling, preserving the original model’s efficiency.
  • Apply the method to both conditional and unconditional generation tasks, including speech-to-text, image captioning, language modeling, and sequential MNIST.

Experimental results

Research questions

  • RQ1Can aligning forward and backward RNN hidden states improve modeling of long-term dependencies in sequence generation?
  • RQ2Does this regularization technique lead to better global coherence in generated sequences without increasing inference cost?
  • RQ3How does the method perform across diverse sequence generation tasks, including those with strong local correlations?
  • RQ4What is the impact of the alignment loss on model performance in high-entropy tasks like language modeling?
  • RQ5Can the method be effectively applied to models requiring expensive sampling, such as PixelRNN or WaveNet?

Key findings

  • TwinNet achieved a 9% relative improvement on a speech recognition task, demonstrating enhanced modeling of long-term dependencies.
  • The method significantly improved performance on the COCO image captioning task, indicating better global coherence in generated captions.
  • On sequential MNIST, TwinNet reduced test set loss by 0.52 nats compared to the baseline LSTM, with further gains when combined with dropout.
  • On Penn Treebank and WikiText-2, TwinNet reduced test perplexity by 0.5–0.9 points compared to AWD-LSTM, showing consistent gains in language modeling.
  • The alignment loss negatively correlated with word frequency, indicating higher regularization for rare or more surprising words.
  • The backward network was discarded during inference, preserving the same computational cost as the baseline, making the method suitable for expensive autoregressive models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.