Representation of Lexical Stylistic Features in Language Models’ Embedding Space
Year: 2023

Abstract:
The representation space of pretrained Language Models (LMs) encodes rich information about words and their relationships (e.g., similarity, hypernymy, polysemy) as well as abstract semantic notions (e.g., intensity). In this paper, we demonstrate that lexical stylistic notions such as complexity, formality, and figurativeness, can also be identified in this space. We show that it is possible to derive a vector representation for each of these stylistic notions from only a small number of seed pairs. Using these vectors, we can characterize new texts in terms of these dimensions by performing simple calculations in the corresponding embedding space. We conduct experiments on five datasets and find that static embeddings encode these features more accurately at the level of words and phrases, whereas contextualized LMs perform better on sentences. The lower performance of contextualized representations at the word level is partially attributable to the anisotropy of their vector space, which can be corrected to some extent using techniques like standardization.1

heading: 1 Introduction
text: The style of a text is often reflected in its grammatical and discourse properties, but also in local word choices made by the author. The choice of one from a set of synonyms or paraphrases with different connotations can define the style of a text in terms of complexity (e.g., help vs. assist), formality (e.g., dad vs. father), figurativeness (e.g., fall vs. plummet), and so on (Edmonds and Hirst, 2002). These lexical stylistic features can be useful in various scenarios, such as analyzing the style of authors or texts of different genres, and determining the appropriate word usage in language learning applications.
1Our code and data are publicly available at https:// github.com/veronica320/Lexical-Stylistic -Features.
Previous approaches to formality detection relied on word length, frequency, as well as on the presence of specific prefixes and suffixes (e.g., intra-, -ation) (Brooke et al., 2010). Such features have also been used for complexity detection, often combined with information regarding the number of word senses and synonyms (Shardlow, 2013; Kriz et al., 2018). Recent studies have shown that the representation space of pretrained LMs encodes a wealth of lexical semantic information, including similarity, polysemy, and hypernymy (Garí Soler and Apidianaki, 2021a; Pimentel et al., 2020; Ettinger, 2020; Ravichander et al., 2020; Vulić et al., 2020, i.a.). In particular, abstract semantic notions such as intensity (e.g., pretty → beautiful → gorgeous) can be extracted using a lightweight approach based on simple calculations in the vector space (Garí Soler and Apidianaki, 2020, 2021b).
In this paper, we explore whether lexical stylistic
370
features can also be identified in the vector space built by pretrained LMs. To do this, we extend the method of Garí Soler and Apidianaki (2020) to address complexity, formality, and figurativeness. We first construct a vector representation for each of these features using a small number of seed pairs shown in Table 1. We then use these vectors to characterize new texts according to these stylistic dimensions, by applying simple calculations in the vector space. We evaluate our method using a binary classification task: given a pair of texts that are semantically similar but stylistically different in terms of some target feature (e.g., formality), the task is to determine which text exhibits the feature more strongly (e.g., is more formal). Note that the goal of our study is not to achieve high performance on the task itself, but rather to probe for how well these stylistic features are encoded in different types of pretrained representations.
We experiment with various static and contextualized embeddings on five datasets, containing words and phrases (doctor vs. medical practitioner), or sentences (Those recommendations were unsolicited and undesirable. vs. that’s the stupidest suggestion EVER.). Our results show that both types of representations can capture these stylistic features reasonably well, although static embeddings perform better at the word and phrase level, and contextualized LMs at the sentence level. We hypothesize that the sub-optimal performance of contextualized LMs on short texts might be partially due to the high anisotropy of their embedding space. Anisotropic word representations occupy a narrow cone instead of being uniformly distributed in the vector space, resulting in highly positive correlations even for unrelated words, thus negatively impacting the quality of the similarity estimates that can be drawn from the space (Ethayarajh, 2019; Gao et al., 2019; Cai et al., 2021; Rajaee and Pilehvar, 2021). We verify this hypothesis by implementing different anisotropy correction strategies (Timkey and van Schijndel, 2021) and discuss the observed improvements in contextualized representations’ performance on short texts.
Overall, our findings contribute to the big picture of probing literature, showing that stylistic features like complexity, formality, and figurativeness can be decoded from the embedding space of pretrained representations using simple calculations, without any supervision. Our lightweight method can be easily integrated into downstream applications like
authorship attribution and style transfer.

heading: 2 Related work
text: There has been an extensive body of literature on probing techniques aimed at identifying the linguistic and world knowledge encoded in LM representations. For example, given a Machine Translation model, does it implicitly capture the syntax structure of the source text? Existing work addresses such questions with methods like auxiliary classifiers (a.k.a. probing/diagnostic classifiers) (Veldhoen et al., 2016; Adi et al., 2017; Conneau et al., 2018), information-theoretic probing (Voita and Titov, 2020; Lovering et al., 2020), behavioral tests (Ebrahimi et al., 2018; Wallace et al., 2019; Petroni et al., 2019), geometric probing (Chang et al., 2022; Wartena, 2022; Kozlowski et al., 2019), visualization of model-internal structures (Raganato and Tiedemann, 2018), and so on. Using these methods, researchers have found that pretrained LMs do encode various types of knowledge, including syntactic (Linzen et al., 2016; Hewitt and Manning, 2019), semantic (Ettinger et al., 2016; Adi et al., 2017; Yanaka et al., 2020), pragmatic (Jeretic et al., 2020; Schuster et al., 2020), as well as factual and commonsense knowledge (Petroni et al., 2019; Thukral et al., 2021).
Our work is along the line of probing for lexical semantics with simple geometry-based methods (Vulić et al., 2020; Garí Soler and Apidianaki, 2021a), which uncovers the target knowledge encoded in the semantic space of LM representations with simple geometric computations (Vulić et al., 2020; Garí Soler and Apidianaki, 2021a). Compared to the most widely used auxiliary classifier method, geometric probing does not rely on any external model. Thus, it requires no annotated training data and avoids the potential issue of the external model itself learning the target knowledge (Hewitt and Liang, 2019).
Directly related to our work, Garí Soler and Apidianaki (2020) proposed a method to detect the intensity of scalar adjectives, where an “intensity” dimension is identified in the vector space built by the BERT model. The method draws inspiration from word analogies in gender bias work, where a gender subspace is identified in the embedding space by calculating the main direction spanned by the differences between vectors of gendered word pairs (e.g., −→ he - −→ she, −−→man - −−−−−→woman) (Bolukbasi et al., 2016; Dev and Phillips, 2019). Similarly,
Garí Soler and Apidianaki (2020) view intensity as a direction in the embedding space which is calculated by subtracting the vector of a low-intensity adjective from that of a high-intensity adjective on the same scale (e.g., −−−−−−→awesome - −−→good, −−−−−→horrible -−→ bad). Intuitively, this subtraction cancels out the adjectives’ common denotation and retains their variance in intensity, which is represented by the resulting difference vector ( −−−→ dV ec). This vector can then be used to determine the intensity of new adjectives by simply taking the cosine similarity of their vector to −−−→ dV ec. We extend this method to other lexical stylistic notions, and address words of different part-of-speech (POS) and longer texts.

heading: 3 Method
text: We adopt the definitions for the three stylistic features of interest (complexity, formality, and figurativeness) proposed by previous work. Simple language is “used to talk to children or non-native English speakers”, whereas more complex language is “used by academics or domain experts” (Pavlick and Nenkova, 2015). Formal language is defined as “the way one talks to a superior”, whereas casual language is “used with friends” (Pavlick and Nenkova, 2015). Figurative language is defined by Stowe et al. (2022) as utterances “in which the intended meaning differs from the literal compositional meaning”, while literal language exhibits no such difference. Unlike the previous two features, figurativeness is often a contextual instead of lexical feature (e.g., the word adhere is used in a metaphorical sense in the expression “adhere to the rules” and in its literal sense in “adhere to the wall”).2 We explore the usability of our method for studying figurativeness by using a small seed
2In the literature, figurativeness is generally studied at the level of utterances (Stowe et al., 2022; Piccirilli and Schulte Im Walde, 2022; Chakrabarty et al., 2022). Some studies also look at the semantic properties of words and phrases as indicators for metaphor identification (Birke and Sarkar, 2006; Tsvetkov et al., 2013; Gutiérrez et al., 2016).
set of synonyms and paraphrases that have literal and figurative connotations (e.g., unsympathetic → cold-hearted) independent of their context. These pairs are only used for constructing our figurativeness vector representation, while our evaluation is performed on a dataset containing full sentences (see Section 4 for details).
Our method involves two steps: (a) feature vector generation, where we construct a vector representation for each feature; and (b) feature value prediction, where we predict how strongly a new piece of text exhibits some target feature using the constructed feature vector. We illustrate the two steps below.
Feature vector generation. We collect a small number of seed pairs to illustrate each notion, shown in Table 1.3 The seed pairs consist of rough paraphrases that differ in the stylistic aspect of interest. Consider complexity as an example. Given a pair of “simple → complex” texts, we subtract the vector of the simple from that of the complex one (e.g., −−−−−−−−−−−−−−−→ medical practitioner - −−−−→ doctor). After performing this subtraction for each pair in the seed set, we then average the resulting difference vectors to obtain a vector representing complexity which we call −−−−−→ dcomplex. This procedure is illustrated in Figure 1. Similarly, for formality, we subtract the vector of the informal paraphrase from that of its formal counterpart (e.g., −−−−−−−−→ respiratory - −−−−−−→ breathing), and for figurativeness, we subtract the vector of the literal expression from that with figurative meaning (e.g., −−−−→ bright - −−−−−→ radiant). By averaging the difference vectors for all pairs in the corresponding seed set, we obtain vectors representing formality ( −−−−→ dformal) and figurativeness ( −−→ dfig). We extend the method of Garí Soler and Apidianaki (2020), which was only applied to scalar adjectives, to words of other POS and to longer text (phrases and sentences). Finally, we compare the vectors that are built using representations from different monolingual and multilingual models.
Feature value prediction. Given a new piece of text (word, phrase, or sentence), we compute the cosine similarity between its vector representation and −−−−−→ dcomplex, −−−−→ dformal and −−→ dfig. The more similar the vector of the new text is to one of these feature 3This is based on the finding from Garí Soler and Apidianaki (2020) that using only a few or even a single pair(s) is almost as competitive as using an entire corpus in the case of intensity ranking.
vectors, the more complex, formal, or figurative the text is considered to be.

heading: 4 Experimental Setup
text: Evaluation task and metrics. We evaluate the representation of the target features in a binary classification task: given a pair of texts (words, phrases, or sentences) t0 and t1 that are semantically similar but stylistically different in terms of some feature F (e.g., figurativeness), the task is to decide which text exhibits the feature more strongly (e.g., is more figurative). For example, given two sentences “You must adhere to the rules.” (t0) and “You must obey the rules.” (t1), the ground truth is that t0 is more figurative. We use accuracy as our evaluation metric.
Seed pairs. For each feature, we use seven seed pairs for vector generation, as shown in Table 1. The seeds for complexity are examples from the paper describing SimplePPDB (Pavlick and CallisonBurch, 2016), and the seeds for formality are from the paper on lexical style properties of paraphrases (Pavlick and Nenkova, 2015). For figurativeness, we manually compile a set of seven seed pairs.
Datasets. The datasets used in our feature value prediction experiments (described in Table 2) contain pairs of words or phrases (short text), and pairs of sentences (long text). Note that this distinction is not based on the number of tokens, but on whether the text is a complete sentence. For complexity, we use SimplePPDB (Pavlick and Callison-Burch, 2016) and SimpleWikipedia (Kauchak, 2013); for formality, Style-annotated PPDB (StylePPDB for short) (Pavlick and Nenkova, 2015) and GYAFC (Rao and Tetreault, 2018). For figurativeness, since there is no dataset of word and/or phrase pairs, we only use the IMPLI (Idiomatic and Metaphoric Paired Language Inference) dataset (Stowe et al., 2022) that contains sentences.
For each dataset, we select the optimal configuration (see the Configuration paragraph below) using the validation set, and report its performance on the test set. To make the label distribution balanced,
we randomly shuffle the order of the two pieces of text in each pair and re-assign the gold label accordingly. This ensures that a majority baseline only performs around chance. Figure 2 shows the distribution of token frequency in each dataset.4
Baselines. We compare our method to two simple baselines. The majority baseline always predicts the majority label in the dataset. The frequency baseline consults the frequency counts of each token in the Google N-gram corpus (Brants, 2006) and considers more frequent tokens to be simpler, more casual, and more literal. Frequency has been a strong baseline for complexity and formality in previous work, given that rare words tend to be more complex than frequently used words (Brooke et al., 2010).
Configuration. We experiment with two parameters in the configuration: LM and layer. Note that the purpose of experimenting with different configurations is not to solve the task, but rather to obtain a comprehensive picture of which embeddings best represent the target features.
• Language Models: We experiment with both static and contextualized representations. For static embeddings, we consider GloVe (Pennington et al., 2014) and fastText (Bojanowski et al., 2017). For contextualized LMs, we consider encoder-only monolingual and multilingual Transformer models of different sizes (base and large), including BERT (Devlin et al., 2019), mBERT (multilingual BERT) (Devlin et al., 2019), RoBERTa (Liu et al., 2019), and XLM-RoBERTa (Conneau et al., 2020).5
4See Appendix A for more details including dataset statistics, pre-processing method, dataset splits, and examples.
5See Appendix B for implementation details.

heading: Pooling Stats Complexity Formality Figurativeness
text: • Layer (l): For contextualized LMs, another configuration choice is which layer to obtain the representation from. We explore the knowledge encoded in different layers in the range of 0-12 for base models and 0-24 for large ones, including the embedding layer.
Pooling strategies. In order to obtain a score for a feature of interest (complexity, formality, or figurativeness) for text segments that contain more than one token (i.e., phrases and sentences), we consider two pooling strategies over the scores calculated for individual tokens:6
• mean: We compute the cosine similarity between −−−−−→ dfeature and each word vector, and take
the average of the similarity scores as the feature value for the text.
6See Appendix B for details on tokenization and multiword expression handling.
• max: We compute the cosine similarity between −−−−−→ dfeature and each word vector, and take
the maximum of the similarity scores as the feature value for the text.
The intuition behind max pooling is that the majority of words in a phrase or sentence would not be too extreme (i.e., too complex or too formal). By looking at the most complex or formal word in the text, we can get an idea of how extreme it might be in that dimension. Naturally, we expect this approach to perform less well than mean pooling for figurativeness, where idiomaticity is most often inferred by looking at the context of use and the word combinations within a sentence.

heading: 5 Results and Discussion
text: Table 3 presents the results of our evaluation. Due to space constraints, each row in the table only shows the optimal performance obtained across all configurations (LM and layers) for static and contextualized models.7 For contextualized LMs in particular, following Vulić et al. (2020), we separately show the optimal performance under two settings: single layer, where only the representation from a single layer l is used; and layer aggregation (“layeragg” for short), where we average the representations from all layers from the 0th to a specific layer l (included).
We observe that our method outperforms the majority and frequency baselines with both static and contextualized LMs. Furthermore, mean
7See Appendix C.1 for detailed accuracy scores for each model.
pooling generally works better than max pooling, although there is still room for improvement. Taking a closer look at the optimal configuration for each feature, for complexity, roberta-large and mbert-base are the dominant best-performing models, yet there are no consistently dominant layers; for formality, bert-base and mbert-base perform the best on short texts and surprisingly with the initial layers (0 or 1), while roberta-large is the best model for long texts with middle or final layers; for figurativeness, bert-large is consistently the best model across all settings.
Interestingly, contextualized LMs far outperform static embeddings on long text sin almost all cases, yet on short texts, static embeddings perform on par or sometimes even better than contextualized LMs. This is the case, for example, with formality “short” (with both pooling strategies) and with complexity “short” (with max pooling). This finding sounds counter-intuitive, given the generally higher performance of contextualized models in various NLP tasks. In our probing setting, we suspect that this might be due to two factors. First, the input in short-text datasets consists of isolated, rather than contextualized, instances of words. This is not natural input for a contextualized LM. Second, previous work has demonstrated that the word-level similarity estimates obtained from the vector space of contextualized LMs might be distorted due to the anisotropy of the space (Ethayarajh, 2019; Ra-
jaee and Pilehvar, 2021). Concretely, anisotropic word representations occupy a narrow cone instead of being uniformly distributed in the vector space, resulting in excessively positive correlations even for unrelated word instances. This has a negative impact on the informativeness of measures such as the cosine and the Euclidean distance, often used for estimating representation similarity (Apidianaki, 2023). These measures are dominated by a small subset of “rogue dimensions” which drive anisotropy and the drop in representational quality in later layers of the models (Timkey and van Schijndel, 2021). In Section 6, we investigate more closely the impact of anisotropy on our results through a series of experiments involving different anisotropy reduction methods.
Finally, comparing the single layer and layer aggregation settings, their respective optimal configurations result in mostly similar performance across datasets, as shown in Table 3. In order to better understand their difference across all possible LM and layer configurations, we present in Table 4 two types of averaged statistics: the percentage of configurations where the layer aggregation performance is equal or higher than the single layer performance, as well as the average gain in terms of accuracy. We observe that layer aggregation improves the performance for complexity and formality (across 64.6% to 94.1% of the configurations and by an accuracy gain of 2.8 to 4.3), but makes almost no difference for figurativeness.
Together with the results from Table 3, this suggests that although layer aggregation does not help with the best configuration, it is beneficial to most configurations on average.
In the next two subsections, we analyze the influence of two more factors on our method: layer depth and text length. For conciseness, we only report the results for the layer aggregation setting. Results for the single layer setting are given in Appendix C.

heading: 5.1 How well do different layers represent the target features?
text: We explore the representation of the three stylistic features inside contextualized LMs by specifically monitoring the change in accuracy observed across layers. The results are shown in Figure 3. The solid curves show results obtained using mean pooling, while the dashed ones correspond to max pooling.
We observe that information about complexity (3a and 3c) is more clearly and consistently encoded after layer 4 of the models, independent of their size (base or large). Across all layers, mean and max pooling exhibit mostly similar behavior for short texts, while mean pooling is clearly better for longer texts. The pattern for figurativeness is similar (3e), though with slightly more fluctuations. For formality, we see a different trend. As shown in Figure 3b, this feature is encoded more clearly in the early layers of the models for short texts. For longer texts, we see diverging patterns across layers of different models (3d). In particular, roberta-large encodes formality better than other tested models while its multilingual versions (xlm-roberta-base and xlm-roberta-large) give much lower results.

heading: 5.2 How does text length influence our method?
text: We analyze the performance change with regard to text length, represented by the average number of tokens in the two texts in a pair. For each feature, we merge examples from the short-text and longtext datasets (if available) and take the predictions from the best-performing contextualized configuration from Table 3. Based on the number of tokens, we group all examples into several bins (unigram, bigram, 3-4, 5-9, 10-14, 15-19, >20) and compute the average accuracy in each bin. Figure 4 shows the results.
Interestingly, we observe different patterns for the three features. For complexity, accuracy scores for shorter texts (0.86 to 0.9) are generally higher than those for long texts (0.73 to 0.77). The drop from 3-4 tokens to 5-9 tokens is particularly clear. For formality, on the contrary, longer texts (0.84 to 0.93) tend to be easier than short ones (0.71 to 0.72). For figurativeness, we do not have results for short texts since no such datasets are available. Within full sentences, we observe that our method works better for shorter sentences (with <5 tokens) than for longer ones (with >=5 tokens) by an accuracy difference of 0.13 to 0.25. One caveat is that these differences are not only influenced by text length, but also by the intrinsic data distribution in different datasets. For example, the domain of the source texts in SimplePPDB (news, legal documents, and movie subtitles) is different from that in SimpleWikipedia (encyclopedia articles). Thus, the accuracy differences could be a result of both factors — text length and text domain.

heading: 6 Anisotropy Reduction Experiments
text: As explained in the previous section, the anisotropy of contextualized LMs’ representation space degrades the quality of the similarity estimates that can be drawn from it (Ethayarajh, 2019). To see if
this has an impact on our method, we apply three post-processing anisotropy reduction methods discussed by Timkey and van Schijndel (2021), which can be used to correct for rogue dimensions and reveal underlying representational quality.
We apply each of these methods to our feature vector construction and feature value prediction processes. Given that our stylistic characterization of new text relies on similarity measurement, we expect that a space that allows us to draw higherquality similarity estimates would better represent these stylistic features and would also improve feature value prediction. The three methods used in our experiments are:
All-but-the-top (abtt). The method was initially proposed for static embeddings by Mu and Viswanath (2018). The main idea is to subtract the common mean vector and eliminate the top few principal components (PCs) (we use the top d 100 , where d represents the dimensionality of the vector space, following their suggestion). These subtracted vectors should capture the variance of the rogue dimensions in the model and make the space more isotropic. In Timkey and van Schijndel (2021), the mean vector and PCs are computed from vector representations for an entire corpus. Since our method is unsupervised, we do not assume access to any large corpus and instead compute them based only on the seed pairs (i.e., 14 words and phrases for each feature). Thus, our method still remains lightweight and computationally efficient. It is, however, important to note that
this is a local correction (rather than a global one) since we are just using a small number of words and phrases, as in Rajaee and Pilehvar (2021).
Formally, given a set of seed texts of size |S| (here |S| = 14) containing token representations x ∈ Rd, we compute the mean vector µ ∈ Rd
µ = 1 |S| · ∑
x∈S x (1)
as well as the PCs
u1, ..., ud = PCA({x− µ, x ∈ S}). (2) Then, the new representation xabtt for an unseen word vector x is the result of eliminating the mean vector and the top k PCs (here k = d100 ):
xabtt = x− µ− k∑
i=1
( u⊤i x ) ui. (3)
Standardization. Based on a similar observation as abtt (a non-zero common mean vector and a few dominant directions), another way for adjustment is to subtract the mean vector and divide each dimension by its standard deviation (std), such that each dimension has µi = 0 and σi = 1. Similarly to abtt, we compute the mean vector and standard deviation using only the seed pairs for each feature.
Formally, we compute the same mean vector µ as in Equation 1, as well as the standard deviation in each dimension σ ∈ Rd
σ =
√ 1
|S| · ∑
x∈S (x− µ)2 (4)
The new representation xstandard for an unseen word vector x becomes
xstandard = x− µ σ . (5)
Rank-based. This method treats a word vector as d observations from an |S|-variate distribution and uses correlation metrics as a measure of similarity, instead of cosine similarity (Zhelezniak et al., 2019). Specifically, Spearman’s ρ, a nonparametric correlation measure, only considers the ranks of embeddings rather than their values. Thus, it will not be dominated by the rogue dimensions of contextualized LMs. Unlike the previous two methods, this method does not require any computation over the seed pair texts. Formally, given a word vector x, the new representation xrank is simply
xrank = rank(x). (6)
Table 5 shows the effect of applying the three anisotropy reduction strategies under the single layer and layer aggregation settings. Overall, after anisotropy reduction, contextualized LMs outperform static embeddings in all cases except formality “short”, confirming our initial hypothesis. Nevertheless, there is no universally optimal strategy, although standardization works best most of the time. Comparing the two pooling strategies, we find that anisotropy correction helps more often with max pooling than with mean pooling.
It is important to reemphasize that our anisotropy correction approach is local, since it only considers a small set of words and phrases for calculating the mean vector, standard deviation, and PCs. This might be the reason for the relatively small observed effect of these correction procedures in our experiments. In future work, we plan to experiment with a larger corpus, and consequently use a larger part of the vector space for calculating the mean/std/PC vectors, in order to investigate the impact of the quantity of data on the induced similarity estimates.

heading: 7 Conclusion
text: We have shown that the embedding space of pretrained LMs encodes abstract stylistic notions such as formality, complexity, and figurativeness. Using a geometry-based method, we construct a vector representation for each of these features, which
can be used to characterize new texts. We find that these notions are present in the space of both static and contextualized representations, and that static embeddings are better at capturing the style of short texts (words and phrases) whereas contextual embeddings at longer texts (sentences). By correcting the anisotropy of contextualized LMs’ representation space, we show that it is possible to close the performance gap from static embeddings on short texts.
Our unsupervised and lightweight method is expected to be applicable for stylistic analysis in other languages and for other stylistic notions, such as concreteness, sentiment, and political stance, which we plan to address in future work. Furthermore, we plan to experiment with anisotropy correction methods on a larger corpus, and to adapt the method for style prediction on longer text (e.g., whole documents). The stylistic measurements obtained using this method can be useful in the creation of lexical style lexicons as well as in downstream applications, for authorship attribution and style transfer.

heading: Limitations
text: We acknowledge the following limitations of our work: (a) The scope of our experiments is limited to the English language currently. Our method is only evaluated on the level of words, phrases, and sentences, but not at the document level. (b) The effect of anisotropy reduction strategies is shown to be rather mixed. Further investigation is required to determine under what conditions these strategies can prove beneficial in the specific context of stylistic feature extraction. (c) Our work addresses only lexical-level stylistic features and not more global aspects of writing style, such as the diversity of word choice and the utilization of unique syntactic structures. Whether this method can be extended to capture the comprehensive nuances of writing style is an interesting direction for future work.

heading: Ethical Considerations
text: In this paper, our method is only tested in intrinsic evaluation settings where existing publicly available datasets have been used. It is not integrated into any downstream application, although this type of stylistic analysis could be potentially useful in different settings.

heading: Acknowledgments
text: This research is based upon work supported in part by the DARPA KAIROS Program (contract FA8750-19-2-1004), the DARPA LwLL Program (contract FA8750-19-2-0201), the IARPA HIATUS Program (contract 2022-22072200005), and the NSF (Award 1928631). Approved for Public Release, Distribution Unlimited. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of DARPA, IARPA, NSF, or the U.S. Government.

heading: A Dataset Details
text: All evaluation datasets we use contain semantically similar but stylistically different words, phrases, or sentences.

heading: A.1 Data Description and Source

heading: Complexity
text: • SimplePPDB (Pavlick and Callison-Burch, 2016): It contains 4.5M pairs of words and short phrases, where one is simpler and the other is more complex. It is constructed based on a subset of the Paraphrase Database (PPDB) (Ganitkevitch et al., 2013). There are both automatically generated and manually annotated pairs.8 URL: http://www.se as.upenn.edu/~nlp/resources/s imple-ppdb.tgz.
• SimpleWikipedia (Kauchak, 2013): It contains 167K pairs of simple/complex sentences generated by aligning Simple English Wikipedia and English Wikipedia. We are using Version 2.0 of the dataset (updated from Wikipedia pages downloaded in May 2011), the “Sentence-aligned” subset. URL: https://cs.pomona.edu/~dkaucha k/simplification/data.v2/sente nce-aligned.v2.tar.gz.

heading: Formality
text: • StylePPDB (Pavlick and Nenkova, 2015): It contains 4.9K pairs of casual/formal words or short phrases from PPDB, both automatically generated and manually annotated. URL: ht tps://cs.brown.edu/people/epav lick/data.html#style-pp-bibte x.
• GYAFC (Rao and Tetreault, 2018): It contains a total of 110K informal/formal sentence pairs, created using the Yahoo Answers corpus. 9. URL: https://github.com/raosu dha89/GYAFC-corpus.

heading: Figurativeness
text: • IMPLI (Stowe et al., 2022): It consists of 25.8K literal/figurative sentence pairs,
8For all datasets, we only use a subset of all pairs based on quality filtering, which is described in Appendix A.2.
9https://webscope.sandbox.yahoo.com/c atalog.php?datatype=l&did=11
spanning idioms and metaphors, both semisupervised and human-annotated. URL: ht tps://github.com/UKPLab/acl202 2-impli.

heading: A.2 Preprocessing Method
text: To reduce noise and construct splits, we preprocess the datasets as follows:
• SimplePPDB: There are both automatically and manually labeled subsets. We only take the manually labeled examples with ≥ 80% of annotators agreeing with the final label. There are only training and validation sets in the original dataset. Since our method requires no training, we take the original training set as our validation set, and the original validation set as our test set.
• SimpleWikipedia: Since our method focuses on complexity in terms of lexical choice but not grammatical structure, we filter out pairs where the two sentences share the exact same set of tokens, or all tokens in a sentence appear in the other sentence. As there are no official splits, we randomly split the filtered dataset into train/validation/test sets of ratio 8:1:1 (since the dataset is huge).
• StylePPDB: The filtering method is the same as that used for SimplePPDB. There are no official splits either, so we randomly split the filtered dataset into a validation set and a test set of the same size (since the dataset is small).
• GYAFC: We take the Entertainment & Music subset, using pairs from the files formal and informal.ref0. Since the official splits only have training and test sets, we take only the test set and re-split it into a new validation set and test set of the same size.
• IMPLI: We take the manual_e subsets (manually created, entailing) for both idioms and metaphors, combine them and re-split the examples into a validation set and test set of the same size.
Finally, we randomly re-assign the label of every example for class balance.

heading: A.3 Statistics and Examples
text: Table 6 shows the dataset statistics and example inputs and outputs after our preprocessing. Table 5 shows the POS distribution statistics.
B Implementation Details

heading: B.1 Tokenization
text: Given a piece of text, we tokenize it with the SpaCy tokenzier10 into words. Then, using the method described in 3, we obtain a score for the feature of interest for each word token (if using static embeddings) or subword tokens (if using contextualized embeddings with WordPiece tokenization). In the latter case, we additionally obtain an aggregated feature score for each word from the scores of its subword tokens using a pooling strategy described in Section 4. Finally, we obtain an overall feature score for the entire piece of text from the scores of all its words using the same pooling strategy.

heading: B.2 Representations
text: We use the following static embeddings: for GloVe, we use GloVe.6B.300d11, consisting of 400K word vectors trained on Wikipedia 2014 and Gigaword 5; and for fastText, we use wiki-news-300d-1M-subword12, consisting of 1 million word vectors trained with subword infomation on Wikipedia 2017, UMBC webbase corpus and statmt.org news dataset. Out-ofVocabulary (OOV) tokens are represented with the all-zero vector.
For contexutalized LMs, we use the following pretrained model checkpoints from HuggingFace Transformers13: bert-base-uncased (110M parameters),
10https://spacy.io/api/tokenizer 11https://nlp.stanford.edu/projects/gl ove/ 12https://fasttext.cc/docs/en/english-v ectors.html 13https://github.com/huggingface/trans formers
bert-large-uncased (336M parameters), bert-base-multilingual-uncased (110M parameters), roberta-base (125M parameters), roberta-large (335M parameters), xlm-roberta-base ( 125M parameters), xlm-roberta-large ( 335M parameters).

heading: B.3 Experiments
text: We perform grid search on hyperparameters including the LM and the layer (0-12 for base models, and 0-24 for large models) using the validation set and report the performance of the optimal configuration on the test set. The optimal hyperparameters can be found in Appendix C.1.
All evaluation experiments are run on a single NVIDIA GeForce RTX 2080 Ti GPU node. Each experiment takes approximately 2-20 minutes depending on the size of the dataset.

heading: C Extended Results
text: In this section, we present additional results that cannot fit into Section 3 due to space limit.

heading: C.1 Performance of Different LMs
text: Table 7 and Table 8 show the detailed performance of specific LMs under the single-layer and the layer aggregation settings, respectively. From the results, we find that there is no consistent winner among all LMs. In terms of layers, on StylePPDB (formality short), the initial layers (0, 1, 2) are dominantly the best-performing ones across all settings. On the other datasets, there is no clear pattern in terms of which layers perform the best.

heading: C.2 Performance Across Layers Under Single-layer Setting
text: Regarding the performance change across layers, in addition to the plots shown in Section 5.1 under the layer aggregation setting, here we present the results under the single-layer setting in Figure 6. Compared to layer aggregation, the results here are noticeably more chaotic, exhibiting no clear general trends.

heading: C.3 Performance by Text Length Under Single-layer Setting
text: Similarly, we also present the performance change by text length under the single-layer setting in Figure 7, complementing the results under the layer aggregation setting in Section 5.2. The trends are mostly similar between the two settings.

heading: C.4 Effect of Anisotropy Reduction
text: Table 9 shows the effect of using the 3 different anisotropy reduction strategies, across all LM and layer configurations. All-but-the-top only works for figurativeness; rank-based only works for formality (long); and standardization works slightly more generally, for complexity (short), formality (short), and formality (long). Nevertheless, overall there is no strategy that works universally under every condition.

heading: Pooling Stats Complexity Formality Figurativeness

heading: Future Work
text: Whether this method can be extended to capture the comprehensive nuances of writing style is an interesting direction for future work