Empowering Diffusion Models on the Embedding Space for Text Generation

Zhujin Gao, Junliang Guo, Xu Tan, Yongxin Zhu, Fang Zhang, Jiang Bian, Linli Xu

TL;DR

This paper introduces Difformer, a novel Transformer-based diffusion model for text generation that tackles two key challenges: embedding space collapse and model degeneration. By proposing an "anchor loss" and a "noise rescaling" technique, Difformer achieves state-of-the-art performance on various text generation tasks, outperforming previous embedding diffusion models.

What Problem Does This Paper Address?

Diffusion models have shown remarkable success in generating high-quality images and audio. Recently, researchers have attempted to adapt these models for text generation by diffusing on the embedding space of words, rather than discrete tokens. However, this adaptation faces unique challenges. Firstly, unlike static image/audio data, text embeddings are learnable and can shift during training, leading to an "embedding space collapse" where embeddings become indistinguishable and the model's training becomes unstable. Secondly, conventional noise schedules used in diffusion models are often insufficient for text generation, causing the denoising model to "degenerate" into a trivial solution that doesn't effectively utilize the conditioning information. This paper systematically studies these issues and proposes solutions to empower diffusion models for text generation.

Methods

The paper introduces two core innovations:

  • Anchor Loss: To combat the embedding space collapse, the authors propose an "anchor loss." This loss function leverages the model's prediction of the clean data (embedding) as an anchor, forcing the model to correctly identify noisy representations as the target tokens. This provides a stronger regularization than previous methods and stabilizes training.
  • Noise Rescaling: To address model degeneration caused by insufficient noise, a "noise rescaling" framework is introduced. This technique defines a "DeGeneration Score" (DGS) to quantify the model's tendency to degenerate. Based on this score, a rescaling factor is applied to the noise schedule, amplifying the noise added to embeddings to prevent the model from becoming trivial.

The overall model, Difformer, is built upon a Transformer architecture and integrates these two techniques. It also incorporates length prediction for more efficient generation.

Datasets

The paper evaluates Difformer on several standard text generation benchmarks:

  • Machine Translation: WMT14 En-De, WMT16 En-Ro, IWSLT14 De-En
  • Text Summarization: Gigaword
  • Paraphrasing: Quora Question Pairs (QQP)
  • Text Simplification: Wiki-Auto
  • Question Generation: Quasar-T (QT)

Key Insights and Ideas

  • Learnable Embeddings are a Double-Edged Sword: While learnable embeddings are crucial for capturing semantic information in text, their dynamic nature poses a significant training challenge (collapse and instability) for diffusion models.
  • Noise Schedules Matter (A Lot): The choice of noise schedule is critical. Insufficient noise leads to a degenerate model that fails to leverage context, significantly impacting performance.
  • Quantifying Degeneration is Key: Defining and measuring the "DeGeneration Score" (DGS) provides a principled way to understand and mitigate the degeneration problem.
  • Noise Rescaling is a Universal Fix: The proposed noise rescaling technique is shown to be effective across different noise schedules, improving performance by preventing degeneration.
  • Anchor Loss for Stability: The anchor loss offers a more robust regularization mechanism than previous approaches like rounding loss, leading to better embedding distribution and training stability.

Key Results

  • State-of-the-Art Performance: Difformer outperforms previous embedding diffusion models and iterative non-autoregressive baselines on various text generation tasks, achieving competitive results even with autoregressive models.
  • Significant BLEU Improvements: For example, on the IWSLT14 De-En dataset, Difformer achieves a BLEU score of 34.48, outperforming baselines like DiffuSeq (28.78) and SeqDiffuSeq (30.03).
  • Efficiency: Difformer achieves comparable quality with significantly fewer reverse steps (K=20) compared to previous diffusion models, leading to faster inference speeds (e.g., 6x faster than Transformer and 3x faster than CMLM with small K).
  • Ablation Studies: Both anchor loss and noise rescaling contribute significantly to performance improvements, with their combination yielding the best results.

Limitations and Future Work

  • Training Time: While inference is efficient, Difformer's training time is still longer than some non-autoregressive models like CMLM.
  • Rescaling Factor Search: The search for the optimal rescaling factor is currently an offline process.
  • Future Work: The authors suggest exploring ways to improve training efficiency and potentially automate the search for the rescaling factor. They also highlight the potential for diffusion models to scale to larger datasets and tasks due to the robustness provided by noise rescaling.

Summary updated

BibTeX
@inproceedings{gao2024empowering,
  author = {Zhujin Gao and Junliang Guo and Xu Tan and Yongxin Zhu and Fang Zhang and Jiang Bian and Linli Xu},
  title = {{Empowering Diffusion Models on the Embedding Space for Text Generation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.261},
}
Figure