Source-linked AI summary

Local and Global Regimes of Geometric Complexity in Language Model Representations

Arwa Osman, Marco Baroni, Iuri Macocco

arXiv:2608.14361v1cs.CL

TL;DR

It was unclear whether intrinsic dimensionality reflects language or dataset-construction artefacts. The paper studies lexical diversity in contextualised word representations and finds two scale-dependent ID regimes with a reversal in how unique-word counts relate to ID.

  • Problem

    It remains unclear whether intrinsic-dimensionality measurements reflect properties of language itself or artefacts of how datasets are constructed.

  • Method

    The paper analyzes neighbourhood-based ID across lexical-diversity conditions, derives the transition point between regimes, and tests it across models, estimators, and word classes.

  • Results

    Below the transition, more unique words lower ID; above it, more unique words raise ID, reversing naive noun-versus-preposition comparisons after lexical-diversity matching.

  • Takeaways & Limitations

    Neighbourhood-based ID measures either within-word contextual variation or global vocabulary geometry, so values across these regimes are not directly comparable.

  • Takeaways & Limitations

    The theoretical derivation assumes same-word representations cluster more closely than different-word representations, an assumption that weakens in later layers.

Abstract

from arXiv · show

Intrinsic dimensionality (ID) is widely used to probe the representational complexity of language models, but it remains unclear whether ID differences reflect properties of language itself or artefacts of how the underlying dataset was constructed. In this paper, we focus specifically on how lexical diversity, the number of unique last-token items present in a dataset, affects ID estimates of that dataset. We find a scale-dependent transition between two regimes: at low lexical diversity, conditions with fewer unique final words produce higher ID, while at high lexical diversity, this ordering reverses, and conditions with more unique words produce higher ID. We derive an exact, parameter-free formula for the point at which this reversal occurs, which matches the observed transition point at every scale tested. On the one hand, our results highlight how care must be taken when interpreting the intrinsic dimensionality of a set of representations as a straightforward cue of their complexity. On the other hand, our discovery of the two ID regimes reveals a general principle of organisation of linguistic data in LLMs that sheds new light on their inner manifold structures.

1 Introduction

The introduction frames intrinsic dimensionality as a tool for probing language-model representations but shows that lexical diversity can create misleading ID differences. The paper isolates lexical diversity and identifies a scale-dependent shift in whether ID reflects contextual variability or vocabulary-wide diversity.

  • Motivation: Intrinsic dimensionality measures the effective degrees of freedom of high-dimensional data and is widely used to probe language-model representational complexity.It characterizes how spread out or constrained hidden states are across layers or models.
  • Motivation: Naively, nouns occupy higher-ID spaces than prepositions across nearly every transformer layer, suggesting a possible link between semantic variety and geometric structure.This comparison is confounded because nouns contain thousands of unique word types, whereas prepositions come from only a few dozen.
  • Motivation: After matching lexical diversity and token frequency, prepositions instead show higher ID than nouns across layers, revealing the apparent part-of-speech effect as a lexical-diversity artefact.The figure uses 25 types and 400 tokens per type for both classes, compared with more than 2,600 noun types and approximately 43 adposition types in the naive comparison.
  • Approach: The study varies lexical diversity from 1 to 10,000 unique contextualised nouns while fixing N = 10,000 samples, estimating ID with GRIDE in Qwen3-8B and Meta-Llama-3-8B.The controlled dataset is derived from WikiText and spans eleven conditions.
  • Main contribution: When neighbourhood scale is small relative to samples per word, ID reflects contextual variability; once it reaches that count, ID reflects vocabulary-wide diversity, with the exact transition confirmed empirically.The transition holds across models, estimators, and word classes, motivating caution when comparing categories that differ in lexical diversity.

2 Related Work

Prior work established intrinsic dimensionality (ID) as a probe of representational complexity, while also revealing estimator limitations and broader confounds. However, lexical diversity had not been isolated as an experimental source of variation in ID estimates.

  • Methods for estimating intrinsic dimensionality: ID estimates effective representational degrees of freedom using methods including k-nearest-neighbour estimators and TwoNN.The k-nearest-neighbour approach models local neighbourhoods as homogeneous Poisson processes, while k controls neighbourhood size; TwoNN uses first- and second-neighbour distance ratios.
  • Intrinsic dimensionality in neural network representations: In deep networks, ID typically expands across early layers and compresses toward the output, with lower final-hidden-layer ID associated with better generalisation.This hump-shaped profile was reported by Ansuini et al. (2019), and subsequent work linked compression to network representations.
  • ID as a cue of complexity in NLP settings: ID has been used in NLP to distinguish machine-generated from human-written text and to characterize truthfulness through differences between hallucinated and correct-answer manifolds.Machine-generated text was reported to occupy a lower-dimensional subspace, whereas hallucinated outputs occupied higher-dimensional activation manifolds than correct ground-truth answers.
  • Confounds in ID estimation: Existing research questions whether common ID estimators reliably track true underlying ID and identifies input diversity as an overlooked source of variation.No prior work had isolated lexical diversity as an experimental variable in its own right, motivating the present study.

3 Experimental Setup

The experiments construct controlled WikiText-103 datasets varying target-noun lexical diversity while preserving varied preceding contexts, then measure representation ID across model layers with GRIDE. The setup uses Qwen3-8B primarily and Meta-Llama-3-8B for cross-architecture validation.

  • Sample Construction: Approximately 84 million WikiText-103 samples contain four consecutive non-overlapping sentences, with a randomly selected fourth-sentence target word as the final processed token.The target representation is conditioned on three complete preceding sentences.
  • Sample Construction: Noun targets span lexical diversity from one repeated noun to thousands of unique types after POS-purity and frequency filtering.Retained nouns are tagged as nouns in at least 80% of occurrences and appear at least 300 times.
  • Dataset Conditions: Eleven datasets each contain N = 10,000 samples, constructed from n unique nouns with m = N/n samples per noun while varying only target-noun identity diversity.Preceding contexts differ independently across samples at every diversity level.
  • Models: Qwen3-8B serves as the primary model, while Meta-Llama-3-8B provides cross-architecture validation.Qwen3-8B has 36 layers and hidden size 4096.
  • Representation Analysis: Final-token hidden states are extracted from every layer and their intrinsic dimensionality estimated independently across five partitions using GRIDE.GRIDE uses the n2 = 2n1 convention, with k via n2 defining neighbourhood scale; results report partition means and standard deviations.

4 A Scale-Dependent Transition in ID

ID exhibits two scale-dependent regimes separated by a transition point: lexical diversity is inversely related to ID at low diversity but directly related at high diversity. The transition shifts to lower lexical diversity as scale increases and is explained by whether nearest-neighbour neighborhoods remain within one word’s representation cluster.

  • Empirical regimes: At every tested scale and across all layers, low-diversity conditions remain low-ID while high-diversity conditions remain high-ID.Within the low-ID regime, fewer unique nouns produce higher ID; within the high-ID regime, more unique nouns produce higher ID.
  • Empirical regimes: The transition point starts near the low-ID cluster, rises across layers, and joins the high-ID cluster by the final layers.As k increases, the transition occurs at progressively lower lexical diversity.
  • Geometric mechanism: Nearest-neighbour structure yields local and global regimes depending on whether a neighborhood contains only representations of the same word or also another word type.The local regime measures contextual variation within one word’s representation cloud, whereas the global regime measures the geometry of the broader noun space.
  • Transition condition: At k = m, where m = N/n is the number of samples per noun, at least one neighbor must come from a different word type, forcing the global regime.For k < m, a neighborhood can in principle consist entirely of same-word samples, so the local regime remains geometrically possible.
  • Transition condition: All six scales from k = 16 to k = 512 collapse onto one trajectory when plotted against k/m and cross the transition at k/m = 1 without fitted parameters.The collapse holds consistently across layers 5, 21, 30, and 36 of Qwen3-8B.

5 Empirical Verification

Empirical tests support the local-cluster assumption underlying the theoretical derivation, although same-word segregation weakens in later layers, especially under high lexical diversity.

  • Local clustering: Same-word tokens almost entirely fill each token’s k-nearest-neighbourhood in early and middle layers across conditions.The same-word fraction is evaluated at k = m−1 for each lexical diversity condition and averaged across datapoints.
  • Layer dependence: Around 0.2–0.4: the same-word fraction falls to this range by the final layers, most noticeably for high-diversity conditions.The diagnostic excludes n = 1 and n = 10,000 because the fraction is respectively 1 or undefined.
  • Layer dependence: Same-word segregation is not strictly layer-independent, but the fraction remains far above the no-clustering baseline in later layers.Under no clustering, the expected same-word fraction is approximately 1/n, about three orders of magnitude below the observed late-layer fractions for the most diverse conditions.

6 Geometric Properties of the Two Regimes

Intrinsic dimensionality exhibits distinct geometric behavior across the two lexical-diversity regimes: fewer unique nouns yield higher ID locally, whereas greater diversity raises ID globally with diminishing returns. The central layer peak remains stable across scales and datasets and appears in both regimes.

  • Local regime: In the local regime, conditions with fewer unique nouns produce higher ID because more samples per noun enrich each word’s contextual geometry.The conjectured mechanism is that larger same-token clusters let the estimator explore contextual variation across more geometric directions.
  • Global regime: In the global regime, ID increases with lexical diversity but shows strongly diminishing returns as neighbourhoods become almost entirely filled with different-word tokens.As n grows large, ρ →1 asymptotically, so adding unique nouns changes neighbourhood composition only marginally.
  • Global regime: At scale 512, the global ratio differs by only 0.4% between 2,500 nouns (99.4%) and 5,000 nouns (99.8%), whose ID curves are nearly indistinguishable.This illustrates saturation of ID in the global regime at high lexical diversity.
  • Scale effects: The central ID peak pattern is relatively stable across scales and datasets, indicating a genuine property of how representations evolve across network layers.The peak emerges in both tight clustered neighbourhoods of the local regime and wide samples of unrelated points in the global regime.

7 Cross-Validation

Cross-validation shows that the lexical-diversity transition is robust across estimators, model architectures, and part-of-speech composition. The predicted transition n_transition = N/k persists across tested scales and conditions.

  • Cross-validation: The analysis is replicated across estimator, model architecture, and part-of-speech composition to test whether the transition generalizes beyond the original setup.Full results are provided in Appendix C.
  • Estimator: The same transition pattern appears with the MLE estimator at every scale k, matching GRIDE exactly.The condition at n = N/k nouns separates from the cluster under both estimators.
  • Model architecture: Across all six tested scales, Meta-Llama-3-8B exhibits the predicted transition at n_transition = N/k.This indicates that the transition point is governed by dataset construction rather than one model architecture.
  • Part-of-speech composition: A POS-diversified dataset preserves the transition pattern across all six scales.The dataset samples nouns, verbs, adjectives, adverbs, and proper nouns, excluding adverbs at the highest diversity levels because of data availability.

8 Discussion and Conclusion

The paper identifies two scale-dependent ID regimes governed by lexical diversity: local ID reflects contextual variation within lexical items, whereas global ID reflects geometry among word types. These findings show that apparent linguistic differences may instead arise from dataset construction, motivating regime checks and lexical-diversity diagnostics.

  • Two ID regimes: Neighbourhood-based ID estimators operate in two modes: local ID measures contextual variation of individual lexical items, while global ID measures relationships among different word types.The regimes depend on lexical diversity, sample size, and scale.
  • Dataset construction: Matching noun and preposition datasets on lexical diversity reversed their original ID comparison, indicating that dataset construction—not syntactic category—drove the initial difference.The original comparison used word classes with substantially different lexical diversity.
  • Scale-dependent relationship: Below the transition, higher lexical diversity lowers ID through fewer samples per noun and sparser cloud sampling; above it, higher diversity raises ID through richer inter-word geometry.The transition separates negative and positive relationships between lexical diversity and ID.
  • Global-regime ceiling: Within the global regime, ID reaches a ceiling when the global ratio approaches 1, so further lexical-diversity increases add no geometric information.The ceiling is predicted in advance from Equation 2 and suggests that the considered sample sizes support stable global-regime ID estimates.
  • Practical implications: Studies comparing conditions with different lexical diversity should verify their regimes using n_transition = N/k and the same-word fraction diagnostic.The paper warns that ID differences attributed to linguistic or task-relevant properties may reflect uncontrolled dataset-construction differences.
  • Geometric probing: ID can probe both local neighbourhoods of similar representations and global neighbourhoods spanning randomly selected unrelated nouns.The paper notes that some ID-profile features, including a mid-layer peak or bump, persist across scales even as other properties change.

Limitations

The study’s limitations concern the restricted data and model settings used to test the transition formula, as well as assumptions underlying its theoretical derivation and diagnostic. Generalisation beyond English Wikipedia, 8B models, and layers where same-word representations cluster closely remains untested or uncertain.

  • Data limitations: The dataset comes entirely from WikiText-103, an English-language corpus of Wikipedia articles.Whether n_transition = N/k generalises to other languages, genres, or domains with different distributional properties remains untested.
  • Model-scale limitations: The models are limited to the 8B parameter scale, despite validation across Qwen3-8B and Meta-Llama-3-8B.It remains unclear whether the same relationship holds at substantially smaller or larger model scales, or whether the transition point depends on model size.
  • Representational assumptions: The theoretical derivation and same-word fraction diagnostic assume that contextualised representations of the same word type cluster more closely than those of different words.This assumption holds strongly in early and middle layers but weakens in later layers, where the same-word fraction declines substantially for high-diversity conditions.

A POS-Diversified Dataset … C.2 Cross-Architecture Validation

The appendix tests the transition between local and global ID regimes across POS-diversified data, lexical-diversity views, ID estimators, and model architectures. Across these robustness checks, the transition occurs at the predicted level n_transition = N/k and is reproduced across scales and architectures.

  • A POS-Diversified Dataset: The POS-diversified dataset samples target words across multiple part-of-speech categories while retaining the main dataset’s construction procedure, lexical-diversity levels, and N = 10,000 samples per condition.It uses five categories for n ≤ 1,250 and four categories for n ≥ 2,500 because adverbs are too infrequent at high lexical diversity.
  • A POS-Diversified Dataset: POS purity and minimum-frequency filters are applied independently within each POS category, matching the noun-only dataset’s filtering procedure.
  • B Transition Point by Lexical Diversity: Figure 6 reorganizes the results by fixed lexical diversity n, with one line per scale k and the bold line marking the transition scale.This view identifies the scale k at which each lexical-diversity level separates the local and global regimes.
  • C Cross-Validation Results: The appendix evaluates robustness through an alternative MLE estimator, cross-architecture replication, and a POS-diversified dataset.
  • C.1 MLE Replication: The MLE transition pattern matches GRIDE exactly, with n = N/k nouns separating from the cluster at every scale on Qwen3-8B.Figure 7 reports MLE ID curves across all layers and six scales.
  • C.2 Cross-Architecture Validation: The transition occurs at n_transition = N/k at every scale for Meta-Llama-3-8B, matching the pattern observed on Qwen3-8B.Figure 8 covers all layers and all six scales.

C.3 POS-diversified Dataset · D Licenses

The POS-diversified dataset preserves the scale-dependent ID transition across layers and scales, indicating that lexical diversity drives the effect rather than noun specificity. The paper also lists the URLs and licenses for its datasets, models, and software.

  • C.3 POS-diversified Dataset: At every scale, Meta-Llama-3-8B exhibits a transition at n = N/k nouns.The pattern matches the Qwen3-8B results shown in Figure 2.
  • C.3 POS-diversified Dataset: The preserved transition across scales indicates that the effect is driven by lexical diversity rather than properties specific to nouns.The result is reported for the POS-diversified dataset described in Appendix A.
  • D Licenses: WikiText-103 is linked through Hugging Face and uses the CC BY-SA 4.0 license.The listed URL is https://huggingface.co/datasets/Salesforce/wikitext.
  • D Licenses: spaCy uses the MIT license, while DADApy uses the apache-2.0 license.Both projects are listed with their respective URLs.
  • D Licenses: Qwen3-8B uses the apache-2.0 license, and Meta-Llama-3-8B uses the llama3 license.Both models are linked through Hugging Face.
  • C.3 POS-diversified Dataset: The POS-diversified Qwen3-8B dataset preserves the ID transition pattern at every scale k.This matches the noun-only results in Figure 2.
  • D Licenses: skdim uses the BSD-3-Clause license.The listed project URL is https://github.com/scikit-learn-contrib/scikit-dimension.
Loading 2608.14361v1…