Learning Universal Authorship Representations

Rafael A. Rivera Soto, Olivia Elizabeth Miano, Juanita Ordonez, Barry Y. Chen, Aleem Khan, Marcus Bishop, Nicholas AndrewsEMNLP 2021

Abstract: Rafael A. Rivera-Soto, Olivia Elizabeth Miano, Juanita Ordonez, Barry Y. Chen, Aleem Khan, Marcus Bishop, Nicholas Andrews. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing.

2021.

Introduction

Authorship verification—the task of determining if two documents share the same author—is a cornerstone of forensic linguistics, plagiarism detection, and content moderation. While modern neural networks have significantly advanced the state-of-the-art, they often suffer from domain entanglement. A model might identify a Reddit user based on the specific topics they discuss rather than their underlying writing style. This study explores the development of "universal" authorship representations that can generalize across disparate domains, such as Amazon reviews, Reddit comments, and fanfiction.

Methodology

The researchers propose an architecture centered on Sentence-BERT (SBERT) and a contrastive training objective designed to isolate stylistic features.

Model Architecture

The model processes a collection of text snippets from an author. Each snippet is passed through a BERT layer, followed by attention-weighted mean pooling. These window-level embeddings are then aggregated using self-attention and max-pooling to produce a final 512-dimensional authorship embedding.

The SBERT-based architecture for authorship representation learning, showing the flow from tokenized windows to a final contrastive loss.

Training Objectives

  • Contrastive Learning: A supervised contrastive loss is employed to minimize the distance between embeddings from the same author while maximizing the distance between different authors.
  • Random Subword Masking: To prevent the model from relying on topic-specific keywords, the authors introduced a data augmentation technique where up to 60% of subwords are replaced with a <maskbox> token. This forces the network to focus on structural and stylistic patterns rather than vocabulary.

Experimental Setup

The study utilizes three large-scale datasets to test cross-domain generalization:

  • Amazon Reviews: 100,000 authors with at least 100 reviews each.
  • Fanfiction Stories: 41,000 authors from fanfiction.net.
  • Reddit Comments: 1,000,000 authors with at least 100 comments each.

To ensure robust evaluation, the researchers used "future" data for testing, preventing the model from memorizing temporal trends or news topics.

Key Results and Analysis

The experiments revealed several critical insights into how neural models learn style:

The "Reddit Advantage"

Models trained on Reddit demonstrated significantly better zero-shot transfer to other domains compared to those trained on Amazon or Fanfiction. For instance, a Reddit-trained model achieved over 80% of the performance of an in-domain model when tested on Amazon reviews. This is attributed to the high topic diversity of Reddit, which forces the model to learn stylistic invariants that persist across different subjects.

Cross-domain evaluation results (Recall@8 and MRR) demonstrating the transferability of models across Reddit, Amazon, and Fanfiction.

Stylistic Filtering via Masking

Randomly masking nearly half the words in a document improved the model's ability to transfer to new domains. By effectively destroying the content, the model was forced to analyze the "skeleton" of the writing. Specifically, applying this technique to the Amazon dataset improved its zero-shot transfer to Reddit by approximately 2.6 points in Recall@8.

Diversity vs. Quantity

The researchers found that increasing the number of authors within a narrow domain yielded diminishing returns for transferability. However, training on a union of domains (e.g., Amazon + Reddit) consistently improved performance across all evaluation sets.

Conclusion and Future Directions

While the SBERT-based approach establishes a new state-of-the-art in authorship ranking, achieving truly "universal" authorship representations remains an open challenge. The authors suggest that future research should focus on explicit disentanglement, potentially using adversarial training to actively penalize the model for learning topic-related information, ensuring that embeddings capture only stylistic fingerprints.

Summary updated

BibTeX
@inproceedings{soto2021learning,
  author = {Rafael A. Rivera Soto and Olivia Elizabeth Miano and Juanita Ordonez and Barry Y. Chen and Aleem Khan and Marcus Bishop and Nicholas Andrews},
  title = {{Learning Universal Authorship Representations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  url = {https://openreview.net/forum?id=o3L8TXv-okx},
}
Figure