TL;DR
Pretrained language models (LMs) don't just understand what we say; they understand how we say it. This paper demonstrates that stylistic features like formality, complexity, and figurativeness are encoded as specific directions in an LM's embedding space, which can be extracted using a simple, unsupervised geometric approach with as few as seven example pairs.
What Problem Does This Paper Address?
While we know that LMs capture semantic relationships (like synonyms) and even abstract concepts like "intensity" (e.g., good vs. awesome), it hasn't been clear how—or if—they represent stylistic nuances. Traditionally, detecting style relied on surface-level features like word length or frequency.
The authors investigate whether stylistic dimensions are "baked into" the geometry of the embedding space. If style is represented as a vector direction, we could characterize the tone of any text simply by looking at where its embedding points relative to a "formality" or "complexity" axis.
Methods
The researchers used a technique called Geometric Probing. The process involves two main steps:
- Feature Vector Generation: They selected seven "seed pairs" for each stylistic dimension. For complexity, a pair might be (doctor $\rightarrow$ medical practitioner). By subtracting the vector of the simple word from the complex one and averaging these differences across all seven pairs, they created a global "complexity vector" ($d_{complex}$).
- Feature Value Prediction: To determine the style of a new word or sentence, they calculated the cosine similarity between the new text's embedding and the previously generated feature vector.
For longer texts (phrases and sentences), they experimented with Mean Pooling (averaging the stylistic scores of all words) and Max Pooling (taking the score of the most extreme word). They also addressed anisotropy—a common issue where LM embeddings cluster into a narrow cone rather than using the whole space—by testing correction methods like standardization and "All-but-the-top" (ABTT).
Datasets
The study evaluated these methods across five distinct datasets:
- Complexity: SimplePPDB (words/phrases) and SimpleWikipedia (sentences).
- Formality: StylePPDB (words/phrases) and GYAFC (sentences).
- Figurativeness: IMPLI (sentences).
The seed pairs used to define these dimensions are shown below:
Key Insights and Ideas
- Static vs. Contextualized Trade-off: Interestingly, "old-school" static embeddings (like GloVe) outperformed modern contextualized LMs (like BERT) at the word and phrase level. However, contextualized LMs were far superior when analyzing full sentences.
- The Anisotropy Bottleneck: The sub-optimal performance of models like BERT on short texts is largely due to anisotropy—the "rogue dimensions" that dominate the vector space. Applying standardization (centering and scaling the dimensions) significantly closed the performance gap.
- Layer-wise Stylistic Encoding: Style isn't represented uniformly across an LM's layers. Complexity information tends to stabilize after the 4th layer, while formality is often most distinct in the very early layers for short texts.
- Length Matters Differently: Complexity is easier to detect in shorter snippets, whereas formality is more reliably identified in longer sentences.
Key Results
The geometric probing method consistently outperformed both random chance and frequency-based baselines.
- Complexity: Achieved up to 89.4% accuracy on short text (using GloVe) and 76.5% on sentences (using mBERT).
- Formality: Reached 76.8% accuracy on short text and a high of 86.7% on sentences (using RoBERTa-large).
- Figurativeness: BERT-large achieved 72.9% accuracy in identifying figurative vs. literal sentences.
Mean pooling was generally the most effective strategy for sentences, suggesting that style is a cumulative property of the words chosen rather than being driven by a single "extreme" word.
Limitations and Future Work
The authors acknowledge several constraints:
- Language Scope: The current study is limited to English.
- Lexical Focus: The method focuses on word choice (lexical style) but doesn't account for more global stylistic markers like syntactic diversity or discourse structure.
- Anisotropy Correction: While standardization helped, no single anisotropy reduction strategy worked universally across all models and tasks.
Future work aims to extend this to other stylistic notions like concreteness, sentiment, and political stance, and to adapt the method for document-level analysis.
Summary updated