Beyond the surface: stylometric analysis of GPT-4o’s capacity for literary style imitation

George Mikros*

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

Abstract

This study aims to explore the ability of GPT-4o to imitate the literary style of renowned authors. Ernest Hemingway and Mary Shelley were selected due to their contrasting literary styles and their overall impact on world literature. Using three distinct prompting strategies—zero-shot generation, zero-shot imitation, and in-context learning—we generated forty-five stylistic imitations and analyzed them alongside the authors’ original texts. To ensure thematic consistency, we constrained the generated texts to shared narrative themes derived from the authors’ works. We used a distance-based approach to authorship attribution using the 1,000 most frequent words and cosine distance to explore how the large language model’s imitations were positioned in the multidimensional authorship space. Moreover, we exploited a random forest classifier and repeated the authorship attribution task to analyze the authorship distinctiveness of the GPT imitations further. We used a combination of Textual Complexity and Readability, Author Multilevel N-gram Profiles, Word Embeddings, and Linguistic Inquiry and Word Count features. t-SNE visualizations further evaluated the stylistic alignment between original and GPT-generated texts. The findings reveal that while GPT-4o captures some surface-level stylistic elements of the authors, it struggles to fully replicate the depth and uniqueness of their stylometric signatures. Imitations generated via in-context learning showed improved alignment with the original authors but still exhibited significant overlap with generic GPT outputs.

Original languageEnglish
Pages (from-to)587-600
Number of pages14
JournalDigital Scholarship in the Humanities
Volume40
Issue number2
DOIs
Publication statusPublished - 23 Apr 2025

Keywords

  • Authorship attribution
  • GPT-4o
  • In-context learning
  • Stylistic imitation
  • Stylometric analysis
  • large language models (LLMs)

Fingerprint

Dive into the research topics of 'Beyond the surface: stylometric analysis of GPT-4o’s capacity for literary style imitation'. Together they form a unique fingerprint.

Cite this