# Beyond Lexical Boundaries: LLM-Generated Text Detection for Romanian Digital Libraries
## 3 Method
### Corpus
#### 3.1.1 Text Generation Strategies  
Starting from the human-authored texts, we expanded the dataset artificially via text generation, leveraging different generation techniques and state-of-the-art language models. An overview of the utilized methods and models is presented in Table 1.  
Several techniques were leveraged for text generation, such as text completion, paraphasing, or backtranslation, to have a greater diversity of the artificially generated texts to feed our detection system. For each generation method, a different input was provided to the model. The text completion method takes as input the first 10 words from each human text and asks the \begin{table}
\begin{tabular}{c c} \hline \hline
**Text Generation Method** & **Language Model** \\ \hline
1. Text Completion & RoGPT2 \\
2. Text Completion & GPT-Neo-Ro \\
3. Text Completion & davinci-003 \\
4. Paraphrasing & Flan-T5 \\
5. Backtranslation (Ro-Ru-Tr-Ro) & davinci-003 \\
6. Backtranslation (Ro-Fr-Es-Ro) & Opus-MT \\
7. Backtranslation (Ro-En-Ru-Ro) & mBART \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Methods overview for artificial text generation. model to continue the text with coherent paragraphs, while for paraphrasing and backtranslation methods, the input is represented by the entire human written text fragments. The motivation behind choosing 10-word prompts for the text completion task is to avoid artificially inflating similarity scores in human-machine text pairs due to n-gram overlap. Using longer prompts could lead to a higher number of shared words between the human reference and the generated texts, skewing the similarity metrics by introducing a higher degree of text overlap. By limiting the prompt length to 10 words, we aimed to strike a balance where the generated texts could still be contextually meaningful, yet not excessively overlap with the reference paragraphs, ensuring a more accurate evaluation of text similarity without introducing unintended biases into the analysis. The language models used for the text completion tasks are RoGPT2 (based on GPT2 architecture), GPT-Neo-Ro (based on GPT3 architecture), and Open AI's davinci-003 (based on GPT3.5 architecture). For the paraphrasing task, Flan-T5 (based on FLAN architecture) was leveraged. The backtranslation task applied three multilingual models, namely davinci-003 (based on GPT3.5 architecture), mBART (based on BART architecture), and Opus-MT (based on a standard Transformer architecture with six attention layers in both encoder and decoder network, having eight attention heads in each layer). The backtranslation models used three iterative translations for each model. The choice of employing iterative translations, involving translations from the original language (Romanian) to multiple target languages and subsequently backtranslating to Romanian, is motivated by several key advantages in the context of generating an artificial corpus. First, this process induces a higher diversity of language patterns since iterative translations introduce linguistic variations, thus making the artificial corpus more representative of the linguistic variability encountered in real-case scenarios. Second, the translations may yield different word choices and contextual interpretations by involving multiple languages, contributing to richer representations in the artificial corpus. Third, iterative translations introduce controlled semantic drift and ambiguity into the text. As the text navigates multiple languages back and forth, subtle changes in meaning and context may occur. This controlled variation is valuable for simulating ambiguities present in real-world language. Fourth, the iterative translation strategy enhances generalization as the generated corpus becomes more adaptable to a range of language variations, ensuring better performance and robustness when applied to tasks involving varied linguistic inputs.