Feature-Level Insights into Artificial Text Detection with Sparse Autoencoders (2025)

Abstract: Artificial Text Detection (ATD) is becoming increasingly important with the rise of advanced Large Language Models (LLMs). Despite numerous efforts, no single algorithm performs consistently well across different types of unseen text or guarantees effective generalization to new LLMs. Interpretability plays a crucial role in achieving this goal. In this study, we enhance ATD interpretability by using Sparse Autoencoders (SAE) to extract features from Gemma-2-2B’s residual stream. We identify both interpretable and efficient features, analyzing their semantics and relevance through domain- and model-specific statistics, a steering approach, and manual or LLM-based interpretation of obtained features. Our methods offer valuable insights into how texts from various models differ from human-written content. We show that modern LLMs have a distinct writing style, especially in information-dense domains, even though they can produce human-like outputs with personalized prompts. The code for this paper is available at https://github.com/pyashy/SAE_ATD.

## introduction the active development of large language models (llms) has led to the increasing presence of ai-generated text in various domains, including news, education, and scientific literature. although these models have demonstrated impressive fluency and coherence, concerns about misinformation, plagiarism, and ai-generated disinformation have required the development of reliable artificial text detection (atd) systems @xcite . existing atd frameworks primarily rely on statistical measures, linguistic heuristics, and deep learning classifiers, yet these methods often lack interpretability, limiting their reliability in highstakes applications @xcite . a promising approach to enhancing interpretability in atd is the use of sparse autoencoders (saes), which learn structured representations of textual data by enforcing sparsity constraints @xcite . we can extract human-interpretable features that capture the underlying structure of text. in this study, we extend this line of research by applying saes from the gemma-2-2b model (team, 2024a) residual streams to analyze features that contribute to artificial text detection. by examining these features, we introduce a categorization of extracted features into discourse features (capturing long-range dependencies), noise features (highlighting unnatural artifacts), and style features (distinguishing stylistic variations). our contributions are the following: for our main dataset, we utilized a highly comprehensive and up-to-date dataset from genai content detection task 1 -a shared task on binary machine-generated text detection, conducted as part of the genai workshop at coling 2025 @xcite . hereafter referred to as the coling dataset, it contains a diverse range of model generations, from mt5 and opt to gpt-4o and llama-3. a complete list of models, along with generation examples, is provided in appendix c. we also performed additional experiments on the raid dataset @xcite , which contains generations from several models with various sampling methods and a wide range of attacks, from paraphrasing to homoglyph-based modifications. we provide the full list of models and attacks, along with examples of generations, in appendix b. ## background given a token sequence (t 1 , t 2 , ..., t n ), an llm computes hidden representations given activations x from a language model, a sparse autoencoder decomposes and reconstructs them using encoder and decoder functions with some activation function σ: for which x(f (x)) should map back to x. here, the sparse and non-negative feature vector f (x) ∈ r m (with m ≫ d) specifies how to combine columns of w dec which is learned features, or latents in order to reconstruct x. ## methods in this work, we take a step towards improving the interpretability of artificial text detection using saes. we employ the gemma-2-2b model along with pre-trained autoencoders on residual streams from gemma-scope @xcite . classifier models. for each even layer, we utilize an individual sae (f (l) , x(l) ) to extract learned features from each token. to obtain a feature vector f representing the entire text for layer l, we sum over all tokens, yielding we use an xgboost classifier to evaluate the expressiveness of the full feature sets for each layer and identify the most important features for further analysis foot_0 , while llm and sae models remain frozen. the classifiers are trained exclusively on the train subset of coling and evaluated on the similar dev set, as well as on the entirely distinct devtest and test subsets. additionally, we employ indicator functions of the form i[f @xmath0. to obtain the optimal classifier i τ * , we determine the threshold τ * using logistic regression on the training data. furthermore, leveraging the sparsity of the feature vectors, we define classifier i 0 by setting τ = 0. in this setting, we consider feature j to be activated in a text if f @xmath1, and not activated otherwise. ## conclusion our analysis shows that modern llms often generate easily detectable text due to specific writing styles, such as long introductions, excessive synonym substitution, and repetition. however, adversaries can bypass these features by using less formal and more personalized prompts, leading to more human-like outputs. unlike previous approaches, we perform a multifaceted analysis of features for artificial text detection (atd). we select key features, examine their behaviour across domains and generators, and interpret them both through manually analysing extreme values and inspecting medium shifts with steering and llm interpretation. this approach provides deeper insights into feature meanings. for example, our interpretation of feature 3608 contrasts with neuropedia's very specific view, which links it to "tokens associated with mathematical expressions". similarly, feature 4645, described by neuropedia as related to "keywords on diabetes" is more broad and relevant in our analysis. we conclude that sparse autoencoder-based analysis of atd datasets is a valuable tool for understanding text generators, detectors, and how detectors generalize to new setups. our findings highlight that detecting ai-generated text is easier with a default prompt but becomes difficult when prompt style changes, a crucial consideration for atd developers.