TL;DR
TOPFORMER is a hybrid architecture that fuses RoBERTa with Topological Data Analysis (TDA) to identify the specific author—human or one of several LLMs—of a given text. By capturing the underlying "shape" and structure of linguistic data, it significantly outperforms standard transformers in authorship attribution, especially when dealing with imbalanced datasets and diverse writing styles like paraphrasing or translation.
What Problem Does This Paper Address?
As Large Language Models (LLMs) proliferate, the challenge has shifted from a simple binary "Turing Test" (is this human or machine?) to a more complex Authorship Attribution (AA) problem: which specific model wrote this? With over 72,000 models on Hugging Face, malicious actors can easily generate high-quality disinformation at scale.
Existing detectors often struggle with two real-world realities:
- Style Diversity: LLMs aren't just used for raw generation; they paraphrase, translate, and summarize, each creating different linguistic "fingerprints."
- Data Imbalance: In the wild, human-written text usually far outweighs specific deepfake samples, making it difficult for standard classifiers to learn effectively.
Methods
The authors propose TOPFORMER, which augments a standard RoBERTa backbone with a TDA module. The workflow is as follows:
- Feature Extraction: Text is passed through RoBERTa to get a 768-dimensional
pooled_outputvector. - Reshaping: This 1D vector is reshaped into a 24x32 2D matrix. The authors found that a near-square matrix provides the most stable topological features.
- Topological Layer: This matrix is treated as a "point cloud." The model applies Persistent Homology, a TDA technique that identifies structural features (like connected components and loops) that persist across different spatial scales.
- Feature Fusion: The TDA features (birth, death, and persistence of these structures) are flattened and concatenated with the original RoBERTa output.
- Classification: The combined vector passes through a linear layer and softmax for multi-class attribution.
Datasets
The model was evaluated on three "realistic" (imbalanced and multi-style) datasets:
- OpenLLMText: Includes human text and generations from LLaMA, ChatGPT, PaLM, and GPT-2, featuring both paraphrasing and raw generation.
- SynSciPass: Scientific articles with a massive imbalance (79k human vs. ~800 machine samples) and four writing styles (human, generator, translator, paraphraser).
- Mixset: A dataset focusing on "mixed" authorship where LLMs paraphrase human text or other machine text.
For comparison, they also tested on more homogeneous benchmarks like TuringBench and M4, where TDA's benefits were less pronounced but still comparable to baselines.
Key Insights and Ideas
- Topology as a Structural Fingerprint: While Transformers excel at capturing contextual relationships (semantics and syntax), TDA captures the "shape" of the data. In NLP, these topological features act as proxies for deep linguistic structures that remain stable even when a model tries to "hide" its style through paraphrasing.
- Robustness to Noise and Imbalance: TDA is mathematically designed to be noise-resistant. This makes TOPFORMER particularly effective for the SynSciPass dataset, where the extreme class imbalance usually causes standard models to fail.
- Reshaping is Non-Trivial: A key finding was that TDA features become unstable if the input matrix is too "skinny" (rows > columns). Reshaping to a dense, near-square matrix (24x32) was essential for extracting uniform feature vectors.
Key Results
TOPFORMER consistently outperformed SOTA baselines like Contra-BERT and GPT-who across all three primary datasets:
- Macro F1 Gains: Achieved up to a 7% increase in Macro F1 score on the SynSciPass dataset compared to a vanilla RoBERTa model.
- Clustering Clarity: PCA plots show that TOPFORMER creates much more distinct, separable clusters for different authors compared to RoBERTa alone, which often produces overlapping clusters for machine-generated text.
Limitations and Future Work
- Computational Cost: Adding the TDA layer increases training and inference time by approximately 0.5 to 2 hours depending on the dataset size. While inference remains "fast," it is heavier than a standard transformer.
- Homogeneity Limits: The authors admit that TDA provides little to no benefit on very homogeneous datasets (where there is only one style of generation). Its strength lies in handling variability.
- Future Directions: The team plans to test TOPFORMER against Authorship Obfuscation (adversarial attempts to hide a model's identity) and explore its performance in low-resource and multilingual settings.
Summary updated