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

SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient

SeqGAN trains text generators with policy gradients instead of GAN gradients

  • Problem GAN gradients fail for discrete tokens, because a small change to a token choice has no matching token. The discriminator also scores only finished sequences, not partial ones.
  • Method SeqGAN treats the token generator as a stochastic policy. It uses the discriminator's score on a finished sequence as the reward, estimates partial sequence values by Monte Carlo rollouts, and updates the generator by policy gradient.
  • Results On a synthetic oracle task, SeqGAN reaches an NLLoracle of 8.736, against 9.038 for the MLE-trained generator, where lower is better.

Why GANs struggle with discrete tokens

Recurrent generators trained by maximum likelihood predict each token from the true prefix, but at inference they condition on their own earlier outputs, which the training data may never have contained. This exposure bias compounds along the sequence. Scheduled sampling reduces the mismatch by feeding the model its own generated tokens during training, yet a later analysis cited by the authors argues that it is an inconsistent strategy that does not fix the problem at its root.

A GAN pairs a discriminator that separates real data from generated data with a generator that tries to fool it, and this has worked well for natural images. For tokens the approach breaks down. The discriminator's gradient tells the generator how to nudge a continuous output, but a small nudge to a choice from a finite vocabulary has no matching token, so the signal carries little meaning.

A second obstacle is timing. The discriminator judges only a complete sequence, so a partial prefix has no direct score, and it is unclear how its current quality should be weighed against the quality of whatever follows it.

The generator as a stochastic policy

SeqGAN recasts generation as a sequence of decisions. The state at step t is the prefix generated so far, the action is the next token, and the generator G_θ(y_t | Y_{1:t-1}) is a stochastic policy that picks that token. Choosing a token deterministically appends it to the prefix, so the state transition itself carries no randomness. The randomness lives entirely in the policy's choice of action.

The only reward is given after the last token: the discriminator's estimated probability that the finished sequence came from real data, D_φ(Y_{1:T}). Intermediate steps receive no direct reward. Because the policy parameters are updated directly, the discrete token choice never needs to be differentiated through, which is the point where the usual GAN gradient fails for text.

Estimating action values and updating the generator

For an intermediate prefix Y_{1:t}, the action value is the average discriminator score over N completions. Each completion Y^n_{t+1:T} is sampled from a roll-out policy G_β conditioned on the prefix. The formula is \( Q(Y_{1:t-1}, y_t) = \frac{1}{N}\sum_{n=1}^{N} D_\phi(Y^n_{1:T}) \) for t < T, and \( Q = D_\phi(Y_{1:T}) \) at t = T. The roll-out policy is set equal to the generator in these experiments, with a simpler roll-out allowed when speed matters more.

Averaging over N completions reduces the variance of the estimate.

The gradient is approximated on one sampled episode as \( \nabla_\theta J(\theta) \simeq \sum_{t=1}^{T}\sum_{y_t} \nabla_\theta G_\theta(y_t|Y_{1:t-1})\, Q(Y_{1:t-1},y_t) \), which can be rewritten as an expectation of the log-probability gradient weighted by Q. The parameters are then moved by \( \theta \leftarrow \theta + \alpha_h \nabla_\theta J(\theta) \).

Adam and RMSprop can replace the plain step. The Monte Carlo estimates are recomputed for each generated sequence, so the update always uses the current discriminator.

Alternating generator and discriminator training

Training starts by fitting the generator with maximum likelihood on the real sequences, then fitting the discriminator by minimizing cross entropy with negative examples drawn from that generator. The authors found the signal from this pre-trained discriminator informative for adjusting the generator.

Each round has g-steps of generator updates by policy gradient, followed by d-steps in which the discriminator is retrained. The retraining uses the same real sequences as positives and freshly generated sequences as negatives, with equal counts of each. Reusing the same positives with different sets of negatives acts like bootstrapping and reduces the variance of the discriminator's estimates.

The discriminator objective is \[\min_\phi -\mathbb{E}_{Y\sim p_{data}}[\log D_\phi(Y)] - \mathbb{E}_{Y\sim G_\theta}[\log(1-D_\phi(Y))]\], which is the cross entropy between the labels and the predicted probability. Each d-step trains the discriminator for k epochs on this loss.

Generator and discriminator networks

The generator is a recurrent network whose hidden state is updated as h_t = g(h_{t-1}, x_t), with the LSTM cell implementing g. A softmax layer over a bias c and a weight matrix V gives the distribution over the next token. The authors note that other recurrent variants, such as the GRU and attention, could serve as the generator without changing the framework.

The discriminator is a convolutional network over the token embeddings concatenated into a matrix. Each kernel slides over a window of l tokens and produces a feature map, and max-over-time pooling keeps the strongest response per kernel. A highway layer then mixes the pooled features with a transformed copy through a transform gate, and a fully connected sigmoid output gives the probability that the input is real.

The generated sequence has a fixed length T.

Synthetic oracle comparison

A randomly initialized LSTM serves as the oracle and generates 10,000 training sequences of length 20. Each model then draws 100,000 samples, and their NLLoracle under the oracle is averaged, with lower values indicating better sequences. The baselines are random token generation, an MLE-trained LSTM, scheduled sampling and PG-BLEU, which scores finished samples with BLEU.

For scheduled sampling the curriculum rate decreases by 0.002 per epoch.

Random generation reaches an NLLoracle of 10.310 and MLE 9.038. Scheduled sampling reaches 8.985 and PG-BLEU 8.946, while SeqGAN reaches 8.736.

In the learning curves, MLE and scheduled sampling settle at a relatively high NLLoracle after about 150 epochs, while SeqGAN keeps improving the same generator structure. The authors read the gap to PG-BLEU as evidence that a discriminator signal guides the policy better than a predefined score such as BLEU.

How the training schedule affects stability

Four settings are shown: g-steps=100 with d-steps=1 and k=10; g-steps=30 with d-steps=1 and k=30; g-steps=1 with d-steps=1 and k=10; and g-steps=1 with d-steps=5 and k=3.

When the generator takes many steps per discriminator update, convergence is fast, but the generator improves faster than the discriminator can follow. The discriminator then gives misleading signals gradually. Training the discriminator for more epochs reduces this instability.

Updating the discriminator after a single generator epoch, before it is fooled, lets the run learn stably. Using five d-steps per round, so the discriminator sees several different negative sets for the same positives, improves overall performance with good stability. The authors tie this to the theorem in the original GAN work.

Poem and Obama speech generation

The poem corpus contains 16,394 Chinese quatrains of four lines of twenty characters. The Obama corpus contains 11,092 paragraphs from political speeches. BLEU-2 is used for poems because most words in classical Chinese poems have one or two characters, while BLEU-3 and BLEU-4 are used for the speeches. BLEU compares against the whole test set rather than against a specific line.

For the human judgement, 20 real poems and 20 each from SeqGAN and MLE were mixed, and 70 experts judged 60 poems. A poem counted one point when judged human-written. The mean human score is 0.4165 for MLE, 0.5356 for SeqGAN and 0.6011 for real poems, with a p-value of 0.0034 for MLE against the reference. The authors describe SeqGAN as performing comparably to real human poems in this judgement.

Piano-key music generation

The training data are the solo tracks of 695 Nottingham folk tunes in MIDI format. Pitches are mapped to 88 numbers, sampled every 0.4 s, and cut into sequences of length 32. BLEU is used for the discrete piano keys, and mean squared error for the continuous pitch patterns, where a lower error is better.

Limitations

The convergence analysis assumes the discriminator can reach its optimum for a given generator. Only then is its signal meaningful and the adversarial training stable, so the analysis does not cover a discriminator that stays weak.

The exact oracle evaluation exists only for the synthetic task. The poem, speech and music results depend on BLEU against reference texts, and the poem human judgement uses 70 experts on 60 poems. The main text reports one value per model in its tables, with no spread across runs.

The generated sequence length is fixed for the discriminator, and variable-length discrimination is mentioned only as a possibility. The authors state that SeqGAN is the first work to extend GANs to generate sequences of discrete tokens; this is their own claim of priority.

Paper info

Authors
Lantao Yu, Weinan Zhang, Jun Wang, Yong Yu
Venue
arXiv · Preprint
First published
2016-9-18
Added
2026-11-12
Updated
2017-8-25
Version
v6
arXiv
1609.05473
Category
cs.LG · cs.AI
Original paper terms
CC BY-SA 4.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

Lantao Yu, Weinan Zhang, Jun Wang, Yong Yu (2016). SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient. arXiv:1609.05473v6. https://arxiv.org/abs/1609.05473v6

BibTeX
@misc{yu2016seqgan,
  title = {{SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient}},
  author = {Lantao Yu and Weinan Zhang and Jun Wang and Yong Yu},
  year = {2016},
  eprint = {1609.05473},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1609.05473v6}
}

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