Controlling Out-of-Domain Gaps in LLMs for Genre Classification and Generated Text Detection
Dmitri Roussinov, Serge Sharoff, Nadezhda Puchnina · 2024
Read Controlling Out-of-Domain Gaps in LLMs for Genre Classification and Generated Text Detection by Dmitri Roussinov, Serge Sharoff, Nadezhda Puchnina (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-20595.txt.
Description
Abstract This study demonstrates that the modern generation of Large Language Models (LLMs, such as GPT-4) suffers from the same out-of-domain (OOD) performance gap observed in prior research on pre-trained Language Models (PLMs, such as BERT). We demonstrate this across two non-topical classification tasks: 1) genre classification and 2) generated text detection.
Catalog record
| CREATOR | Dmitri Roussinov, Serge Sharoff, Nadezhda Puchnina |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 51 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2412-20595
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Controlling Out-of-Domain Gaps in LLMs for Genre Classification and Generated Text Detection Dmitri Roussinov, Serge Sharoff, Nadezhda Puchnina Abstract This study demonstrates that the modern generation of Large Language Models (LLMs, such as GPT-4) suffers from the same out-of-domain (OOD) performance gap observed in prior research on pre-trained Language Models (PLMs, such as BERT). We demonstrate this across two non-topical classification tasks: 1) genre classification and 2) generated text detection. Our results show that when demonstration examples for In-Context Learning (ICL) come from one domain (e.g., travel ) and the system is tested on another domain (e.g., history ), classification performance declines significantly. To address this, we introduce a method that controls which predictive indicators are used and which are excluded during classification. For the two tasks studied here, this ensures that topical features are omitted, while the model is guided to focus on stylistic rather than content-based attributes. This approach reduces the OOD gap by up to 20 percentage points in a few-shot setup. Straightforward Chain-of-Thought (CoT) methods, used as the baseline, prove insufficient, while our approach consistently enhances domain transfer performance. 1 Introduction Recent advancements in Large Language Models (LLMs) have pushed the boundaries of natural language processing, leading to remarkable performance across a wide range of tasks Brown et al. (2020) ; Floridi and Chiriatti (2020) ; Bubeck et al. (2023) . While their success with In-Context Learning (ICL) has gained particular attention, questions remain regarding their consistency when applied to unfamiliar domains. Unlike models similar in size to BERT Devlin et al. (2018) , which require a sample of labeled data for domain-specific tuning, LLMs are often used via ICL with little to no fine-tuning. However, this flexibility comes at a cost, as LLMs frequently experience a decline in performance when tested across domains Yuan et al. (2024) , a gap also observed in earlier, smaller models Roussinov and Sharoff (2023) . This degradation is often attributed to the models’ reliance on surface-level features rather than deeper, domain-independent attributes Wang et al. (2023) . To address this challenge, we introduce a method that controls which prediction indicators the model considers during few-shot document classification. While this approach is broadly applicable to many non-topical document classification tasks, our focus here is on the ICL approach to two specific tasks: 1) the automated recognition of document genre, and 2) detection of computer-generated texts. Genre classification plays a vital role in fields such as information retrieval, automatic summarization Stewart and Callan (2009) , machine translation Van der Wees et al. (2018) , and dependency parsing Müller-Eberstein et al. (2021) . It also aids information security by enabling genre-aware assessments of web document credibility Agrawal et al. (2019) , and is crucial for curating genre-diverse corpora to pre-train LLMs to build robust foundation models Kuzman et al. (2023) ; Lepekhin and Sharoff (2022) . While recent advancements in LLMs have shown that zero-shot methods can achieve strong performance in genre classification Kuzman et al. (2023) , another qualitative exploratory study pointed out that a few-shot approach may severely suffer from OOD performance gaps Roussinov and Sharoff (2023) . Detecting AI-generated text has become critical in verifying authenticity and maintaining information integrity. As models like GPT-4 produce increasingly human-like text, the risks of misinformation, plagiarism, and malicious content generation have surged. The task involves distinguishing human-authored text from machine-generated outputs, leveraging techniques that identify linguistic patterns or use methods like watermarking (embedding hidden markers in generated text). Recent surveys emphasize the importance of detecting generated content for preventing deepfakes, maintaining trust in digital communications, and ensuring transparency in AI applications Tang et al. (2024) ; Gehrmann et al. (2019) ; Kirchenbauer et al. (2023a) . Here are our specific contributions: 1 1 1 For replicability of our experiments, the full experimental setup is at https://github.com/dminus1/LLM-OOD-control 1. While prior studies focused on datasets from distinct sources or smaller models like BERT Kuzman et al. (2023) ; Roussinov and Sharoff (2023) , our work directly confirms significant out-of-domain performance gaps in LLMs across two key tasks: genre classification and generated text detection, both using In-Context Learning across multiple topics (domains). We evaluated these tasks using two advanced LLM families (GPT-4 2 2 2 https://chat.openai.com/ and Claude 3 3 3 https://claude.ai/ ), accessed through their APIs. 2. Earlier studies with smaller (BERT-sized) pre-trained language models (PLMs) reported only modest reductions in OOD gaps (e.g., 2?3 percentage points; Roussinov and Sharoff, 2023 ). In contrast, our results demonstrate significant improvements, with reductions of up to 7 and 20 percentage points across the two tasks, respectively. This facilitates domain transfer by enabling classifiers demonstrated with few-shot examples from one domain (e.g., travel ) to be effectively applied in another (e.g., history ). Our method is distinctive in its ability to control which text attributes are emphasized (e.g., style) and which are disregarded (e.g., topical content). 3. Through ablation studies, we verify that detailed prompts are crucial for optimal performance, while the straightforward application of Chain-of-Thought (CoT, Wei et al. , Wei et al., 2022 ) lacks the precision needed to guide the model effectively. 2 Methodology Figure 1: Domain transfer assessment methodology adapted from Roussinov and Sharoff (2023) for few-shot In-Context Learning (ICL), independently testing two tasks: (1) genre classification and (2) generated text detection. Prompt construction may optionally include instructions on which indicators to use or ignore. The topic modeling scores determine which texts are considered on-topic (top) or off-topic (bottom). On-topic texts are used for testing and, depending on the configuration, for ICL demonstration examples, while off-topic texts are only used as examples. Synthetic texts are generated by an LLM for the generated text detection task. This methodology is applicable to other non-topical classification tasks, such as determining gender, identifying authorship, analyzing sentiment, etc. 2.1 The Approach Figure 1 illustrates the overall workflow for our experiments. As in prior recent works on genre classification, e.g., Kuzman et al. (2023) or Roussinov and Sharoff (2023) , we define genre as the ’function of the text, author?s purpose, and form of the text.’ Writing style is an important characteristic of genre but not the only one. Other characteristics include the intended audience, the medium through which the text is delivered, and the context of its use. Following the methodology in Roussinov and Sharoff (2023) , we define ’domain’ as a topic in the topic modeling sense Blei et al. (2003) . Our approach, therefore, focuses on identifying distinct topics such as sports, politics, or health from a large general-purpose corpus. This contrasts with several previous studies (e.g., Kuzman et al., 2023 ), where ’domain’ is defined by differences in dataset collection or labeling methods. For example, in their approach, book reviews and movie reviews would be considered separate domains within a sentiment analysis task. We employ the domain transfer assessment methodology and datasets from Roussinov and Sharoff (2023) , originally developed to test out-of-domain (OOD) classification with BERT-sized PLMs, to further investigate and address the OOD gap in few-shot genre classification using ICL and large language models (LLMs). We propose and validate a domain transfer approach by adapting Chain-of-Thought (CoT, Wei et al., 2022 ) prompting to control which text properties should be emphasized (e.g., writing