Learning Interpretable Style Embeddings via Prompting LLM s (2023)

Abstract: Style representation learning builds content-independent representations of author style in text. To date, no large dataset of texts with stylometric annotations on a wide range of style dimensions has been compiled, perhaps because the linguistic expertise to perform such annotation would be prohibitively expensive. Therefore, current style representation approaches make use of unsupervised neural methods to disentangle style from content to create style vectors. These approaches, however, result in uninterpretable representations, complicating their usage in downstream applications like authorship attribution where auditing and explainability is critical. In this work, we use prompting to perform stylometry on a large number of texts to generate a synthetic stylometry dataset. We use this synthetic data to then train human-interpretable style representations we call LISA embeddings. We release our synthetic dataset (StyleGenome) and our interpretable style embedding model (LISA) as resources.

## introduction style representation learning aims to represent the stylistic attributes of an authored text. prior work has treated the style of a text as separable from the content. stylistic attributes have included, but are not limited to, linguistic choices in syntax, grammar, spelling, vocabulary, and punctuation @xcite . style representations should represent two texts with similar stylistic attributes more closely than texts with different attributes independent of what content is present in the texts. stylometry, the analysis of style, applies forensic linguistics to tasks like authorship attribution. stylometry often relies on semi-manual analysis by forensic linguistic experts @xcite @xcite . computational stylometry often uses rule-based approaches utilizing count-based features like the frequencies of function words @xcite , 2009; tausczik and pennebaker, 2010). more modern, neural approaches attempt to learn style representations in an unsupervised fashion through a proxy task like style transfer @xcite @xcite @xcite @xcite or authorship verification @xcite @xcite . these stronger neural approaches, unlike simpler frequency-based techniques, are uninterpretable. this makes it difficult to effectively analyze their representations and their failure modes, and precludes their usage in real-world authorship attribution scenarios because interpretability and verification is critical for legal admissibility @xcite . with this motivation, we propose a humaninterpretable style representation model m which, for a given text t, produces a d-dimensional vector m(t) ∈ [0.0, 1.0] d . each dimension corresponds to one of d style attributes {a 0 , a 1 , . . . , a d }. each element at dimension d of this vector is constrained in the range [0.0, 1.0] to represent the probability of the corresponding style attribute a d being present in the text t. see figure 1 for a visualization of a result from our final trained model with @xmath0. an immediate obstacle to train such a model is that no large dataset of texts with stylometric annotations currently exists; annotating a large number of texts on a wide variety (@xmath1. given this, we use gpt-3 @xcite , a large language model (llm), and zeroshot prompts to generate a synthetic dataset we call stylegenome of human-interpretable stylometric annotations for various texts. our approach is motivated by recent works showing models trained on synthetic datasets annotated by prompting llms can match and sometimes even outperform models trained on human-labeled datasets @xcite @xcite . training on stylegenome, we develop the linguistically-interpretable style attribute (lisa) embedding model. we summarize our primary contributions: ## generating stylegenome to create stylegenome for training lisa, we select reddit data from the million user dataset (mud) @xcite to stylometrically annotate following prior work that uses reddit to source a diversity of styles from different authors @xcite . we sample 10 random posts per author for 1,000 random authors, resulting in 10,000 total posts selected for annotation. we display some of the diversity of styles captured in the following examples from our reddit authors. they vary in formality, punctuation, emoji usage, etc.: reddit user #47: forreal though sell we use gpt-3 foot_0 @xcite to annotate each post in two stages. ## method we first distill stylometric annotation knowledge from gpt-3 into a style feature agreement model (sfam). given a text t and a style attribute a as input, sfam(t, a) produces an agreement score between 0.0 and 1.0 representing the probability of the style attribute being present in the text. by selecting a set of d style attributes {a 0 , a 1 , . . . , a d }, we can use sfam to construct lisa, our interpretable style representation model that produces d-dimensional vectors: the euclidean distance between style vectors for two texts ∥m lisa (t 2 ) -m lisa (t 1 )∥ 2 would not be particularly meaningful. we can multiply a trained weight vector w or a weight matrix w to the style vectors, that act as simple interpretable embedding layers. this operation would make the euclidean distance more meaningful, for example ∥m lisa (t 2 ) * w -m lisa (t 1 ) * w∥ 2 . we call the result of a lisa style vector multiplied by w or w a lisa style embedding. we discuss training in detail next, leaving hyperparameter and implementation specifics in appendix e. ## results we first evaluate to what degree sfam, which is ultimately used to build lisa representations, learns useful stylometric annotation capabilities that align with human reviewers. we then evaluate lisa itself on stel, a framework purpose-built for evaluating the quality of style measures @xcite . all evaluations were completed after the collection of the stylegenome dataset. correlation to human judgments we conduct a broad set of 55 studies across 21 datasets in 7 distinct categories of linguistic style and authorship dimensions in ## conclusion in this work, we propose a promising novel approach to learning interpretable style representations. to overcome a lack of stylometrically annotated training data, we use a llm to generate stylegenome, a synthetic stylometry dataset. our approach distills the stylometric knowledge from stylegenome into two models, sfam and lisa. we find that these models learn style representations that match the performance of recent direct neural approaches and introduce interpretability grounded in explanations that correlate with human judgments. our approach builds towards a research direction focused on making style representations more useful for downstream applications where such properties are desirable such as in a forensic analysis context. future directions that introduce human-in-the-loop supervised annotations or newer, larger, and better aligned llms for annotation have the potential to yield further gains in both performance and interpretability. model and data release we release our dataset (stylegenome) and our two models (sfam and lisa) to further research in author style.