发现大模型嵌入空间存在分层流形结构,可解释语义差异。
Unraveling the Localized Latents: Learning Stratified Manifold Structures in LLM Embedding Space with Sparse Mixture-of-Experts
- 用稀疏专家混合模型探测嵌入空间的局部流形结构。
- 不同专家对应不同语义域,内在维度与输入困惑度相关。
- 结果可解释,适合研究语义层次与模型内部机制的人参考。
真实数据常表现出复杂局部结构,单一模型在嵌入空间中光滑全局流形难以解析。本文提出假设:大语言模型的隐空间中,嵌入分布于分层流形结构上,其维度随输入数据的困惑度和领域变化,称为分层流形(Stratified Manifold),共同构成分层空间(Stratified Space)。为此,我们构建基于专家混合(MoE)的分析框架,各专家采用不同稀疏度的字典学习算法,结合注意力软门控网络,验证了模型能为多种输入源学习专用子流形,反映嵌入空间中的语义分层。进一步分析子流形的内在维度,统计专家分配、门控熵与专家间距离。实验表明,该方法不仅验证了嵌入空间中分层流形的存在性,还提供了与输入数据内在语义变化一致的可解释聚类。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。