LayerTracer:一种用于任意大语言模型架构的联合任务-粒子和脆弱层分析框架
LayerTracer: A Joint Task-Particle and Vulnerable-Layer Analysis framework for Arbitrary Large Language Model Architectures
AI总结:
本文提出LayerTracer框架,通过逐层提取隐藏状态并映射到词汇概率分布,实现任务粒子定位与层脆弱性量化分析,为混合架构设计和模型优化提供科学依据。
摘要:
目前,大语言模型(LLMs)具有多样化的架构景观,包括传统Transformer、GateDeltaNet和Mamba。然而,各种LLM架构中层次表示的演化规律、任务知识形成位置以及网络鲁棒性瓶颈机制仍不明确,对混合架构设计和模型优化构成核心挑战。本文提出LayerTracer,一种架构无关的端到端分析框架,兼容任意LLM架构。通过逐层提取隐藏状态并映射到词汇概率分布,实现任务粒子定位与层脆弱性量化分析。我们定义任务粒子为目标令牌概率显著上升的关键层,代表模型任务执行的起点;脆弱层定义为在掩码扰动前后输出分布之间Jensen-Shannon(JS)散度最大的层,反映其对扰动的敏感性。实验表明,任务粒子主要出现在模型的深层,无论参数规模如何,而大参数模型表现出更强的层次鲁棒性。LayerTracer为混合架构的层划分、模块比例和门控切换提供科学依据,有效优化模型性能。它准确定位任务有效层和稳定性瓶颈,为LLM结构设计和可解释性研究提供通用支持。
英文摘要:
Currently, Large Language Models (LLMs) feature a diversified architectural landscape, including traditional Transformer, GateDeltaNet, and Mamba. However, the evolutionary laws of hierarchical representations, task knowledge formation positions, and network robustness bottleneck mechanisms in various LLM architectures remain unclear, posing core challenges for hybrid architecture design and model optimization. This paper proposes LayerTracer, an architecture-agnostic end-to-end analysis framework compatible with any LLM architecture. By extracting hidden states layer-by-layer and mapping them to vocabulary probability distributions, it achieves joint analysis of task particle localization and layer vulnerability quantification. We define the task particle as the key layer where the target token probability first rises significantly, representing the model's task execution starting point, and the vulnerable layer is defined as the layer with the maximum Jensen-Shannon (JS) divergence between output distributions before and after mask perturbation, reflecting its sensitivity to disturbances. Experiments on models of different parameter scales show that task particles mainly appear in the deep layers of the model regardless of parameter size, while larger-parameter models exhibit stronger hierarchical robustness. LayerTracer provides a scientific basis for layer division, module ratio, and gating switching of hybrid architectures, effectively optimizing model performance. It accurately locates task-effective layers and stability bottlenecks, offering universal support for LLM structure design and interpretability research.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。