Authorship Attribution for Neural Text Generation (2020)

Abstract: In recent years, the task of generating realistic short and long texts have made tremendous advancements. In particular, several recently proposed neural network-based language models have demonstrated their astonishing capabilities to generate texts that are challenging to distinguish from human-written texts with the naked eye. Despite many benefits and utilities of such neural methods, in some applications, being able to tell the “author” of a text in question becomes critically important. In this work, in the context of this Turing Test, we investigate the so-called authorship attribution problem in three versions: (1) given two texts T1 and T2, are both generated by the same method or not? (2) is the given text T written by a human or machine? (3) given a text T and k candidate neural methods, can we single out the method (among k alternatives) that generated T? Against one humanwritten and eight machine-generated texts (i.e., CTRL, GPT, GPT2, GROVER, XLM, XLNET, PPLM, FAIR), we empirically experiment with the performance of various models in three problems. By and large, we find that most generators still generate texts significantly different from human-written ones, thereby making three problems easier to solve. However, the qualities of texts generated by GPT2, GROVER, and FAIR are better, often confusing machine classifiers in solving three problems. All codes and datasets of our experiments are available at: https://bit.ly/ 302zWdz

## introduction recent rapid advancements in deep learning technologies have enabled the generation of realistic artifacts (e.g., deepfakes) that are difficult to distinguish from genuine human-generated artifacts. in the text domain, which is the main focus of this work, similarly, the advancement of natural lan-guage generation (nlg), especially those based on neural language models, has led to the inundation of realistic text generation. as novel nlg techniques become more sophisticated and prevalent, corresponding pitfalls and risks of such technologies also increase. adversaries may use such technologies to generate realistic artifacts to trick naive users in fraudulent activities (e.g., machine-generated chatbot conversation in a phishing scam or deepfake-based disinformation campaign). therefore, the need to distinguish machine-generated texts from human-written ones, so-called the turing test, naturally arises. furthermore, in some security applications, merely being able to identify machine-generated text may not be sufficient. instead, a more critical solution would be to tell which nlg method among many candidates has generated a given text in question-socalled the authorship attribution (aa) problem. to improve our understanding of this newly-emerging problem, we empirically investigate three versions of the aa problem in this paper. for all three versions, we assume that there are k different nlg methods 1 . problem 1 (same method or not) given two texts t 1 and t 2 , determine if both t 1 and t 2 are generated by the same nlg method (or human) or not. problem 2 (human vs. machine) given a text t 1 , determine if t 1 is written by human or generated by any k nlg methods. ## generation of texts we have nine text generators-i.e., one human writer and eight neural machine generators. all eight neural generators require a short prompt to begin their generation and the number of words to generate. these eight generators were chosen because we found that they had the best pre-trained models for our task. we used the titles of news articles (written by human journalists) as the prompt and set 500 as the number of words. 1. human. we collected recently-published news titles and contents in mostly politics-819 from cnn, 132 from washington post, and 113 from the new york times. as professional reporters write these news articles, they represent human-written texts. then, we used the news titles as the prompts for other neural methods. ## linguistic analysis we first conduct a psycholinguistics study to analyze different linguistic features of generated texts. the result is summarized in on the other hand, the flesh-kincaid grade generates a score representing the u.s. grade level of education (the higher, the more sophisticating). for instance, text given a 10.8 score suggests that its author can be in the 11-th grade and about 16-17 years old. next, we use linguistic inquiry and word count (liwc) @xcite to capture the psycholinguistics features. liwc has 93 features, of which 69 are categorized into: standard linguistic dimensions (e.g., pronouns, past tense), psychological processes (e.g., social processes), personal concerns (e.g., money, achievement), and spoken categories (e.g., assent, nonfluencies) @xcite . grover, and fair scores are as high human, suggesting that they all generate sophisticated texts. liwc-article shows the usage of a, an, the, which are crucial in any formal writing. similar to liwc-analytic, gpt2, grover, and fair score similar to human. overall, the patterns among these liwc features follow our observations that gpt2, grover and fair generally have higher news generation quality than other machine algorithms. finally, we also measure the entropy scores of generated texts @xcite . figure 1 shows the 2-dimensional distribution of generated texts using principal component analysis (pca) on all psycholinguistic features, with about 70% explained variation. as we can observe a large overlapped portion among generated texts. we expect a non-linear machine learning model (e.g., random forest) would perform better than a linear method such as naive bayes in classifying the texts according to their generators using these features. ## model architecture in solving three problems, we compare various relatively-simple neural models' performances, employing different architectures to encode generated texts into representation vectors, which then feed into a fully connected network followed by a softmax layer for prediction. note that our goal is not to develop sophisticated neural models to solve three problems. rather, we want to empirically evaluate how these simple neural models (as baselines) perform in solving three problems. experimenting with these neural models, we split the dataset into the training, validation, and testing parts in 7:1:2 ratio. ## p1: same method or not the first version of the problem is to determine whether two given texts are generated by the same method (including human writers) or not. even if one cannot pinpoint whom the author is for a given text, one may still notice similarities between texts. therefore, p1 tests the varying capabilities of models to detect such similarities between the two texts. we prepare two datasets of a similar size. in the balanced set, half of text pairs are generated by the same method (e.g., human-human or ctrl-ctrl), and the other half are random pairs of the two different methods (e.g., human-ctrl or grover-fair). in the imbalanced set, 11% of text pairs are generated by the same method, while the remaining 89% are by different methods (1:8 ratio). model-wise, we utilize the siamese neural network @xcite with one of the text encoders in section 5 to predict whether the two input texts are generated by the same method. ## p2: human vs. machine the second version of the problem determines whether a given text is generated by human or ma-chine (i.e., one of the neural methods). p2 is a type of the turing test. despite the recent advancements in neural nlg methods, we hypothesize that there may still be latent differentiating characteristics between human-written and machine-generated texts. therefore, p2 tests the varying capabilities of different models to detect such differences between human and machine writings. for p2, in addition to five neural models introduced in section 5, we also tested three known turing test models including roberta @xcite using a similar implementation of gpt2 output detector foot_7 , grover-detect (zellers et al., 2019) 9 , and roberta-tuned, which is the roberta that we fine-tuned using 20% of our data. roberta is fine-tuned by adding a classification layer on top of it. next, the weight of the classification layer is randomly initialized and then trained on the gpt2 output and human written text foot_9 . further, we utilize the 20% of the target data we collected to fine-tune the roberta classification model. note that grover-detect used in our experiment was trained using only 5k training samples, while its improved version trained with 100k samples is not publicly available. additionally, gltr is another state-of-the-art turing tester used to distinguish machine-generated texts from human-generated texts @xcite , although not used in these experiments. furthermore, in this setting, we tested both individual case (i.e., one neural method at a time) and collective case (i.e., eight neural methods combined). first, we prepare eight test sets for the individual case, each of which is the balanced test set between human (50%) vs. one neural generator (50%). for the performance of collective cases shown in ## p3: authorship attribution the third version of the problem is to single out the real author of a given text, among many alternatives (e.g., one human and k neural methods). therefore, p3 tests different models' varying capabilities to exploit both similarities within and differences across human and machine writings. for p3, in addition to five neural models introduced in section 5, we also tested four classical machine learning models (i.e., naive bayes, decision tree, svm, and random forest) using psycholinguistic features discussed in section 4 and four state-of-the-art aa solutions, including pos+cnn-lstm and pos+lstm-lstm (jafariakinabad et al., 2019), 3-grams + svm @xcite and character n-gram + svm @xcite . neural methods such as embedding, rnn, and cnn-rnn used glove word embedding @xcite , but stacked cnn and parallel cnn did not use glove due to its negative impact on performance. the most challenging test set turns out to be both human and grover that yields relatively low average f1 scores across all of classical, neural, and existing aa models (0.5423 and 0.5542, respectively). also, interestingly, neural classifiers are able to classify fair very accurately unlike classical or existing aa models, while classical ## conclusion we have conducted comprehensive experiments on three versions of the authorship attribution (aa) problem: (1) the same method or not, (2) human vs. machine (turing test), and (3) who is the author. notable findings from our empirical evaluation include: (1) not all neural text generation methods generate high-quality human-mimicking texts-in particular, gpt2, grover, and fair generated better-quality texts and (2) using specific linguistic features and simple neural architectures, we can solve three problems reasonably well, except gpt2 and fair in p2 and grover in p3.