SINAI at S em E val-2024 Task 8: Fine-tuning on Words and Perplexity as Features for Detecting Machine Written Text (2024)

Abstract: This work presents the proposed systems of the SINAI team for the subtask A of the Task 8 in SemEval 2024. We present the evaluation of two disparate systems, and our final submitted system. We claim that the perplexity value of a text may be used as classification signal. Accordingly, we conduct a study on the utility of perplexity for discerning text authorship, and we perform a comparative analysis of the results obtained on the datasets of the task. This comparative evaluation includes results derived from the systems evaluated, such as fine-tuning using an XLM-RoBERTa-Large transformer or using perplexity as a classification criterion. In addition, we discuss the results reached on the test set, where we show that there is large differences among the language probability distribution of the training and test sets. These analysis allows us to open new research lines to improve the detection of machine-generated text.

## introduction in recent years, the use of generative models has increased considerably. the capabilities of this multifaceted tool include summarizing texts, retrieving information through searches, rephrasing texts for specific purposes and so on. however, it is important to recognize the potential threats associated with their application in certain contexts. for example, hallucinations in natural language generation (nlg) models present significant problems, as they damage performance, raise safety issues for its use in the real world and hallucinations introduce privacy violation risks @xcite . likewise, the very ability to generate natural language represents a threat, since it is increasingly indistinguishable from natural language. therefore, the development of systems with the capacity to discern the authority of a given text, determining whether it is of human origin or generated by a generative model, is arising peremptory. the language used by humans follows a probability distribution that differs so far from the distribution of the automated generated language @xcite . perplexity measures the uncertainty value of a sample in a probability distribution. accordingly, it is used in natural language processing (nlp) as a metric to evaluate the effectiveness of linguistic models, for instance in text generation and machine translation tasks @xcite @xcite . hence, it can be used to assess whether a text was generated by a machine, whose perplexity would be low, or written by a human, whose score would be large, since it may differ from that text automatically generated. we thus claim that perplexity can be used as a classification signal to enhance the finding of machine-generated texts @xcite . in this work, we present the model submitted by the sinai team to subtask a of task 8 of semeval 2024 @xcite . our proposal is based on the fuse of the word embeddings vectors stemmed from the fine-tuning of xlm-robert-large language model and the perplexity score of the input text. we use the multimodal-toolkit library @xcite to fuse this two set of features. after obtaining relevant results in the training phase and finding a clear difference between machine-generated and human-written texts, the results obtained have not been satisfactory. in part, this is due to the difference between the training and test datasets, which is analyzed later. nevertheless, the exploration of the results obtained by merging textual content and associated perplexity raises the idea of using more novel linguistic models to calculate textual perplexity (see section 7). the rest of the paper is organized as what follows: section 2 presents the works that support our proposal. section 3 describes the data of the task, and section 4 is focused on the systems evaluated 1 1505 and the submitted one. section 5 presents the results reached during the training phase, and section 6 the official reached ones as well as an analysis of them. we summarize the conclusions in section 7. we release the source code at github. foot_0 ## related work the language generation capacity of large language models is unceasing improving @xcite . hence, machine-generated text detection is key as a fundamental countermeasure to mitigate the misuse of nlg models, accompanied by notable technical challenges and a multitude of unresolved issues. we find a wide range of strategies to differentiate human-written text from machine-generated text @xcite ) from the most simple ones based on bag-of-words models to the latest ones grounded in the fine-tuning of linguistic models. the paper @xcite has shown that different observable patterns make up generative models of language, either grammatically or through the meaning of sentences. for example, perplexity is usually lower in texts generated by artificial intelligence and their texts rather express feelings and use unusual words. this paper also shows a difference in performance between perplexity-based and machine learning-based classification, the latter being better than perplexitybased classification. however, it shows the capacity of perplexity score to distinguish among natural language text and machine-generated text. ## data and task description task 8 is focused on the identification of machinegenerated text. in this work, we manage the subtasks of monolingual (english) and multilingual classification. the dataset for the monolingual english task consists of 119,757 training instances, complemented by another 5,000 evaluation instances @xcite . in the multilingual task, the corpora comprise a total of 172,417 instances, with an allocation of 4,000 instances for the evaluation phase. this multilingual dataset is composed of 77.48% english text, with bulgarian as a secondary language. the rest of the training dataset also incorporates languages such as chinese, indonesian, and urdu. in addition, the evaluation dataset includes texts in russian, german, and arabic. each instance includes the text, along with its corresponding source according to five categories: wikihow, wikipedia, reddit, arxiv, peerread. in the multilingual task, we can find additional sources: bulgarian, urdu, indonesian, and chinese. also has a category that attributes the text to a specific large language model: chatgpt, cohere, bloomz, davinci, dolly, or human in another case. the gold label is 1, if the text is machine-generated and 0 otherwise. the dataset presents an even distribution, with cases annotated as human or machine being approximately equal in the training and development corpora. ## system description our proposed system to subtask a of task 8 is based on the wide success of fine-tuning methods on language models and in our claim of using perplexity as a feature to separate texts written by humans from machine-generated texts. @xcite . we use the xlm-roberta-large base as a language model, and we first assess its performance by fine-tuning the training data on it. then, we evaluate the use of the perplexity as a classification signal, and the third one, which we submit to the shared-task, is based on joint use the resulting features of the fine-tuning phase and the perplexity score of each sentence. in the next subsections, we argue the use of perplexity as feature in section 4.1, we present all the systems studied in section 4.2 and we describe all the implementation details in section 4.3. ## development results once we optimized the hyperparameters of each model, we assessed the performance of each system on the development data. we use accuracy as an evaluation measure, since it is the evaluation measure of the shared-task. as detailed previously, the results of systems one and two are based on monolingual data, while system accuracy system one -fine-tuning 0.8002 system two -perplexity 0.6894 proposed system -monolingual 0.8698 proposed system -multilingual 0.6789 task baseline monolingual 0.7400 task baseline multilingual 0.7200 as we indicated below, system one is only grounded in fine-tuning the xml-roberta-large model on the training data. the results are over the task baseline, which means that the incorporation of knowledge from the domain with the optimal values of the hyperparameters may reach competitive results and to overcome the task baseline. the system that only uses perplexity as a classification signal reached poorer results than the baseline system. however, its performance is close to 70% accuracy, which means that the perplexity may be used as a feature to discriminate among human written text and machine-generated text, as we claim. the proposed system jointly uses words and perplexity as features. in the monolingual scenario, this fusion of features reaches strong results far away from the task baseline. nonetheless, the results for the multilingual scenario were not as strong as the monolingual one. according to the results of the monolingual data, we use as proposed system the one based on the fusion of words and perplexity as features. ## analysis and discussion the final results revealed unexpected differences compared to the results observed during the development phase. in the system that jointly uses 4 1508 perplexity and text, the accuracy achieved in the monolingual task was 0.744631, which was lower than expected based on performance during development. in contrast, a poorer result was observed on the multilingual task, which achieved an accuracy of 0.801689 on the final test data set. both results are lower than the baseline obtained by the competitors, with 0.8846 accuracy for the monolingual test and 0.8088 for the multilingual test. recognizing these discrepancies, our initial action consisted of an examination to determine the causes. the main advantage of our system resides in the incorporation of perplexity as classification signal along with the textual data. consequently, our analysis primarily focused on examining the perplexity to elucidate possible factors contributing to the observed errors, as well as observing which class is more difficult to recognize, human-written or machine-generated texts. ## conclusion we have described the system submitted to subtask a of task 8 of semeval. the system is grounded in the claim that perplexity may be a discriminant feature in identifying machine-generated texts. hence, our submitted system is built upon the finetuning of a xml-roberta-large language model on a fusion of words and perplexity as features. the results reached during the development phase convinced us that our claim holds. the official results show that the fusion of words and perplexity as features were not as good as the assessment on the development set. according to our analysis results, it may be caused by the use of a different large language model to generate the text documents. it pushes us to study the influence of the reference large language model used for the calculation of the perplexity and also to analyze the possibility of combining different perplexity calculated using a wide diverse set of large language models. 5 1509