Hostname: page-component-77f85d65b8-lfk5g Total loading time: 0 Render date: 2026-03-27T02:26:41.880Z Has data issue: false hasContentIssue false

Looking for the inner music: Probing LLMs’ understanding of literary style

Published online by Cambridge University Press:  19 June 2025

Rebecca M. M. Hicke*
Affiliation:
Department of Computer Science, Cornell University, Ithaca, NY, USA
David Mimno
Affiliation:
Department of Information Science, Cornell University, Ithaca, NY, USA
*
Corresponding author: Rebecca M. M. Hicke; E-mail: rmh327@cornell.edu
Rights & Permissions [Opens in a new window]

Abstract

Language models have the ability to identify the characteristics of much shorter literary passages than was thought feasible with traditional stylometry. We evaluate authorship and genre detection for a new corpus of literary novels. We find that a range of LLMs are able to distinguish authorship and genre, but that different models do so in different ways. Some models rely more on memorization, while others make greater use of author or genre characteristics learned during fine-tuning. We additionally use three methods – direct syntactic ablation of input text and two means of studying internal model values – to probe one high-performing LLM for features that characterize styles. We find that authorial style is easier to characterize than genre-level style and is more impacted by minor syntactic decisions and contextual word usage. However, some traits like pronoun usage and word order prove significant for defining both kinds of literary style.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NC
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial licence (https://creativecommons.org/licenses/by-nc/4.0), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original article is properly cited. The written permission of Cambridge University Press must be obtained prior to any commercial use.
Open Practices
Open data
Copyright
© The Author(s), 2025. Published by Cambridge University Press
Figure 0

Figure 1. The size of each dataset used in the experiment by number of samples.

Figure 1

Table 1. Example formatted input and output pairs for each model type

Figure 2

Figure 2. The overall accuracy of each model for (left) authorship attribution and (right) genre identification.Note: Accuracy is separated into results for samples from novels included in training and samples from novels withheld from training. Results of a single run are reported and error bars represent the standard error bootstrapped over 1,000 iterations. The y-axis is sorted by model’s performance on samples from in-training novel.

Figure 3

Figure 3. The prompt used to probe llama-3-8b and flan-t5-xl for memorization of studied texts.

Figure 4

Figure 4. The prompt used to probe llama-3-8b and flan-t5-xl for internal representations of genre.

Figure 5

Figure 5. Confusion matrices of the responses of the prompted (left) and fine-tuned (right) llama-3-8b models for genre identification.Note: Correct labels are represented by rows and model outputs are columns; labels produced outside of the correct set are ignored. The rows sum up to $\sim $100%.

Figure 6

Figure 6. Confusion matrices of the responses of the prompted (left) and fine-tuned (right) flan-t5-xl models for genre identification.Note: Correct labels are represented by rows and model outputs are columns. The rows sum up to $\sim $100%.

Figure 7

Figure 7. Accuracy by author (left) and genre (right) for each model.Note: Results of a single run are reported and error bars represent the standard error bootstrapped over 1,000 iterations. The x-axes are sorted by the accuracy of llama-3-8b.

Figure 8

Figure 8. The % of misattributions assigned to the top n “scapegoated” authors (left) or genres (right).Note: Results are reported for a single run and error bars represent the standard error bootstrapped over 1,000 iterations.

Figure 9

Figure 9. The accuracy of each model on samples from withheld novels for authorship attribution (left) and genre identification (right) across each text perturbation.Note: Results are reported for a single run and error bars represent the standard error bootstrapped over 1,000 iterations.

Figure 10

Figure 10. llama-3-8b (top) and flan-t5-xl’s (bottom) accuracy when stop words of a certain part of speech are masked by average number of those stop words per sample for both tasks.Note: Results are reported for a single run and error bars represent the standard error bootstrapped over 1000 iterations. The pronoun data are labeled to provide context for in-text analysis.

Figure 11

Figure 11. The SVM (top) and cosine delta’s (bottom) accuracy when stop words of a certain part of speech are masked by average number of those stop words per sample for both tasks.Note: The pronoun data are labeled to provide context for in-text analysis.

Figure 12

Figure E1. Accuracy by author (left) and genre (right) for each model on samples from in-training novels.Note: Results of a single run are reported and error bars represent the standard error bootstrapped over 1,000 iterations. The x-axes are sorted by the accuracy of llama-3-8b.

Figure 13

Figure E2. Accuracy by author (left) and genre (right) for each model on samples from out-of-training novels.Note: Results of a single run are reported and error bars represent the standard error bootstrapped over 1,000 iterations. The x-axes are sorted by the accuracy of llama-3-8b.

Submit a response

Rapid Responses

No Rapid Responses have been published for this article.