T ue S ents at S em E val-2024 Task 8: Predicting the Shift from Human Authorship to Machine-generated Output in a Mixed Text (2024)

Abstract: This paper describes our approach and results for the SemEval 2024 task of identifying the token index in a mixed text where a switch from human authorship to machine-generated text occurs. We explore two BiLSTMs, one over sentence feature vectors to predict the index of the sentence containing such a change and another over character embeddings of the text. As sentence features, we compute token count, mean token length, standard deviation of token length, counts for punctuation and space characters, various readability scores, word frequency class and word part-of-speech class counts for each sentence. class counts. The evaluation is performed on mean absolute error (MAE) between predicted and actual boundary word index. While our competition results were notably below the baseline, there may still be useful aspects to our approach.

## introduction with the rapid proliferation of large language models (llms) that are able to produce fluent texts in response to user queries across a wide range of domains and topics, concerns are raised about the potential misuses of such powerful tools. in spite of their fluency, llm-generated texts may contain factual errors, inadvertently spreading misinformation. another common issue occurs in the education system, where students may attempt to pass off the responses of such an llm as their own work, evading commonly used safeguards against plagiarism. given the overwhelming volume of potentially machine-generated content, it is desirable to have automated means of detecting such texts to address the abovementioned issues. in this task @xcite , we examine exclusively english mixed texts, where a switch from human authorship to llm output occurs at most once in a text sample (some samples are entirely machinegenerated). to us, this models a plausible use case, where a human user employs an llm to finish their work for them. for each sample, the task is to predict the token index at which the authorship change occurs. we observe, that due to the structure of the samples, we can reformulate the task more generally as trying to detect an authorship change and its location within the sample texts, without explicitly trying to detect the presence of llm-generated text. this allows us to adapt more traditional, computationally relatively inexpensive approaches to stylometry and authorship identification/attribution. while the task is formulated as prediction of a boundary word, we begin by identifying the boundary sentence in which the authorship change occurs. for each sentence, textual feature vectors are extracted and combined with character n-gram information, those sentence vectors are then fed into a bidirectional lstm network @xcite which is trained to predict the boundary sentence. we found that our approach performed reasonably well in-domain on the development set, in spite of inevitably introducing some token offset error by only making sentence level predictions and choosing the middle tokens, but failed out-of-domain on the test set, ranking at 26 out of 30 in the competition on subtask c. ## background in accordance with the task guidelines we do not use external data, but use the english subsets of larger data sets from subtask a and b to extract a character vocabulary. the subtask c dataset comprises a bit over 4000 texts with 505 pre-split into a dev set by the task authors, each text labeled with the index of the boundary word. the following table shows token and sentence counts for train and dev set, when tokenized by splitting on whitespace (u+0020) as in the task baseline model. sentence splits are determined subsequently on the token lists by identifying sentence-final tokens using our detection regex, this is done to ensure matching the given boundary word labels. we observe that about half of the samples contain 4 -11 sentences and sentence count per sample ranges from 1 to 76, with 24 samples containing just one sentence, like e.g. "we have added a 2+ page discussion on the experimental results, highlighting the superiority of the arc-based models and their impact on the field of deep learning." (boundary word 'discussion' in bold). while on average the author switch occurs in the fourth sentence, in about 15-20% of the samples the switch occurs in the first sentence. examining the boundary word position within their respective sentences we found an average offset of -1.6 (train set) or -1.8 (dev set) from the middle of the sentence, i.e. the switch occurs slightly before mid sentence on average. an example text, split in sentences and tokens can be observed below, with the boundary word "baseline" at index 20 highlighted: ## system overview in our system, we at first sought to compare and combine more traditional textual features with task-specific learned character embeddings, as the former offer the benefit of cheap computation and greater transparency, whereas the latter should allow the system to capture more subtle patterns at the expense of transparency and at a higher computational cost. we choose a relatively straightforward basic architecture for our models, using a bilstm over sentence vectors to predict the boundary sentence at which the authorship change occurs. with regards to textual features, we compute for each sentence: token count, mean token length, standard deviation of token length, counts for punctuation and space characters, various readability scores, word frequency class and word part-of-speech class counts. for our character model, we used another bilstm with embedding layer over the text characters, adjusting the token labels to the character level. as the character level model did not perform to our expectations on both normalized and raw text, we did not combine it with the textual feature model and decided to use the latter as a standalone model. ## experimental setup we used the provided train/dev split to tune our models. we compared performances of a purely textual feature based model and a character-based model. we extracted the textual features offline, using the spacy @xcite library for python and its textdescriptives @xcite extension library. we used the en_core_web_sm (v3.7.1) pipeline for spacy. hyperparameters were tuned manually, we settled on single-layer networks of hidden size 16, using adam optimizer @xcite with learning rate 1e-5, training on batches of size 8 over 100 epochs. for the characterbased network we choose an embedding size of 8. the task is evaluated on mean absolute error (mae) between predicted and actual boundary word index. to translate our boundary sentence prediction into a token index, we selected the middle token index as default, rounding it down for sentences with an even token count. for the character model, we chose the token containing the predicted character index. ## results on the development set our textual feature model showed somewhat promising results with regards to predicting the sentence containing the boundary word. it predicted the correct sentence in 69.9% of cases, the adjacent sentence in a further 21.4% with a sentence index mae of 0.47. translating these predictions into token level predictions using the sentence mid-point yielded a token mae of 13.5, notably worse than the baseline model's. our character embedding model did perform notably worse on the development set, with a token mae of 48.9. we therefore did not pursue it further and abandoned our initial idea of combining it with the textual feature model. on the test set, for the competition, we submitted the predictions of our textual feature model, unfortunately not matching the performance on the development set. we only managed to predict 30% of boundary sentences correctly, with another 22.6% predictions of the adjacent sentence, resulting in a sentence mae of 3.2 and a disappointing token mae of 59, ranking 26 out of 30 among the participant models in subtask c. we suspect this drop in performance mainly be caused by introduction of a new text domain in the test set, while development and training samples are exclusively drawn from peerread @xcite i.e. academic peer reviews, the test set introduces student essays from outfox @xcite . this degradation of performance for stylistic textual features is in line with other findings, e.g. the comparisons performed on the m4 dataset @xcite of which this competition's dataset is an extension. ## conclusion while our model's performance leaves plenty of room for improvement, we can envision the use of simple textual features in a lightweight model, similar to ours as a basic tool in contexts where more powerful models are either unavailable or too expensive to run and the text domain is known in advance. focusing on sentence level instead of token level predictions allows us to reduce computational effort and we consider it sufficient for many practical applications, where automated detection of llm generated text is only a first step, such as e.g. examining student essays, where we would expect a teacher to follow up with affected students regarding suspicious spans of text individually.