Table of Contents
Fetching ...

Unraveling the Localized Latents: Learning Stratified Manifold Structures in LLM Embedding Space with Sparse Mixture-of-Experts

Xin Li, Anand Sarwate

TL;DR

The paper investigates whether LLM embedding spaces exhibit a stratified manifold structure rather than a single smooth global manifold. It introduces an unsupervised dictionary-learning Mixture-of-Experts framework with an attention-based soft gate to assign embeddings to sub-manifolds of varying intrinsic dimensions via sparse codes. Experiments across multiple domain datasets and backbone models show domain-specific clustering and increasing stratification with larger models, yielding interpretable strata and intrinsic-dimension estimates. These findings offer a new lens on the local geometry of embedding spaces and point toward interpretability-driven directions for model design and analysis.

Abstract

However, real-world data often exhibit complex local structures that can be challenging for single-model approaches with a smooth global manifold in the embedding space to unravel. In this work, we conjecture that in the latent space of these large language models, the embeddings live in a local manifold structure with different dimensions depending on the perplexities and domains of the input data, commonly referred to as a Stratified Manifold structure, which in combination form a structured space known as a Stratified Space. To investigate the validity of this structural claim, we propose an analysis framework based on a Mixture-of-Experts (MoE) model where each expert is implemented with a simple dictionary learning algorithm at varying sparsity levels. By incorporating an attention-based soft-gating network, we verify that our model learns specialized sub-manifolds for an ensemble of input data sources, reflecting the semantic stratification in LLM embedding space. We further analyze the intrinsic dimensions of these stratified sub-manifolds and present extensive statistics on expert assignments, gating entropy, and inter-expert distances. Our experimental results demonstrate that our method not only validates the claim of a stratified manifold structure in the LLM embedding space, but also provides interpretable clusters that align with the intrinsic semantic variations of the input data.

Unraveling the Localized Latents: Learning Stratified Manifold Structures in LLM Embedding Space with Sparse Mixture-of-Experts

TL;DR

The paper investigates whether LLM embedding spaces exhibit a stratified manifold structure rather than a single smooth global manifold. It introduces an unsupervised dictionary-learning Mixture-of-Experts framework with an attention-based soft gate to assign embeddings to sub-manifolds of varying intrinsic dimensions via sparse codes. Experiments across multiple domain datasets and backbone models show domain-specific clustering and increasing stratification with larger models, yielding interpretable strata and intrinsic-dimension estimates. These findings offer a new lens on the local geometry of embedding spaces and point toward interpretability-driven directions for model design and analysis.

Abstract

However, real-world data often exhibit complex local structures that can be challenging for single-model approaches with a smooth global manifold in the embedding space to unravel. In this work, we conjecture that in the latent space of these large language models, the embeddings live in a local manifold structure with different dimensions depending on the perplexities and domains of the input data, commonly referred to as a Stratified Manifold structure, which in combination form a structured space known as a Stratified Space. To investigate the validity of this structural claim, we propose an analysis framework based on a Mixture-of-Experts (MoE) model where each expert is implemented with a simple dictionary learning algorithm at varying sparsity levels. By incorporating an attention-based soft-gating network, we verify that our model learns specialized sub-manifolds for an ensemble of input data sources, reflecting the semantic stratification in LLM embedding space. We further analyze the intrinsic dimensions of these stratified sub-manifolds and present extensive statistics on expert assignments, gating entropy, and inter-expert distances. Our experimental results demonstrate that our method not only validates the claim of a stratified manifold structure in the LLM embedding space, but also provides interpretable clusters that align with the intrinsic semantic variations of the input data.

Paper Structure

This paper contains 18 sections, 8 equations, 11 figures, 2 tables.

Figures (11)

  • Figure 1: Working mechanism of our model to learn stratum information from a complex dataset.
  • Figure 2: Gating probability visualizations for RoBERTa.
  • Figure 3: Gating probability visualizations for LLama-3.2-1B.
  • Figure 4: Gating probability visualizations for DeepSeek-R1-Distill-Qwen-1.5B.
  • Figure 5: Gating probability visualizations for BERT.
  • ...and 6 more figures

Theorems & Definitions (26)

  • definition 1: Topological Equivalence or Homeomorphism
  • definition 2: Hausdorff Space
  • definition 3: Manifold
  • definition 4: Stratified Spaces
  • definition 5: Equivalence Relation
  • definition 6: Countability
  • definition 7: Metric Spaces
  • definition 8: Ball
  • definition 9: Neighborhood, Limit Point, Closed and Open Sets in Metric Spaces
  • definition 10: Neighborhoods
  • ...and 16 more