← all repositories
CR-Gjx/LeakGAN

When your GAN snitches on itself: leaking discriminator features to write longer text

A 2018 AAAI paper that fixes the classic GAN problem for text generation—scalar rewards arriving too late—by letting the discriminator leak its own hidden features mid-generation.

576 stars Python Language ModelsAgents
LeakGAN
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

LeakGAN generates text longer than 20 words without falling apart, using a GAN where the discriminator secretly tips off the generator during writing. It runs on TensorFlow 1.2.1 and Python 2.7, with experiments on synthetic data and Image COCO captions.

The interesting bit

The “leak” is the clever part: the discriminator’s CNN feature maps get piped to a Manager LSTM, which translates them into goal embeddings that guide a Worker LSTM word-by-word. The paper claims this lets the model implicitly learn sentence structure from pure adversarial interaction—no supervised parsing required.

Key highlights

  • Hierarchical generator with Manager/Worker modules, both LSTM-based
  • Discriminator leaks high-level CNN features mid-generation, not just final scalar reward
  • Tested on synthetic data and real-world Image COCO captions
  • Explicitly designed to beat the “more than 20 words” wall that breaks standard SeqGAN-style approaches
  • Code builds directly on LantaoYu’s SeqGAN

Caveats

  • Locked to TensorFlow 1.2.1 and Python 2.7—archaeology required to run in 2024
  • README is sparse on implementation details; you’ll be reading the paper for hyperparameters
  • No training curves, sample outputs, or pre-trained models in the repo

Verdict

Worth studying if you’re building hierarchical RL for generation or researching why GANs fail at long text. Skip if you need something that runs out of the box on modern PyTorch—this is a reference implementation from the TF 1.x era, not a maintained tool.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.