Latent Diffusion for Language Generation

Diffusion models have achieved great success in modeling continuous data modalities such as images, audio, and video, but have seen limited use in discrete domains such as language. Recent attempts to adapt diffusion to language have presented diffusion as an alternative to existing pretrained language models. We view diffusion and existing language models as complementary. We demonstrate that encoder-decoder language models can be utilized to efficiently learn high-quality language autoencoders. We then demonstrate that continuous diffusion models can be learned in the latent space of the language autoencoder, enabling us to sample continuous latent representations that can be decoded into natural language with the pretrained decoder. We validate the effectiveness of our approach for unconditional, class-conditional, and sequence-to-sequence language generation. We demonstrate across multiple diverse data sets that our latent language diffusion models are significantly more effective than previous diffusion language models.

Paper

References (81)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer TpnG6/10 · confidence 4/52023-07-02

Summary

This work proposes a new type of diffusion language model based on latent representations. The proposed approach leverages the continuous representation space produced by pre-trained encoder-decoder language models (BART and FLAN-T5). To embed the variable-length encoder features, the author(s) propose to adopt Perceiver Resampler to construct a fixed length latent representation. After obtaining the diffused representation, a reconstruction network is used whose output is later taken by the frozen language decoder to generate the output. Extensive experiments are performed on a few types of tasks across different benchmarks. The experimental results verify that the proposed approach outperforms existing diffusion-based methods and performs comparably with directly fine-tuned language models. Good discussions on future work are included in this work.

Strengths

* The paper is generally well-written and the presentation is clear. * The proposed model is novel in terms of architectural design and motivations. * Extensive experiments are conducted to sufficiently evaluate the method and the results are convincing.

Weaknesses

* One major weakness of this work is its potential impact to the research community in the long-term. From the presented results (Table 6), simply fine-tuning the language model still yields the best results across the board. In addition, the existing autoregressive language model such as ChatGPT and GPT-4 have proven their exceptional capabilities in various applications. On the other hand, it is hard to judge the performance of diffusion-based approaches, especially when the model is scaled up. I believe scaling up the proposed model is out-of-scope of the this work, but it worth considered by the author(s). * **An important comparison is missing**. From the first impression, the encoding of language encoder and the sequential decoding of language decoder are shared by both the proposed method and the standard autoregressive language model. The additional diffusion process would inevitably increase the inference latency. While the author(s) discuss the downside of inference latency in Section 6, it is important to compare both approaches systematically.

Questions

1. Could you elaborate more details of the language autoencoder experiments in Section 5.1? Do you train the compression and reconstruction networks to let the model replicate the input in its output? 2. In line 268, why do you need to specify the length for inference. I think the generation length is determined by the emission of EOS token of the language decoder. Please correct me if I am wrong.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

Please see the sections of weaknesses and questions.

Reviewer LWig4/10 · confidence 5/52023-07-07

Summary

The paper proposes a latent diffusion model for text generation, by stacking pre-trained powerful language models and fine-tuned projection layers and diffusion networks together. The input is first encoded into hiddens, then the diffusion model generates the hidden used as the condition of the language decoder. The final results are generated then. Experiments are conducted on both conditional and unconditional language generation tasks.

Strengths

- The paper is well-written and easy to follow. - The method part is in detail which makes readers understand the model immediately.

Weaknesses

- The contribution is weak. 1) the diffusion model is only utilized to generate the condition of the LM decoder, which means that the model just provides another projection of the original LLM encoder output. Why is this step necessary? As a cost, the generation speed is very slow. I saw in the appendix that generating 1k samples needs 3 minutes. What will the original BART cost? 2) The performance of the model heavily depends on the backbone LM. For example, BART outperforms FLAN-T5 by a large margin. What if training from scratch? What is the performance with other architectures? What if the performance of backbones varies from task, for example, in some tasks BART is better but in others FLAN-T5 is better? This kind of dependence strictly limits the generality of the model. - The experiments lack some new baselines, such as GENIE, Difformer, etc. The choice of datasets is also wired, why not conduct experiments on exactly the same ones as Diffuseq?

Questions

Please answer the questions in Weaknesses. What are the purpose and benefits of utilizing diffusion in such a framework?

Rating

4: Borderline reject: Technically solid paper where reasons to reject, e.g., limited evaluation, outweigh reasons to accept, e.g., good evaluation. Please use sparingly.

Confidence

5: You are absolutely certain about your assessment. You are very familiar with the related work and checked the math/other details carefully.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

The authors have discussed limitations.

Reviewer T1gz3/10 · confidence 4/52023-07-07

Summary

The paper demonstrates that encoder-decoder language models can be used to efficiently learn high-quality language autoencoders and to learn continuous diffusion models in the latent space of language autoencoders so that continuous latent representations of natural language can be sampled using pre-trained decoders.

Strengths

1. The paper proposes an additional compression module which maps high-dimensional encoder representations to low-dimensional fixed-length representations. And the corresponding reconstruction network is trained to map these fixed-length features back to high-dimensional features, guiding the frozen language decoder to reconstruct the original language. 2. The paper verifies the effectiveness of the model's unconditional, class-conditional, and sequence-to-sequence language generation methods on several different datasets.

Weaknesses

1. The motivation of the paper is somewhat weak. Why do we need to apply the latent diffusion model on text generation? What are the advantages over autoregressive and non-autoregressive models? It seems that the performance (MBR-5 in Table 6) is worse than the original AR model. Maybe it is faster? Overall, the lack of clear motivation makes the paper read like a technical report. 2. I have reservations about the ability of the variational paragraph embedder to learn effective representations of sentences with different lengths. What would happen if there is a significant difference in sentence lengths, such as one being very short (e.g., 5 tokens) and the other being much longer (e.g., 512 tokens or more)? Moreover, what is the influence of fixed length number, $l$ in line 102?

Questions

1. Is the autoencoder joint training with the denoising network? 2. What is the influence of different VAE models on the final generation performance?

Rating

3: Reject: For instance, a paper with technical flaws, weak evaluation, inadequate reproducibility and incompletely addressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

2 fair

Contribution

2 fair

Limitations

Yes, the authors clearly give the limitations of their work.

Reviewer 5zaG6/10 · confidence 4/52023-07-10

Summary

This paper introduces a novel approach to learning diffusion models in the latent space of an encoder-decoder language autoencoder. The proposed latent diffusion model utilizes continuous latent codes to generate text through sampling, leveraging a pre-trained decoder. The effectiveness of this approach is demonstrated across various unconditional and conditional sequence generation tasks.

Strengths

1. The idea presented in the paper is straightforward and easy to understand. It extends the concept of latent diffusion models (LDM) used in other domains, such as images, to the language domain, showcasing the versatility of this approach. 2. This paper stands out by incorporating an autoregressive decoder into diffusion models, which combines the strengths of both methods. This integration significantly enhances the quality of text generation, distinguishing it from existing diffusion-based language models.

Weaknesses

The basic idea of learning diffusion models in the latent space has been well explored in the image domain. Adding a self-conditioning trick has also been used in previous diffusion-LM literatures. Therefore the overall novelty is relatively limited.

Questions

1. In line 107, if the latent vector is normalized by its norm, then the latents are not Gaussian anymore but become a point on the hypersphere. Will it make more sense to divide the latent with its standard deviation estimated from the data? 2. From the encoder to latents and the latents to the decoder involve two cross-attention, will this cause training instability when optimizing things end to end? On the other hand, how does the model avoid copying all encoder information to the target side? 3. How are the length and dimensions of the latents decided? Will it be possible to design variable lengths of latents to account for the actual sequence length?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

The limitations were addressed.

Reviewer SqZp5/10 · confidence 4/52023-07-11

Summary

This paper introduces a latent diffusion model for natural language generation, utilizing a continuous diffusion framework. The authors leverage pretrained encoder-decoder models, such as BART and Flan-T5, to establish a continuous feature space. They propose a Perceiver Resampler as a compression module to handle variable-length and high-dimensional challenges, allowing effective learning of the diffusion process and parameterized denoising. The generative process includes a reconstruction module to map the low-dimensional latent space back to the feature space and is supported in unconditional, class-conditional, and seq2seq settings. The proposed approach demonstrates its effectiveness through extensive experiments.

Strengths

1. The utilization of pretrained encoder-decoder models to establish a feature space is a clever and efficient approach, distinguishing it from previous work that relied on less-capable embedding "encoder-decoder" for latent diffusion. 2. The paper conducts extensive experiments in various settings, including unconditional, class-conditional, and seq-conditional text generation. The evaluation metrics cover aspects of quality, diversity, and other relevant factors.

Weaknesses

1. Evaluation concerns arise from the lack of a multilingual setting in the benchmark datasets investigated. The benchmark datasets investigated in the paper were various, which was good, but lacked of multilingual setting, making the evaluation not fully convincing. Several previous diffusion-based text generation studies experimented on machine translation, e.g, CDCD [2], Difformer [2], and DINOISER [3] studied on WMT14 English-to-German dataset, which is most commonly-used setting for non-autoregressive text generation. Can the proposed LD4LG model also be applied in a multilingual setting? 2. The paper lacks a comprehensive literature review, hence comparison and discussion on its contributions with relevant studies. In the experiments, only diffusion-lm and diffuseq were compared. Additionally, the related work section primarily cites papers from 2022, while significant progress has been made in text diffusion research this year. What are the advantages of LD4LG compared to other continuous diffusion models, such as CDCD, Difformer, and DINOISER? How does it compare to discrete diffusion models like DiffusionBERT, reparameterized discrete diffusion model (RDM), and DiffusER? --- [1] Continuous diffusion for categorical data [2] Difformer: Empowering Diffusion Model on Embedding Space for Text Generation [3] DINOISER: Diffused Conditional Sequence Learning by Manipulating Noises [4] DiffusionBERT: Improving Generative Masked Language Models with Diffusion Models [5] A Reparameterized Discrete Diffusion Model for Text Generation [6] DiffusER: Discrete Diffusion via Edit-based Reconstruction

Questions

See weaknesses. I am happy to raise my rating upon the authors' responses to my concerns.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

2 fair

Contribution

2 fair

Limitations

n/a

Reviewer TpnG2023-08-13

Thank you for your comprehensive response

Thank you for the rigorous replies. I appreciate the author(s)' honest acknowledgments of this work's limitations. I have raised my score to 6.

Reviewer SqZp2023-08-15

Thanks for your response and increase my rating

Dear authors, Thank you so much for your efforts in providing thorough results and discussions! Although there're still rooms for improvement for multilingual/machine translation given the WMT14 De-En results, the responses have mostly addressed my concerns in general. I accordingly raise my rating from 4 to 5. Please add the new results and discussions in the revision.

Authorsrebuttal2023-08-21

Updated Machine Translation Results

Thank you for updating your score! We provide updated machine translation results below with further training. | Model | SacreBLEU | |-|-| | Diffusion-LM (n=5) | 20.3 | | CDCD (n=1) (~227.6 epochs) | 24.9 | | CDCD (n=10) (~227.6 epochs) | 25.4 | | DiNOISER (n=5) (1000 epochs) | 28.8 | | LD4LG (MT5) (n=1) (~28 epochs) | 26.5 | | LD4LG (MT5) (n=5) (~28 epochs) | 27.0 | We observe that our method comfortably outperforms CDCD while training on 15% as much data. The updated result also more than halves the distance between our prior result and DiNOISER while training on less than 3% as much data. The strong performance of LD4LG with comparably little training demonstrates the value of incorporating strong pre-trained models. Our method is still steadily improving with training and is therefore still undertrained compared to the baselines. We look forward to incorporating your thoughtful feedback into the final version of the paper. Thank you again for engaging with our response!

Reviewer T1gz2023-08-18

Thanks you for the clarifications. The research motivation still remains somewhat unclear to me. The author also did not directly address my question about the generated lengths. The supposed advantages of having both Diffusion and AR simultaneously also bring forth issues. For very short texts, it increases computational overhead. For very long texts (>=512), the effectiveness is also unknown. Although the author mentions that the sentence lengths differ in the various datasets used, without specific statistical results, we are completely unaware of whether the model truly possesses the capability to generate sentences of varying lengths. Lastly, the generalizability of the fixed hidden space size configuration is questionable, and I find it hard to believe that this method could be applicable to different generation tasks through pre-training in the future. Additionally, in Diffusion-LM[1], there are controlled experiments concerning sentence length. The claimed controlled advantages in the paper are compared to a very limited set of models. Diffusion-LM also asserts the advantages of their model in terms of controllability, and the compared models include PPLM[2], FUDGE[3], DELOREAN[4], COLD[5], and GPT-2. However, there is no overlap in the comparison datasets between this article and Diffusion-LM, making it difficult for me to make a judgment. Therefore, I will maintain the score. [1] Diffusion-LM Improves Controllable Text Generation. [2] Plug and play language models: A simple approach to controlled text generation. [3] FUDGE: Controlled text generation with future discriminators. [4] Back to the future: Unsupervised backprop-based decoding for counterfactual and abductive commonsense reasoning. [5] Cold decoding: Energy-based constrained text generation with langevin dynamics.

Authorsrebuttal2023-08-21

**Motivation** To reiterate, our key motivation is to integrate diffusion and pre-trained language models into a single text generation system to combine the strengths of diffusion and AR generation. All current methods train diffusion models from scratch and we are the first to investigate the possibility of combining existing auto-regressive models with diffusion models. Our experiments in class-conditional generation show that our framework is more effective than a fine-tuned GPT-2 model. Our oracle sequence-to-sequence results also demonstrate that diffusion models have excellent coverage over the hypothesis space and have the potential to outperform auto-regressive models. **Comparison with Diffusion-LM** In our work, we focused directly on improving the language generation capabilities of diffusion language models. We evaluated our framework’s capabilities across unconditional, class-conditional, and seq2seq language generation generation. This represents a more diverse collection of datasets and settings than the Diffusion-LM paper. We compare directly against Diffusion-LM on the ROCStories dataset that they utilized for unconditional generation. We selected the ROCStories dataset primarily because it was used in their work. Our method achieves a substantially higher MAUVE score of 0.716 vs 0.043 for Diffusion-LM on that dataset (as seen in Table 2). DiffuSeq also represents a direct extension of Diffusion-LM to the Seq2Seq setting, and we compare against that method on multiple datasets (Table 6). We believe that the sample generations (provided in the appendix) highlight our improvements in coherence over Diffusion-LM and its extension to seq2seq tasks (DiffuSeq). Diffusion-LM did explore using external classifiers for plug-and-play control with the formulaic E2E restaurant review dataset. However, plug-and-play control is most relevant when the underlying model already generates high quality text. As a result, we and other recent work (e.g. DiffuSeq, GENIE, CDCD, DiffusionBERT) first focus on improving the language generation capabilities of the diffusion model. Please refer to our response to Reviewer LWig and SqZp for additional comparisons with these methods. As diffusion language models continue maturing in quality, exploring classifier-based control represents interesting future work. We leave comparisons to methods like PPLM and FUDGE to such future work exploring plug-and-play control.

Authorsrebuttal2023-08-21

**Sequence Lengths** In LD4LG, we perform diffusion in a compressed latent space (e.g. dimension 32 x 64). We can compress texts of different lengths into this latent space and then rely on the decoder’s ability to generate text sequences of different sizes when conditioned on the diffused latent code. We present some statistics for the lengths of 1000 random validation samples across various datasets we examined. We use simple whitespace tokenization to compute these statistics to be tokenizer-agnostic. The numbers are therefore low compared to the number of BPE tokens for the various models. We also compute the Pearson’s r Correlation between the input length and the length of the autoencoder reconstruction. | Dataset | Mean Length | StDev Length | Min Length | Max Length | Pearson's r Correlation (Input Length vs. Reconstruction Length) | |-|-|-|-|-|-| | ROCStories | 43.5 | 7.7 | 20 | 58 | > 0.99 | | AG News | 30.0 | 8.3 | 8 | 56 | > 0.99 | | WMT14-En | 18.8 | 10.9 | 1 | 77 | > 0.99 | We observe that all datasets have a variety of lengths and that the input and output lengths have near-perfect correlation (> 0.99). The autoencoder therefore effectively reconstructs input language of a variety of lengths from the fixed-size latent space. The near-perfect reconstruction performance reported in our submission (Table 1) also demonstrate this. We also present some examples of our autoencoder’s reconstructions for validation inputs of varying lengths from the WMT-14 English dataset. | Input | Reconstruction | |-|-| | That pleases me. | That pleases me. | | For almost ten years the choir has been practising songs in this foreign,'soft' language, and now and then they bring them back to where they originally came from: the South of Africa. | For almost ten years the choir has been practising songs in this foreign,'soft' language, and now and then they bring them back to where they originally came from: the South of Africa. | | Then she tells of her husband who was in the army. | Then she tells of her husband who was in the army. | | Amid the usual futile arguments over who started it, scores of buildings have been reduced to rubble; more than 140 Palestinians, most of them civilians, and six Israelis have been killed; and, for the first time, missiles from Gaza have landed near Tel Aviv, Israel's metropolis, and the holy city of Jerusalem. | Amid the usual futile arguments over who started it, scores of buildings have been reduced to rubble; more than 140 Palestinians, most of them civilians, and six Israelis have been killed; and, for the first time, missiles from Gaza have landed near Tel Aviv, Israel's metropolis, and the holy city of Jerusalem. | | Whether at a physical comfort, emotional or spiritual level. | Whether at a physical comfort, emotional or spiritual level. | | It starts by the Antonia Fortress - Praetorium - where the judgement took place, and brings us along the streets of the Old Town to the Church of the Holy Sepulchre on Golgotha - the place of the crucifixion, Stone of Unction and the place of Jesus' burial. | It starts by the Antonia Fortress - Praetorium - where the judgement took place, and brings us along the streets of the Old Town to the Church of the Holy Sepulchre on Golgotha - the place of the crucifixion, Stone of Unction and the place of Jesus' burial. | We would like to emphasize that any limitations that our model has in terms of modeling datasets of different lengths will be shared by other diffusion and autoregressive models. Other language diffusion models, such as Diffusion-LM, generate instances of varying length by always generating a max-length sequence with a variable number of [PAD] tokens. To generate “It pleases me.”, for instance, Diffusion-LM would generate: “[BOS] It pleases me. [EOS] [PAD] [PAD] [PAD] [PAD] [PAD]... [PAD]”. Our hybrid approach represents an improvement over such methods. Autoregressive models often fail to extrapolate to longer sequence lengths than those observed during training [1]. This limitation would be shared by our framework, but it is not unique to our approach. While overcoming this limitation in autoregressive models is an active area of research [2], such advances could potentially be incorporated into our hybrid framework. [1] Kazemnejad, Amirhossein, et al. "The Impact of Positional Encoding on Length Generalization in Transformers." (2023). [2] Press, Ofir, Noah A. Smith, and Mike Lewis. "Train short, test long: Attention with linear biases enables input length extrapolation." (2021).

Reviewer 5zaG2023-08-18

Thank you for the detailed response. I will keep my score as 6.

Authorsrebuttal2023-08-21

In light of our new experiments and favorable comparison against the additional reference you provided, do you have any additional questions or concerns? We will try to respond if we are able in the limited time remaining for the discussion period. Thank you for your valuable comments. We look forward to incorporating your feedback into the final version of the paper!

Reviewer LWig2023-08-21

Thanks a lot for your effort in providing more results! My concerns are mainly about the contribution and experimental comparison: 1) borrowing ldm from cv to nlp is an incremental idea and does not meet the bar of NeurIPS; 2) more experiments with recent text diffusion baselines should be done, i.e., on the same datasets and tasks. I'll hold my original score.

Authorsrebuttal2023-08-21

We would like to further emphasize our extensive experimental comparisons. We list below the various text diffusion methods, along with their publication date, that we have compared against in our original submission and during the rebuttal: Diffusion-LM, NeurIPS 2022 DiffuSeq, ICLR 2023 DiffusionBERT, ACL 2023 CDCD, Arxiv December 2022 GENIE, Arxiv Feb 2023 DiNOISER, Arxiv Feb 2023 Reparameterized Discrete Diffusion (RDM), Arxiv Feb 2023 Given that the submission deadline was in May 2023, we believe that this represents a reasonably comprehensive comparison against recent text diffusion methods. Because text diffusion is in its early stages, the community has not yet settled on an established set of benchmarks and, as discussed, some of the datasets that have been used are nonstandard and have significant quality problems. We compare against the above work when possible and the comparisons are consistently favorable.

Authorsrebuttal2023-08-21

Although latent diffusion is commonly used for images, its extension to language presents unique challenges given the discreteness of the domain. Latent diffusion models are reliant on the strength of the underlying autoencoder; image diffusion models train an autoencoder from scratch, but we introduce a new perceiver-based network to effectively and efficiently adapting existing pre-trained language models into strong language autoencoders. As multiple reviewers acknowledge, we are distinctive from other diffusion language models in developing a hybrid approach utilizing the complementary strengths of diffusion and autoregressive generation.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC