Semantics or spelling? Probing contextual word embeddings with orthographic noise
Jacob A. Matthews, John R. Starr, Marten van Schijndel
TL;DR
The paper questions the assumption that pretrained language model hidden states serve as reliable semantic proxies for contextual word embeddings (CWEs). By introducing minimal orthographic noise (a single character swap) in alphabetic words across authentic contexts and comparing CWEs with both edited and unedited forms, the authors quantify representational similarity using $cos(\bar{\mathbf{w}}, \bar{\mathbf{w}}_{edit})$ and $\rho_{\bar{\mathbf{w}}, \bar{\mathbf{w}}_{edit}}$ across diverse PLMs. They find that CWEs are highly sensitive to input perturbations, with sensitivity correlating to tokenization and the number of input tokens per word; context can mitigate this but token-length effects persist. These results challenge the notion that CWEs primarily reflect word-level semantics and urge caution when interpreting CWE similarity in semantic analyses, especially under noisy data conditions or semantic-shift tasks. The study highlights the fragility of representational similarity measures and the need for careful methodological design when using CWEs as semantic proxies.
Abstract
Pretrained language model (PLM) hidden states are frequently employed as contextual word embeddings (CWE): high-dimensional representations that encode semantic information given linguistic context. Across many areas of computational linguistics research, similarity between CWEs is interpreted as semantic similarity. However, it remains unclear exactly what information is encoded in PLM hidden states. We investigate this practice by probing PLM representations using minimal orthographic noise. We expect that if CWEs primarily encode semantic information, a single character swap in the input word will not drastically affect the resulting representation,given sufficient linguistic context. Surprisingly, we find that CWEs generated by popular PLMs are highly sensitive to noise in input data, and that this sensitivity is related to subword tokenization: the fewer tokens used to represent a word at input, the more sensitive its corresponding CWE. This suggests that CWEs capture information unrelated to word-level meaning and can be manipulated through trivial modifications of input data. We conclude that these PLM-derived CWEs may not be reliable semantic proxies, and that caution is warranted when interpreting representational similarity
