A Stylometric Application of Large Language Models
Harrison F. Stropkay, Jiayi Chen, Mohammad J. Latifi, Daniel N. Rockmore, Jeremy R. Manning
TL;DR
This work investigates whether large language models can capture author-specific writing styles by training separate GPT-2 models on individual authors and using cross-entropy loss on held-out texts as a stylometric distance. The key idea, predictive comparison, treats lower cross-entropy as closer stylistic similarity and enables both attribution and distance estimation, including a formal distance metric $d(i,j) = \tfrac{1}{2}\left(\overline{L_j(i)} + \overline{L_i(j)}\right)$. Empirically, models trained on the same author consistently outperform others, achieving perfect author discrimination across eight authors and successfully resolving the contested Oz book authorship; ablation studies show both content and function words contribute to the signature, while POS-only signals are weaker. The approach offers a simple, open-set-friendly framework for computational stylometry and literary attribution, though it faces limitations in scope, interpretability, and cross-domain robustness, with future work aimed at theory, efficiency, and broader applications.
Abstract
We show that large language models (LLMs) can be used to distinguish the writings of different authors. Specifically, an individual GPT-2 model, trained from scratch on the works of one author, will predict held-out text from that author more accurately than held-out text from other authors. We suggest that, in this way, a model trained on one author's works embodies the unique writing style of that author. We first demonstrate our approach on books written by eight different (known) authors. We also use this approach to confirm R. P. Thompson's authorship of the well-studied 15th book of the Oz series, originally attributed to F. L. Baum.
