The truncation trick is a sampling technique for generative adversarial networks that restricts latent vectors to the high-density center of their distribution, so that the generator produces more typical, higher-fidelity outputs at the cost of diversity. In Generative AI it is best known from BigGAN and StyleGAN, where a single scalar, usually called the truncation threshold or truncation psi (ψ), lets a user move smoothly along the fidelity-diversity trade-off without retraining the model.
The technique is applied only at inference time. Training still uses the full prior, typically a standard normal distribution, but sampling deliberately avoids the low-density tails where the generator received little training signal and where artifacts are most likely.
How the truncation trick reshapes latent sampling
The truncation trick works by pulling samples toward the mode of the latent distribution. A GAN maps a latent vector z to an image, and regions of latent space far from the mean are visited rarely during training. The generator therefore maps those regions to images that are less realistic, distorted or incoherent, which the trick avoids.
Two formulations are common. BigGAN-style truncation draws each component of z from a standard normal distribution and resamples any value whose magnitude exceeds a threshold, producing a truncated normal. StyleGAN-style truncation operates in the intermediate latent space W: it computes the average latent vector w̄ over many samples and replaces each sampled w with w' = w̄ + ψ(w - w̄), a linear interpolation toward the center.
The following table compares the two main variants and the parameter each one exposes.
| Variant | Space affected | Control parameter | Behavior at the extreme |
|---|---|---|---|
| BigGAN truncation | Input noise z | Threshold, often 0.04 to 2.0 | Near zero yields almost one image per class |
| StyleGAN truncation | Intermediate latent W | ψ between 0 and 1 | ψ = 0 returns the average image |
| Layer-limited truncation | Selected W inputs only | ψ plus a layer cutoff | Coarse features fixed, fine details vary |
| Class-conditional truncation | Per-class mean in W | ψ toward a class center | Typical example of the chosen class |
The fidelity and diversity trade-off
Truncation raises sample quality and lowers sample variety in a single, predictable motion. As ψ or the threshold decreases, faces become more symmetrical, objects more canonical and backgrounds cleaner, but outputs start to resemble one another and rare attributes disappear.
This trade-off is visible in standard metrics. Inception Score (IS) rewards confident, class-recognizable images and therefore rises with stronger truncation. Fréchet Inception Distance (FID) compares the full feature distribution with real data, so it usually improves at moderate truncation and worsens at strong truncation, once lost diversity outweighs gained quality. Precision and recall metrics for generative models separate the two effects more clearly.
The table below summarizes typical effects of different truncation strengths; exact values depend on the model and dataset.
| Setting | Visual result | Diversity | Typical metric behavior |
|---|---|---|---|
| ψ = 1.0 (none) | Full variety, occasional artifacts | Highest | Best recall, weaker precision |
| ψ ≈ 0.7 | Clean outputs, broad variety | High | Often near the best FID |
| ψ ≈ 0.5 | Very polished, more uniform | Moderate | Higher precision, FID rising |
| ψ ≈ 0.2 or less | Near-identical average images | Very low | High IS, poor FID and recall |
Why some generators tolerate truncation better
Not every GAN responds well to truncation. In the original BigGAN work, several large models produced saturation artifacts when sampled from a truncated prior, because the generator had not learned a smooth mapping near the center. The authors addressed this with orthogonal regularization, which encourages weight matrices to stay close to orthogonal and makes the generator amenable to truncation.
StyleGAN benefits from its mapping network, which transforms z into the more disentangled space W. Because W is less entangled than z, interpolating toward w̄ changes attributes gradually and coherently. StyleGAN also allows truncation to be applied only to the coarse layers, which fixes pose and overall shape while leaving color and texture free to vary.
How it relates to other quality controls in generative models
The truncation trick belongs to a broader family of inference-time controls that concentrate samples on high-likelihood regions. Each one trades coverage for typicality, although the mechanism differs by model family.
| Technique | Model family | Mechanism | Shared effect |
|---|---|---|---|
| Truncation trick | GANs | Shrinks latent samples toward the mean | Quality up, diversity down |
| Classifier-free guidance | Diffusion models | Amplifies conditional over unconditional prediction | Prompt adherence up, variety down |
| Temperature scaling | Autoregressive and flow models | Sharpens or flattens output distribution | Lower values give safer outputs |
| Top-k and nucleus sampling | Autoregressive models | Cuts low-probability tokens | Fewer incoherent continuations |
Truncation should not be confused with mode collapse. Mode collapse is a training failure in which the generator covers only part of the data distribution; truncation is a deliberate, reversible choice at sampling time on a model that may cover the distribution well.
Practical use, limitations and common mistakes
Practitioners choose ψ by purpose rather than by a fixed rule. Showcase images and demonstrations favor stronger truncation, while dataset augmentation and evaluation require weak or no truncation to preserve coverage of the real distribution.
| Situation | Recommended setting | Reason |
|---|---|---|
| Reporting FID or recall | ψ = 1.0 or as specified | Truncation biases distribution metrics |
| Portfolio or demo images | ψ about 0.5 to 0.7 | Polished results with acceptable variety |
| Synthetic training data | ψ about 0.8 to 1.0 | Preserves rare cases and edge examples |
| Exploring unusual outputs | ψ above 1.0 | Extrapolates away from the mean, with more artifacts |
- Comparing models at different truncation levels makes FID and IS results misleading; always report the setting.
- Strong truncation amplifies dataset bias, because the mean latent reflects the most common attributes in the training data.
- Computing w̄ from too few samples gives an unstable center; tens of thousands of samples are a common choice.
- Truncation cannot repair a poorly trained generator; it only hides tail regions of the latent space.
A plain-language summary
An image generator starts from a random list of numbers. Most of those numbers fall in a familiar middle range. A few land far out at the edges, and the generator handles those poorly. The truncation trick keeps the random numbers closer to the middle.
The result is like asking a portrait painter for a typical face instead of an unusual one. The pictures look cleaner and more convincing. They also look more alike. The single dial trades variety for polish, and the user decides where to set it.
An example from practice
A design team uses a StyleGAN model trained on product photos to generate concept images of ceramic vases. At ψ = 1.0, roughly one image in five shows warped rims or melted textures, which forces staff to sort through large batches by hand.
The team sets ψ to 0.6 for presentation material. Almost every output now looks like a plausible, well-lit vase, and review time drops sharply. However, the unusual asymmetrical shapes that inspired several earlier ideas largely disappear.
For idea generation the team therefore keeps a second workflow at ψ = 0.9, accepting more rejects in exchange for variety. When the team later benchmarks a new model, it disables truncation entirely so that FID scores remain comparable with published results.