Precisely the Point: Adversarial Augmentations for Faithful and Informative Text Generation (2022)

Abstract: Though model robustness has been extensively studied in language understanding, the robustness of Seq2Seq generation remains understudied.In this paper, we conduct the first quantitative analysis on the robustness of pre-trained Seq2Seq models. We find that even current SOTA pre-trained Seq2Seq model (BART) is still vulnerable, which leads to significant degeneration in faithfulness and informativeness for text generation tasks.This motivated us to further propose a novel adversarial augmentation framework, namely AdvSeq, for generally improving faithfulness and informativeness of Seq2Seq models via enhancing their robustness. AdvSeq automatically constructs two types of adversarial augmentations during training, including implicit adversarial samples by perturbing word representations and explicit adversarial samples by word swapping, both of which effectively improve Seq2Seq robustness.Extensive experiments on three popular text generation tasks demonstrate that AdvSeq significantly improves both the faithfulness and informativeness of Seq2Seq generation under both automatic and human evaluation settings.

## introduction recently, text generation has made significant progress thanks to the development of pre-trained sequence-to-sequence (seq2seq) models @xcite @xcite . despite being able to generate fluent and grammatical text, current state-of-the-art models tend to generate low-informative and unfaithful outputs that hallucinated with the given inputs @xcite . one major reason is that seq2seq models, generally trained with negative log-likelihood (nll), are still not robust enough to handle perturbations in the input @xcite . this vulnerability can lead original input x: police said the incident happened near the village of tockwith. north yorkshire police said it was believed the aeroplane had suffered engine failure. sgt andy graham, who attended the crash, praised the "great piloting skills resulting in no injuries". output from x: a light aircraft has crashed into a field in yorkshire, but no-one was injured. adversarial input x ′ : police said the incident happened near the village of tockwith. north yorkshire police said it was believed the aeroplanes had suffered engine failure. sgt andy graham, who attended the crash, praised the "great piloting skills resulting in no accident". output from x ′ : two aeroplanes have crashed in north yorkshire, with one of them landing safely on its roof. to significant degeneration of the generalization performance for text generation tasks @xcite . the model robustness problem has been extensively studied in language understanding, however, it is still understudied in language generation, especially for pre-trained seq2seq models @xcite . the popular adversarial learning methods for language understanding, such as freelb @xcite , are not effective on seq2seq generation tasks (as shown in to address this problem, we provide the first quantitative analysis on the robustness of pretrained seq2seqs. specifically, we quantitatively analyze the robustness of bart across three generation tasks, i.e., text summarization, table-to-text, and dialogue generation. through slightly modifying the input content, we find that the corresponding output significantly drops in both informativeness and faithfulness, which also demonstrate the close connection between the robustness of seq2seq models and their informativeness and faithfulness on generation tasks. based on the analysis above, we further propose a novel adversarial augmentation framework for sequence-to-sequence generation (advseq) to enhance its robustness against perturbations and thus obtain an informative and faithful text generation model. advseq constructs challenging and factually consistent adversarial samples and learns to defend against their attacks. to increase the diversity of the adversarial samples, advseq applies two types of perturbation strategies, implicit adversarial samples (advgrad) and explicit token swapping (advswap), efficiently utilizing the back-propagate gradient during training. advgrad directly perturbs word representations with gradient vectors, while advswap utilizes gradient directions for searching for token replacements. to alleviate the vulnerability of nll, advseq adopts a kl-divergencebased loss function to train with those adversarial augmentation samples, which promotes higher invariance in the word representation space @xcite . we evaluate advseq by extensive experiments on three generation tasks: text summarization, table-to-text, and dialogue generation. our experiments demonstrate that advseq can effectively improve seq2seq robustness against adversarial samples, which result in better informativeness and faithfulness on various text generation tasks. comparing to existing adversarial training methods for language understanding and data augmentation methods for seq2seqs, advseq can more effectively improve both the informativeness and faithfulness for text generation tasks. we summarize our contributions as follows: ## seq2seq robustness analysis in this section, we analyze the robustness of the seq2seq by evaluating its performance on adversarial samples. in brief, after the input contexts are minorly modified, we check whether the model maintains its informativeness and faithfulness. a robust model should adaptively generate high-quality texts corresponding to the modified inputs. following the definition of adversarial examples on seq2seq models, adversarial examples should be meaning-preserving on the source side, but meaning-destroying on the target side @xcite . formally, given an input context x and its reference text y ref from the test set of a task, and a seq2seq model f θ trained on the training set, we fist collect the original generated text @xmath0. we measure its faithfulness and informativeness by e f (x, y) and e i (x, y, y ref ), where e f and e i are the faithfulness and informativeness metrics, respectively. then, we craft an adversarial sample x ′ by slightly modifying x trying not to alter its original meaning and generate y ′ grounded on x ′ . finally, we measure the target relative score decrease @xcite of faithfulness after attacks by: we calculate the decrease of informativeness similarly. we also report the entailment score of x ′ towards x: s(x, x ′ ) to check whether the modification changes the meaning. task s e i e f summarization ents rourge-l cc/qe table-to-text -parent parent dialogue nli ents ppl ppl/ranking as a preliminary study of robustness, we design a simple word swapping-based method for crafting adversarial samples. for word w @xmath1, we first calculate its salience score as f θ (y ref |x)f θ (y ref |x \ w i ), where f θ (y|x) is the validation score of generating y given x, and x \ w i is input x with word w i deleted. we then sort the salient score to get the swapping orders of words in x, giving priority to those with higher scores. following the orders, we iteratively swap each word with its top 10 nearest neighbors in the word embedding space and keep the replacement if the output bleu score decreases after swapping. for better meaning preservation, we hold the maximum difference in edit distance to a constant of 30 for each sample. the details of algorithm and evaluation metrics are introduced in appendix a. ## advseq framework inspired by the findings in the previous section, we propose to improve the informativeness and faithfulness of a seq2seq model via enhancing its robustness. we propose our framework advseq for robustly fine-tuning pre-trained seq2seq models. during training, advseq utilizes gradient information to automatically construct challenging but factually consistent augmentation samples. for better diversity, we construct two kinds of augmentation samples, implicit adversarial sample (advgrad) and explicit token replacement (advswap). in the following, we introduce advseq in detail. given an input sample (x, y), a seq2seq model with parameters θ learns to generate fluent text by training with nll loss. considering the vulnerability of nll, we further measure and optimize probability distribution changes caused by small random perturbations via kl divergence. the overall loss function w.r.t. the clean sample (x, y) is then defined as: advgrad directly utilizing back-propagated gradient of l o as perturbations, we construct implicit adversarial samples. instead of randomly perturbing word representations like l o , advgrad further searches for stronger perturbations that mostly affect the generation process by solving: advswap simultaneously utilizing gradient directions of l o , we construct explicit adversarial samples by token swapping. the core idea is to identify and swap salient tokens in x without or minorly changing the original meaning of x. the first procedure is to identify a set of salient tokens in x that attributed most to the generation. we formulate this procedure as a causal inference problem @xcite . concretely, given target context y, which can either be the whole reference text y or sampled spans from it, we need to infer a set of most relevant tokens x from x that contribute most for generating y. because the difficulties of this procedure depend on specific tasks, we apply two strategies for searching x in different tasks: for tasks like table-to-text that word overlapping is enough to infer the precise causality, we randomly sample several spans from y as y and find the corresponding x by word overlapping. while, for highly abstractive generation like text summarization, we use the global information y as y and infer x by gradient ranking, which measures the salience of a token by gradient norm @xcite . after the x is inferred, we search around the neighbors of word embedding space for meaning preserving swapping, utilizing the semantic textual similarity of word embeddings @xcite . to make the adversarial samples more challenging, we search at the direction of gradient ascent to replace x @xmath2: overall training for efficiently utilizing the first back-propagate step of l o , we apply the "free" large-batch adversarial training (freelb) @xcite . for every training step, we first forward and back-propagate l o for constructing advgrad and advswap while saving the gradient ∇ θ l o with respect to θ. next, we forward and back-propagate the loss function of two augmentations: l i + l e and accumulate its gradient with respect to model parameters θ. finally, we update θ with previous two-step accumulated gradient. the overall training procedure is summarized in the algorithm 2 in the appendix. ## implementation details during fine-tuning, we set the learning rate to 3e-5, label smoothing to 0.1. for xsum and cnn/dm, we follow the parameter settings of @xcite . for wikiperson and dialogue nli we apply the similar parameter settings with @xcite on cnn/dm, except we do not apply trigram block during inference. for advgrad we set α to 4e-1, ϵ to 2e-1. for advswap we randomly select two spans that contain overlapping tokens with x as y for table-to-text, we set k to 0.15 for gradient ranking for text summarization and dialogue nli. els produce the best rouge scores. compared with all baselines in respective of faithfulness, our models also produce significantly better qe scores, which correlate better with human judgments than cc scores on both datasets, as claimed by @xcite . specifically, both advgrad and advswap improve rouge and qe scores across datasets. through combing them, advseq produces a better performance on cnn/dm. ## conclusion we are the first to conduct quantitative analysis on the robustness of pre-trained seq2seq models, and reveal the close connection between the robustness of seq2seq models and the informativeness and faithfulness for text generation tasks. through quantitative analysis, we point out that current sota pre-trained seq2seq model is still not robust enough to tackle minor perturbations in the input. to alleviate this problem, we propose advseq to improve the faithfulness and informativeness of seq2seq models via enhancing their robustness. augmented by two types of adversarial samples during training, advseq generates text with much better informativeness and faithfulness compared to strong baselines on text summarization, table-to-text, and dialogue generation.