Unlocking the Power of GANs in Non-Autoregressive Text Generation

## Abstract

Abstract Generative Adversarial Networks (GANs) have been studied in text generation to tackle the exposure bias problem. Despite their remarkable development, they adopt autoregressive structures so suffering from high latency in both training and inference stages. Although GANs have potential to support efficient generation by adopting non-autoregressive (NAR) structures, their explorations in NAR models are extremely limited. In this work, we conduct pioneering study of building language GANs based on NAR structures. We identify two issues that constrain the performance of GAN-based NAR models. Firstly, existing methods of incorporating latent variables provide highly similar representations which cannot describe the diversity of different words in sentences. We tackle this problem by proposing Position-Aware Self-Modulation, providing more diverse and effective representations. Secondly, the attention mechanism in Transformer cannot accurately build word dependencies in the unstable training of GANs, and we adopt Dependency Feed Forward Network to enhance the model capacity in dependency modeling. Armed with these two facilities, we propose a GAN-based NAR model, Adversarial Non-autoregressive Transformer (ANT). The experimental results demonstrate that ANT can achieve comparable performance with mainstream models in a single forward pass and has great potential in various applications like latent interpolation and semi-supervised learning.

## 1 Introduction

Generative Adversarial Networks (GANs) (Goodfellow et al., ) denote a powerful family of generative models. Unlike diffusion models (Ho et al., ; Saharia et al., ) and autoregressive (AR) models (Zhang et al., ; Yu et al., ) requiring multiple inference steps, GANs can produce high quality samples in a single forward pass, and thus have much lower latency (Sauer et al., ; Kang et al., ). GANs were first applied to text generation to tackle the notorious exposure bias problem (Bengio et al., ), which arises from the discrepancy between training and inference processes in Maximum Likelihood Estimation (MLE)-based AR models. These language GANs (Yu et al., ; de Masson d’Autume et al., ; Ren & Li, ) keep the AR structures and tackle the exposure bias problem by using previously generated words as input in both training and inference stage. When providing consistent training and test processes, they do not support parallel computation and have high latency. The high efficiency nature of image GANs are completely lost in existing language GANs. In theory, the global optimality of GANs is achieved if and only if the learned distributions are exactly same with the real distributions (Goodfellow et al., ). More importantly, their convergence does not rely on specific structures. GANs can theoretically obtain high quality samples in a single forward pass. Even so, their explorations in non-autoregressive (NAR) text generation are extremely limited.

In this paper, we unlock the power of GANs in building NAR text generative models. Instead of using AR structures like existing language GANs (Yu et al., ; Lin et al., ; Che et al., ; de Masson d’Autume et al., ; Ren & Li, ), our model adopts NAR structures supporting high efficiency parallel computation. When benefiting from the generation efficiency, we observe clear gaps between the performance of existing AR language GANs and our NAR language GANs. The main obstacles come from two problems. Firstly, GANs rely on latent variables (which are always from a pre-defined distribution) to support sampling, while existing methods of incorporating latent variables provide highly similar representations. These representations cannot describe the diversity between words and thus leading to inaccurate sentence generation. Secondly, Transformer (Vaswani et al., ), widely used in NAR models (Gu et al., ; Ghazvininejad et al., ), establishes word dependencies solely through the attention mechanism. However, the dynamic weight assignment process becomes unstable during the fragile training of GANs, causing the loss of word dependencies and ultimately resulting in ungrammatical outputs.

Regarding the first problem, we propose Position-Aware Self-Modulation which can provide diverse hidden representations for the model to obtain various words in sentences. For the second problem, we replace the original Feed-forward Network (FFN) module in Transformer to be our proposed Dependency Feed-forward Network (Dependency FFN). Different with the attention mechanism whose dependency is easily lost with poor weight assignment, Dependency FFN provides more stable methods for dependency modeling. Armed with these two facilities, we propose an Adversarial Non-autoregressive Transformer (ANT). The contributions of this work are summarized as follows:

- •
We conduct pioneering work of building language GANs in NAR structures. To support the generation of various words in sentences, we propose Position-Aware Self-Modulation which can obtain diverse representations to describe the diversity of different words and improve generation quality. Furthermore, Dependency FFN is proposed to support more stable dependency modeling. Different with the attention mechanism, which is easily influenced by the unstable training process of GANs, Dependency FFN can help the model build more accurate dependencies and thus obtain more grammatical results.
- •
Utilizing these two facilities, we propose a GAN-based NAR text generative model—ANT. Existing language GANs employ AR structures, which leads to high latency due to their reliance on previously generated words. ANT, however, generates all words in parallel and support high efficiency generation. It inherits the advantages of GANs, enabling the generation of high-quality samples in a single forward pass.
- •
The experimental results demonstrate that ANT achieves performance comparable to existing models, but with significantly lower latency, in both unconditional and conditional generation tasks. Besides, we also explore the potential of ANT in applications like latent interpolation and semi-supervised learning. To the best of our knowledge, it is the first work demonstrating the effectiveness of GANs in building NAR text generative models.

## 2 Background

GANs (Goodfellow et al., ) are initially transferred to text generation to tackle the notorious exposure bias problem (Bengio et al., ). More specifically, existing text generative models adopt autoregressive structures as backbones and use Maximum Likelihood Estimation (MLE) as training objectives. These methods use ground truth as input during training, but reads previously generated words during inference. When the model makes mistakes in generation, these mistakes will be fed into the model as input and the model will be in the state space it has never met during training (Bengio et al., ). These mistakes will thus be quickly amplified, leading to a sharp decrease in the quality of the generated samples.

The training of GANs does not need ground truth as input, so they can use generated tokens in both training and inference stage. It tackles the exposure bias problem by providing a consistent generation manner in training and test procedures. In text generation, the generator often models the output word probabilities and sample specific words from these probabilities. This sampling operation, however, is non-differentiable and stops the gradients from being passed through to the generator.

Early study tackles this problem by using either Reinforce (Yu et al., ; Lin et al., ; Che et al., ; Guo et al., ; de Masson d’Autume et al., ) or continuous relaxations (Nie et al., ). However, Reinforce Williams () is in high variance, while continuous relaxations like Gumbel-softmax Jang et al. () are biased estimators. Models based on these two methods rely on pre-training techniques to obtain acceptable performance (Ren & Li, ).

Figure: Figure 1: Structure of Adversarial Non-autoregressive Transformer (ANT)
Refer to caption: extracted/5894893/structure.jpg

Another method is to transform words into representations, and train the generator to obtain these representations. This method avoid the non-differentiable sampling operation during training, so the gradients can be passed to the generator directly. Different with Reinforce and continuous relaxations, which directly model word probabilities, these methods model word representations so they are denoted as representation modeling methods (Ren & Li, ). This method can obtain satisfied performance without using any pre-training techniques. We thus build our model based on this method.

NAGAN (Huang et al., ), which also adopts GANs to build NAR models, is the most similar work to ours, yet the performance of their model is significantly limited by the biased straight-through estimator (Bengio et al., ), whereas our model is free from this problem. Besides, our proposed facilities: Position-Aware Self-Modulation and Dependency Feed Forward Network can further boost model performance and they are not explored in previous work.

Furthermore, existing MLE-based NAR models (Gu et al., ; Ghazvininejad et al., ) suffer from the multi-modality problem Gu et al. (), which tends to mix words in different candidates and obtain ungrammatical results.  Huang et al. () reveal that the KL divergence between their learned distributions and the real distributions remains non-negative lower bounds. In theory, the learned distribution cannot be exactly same with the real distributions unless words in sentences are independent to each other (which does not match the real situation). Thus, existing NAR models are mainly developed in several specific tasks, while their explorations in more general tasks (like unconditional generation) are extremely limited. This further underscores the pressing necessity of investigating more promising approaches for building NAR models, thereby enabling their application across diverse domains.

## 3 Model

### 3.1 Model Structure

In this paper, we propose an Adversarial Non-autoregressive Transformer (ANT) which generates text in a fully NAR manner. ANT is based on the representation modeling framework (Ren & Li, ). As shown in Figure 1, there are three parts in ANT: Aligner, Discriminator and Generator. The aligner maps words into representations, and the generator tries to recover these representations. The discriminator needs to identify whether input representations are from the aligner or the generator. We adopt Transformer (Vaswani et al., ) as the backbones of all the three parts to support highly parallel computation. An input is firstly added with a positional encoding and fed into encoder layers. Each encoder layer has a multi-head attention (MHA) module and feed forward network (FFN) module. A layer normalization is added after each module.

Figure: Figure 2: Cosine similarity of the output from (a) Self-Modulation; and (b) Position-Aware Self-Modulation.
Refer to caption: extracted/5894893/cos_sim.jpg

The aligner is trained to reconstruct words based on the masked input, which is the same as the training process of BERT (Devlin et al., ). Following the previous work which adopts representation modeling methods to train language GANs (Ren & Li, ), we use the loss function of variational autoencoder (VAE) (Kingma & Welling, ) to train the aligner:

$$ $\displaystyle L_{A}$ $\displaystyle=-\mathbb{E}_{z^{\prime}_{i}\sim q(z^{\prime}_{i}|x_{i})}(logp(x_ {i}|z^{\prime}_{i}))+KL(q(z^{\prime}_{i}|x_{i})||p(z^{\prime}_{i}))$ (1) $$

where $x_{i}$ is the $i$-th word in the sentence, $z^{\prime}_{i}$ is obtained by using reparameterization trick: $z^{\prime}_{i}=\mu_{x_{i}}+\sigma_{x_{i}}\cdot\mathcal{N}(0,1)$, and $z^{\prime}_{i}$ is transformed back into words with a linear transformation layer $F_{LT}$. Different from cross entropy which maps words into specific points in the representation space, this method describes a region for each word, so representations slightly away from their central points $\mu_{x_{i}}$ can still be transformed into correct words.

A non-autoregressive generator cannot input previously generated words, so trainable representations are adopted as input. The generator then gives output representations $r_{i}$ in different positions and uses the same linear transformation layer $F_{LT}$ in the aligner to transform these representations back into words. The discriminator adopts the output representations from the aligner and the generator ($\mu_{x_{i}}$ and $r_{i}$) as input. Different from image GANs whose discriminators give a single scaler output for an image, our discriminator gives output for each representation. During training, the aligner will be trained first, and its parameters are fixed during the training of the discriminator and the generator. The representations given by the generator need not be transformed into words in training process, so the gradients from the discriminator can directly pass through to the generator.

Causal masks are adopted in both the discriminator and the generator to break the possible symmetry in the input. We use Wasserstein distance (Arjovsky et al., ) as the training objective and adopt Lipschitz penalty (Petzka et al., ) to regularize the discriminator. However, there is still a gap between our basic model and existing autoregressive models and we further propose Position-Aware Self-Modulation and Dependency Feed Forward Network (Dependency FFN) to improve model performance.

### 3.2 Position-Aware Self-Modulation

An effective sampling method plays a key role in the success of GANs. Transformer based image GANs (Lee et al., ) generate different samples by adopting self-modulation (Chen et al., ) to incorporate latent variables. Self-modulation assigns the same shift and scale factors to the normalized results in different positions, which leads the representations in various positions to be highly similar even with positional encodings (as shown in Figure 2 (a)). However, the output of the generator (i.e., word representations in different positions) are of high diversities. Similar input representations cannot describe the diversity among different words and thus leading to inaccurate sentence generation.

Figure: Figure 3: Proposed Facilities in ANT.
Refer to caption: extracted/5894893/component.jpg

To tackle this problem, we propose Position-Aware Self-Modulation. As shown in Figure 3 (a), this method adopts different mapping layers for the calculations in different positions so as to gain diverse results. In practice, a parallel implementation is adopted to improve the computation efficiency, which is:

$$ $\displaystyle\begin{pmatrix}\mathbf{h}^{\prime}_{1}\\ \mathbf{h}^{\prime}_{2}\\ \vdots\\ \mathbf{h}^{\prime}_{N}\end{pmatrix}$ $\displaystyle=MLP(z)$ (2) $\displaystyle\mathbf{h}_{i}$ $\displaystyle=\gamma(\mathbf{h}^{\prime}_{i})\circ LN(\mathbf{x}_{i})+\beta( \mathbf{h}^{\prime}_{i})$ $$

where $z$ is the latent variable, $\mathbf{h}^{\prime}_{i}$ is the hidden representation in the $i$-th position, $MLP(\cdot)$ is a non-linear transformation whose activation function is GELU (Hendrycks & Gimpel, ), $LN(\cdot)$ is the layer normalization, $N$ is the length of the sentence, and $\gamma(\cdot)$ and $\beta(\cdot)$ are linear transformations. In Position-Aware Self-Modulation, representations in different positions are calculated based on unique parameters and have clear differences (as shown in Figure 2 (b)), so as to provide more effective signals to obtain target sentences.

### 3.3 Dependency Feed Forward Network

Transformer (Vaswani et al., ) builds word dependencies by dynamically assigning weights in the attention mechanism. This process, however, is unstable under the training of GANs. It will lead the models to lose word dependencies, and finally result in ungrammatical sentences. We tackle this problem by proposing Dependency Feed Forward Network (Dependency FFN) to strengthen the FFN module with the capacity of dependency modeling. The structure of Dependency FFN is shown in Figure 3 (b), and calculated as follows:

$$ $\displaystyle\mathbf{s}_{t}$ $\displaystyle=\sigma(\mathbf{x}_{t}W_{s}+b_{s})$ (3) $\displaystyle\mathbf{o}_{t}$ $\displaystyle=\mathbf{s}_{t-1}W_{a}+\mathbf{s}_{t}W_{b}+b_{o}$ $$

where $\sigma(\cdot)$ is an activation function which is GELU in this work. With causal masks, $\mathbf{s}_{t-1}$ and $\mathbf{s}_{t}$ contain the information of first $(t-1)$ and $t$ words, respectively. Using the sum of these two variables can help the model to explicitly build stable dependencies between the $t$-th word and previous $(t-1)$ words in the fragile training process of GANs.

### 3.4 Extension to Conditional Generation

Besides unconditional generation, conditional generation is frequently employed in a variety of tasks. We thus also extend ANT to conditional generation. Given a condition representation $c$, the generator can consider it by shifting the original latent variable $z$. We find that using trainable factors to assign weights to $z$ and $c$ can slightly improve the performance: $\hat{z}=\alpha_{1}\circ z+\alpha_{2}\circ c$, where $\alpha_{1}$ and $\alpha_{2}$ are two trainable variables. For the discriminator, we use the sum of word representations $x^{d}_{t}$ and conditional representations $c$ as the input: $\hat{x}^{d}_{t}=x^{d}_{t}+c$. Then, $\hat{x}^{d}_{t}$ is fed into the remaining modules of the discriminator.

## 4 Experiment

**Table 1: FED and I. BLEU on the COCO Dataset and EMNLP Dataset (DI: Decoding Iteration).**
| Model | DI | COCO Dataset | EMNLP Dataset |  |  |
| --- | --- | --- | --- | --- | --- |
| FED $\downarrow$ | I. BLEU $\uparrow$ | FED $\downarrow$ | I.BLEU $\uparrow$ |  |  |
| Training Data | - | 0.007 | 35.36 | 0.010 | 20.62 |
| Transformer | O(N) | 0.008 | 34.28 | 0.014 | 19.50 |
| SeqGAN | O(N) | 0.134 | 22.34 | 0.210 | 9.90 |
| RankGAN | O(N) | 0.203 | 22.10 | 0.290 | 10.37 |
| MaliGAN | O(N) | 0.074 | 25.95 | 0.079 | 13.11 |
| LeakGAN | O(N) | 0.132 | 29.43 | 0.125 | 11.59 |
| RelGAN | O(N) | 0.062 | 29.53 | 0.136 | 14.74 |
| ScratchGAN | O(N) | 0.014 | 30.76 | 0.018 | 17.19 |
| InitialGAN | O(N) | 0.013 | 33.06 | 0.025 | 17.74 |
| CMLM | O(k) | 0.016 | 27.65 | 0.062 | 16.67 |
| NAT | O(1) | 0.024 | 26.41 | 0.111 | 11.38 |
| NAGAN | O(1) | 0.084 | 24.98 | 0.748 | 2.01 |
| ANT | O(1) | 0.013 | 31.12 | 0.026 | 15.51 |

### 4.1 Experiment Setup

The experiment covers both unconditional generation and conditional generation to evaluate model performance comprehensively. For the unconditional generation, the task is to generate sentences whose distribution can be as close as to the target sets. We follow the settings of previous work (de Masson d’Autume et al., ; Ren & Li, ) and use sentences from two datasets: the COCO Image Caption Dataset (Lin et al., )(^1^11[https://cocodataset.org](https://cocodataset.org)) and the EMNLP 2017 News Dataset(^2^22[http://www.statmt.org/wmt17/](http://www.statmt.org/wmt17/)). The size of training sets of the COCO dataset and the EMNLP dataset are set to be 50,000 and 200,000, respectively. The COCO dataset can support evaluations in short sentence generation, while the EMNLP dataset focuses on long sentence generation. For the conditional generation, we randomly select 100,000 sentences from the Yelp Dataset(^3^33[https://www.yelp.com/dataset](https://www.yelp.com/dataset)) as training data and use emotion labels (positive or negative) as conditions.

### 4.2 Evaluation Metrics

The evaluation is conducted at both embedding level and token level. In embedding level, we use Universal Sentence Encoder(^4^44[https://tfhub.dev/google/universal-sentence-encoder/4](https://tfhub.dev/google/universal-sentence-encoder/4)) (Cer et al., ) to transform sentences into embeddings. Then, we calculate both Fréchet Embedding Distance (FED) (de Masson d’Autume et al., ) and Least Coverage Rate (LCR) (Ren & Li, ) to evaluate the overall similarity and the fine-grained similarity of two distributions, respectively.

In token level, we use Inverse-BLEU (I. BLEU) to evaluate model performance in terms of quality and diversity together. Besides, we also draw a curve of BLEU (Papineni et al., ) and Self-BLEU (Zhu et al., ) by tuning the temperature of the model (Caccia et al., ). In the case of conditional generation, Accuracy (Acc.) is also employed to assess whether the models produce sentences that align with the input labels.

Figure: Figure 4: Additional Experimental Results. (a) Model Performance at Various Temperature. (b) Least Coverage Rate.
Refer to caption: extracted/5894893/exp_results.jpg

### 4.3 Compared Model

An important compared model is Transformer, which adopts AR structures and is trained on MLE. It is the mainstream model in various text generation tasks. Besides, a number of AR language GANs are also compared:
SeqGAN (Yu et al., ), RankGAN (Lin et al., ), MaliGAN (Che et al., ), LeakGAN (Guo et al., ), and ScratchGAN (de Masson d’Autume et al., ), which are based on REINFORCE; RelGAN (Nie et al., ), which uses Gumbel-softmax to obtain gradients; InitialGAN (Ren & Li, ), which does not use the above two method and adopts representation modeling. All the models mentioned-above are AR models whose Decoding Iteration (DI) is $O(N)$ ($N$ is the sequence length).

For NAR models, we compare with another GAN-based model: NAGAN (Huang et al., ). Furthermore, two classical MLE-based NAR models are compared in our experiments: Non-autoregressive Transformer (NAT) (Gu et al., ) and conditional masked language model (CMLM) (Ghazvininejad et al., ). More illustrations about experiment details can be found in Appendix A. We will release our code to the public in the future.

### 4.4 Experimental Result

#### 4.4.1 Unconditional Generation

The experimental results of the unconditional generation are shown in Table 1. For the COCO dataset, Transformer gets the best performance in AR models, while ANT is the best one in NAR models. More specifically, ANT obtains 0.013 in FED. This result outperforms a number of AR language GANs and is close to the InitalGAN, which is the best language GANs on the COCO dataset. Similar results can be found in Inverse BLEU (I. BELU). ANT gets 31.12 in I. BLEU and it is much better than other NAR models. The performance of MLE-based NAR models (NAT and CMLM) is far behind the AR models. Existing MLE-based NAR models make use of the characteristic of specific tasks (like strong corresponding relation between input and output in machine translation) to relieve the multi-modality problem Gu et al. (). Once they are transferred to more fundamental tasks (e.g., unconditional generation), the inhere problem will be more severe and lead to the obvious decrease of model performance. NAGAN, another GAN-based NAR model, is inferior to all the other models. It shows the limitations of the biased straight-through estimator.

For the EMNLP dataset, Transformer is still the best model. ANT outperforms other NAR models in FED, while CMLM can slightly outperform ANT in Inverse BLEU. The iterative decoding mechanism helps CMLM to better process complicated datasets with higher decoding latency. To further discuss their performance in the token level, we follow the suggestions from Caccia et al. (), and draw the curve of Self-BLEU and Negative BLEU by tuning the temperature in Transformer. The results are shown in Figure 4 (a). ANT is the only NAR model which can get comparable performance with AR models, while other NAR models (including CMLM) remain behind obviously. Specifically, NAGAN gets extremely low BLEU, which indicates that NAGAN cannot generate fluency sentences. It reveals the difficulties of NAGAN to converge on complicated datasets. Furthermore, we compare Least Coverage Rate (LCR) of Transformer and other NAR models in Figure 4 (b). ANT outperforms CMLM with lower decoding iterations, and it is the only NAR model which can get close performance with Transformer.

#### 4.4.2 Conditional Generation

The experimental results of conditional generation are shown in Table 2. Among NAR models, ANT gets comparable performance with CMLM in FED, and achieves higher Inverse BLEU and Accuracy with lower decoding latency. NAT, which also generates samples in one decoding step, is inferior to other models. For the accuracy, ANT gets 88.35% which is the highest one among all the NAR models. ANT can generate sentences consistent with the given labels.

**Table 2: FED, I. BLEU and Acc. on the Yelp dataset**
| Model | DI | FED | I. BLEU | Acc. |
| --- | --- | --- | --- | --- |
| Training Data | - | 0.008 | 24.18 | 92.47% |
| Transformer | O(N) | 0.011 | 23.04 | 91.73% |
| CMLM | O(k) | 0.015 | 18.35 | 87.85% |
| NAT | O(1) | 0.032 | 11.81 | 83.54% |
| ANT | O(1) | 0.018 | 19.08 | 88.35% |

Both the experimental results in unconditional generation and conditional generation demonstrate the effectiveness of ANT. It outperforms a number of AR language GANs. Even comparing with the existing best language GANs, it can still obtain comparable performance in much lower latency. It is thus not necessary to build language GANs in AR structures. Besides, ANT is free from the theoretical limitations in MLE-based NAR models, so it can obtain better performance and denotes a more promising methods in building NAR models.

Figure: Figure 5: Ablation study of (a) Dependency FFN, and (b) Position-Aware Self-Modulation.
Refer to caption: extracted/5894893/ablation.jpg

#### 4.4.3 Ablation Study

We design two features for ANT: 1) Dependency FFN; and 2) Position-Aware Self-Modulation. Experiments are conducted to demonstrate the effectiveness of these two modules. For Dependency FFN, we compare the performance between Dependency FFN and the original FFN in Figure 5 (a). ANT with Dependency FFN has lower FED and higher Inverse BLEU. It obtains better performance in both the token-level metrics and the embedding-level metrics. These results show that Dependency FFN can help improve model performance by modeling more accurate word dependencies. For Position-Aware Self-Modulation, we compare the training curves with original Self-Modulation with FED in Figure 5 (b). ANT with Position-Aware Self-Modulation converges faster, and finally achieves better performance. Position-Aware Self-Modulation can enhance model performance by providing more diverse and effective representations.

### 4.5 Discussion

One advantage of ANT is that it only requires one decoding step and has high speedup. We compare the speedup of different models in Figure 6 (a). ANT is 14.75 times faster than Transformer. Even comparing with CMLM, it also has much lower decoding latency while obtaining comparable or even better performance. Besides, ANT has great potential in various applications. We explore the potential of ANT in different applications including semi-supervised learning and latent interpolation in the following.

**Table 3: Effectiveness of ANT in Semi-supervised Learning (Num.: number of labeled data).**
| Method | Num. | P | R | F1 |
| --- | --- | --- | --- | --- |
| SL | 500 | 91.28% | 89.06% | 90.15% |
| SSL | 90.77% | 92.15% | 91.46% |  |
| SL | 1000 | 92.42% | 91.33% | 91.87% |
| SSL | 94.87% | 92.39% | 93.62% |  |

Generative models can be incorporated into semi-supervised learning (SSL) to assist the training of other models. It requires the models to be in high efficiency, since it needs to obtain new data during the training process. We investigate the application of ANT in SSL by incorporating it into the training of a classification model. The classification model is trained to identify emotion labels of sentences in the Yelp dataset. We prepare two training sets. One is composed of 500 labeled data and the other one consists of 1,000 labeled data. The results are shown in Table 3. For the classification model trained on 500 labeled data, its F1 score increases from 90.15% to 91.46%. It gains +1.31% improvement after using SSL. For the model trained 1,000 labeled data, its F1 scores increases from 91.87% to 93.62% in which +1.75% improvement is led by the SSL. The classification models trained in SSL consistently outperform the ones trained in supervised learning (SL). ANT can obtain data following same distributions as the original data so as to help the classification model improve performance.

Figure: Figure 6: (a) Speedup of Different Models. (b) Case Study of Latent Interpolation.
Refer to caption: extracted/5894893/discuss.jpg

Besides, ANT enables latent interpolation just like image GANs. There are two latent variables in ANT: $z$, which is sampled from a pre-defined distribution; and $c$, which is a condition representation. We fix one of them and gradually change the other one. The first example in Figure 6 (b) shows the samples given by tuning $z$ with fixed $c$, in which ANT transforms one sentence into another one, with the middle sentences kept understandable. The second example shows the samples given by changing $c$ from the negative representation to the positive representation. ANT gradually transforms negative words into positive ones while keeping the main structure of the sentence. Such latent interpolation is seldomly explored by NAR models, and it may inspire further ideas for related tasks.

## 5 Conclusion

In this work, we firstly reveal the limitations in existing language GANs based on AR structures. The global optimality of GANs do not rely on specific structures and NAR structures can obtain similar performance with much lower latency. Then, we reveal two problems in building GAN-based NAR models: 1) Existing methods of integrating latent variables obtain similar representations which cannot describe the diversity of different words. 2) The attention mechanism in Transformer cannot build word dependencies stably. We tackle these two problems by proposing Position-Aware Self-Modulation and Dependency Feed Forward Network, respectively. Armed with these two facilities, we propose an Adversarial Non-autoregressive Transformer (ANT), a GAN-based NAR model. The experimental results demonstrate that ANT obtains comparable performance as other AR models but with much lower decoding latency. Besides, we also demonstrate the great potential of ANT in various tasks like smooth latent interpolation and semi-supervised learning.

## Appendix A Experiment Details

### A.1 Implementation Details

The layer numbers of the aligner, generator and discriminator are all set to be 4. Their input dimension is 256, and the hidden dimension of FFN / Dependency FFN is 1,024. The head number is set to be 8. We use AdamW (Loshchilov & Hutter, ) as the optimizer of the aligner and the weight decay is set to be 1e-5; its learning rate is 0.0001. During the adversarial training, AdamW (Loshchilov & Hutter, ) is used as the optimizer of the discriminator whose weight decay is set to be 0.0001; its learning rate is 0.0002 for the COCO and Yelp dataset, and 0.00015 for the EMNLP dataset. We choose Adam (Kingma & Ba, ) as the optimizer of the generator and its learning rate is 0.0001. The $\beta_{1}$ and $\beta_{2}$ in the optimizers of the discriminator and the generator are set to be 0.5 and 0.9, respectively. The maximum training epoch is set to be 4,500. We implement our model based on Tensorflow(^5^55[https://www.tensorflow.org](https://www.tensorflow.org)) (Abadi et al., ) and the model is trained on NVIDIA GeForce RTX 3090.

### A.2 Implementation of NAT and CMLM

Both NAT (Gu et al., ) and CMLM (Ghazvininejad et al., ) are designed for machine translation, so their original structures contains an encoder to encode input in source language. However, there may be no meaningful input in our experiment (e.g., unconditional generation), so this structure cannot be used in the experiment directly. We thus use the idea of VAE to obtain hidden representations, so they can be transferred to the tasks in our experiments.

More specifically, a Transformer-based encoder is adopted to encode the sentences into hidden representations during training. Then, these representations are fed into the decoder to reconstruct the input sentences. During inference, representations sampled from the standard normal distribution will be fed into the decoder, and the decoder will generate sentences based on the sampled representations. For NAT, the representations are fed into decoder as input. For CMLM, the representations are concatenated with the embeddings of input tokens (masked or unmasked words). The iteration number of CMLM is set to be 10 as in previous work (Ghazvininejad et al., ; Huang et al., ).

### A.3 Evaluation Metrics

Fréchet Embedding Distance (FED) (de Masson d’Autume et al., ) is same with the Fréchet Inception Distance (FID) (Heusel et al., ) except for the encoding model. The encoding model is changed to be fit into text generation. We adopts Universal Sentence Encoder following the settings of the previous work (de Masson d’Autume et al., ). It is calculated as follows:

$$ $FED=||\mu_{1}-\mu_{2}||^{2}_{2}+Tr(c_{1}+c_{2}-2(c_{1}c_{2})^{1/2})$ (4) $$

where $\mu_{1}$ and $\mu_{2}$ are the mean, and $c_{1}$ and $c_{2}$ are the covariance.

Least Coverage Rate (LCR) (Ren & Li, ) is proposed to be a compliment when the FED of two models are too close to each other, since LCR is more sensitive to the change of data quality (Ren & Li, ). Given two sets of sentence $X_{i}^{a}\in\mathbb{X}_{a}$ and $X_{i}^{b}\in\mathbb{X}_{b}$, LCR is calculated as follows:

$$ $\displaystyle S_{ij}=Sim(\mathbf{Emb}({X}^{a}_{i}),\mathbf{Emb}({X}^{b}_{j}))$ (5) $\displaystyle{R}_{a}=\frac{1}{|\mathbb{X}_{a}|}\sum_{i=1}^{|\mathbb{X}_{a}|} \delta(\sum_{j=1}^{|\mathbb{X}_{b}|}S_{ij}\geq\tau)$ $\displaystyle{R}_{b}=\frac{1}{|\mathbb{X}_{b}|}\sum_{j=1}^{|\mathbb{X}_{b}|} \delta(\sum_{i=1}^{|\mathbb{X}_{a}|}S_{ij}\geq\tau)$ $\displaystyle LCR(\mathbb{X}_{a},\mathbb{X}_{b})=min({R}_{a},{R}_{b})$ $$

where ${X}^{a}_{i}$ and ${X}^{a}_{i}$ are the i-th and j-th sentences from sentence sets $\mathbb{X}_{a}$ and $\mathbb{X}_{b})$, respectively. $\mathbf{Emb}(\cdot)$ is the model used to transform sentences into embeddings (which is Universal Sentence Encoder in this work), $\tau$ is a hyperparameter, $Sim(\cdot)$ is cosine similarity and $\delta(\cdot)$ is a function which returns 1 if input is higher than 0, and 0 for others.

The idea of LCR is to identify whether a specific mode in one set is covered by the sentences in another set or not. Then, it uses the minimum coverage rates as the output, so LCR can be sensitive to two common problems in text generative models: 1) models tend to generate sentences which are out of the real distributions; and 2) the generated sentences are in high similarities.

All the token level metrics (i.e., BLEU, Self-BLEU, and Inverse BLEU) are calculated up to 5 grams following previous work (de Masson d’Autume et al., ; Ren & Li, ).

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 3
presentation: 3
questions: Please check the weakness.
soundness: 3
strengths: 1. This work is pioneering in applying GANs within a non-autoregressive structure for text generation, presenting novel solutions like Position-Aware Self-Modulation and Dependency FFN to tackle inherent limitations in GAN-based text generation.
summary: The paper introduces a novel model called Adversarial Non-autoregressive Transformer (ANT) aimed at enhancing the efficiency and performance of Generative Adversarial Networks (GANs) in text generation. Unlike conventional GANs that rely on autoregressive (AR) structures, ANT leverages a non-autoregressive (NAR) framework, allowing for parallel computation and significantly reducing latency in both training and inference. Key contributions include the introduction of Position-Aware Self-Modulation to enhance representation diversity and Dependency Feed Forward Network (Dependency FFN) to improve dependency modeling. Experimental results show ANT's competitive performance with AR models in terms of quality while achieving lower latency.
weaknesses: 1. The datasets chosen for experimental validation are relatively simple, lacking common tasks like translation and summarization, which weakens the persuasiveness of the results.
2. The issue described in line 57, "the dynamic weight assignment process becomes unstable during the fragile training of GANs," lacks references, in-depth analysis, or detailed description of the phenomenon, making it difficult to thoroughly understand this problem.

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: refer to the comments
soundness: 2
strengths: - The authors propose Position-Aware Self-Modulation (PASM), which provides more diverse and effective latent variable representations, enhancing the model's ability to capture the diversity of different words in sentences.
- To improve the dependency among the decoding procedure, the authors propose Dependency Feed Forward Network (DFFN),  which can lead to better performance.
- The authors conduct extensive experiments to validate the effectiveness of their proposed model, comparing it against mainstream models and demonstrating its competitive performance.
summary: This paper explores the application of Generative Adversarial Networks (GANs) in non-autoregressive (NAR) text generation, addressing the limitations of existing GAN-based text generation models that typically rely on autoregressive structures. The authors identify two main issues with current NAR models: the lack of diversity in latent variable representations and the instability of attention mechanisms during GAN training. To tackle these problems, they introduce two useful techniques: Position-Aware Self-Modulation (PASM) and Dependency Feed Forward Network (DFFN). The experimental results demonstrate that ANT achieves comparable performance to the baselines.
weaknesses: - The title of the paper is "Unlocking the Power of GANs xxx." Generally, the strength of GANs lies in the training of the generator and discriminator through a game-theoretic mechanism. However, the main focus of this paper is not on GANs but rather on non-autoregressive text generation. I do not believe the power of GANs lies in non-autoregressive modeling.
- While the authors compare their model, ANT, to several state-of-the-art models, it appears they have selectively chosen only strong non-autoregressive baselines that utilize GANs. Other baseline methods, such as Huang et al. (ICML 2022), should also be discussed to strengthen the claims regarding the model's superiority.
- Additionally, the experiments are conducted primarily on specific tasks and datasets, which are somewhat outdated. It would be valuable to assess how well the model generalizes to other text generation tasks, such as summarization, dialogue generation, and long-form text generation.

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 2
questions: 1. Could the authors provide empirical evidence or further analysis to support the claim that Position-Aware Self-Modulation significantly improves generation diversity compared to standard practices in NAR models?
2. How does the Dependency Feed Forward Network provide a clear advantage over traditional FFNs in the context of GAN training, and what experimental results demonstrate this, beyond the marginal improvement shown in Figure 5?
soundness: 2
strengths: - The paper is well-structured and provides clear explanations of the proposed methods and their implications, making it easy to follow the authors' reasoning.
summary: This paper introduces the Adversarial Non-autoregressive Transformer (ANT), a GAN-based model for efficient text generation. It proposes two main contributions: Position-Aware Self-Modulation and Dependency Feed Forward Network (Dependency FFN). The study claims that ANT achieves comparable performance to mainstream models with significantly lower latency.
weaknesses: 1. The paper may lack a comprehensive comparison with state-of-the-art non-autoregressive models, which is crucial for establishing the significance of the proposed ANT model:  Glancing Transformer (Qian et al, 2021), Fully-NAT (Gu et al. 2021), DA-Transformer (Huang et al. 2022), SUNDAE (Nikolay Savinov et al. 2022), etc. 
2. While the paper claims that Position-Aware Self-Modulation enhances generation diversity, it appears to be a common practice to input identical [MASK] tokens plus positional embeddings in NAR models, which also achieve strong performance during decoding. The paper does not provide direct evidence to show that the similar representation approach hinders the model's generation ability or that Position-Aware Self-Modulation offers a significant improvement over this standard practice. This lack of evidence makes it difficult to assess the true impact of this contribution.
3. The Dependency Feed Forward Network is presented as a solution to the instability of word dependencies during GAN training. However, the provided evidence in Figure 5 shows only a marginal improvement, with the gap in FED not exceeding 0.001. Such a small difference raises questions about the practical significance of this improvement, especially considering the computational overhead it might introduce.

---

confidence: 2
contribution: 2
initial_rating: 3
presentation: 2
questions: See weaknesses section
soundness: 2
strengths: This work pioneers the development of language GANs based on non-autoregressive (NAR) structures, addressing the high latency issues inherent in autoregressive (AR) models. By generating all words in parallel, the Adversarial Non-autoregressive Transformer (ANT) achieves high-efficiency generation, significantly reducing both training and inference times.

The introduction of Position-Aware Self-Modulation and Dependency Feed-forward Network (Dependency FFN) addresses critical challenges in GAN-based NAR models. Position-Aware Self-Modulation enhances the diversity of hidden representations, leading to the generation of more varied and high-quality words in sentences. Dependency FFN improves the stability and accuracy of dependency modeling, resulting in more grammatically coherent outputs compared to traditional attention mechanisms.
summary: This work introduced the Adversarial Non-autoregressive Transformer (ANT), a pioneering study of building language GANs based on non-autoregressive (NAR) structures to address the exposure bias problem and reduce latency in training and inference. ANT tackles two key issues: the lack of diversity in latent variable representations by proposing Position-Aware Self-Modulation, and the inaccurate word dependency modeling in Transformers by adopting a Dependency Feed Forward Network. Experimental results show that ANT achieves performance comparable to mainstream models in a single forward pass, with promising applications in latent interpolation and semi-supervised learning.
weaknesses: The baselines selected for comparison in the paper are quite outdated, with the chosen non-autoregressive (NAR) models being from 2018, 2019, and 2021. Given the rapid advancements in the field of natural language processing (NLP), it is crucial to compare the proposed model against the most recent and state-of-the-art NAR models to provide a more accurate assessment of its performance. The absence of comparisons with the latest models raises concerns about the relative effectiveness and competitiveness of the proposed approach.

The experiments conducted in the paper are limited to the COCO and EMNLP datasets, which do not provide a comprehensive evaluation of the model's capabilities. To thoroughly assess the performance and robustness of the proposed NAR model, it is essential to test it on a wider range of datasets, including those for machine translation (e.g., WMT), natural language inference (e.g., SNLI), and text summarization. Evaluating the model on these additional datasets would offer valuable insights into its effectiveness across different NLP tasks, particularly in handling longer texts, which is a critical aspect of many real-world applications. The current dataset selection limits the generalizability and applicability of the findings.

If these aspects were addressed with more comprehensive experiments, it would significantly improve the evaluation and increase the overall score of the paper.