Source-linked AI summary
Representation of syntax in LLMs through the lens of linear distance and similarity-aware entropy
Juan Pablo Vigneaux, Mary Kennedy, Khalil Iskarous, Robert Frank, Matilde Marcolli
TL;DR
The paper examines whether syntactic relations differ in how legibly they are represented by language-model structural probes, beyond aggregate tree-reconstruction scores. It disaggregates performance by dependency label and models variation using linear-distance and similarity-aware-entropy measures. Across model sizes and architectures, relation-specific UASL is largely explained by distance descriptors and the diversity of relation heads, while the authors identify important scope limits for interpreting probe behavior.
Problem
The paper asks whether linguistic differences among dependency relations correspond to quantitative probe-performance differences and distinct computational mechanisms.
Method
The study measures undirected attachment score by label on transformer residual-stream representations of Penn Treebank dependency trees and models relation-level variation with distance and similarity-aware entropy.
Results
UASL is best explained by mean log linear distance, dispersion of log distance, and similarity-aware entropy of relation heads, with findings stable across five models.
Takeaways & Limitations
Similarity-aware entropy captures variability relevant to syntactic abstraction, while linguistic distinctions provide cues to different relation-processing behaviors.
Takeaways & Limitations
The study cannot quantify internal versus external variation among syntactic relations and trains only one probe per model checkpoint.
Abstract
from arXiv · showhide
Structural probes were introduced by Hewitt and Manning to reconstruct syntactic trees from a neural language model's latent representations. They are evaluated by calculating the proportion of syntactic tree edges correctly reconstructed over an annotated corpus (as measured by undirected unlabeled attachment score). Here, we disaggregate this measure, considering undirected attachment score by label (UASL), which assesses the reconstruction accuracy of each syntactic relation separately, establishing important differences among relations that overlap linguistic distinctions. Moreover, we identify two factors that predict most of UASL's variability across relations: (i) the mean and dispersion of the linear distance (on a log scale) between the related words, and (ii) the diversity (similarity-aware entropy) of the syntactic relation's head. These results, which hold across a range of model sizes and architectures, shed light on the degree of abstraction of the representation of syntax in language models and the dependence of such representation on geometric properties of the embedding space.
1 Introduction
The paper asks whether syntactic relations differ quantitatively in language-model representations and whether such differences reflect measurable linguistic or geometric factors. It finds relation-specific probe behavior associated with distance and similarity-aware head entropy across models.
- UASL varies widely among dependency relations, revealing limits in how syntactic dependencies are abstracted.
- The analysis tests syntactic role, relation frequency, linear distance, and similarity-aware entropy as candidate explanations for UASL variability.
- Relations with similar syntactic-theoretic properties exhibit similar UASL-versus-distance behavior, suggesting distinct underlying processing mechanisms.
- Similarity-aware entropy of relation heads independently modulates UASL alongside linear-distance descriptors.
- Higher similarity-aware head entropy hinders probe performance because diverse head embeddings may require attention to point in independent or conflicting directions.
- The findings remain stable across BERT-base, DeBERTa-v3-base, ModernBERT-base, GPT-2-base, and GPT-J-6B.
2 Related work
The related-work context situates similarity-aware entropy as a diversity measure with roots in ecology and applications in NLP uncertainty estimation. Structural-probing research established syntactic-tree recovery and distance effects, but not relation-specific distance effects.
- Structural probes recover dependency trees from language-model representations, while recent work established a general distance dependence without differentiating syntactic relations.
- Similarity-aware entropy originated as an ecological diversity measure and has also been called kernelized 2-complexity or geometry-aware Shannon entropy.
- In NLP, similarity-aware entropy has been used to quantify uncertainty in machine translation.
3 Background
The study probes transformer residual-stream representations of Penn Treebank dependency trees, using UASL to measure how legible each relation is without training on labels.
- The study evaluates BERT-base and four additional transformer models spanning parameter counts and architectures.
- Residual stream checkpoints are extraction points after successive embedding, attention, and MLP modifications, capturing evolving contextualized token representations.
- The data comprise Penn Treebank Wall Street Journal dependency trees split into sections 02–21 for training, 22 for development, and 23 for testing.
- Structural probes map representations into a 64-dimensional space so Euclidean distances approximate tree-path lengths, then recover a minimum spanning tree.
- UASL is the proportion of edges with one relation label recovered by an unlabeled probe, measuring relation legibility rather than labeled-parser accuracy.
4 UASL performance by dependencies
Probe performance differs substantially across dependency relations and is not explained by corpus frequency alone. Qualitative patterns point to argument type, phraseology, clause complexity, and linear distance as important factors.
- Thematic dependencies: Internal arguments generally outperform external arguments, with dobj and pobj showing nearly identical patterns and similarities to xcomp, pcomp, and iobj.
- Performance: Top-performing relations tend to involve closed-class, set-phraseology words, whereas intermediate relations span copulas, modifiers, relative clauses, and coordination.
- Performance: Advcl and parataxis are among the lowest-performing relations because both link syntactically complex clauses.
- Length and diversity: UASL declines steeply over the first few words of linear distance and then becomes nearly flat across all five models.
- Probe performance is not strictly dictated by relation frequency in the corpus.
- Length and diversity: The paper identifies linear distance and diversity of relation terms as the main factors driving differences in UASL, with ordered distance also affecting performance.
5 Distance and UASL performance
The paper refines the average negative effect of dependency distance by analyzing UASL separately across relations. Log-linear fits and model-free clustering show that distance behavior varies substantially and groups according to syntactically motivated distinctions.
- Increased linear distance decreases probe accuracy, but distance is not necessarily a good predictor for individual dependencies.
- The log-linear decay model predicts UASL as a relation- and checkpoint-specific intercept plus slope times the logarithm of linear distance.The regression uses distances with at least five corresponding PTB test-set edges.
- Ten relations with fewer than three observed distance values were excluded, while neg, cop, and aux showed near-perfect log-linear decay.Relations such as vmod, ccomp, and cc deviated substantially from the model.
- The dendrogram compares relations by UASL curves over shared distance ranges using a symmetric log-scale for the horizontal axis.The clustering uses UPGMA average linkage and marks 25% of the tallest merge.
- Model-free clustering divides relations into broad groups distinguished by function-word and nominal-modifier patterns versus verbal heads and varied dependents.The red cluster is additionally associated with clause-level linkage, while the brown cluster contains argument relations.
6 Entropy analysis
The entropy analysis tests whether lexical diversity and distance distributions explain variation in UASL across dependency relations. A weighted regression identifies mean log distance, distance dispersion, and similarity-aware head entropy as central predictors.
- Similarity-aware head entropy adjusts lexical diversity for embedding similarity, reflecting whether relation heads are numerous and geometrically similar or diverse.The similarity score uses nonnegative cosine similarity between fastText-derived word embeddings.
- A weighted least squares regression predicts UASL for 42 dependency relations using relation-level lexical and distance properties.Each relation is weighted by its number of edges because UASL sampling noise depends on edge count.
- The weighted regression explains R2 = 0.736 of UASL variation, with adjusted R2 = 0.715 across n = 42 relations.The reported model has F(3, 38) = 35.2 and p < 10^-10.
- Mean log dependency length has a large negative coefficient, while standard deviation of log distance has a positive coefficient when the mean is held fixed.Greater spread generally corresponds to smaller median distances, which are easier for the probe to recover.
- Higher similarity-aware entropy of relation heads hinders probe performance, whereas similarity-corrected dependent entropy has no similarly significant effect.The authors conjecture that diverse head embeddings make geometric encoding of relations more difficult.
- Using the model’s own contextualized representations leaves the regression essentially unchanged, including head entropy β = −0.081 and mean log length β = −0.251.Both reported coefficients have p < .001.
7 Conclusions
The conclusions identify distance, distance dispersion, head diversity, and word order as factors shaping syntactic probe performance. Across models, these findings quantify limitations of abstraction and show that structural, statistical, and linguistic factors interact.
- Longer linear distances and greater head similarity entropy are negatively correlated with probe performance.
- Some top-performing word-order-sensitive relations lose performance when probes are trained on shuffled transformers.The authors suggest templatic relations may be learned through n-gram detection and acquired more easily than complex relations.
- Deeper transformer layers are more likely to reconstruct dependencies with longer linear distances, although not all UASL curves decay polynomially.
- UASL is better explained by mean log distance, standard deviation of log distance, and similarity-aware head entropy, with relation abundance affecting estimation precision.
- Higher similarity-aware head entropy provides a quantitative measure of limitations or difficulties of syntactic abstraction in LLMs, robust across different models.
- Probe performance is modulated by interacting structural, statistical, and linguistic factors rather than by any one category alone.
Limitations
The paper identifies methodological and scope limitations, including unmeasured variation, untested probe stability, and an incomplete link between probe findings and transformer mechanisms. It also calls for testing whether these patterns generalize across languages and architectures.
- The study could not quantify the distinction between internal and external variation among syntactic relations.
- Training one probe per model checkpoint left probe stability across corpus splits and training runs unevaluated.
- The findings have not yet been tested on similar structures in other languages or across broader architectural and linguistic variation.
- Structural-probe performance has not yet been linked to transformer computational mechanisms, and the model’s use of detected syntactic encoding remains unproven.
A.2 The probe and its training
The appendix defines how structural probes reconstruct dependency trees, how relation-specific scores are pooled, and how representations are sampled across model architectures. It also examines layer-normalization conventions and verifies the relation-level patterns across multiple models.
- The probe and its training: The probe reconstructs each sentence as a minimum spanning tree over projected 64-dimensional word representations.
- The probe and its training: UUAS and UASL are pooled over the dataset, so every edge counts once and UUAS becomes edge-count-weighted average UASL.
- Another look at layer normalization: Layer normalization affects probe conventions only through token-dependent rescaling, because its shift, gain, and centering can be absorbed by the probe.
- Another look at layer normalization: GPT-2-base showed nearly indistinguishable conventions: peak development UUAS was 0.7755 under A versus 0.7741 under B, with mean B −A of −0.0050.
- Cross-model checks: Across BERT-base, DeBERTa-v3-base, ModernBERT-base, GPT-2-base, and GPT-J-6B, the general relation ordering was preserved, with pcomp highest and csubj lowest.
C.1 Models’ UASL as a function of linear distance
Across models, UASL generally declines as dependency linear distance increases, and log-linear distance models capture this pattern reasonably but imperfectly. Distance-based clustering groups relations with similar syntactic behavior, while adding full distance-distribution information offers limited interpretability gains.
- All models show similar UASL decay as linear distance increases across residual-stream checkpoints.
- The log-linear model’s median R2 ranges from 0.588 for DeBERTa-v3-base to 0.777 for BERT-base across relation-checkpoint pairs.The model is therefore useful but does not describe every dependency relation well.
- Range-based clustering: Distance-only clustering isolates the longest-range relations advcl, ccomp, and parataxis, whose δ90 equals 17.Intermediate-range relations with δ90 values from 7–9 form another cluster.
- Alternative distance distributions: Wasserstein-1 distinguishes relations sharing the same δ90, but its clustering is more fragmented and not significantly more interpretable than percentile-based range clustering.For example, cc and csubj share δ90 = 11 yet differ by 3.07 words in W1.
- UASL-profile clustering: UASL-curve clustering groups dependency relations with similar distance-conditioned behavior, including broad clusters of function-word dependents across models.The clustering is based on average-linkage dendrograms using dUASL, with composite range metrics considered separately.
D Regression results across models
Regression analyses identify stable relationships between UASL and distance descriptors, dispersion, and similarity-aware head entropy across models. Alternative encodings of distance perform worse, while adding skewness does not improve the model.
- Regression interpretation: The regression predictors are evaluated with added-variable plots that residualize UASL and each predictor against the other two predictors.This partial view is needed because sd(log δ) correlates +0.56 with mean(log δ).
- Cross-model regression: Across models, mean log distance has a negative coefficient, dispersion a positive coefficient, and head similarity-aware entropy a negative coefficient.The signs and approximate magnitudes remain comparable across architectures.
- Distance encoding: Replacing mean(log δ) with log(mean δ) lowers R2 by approximately 0.09 in every model.The reported transitions include BERT-base 0.694 → 0.603 and GPT-J-6B 0.706 → 0.610.
- Distance dispersion: Replacing sd(log δ) with var(log δ) lowers R2 in all five models and weakens the dispersion term’s statistical significance.For BERT-base, R2 changes from 0.736 to 0.722; dispersion p-values become .056–.179 rather than .017–.095.
- Higher moments: Adding the third moment improves neither the regression’s useful information nor the dispersion effect.The dispersion term improves adjusted R2 in all models, whereas skewness does not add useful information and can spoil the dispersion effect.
- Ordered distance: Permuting pretraining sentences reverses the performance ordering of some relations, including mwe, auxpass, cc, and conj.The mwe relation shifts from among the highest-scoring dependencies to among the lowest-scoring ones.
E.2 Linear distance and lexical diversity for a model pre-trained on permuted sentences
A transformer pretrained on randomly permuted sentences does not recover dependency trees and no longer exhibits the distance and lexical-diversity patterns found in the standard models. Its regression explains far less between-relation variance, with key coefficients changing magnitude or sign.
- Overall performance: Dev-set UUAS peaks at 0.093 for RoBERTa-Shuffle-n1, compared with 0.815 for BERT-base.Across 13 checkpoints, the permuted model varies only from 0.084 to 0.093 and never recovers dependency trees.
- Log-linear decay: The median log-linear decay-model R2 is 0.102 for RoBERTa-Shuffle-n1, versus 0.777 for BERT-base.Its mean UASL-versus-distance curves are close to flat, indicating that linear distance carries almost no information in this setting.
- Regression: The three-predictor regression explains R2 = 0.195 of between-relation variance, compared with 0.736 for BERT-base.The best-checkpoint regression has adjusted R2 = 0.132, F(3, 38) = 3.07, p = .039, and n = 42.
- Regression coefficients: The mean log-distance coefficient falls from −0.252 to −0.002, while similarity-aware entropy and dispersion coefficients change sign.The reported coefficients change from −0.082 to +0.014 for entropy and from +0.163 to −0.060 for dispersion.