arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.18898cs.LGstat.ML
收藏

一种双参数Weibull框架用于变压器权重分布诊断

A Two-Parameter Weibull Framework for Diagnosing Transformer Weight Distributions

Independent Researcher(独立研究者)

Tiexin Ding

AI总结:

本文提出了一种基于Weibull分布的双参数框架,用于分析Transformer中元素权重幅度分布,通过实验发现不同模块的k值分布特征,并揭示了训练过程中lambda参数的变化规律。

摘要:

我们应用Weibull分布——极值理论中的一个双参数家族——作为诊断框架,用于分析Transformer中元素权重幅度分布。在初始化时,i.i.d.高斯权重给出|w| ~ HalfNormal,产生k ~ 1.20通过中间80%概率-图拟合(此工作中的协议)。这个锚点使k成为一种原则性的、架构无关的训练动态测量工具;在每个层的每个检查点独立拟合每个权重矩阵,使能够进行每组件、每层和每步的诊断,这些聚合统计无法解决。将此框架应用于12个模型,涵盖7个架构家族(Pythia, OLMo-1/2, LLaMA-3, Mistral, Qwen2.5/3)揭示了三个发现。首先,FFN模块和注意力输出投影W_o——传输类——落在狭窄的k带中:在12个条目中,中位数终端k在[1.186, 1.204]之间(跨家族CV=0.51%),在SwiGLU/GeLU激活、Pre-LN/QK-Norm放置和70M-14B大小之间共享。其次,注意力输入投影W_q, W_k——选择类——脱离Weibull家族,其严重程度由存储形状决定:分别存储Q/K(OLMo-1, OLMo-2)产生k在[0.76, 0.99](深层);GQA模型产生k在[1.10, 1.16](轻微);Pythia的合并W_qkv占据过渡区,跟踪训练预算T/tau单调递增。第三,lambda在训练过程中显著增长,并在Pythia家族中与sqrt(eta/lambda_wd)成比例(Pearson r=0.94,三种传输类型),方向上与Fan等人(2025)一致。这两个参数携带独立信息:k标记功能类别,lambda标记训练进度。我们发布了npm-weibull-py v0.4(Python库)和DATABASE_v9_1在https://github.com/tiexinding/NPM-Weibull-public。

英文摘要:

Transformer checkpoints contain billions of weights, yet how their element-wise distributions vary across components, models, and training is hard to characterize. We fit the magnitude distribution of each analyzed weight matrix with a two-parameter Weibull reference model under a fixed middle-80% protocol. For i.i.d. Gaussian initialization, the corresponding half-Normal target has protocol-fitted shape $k_0 \approx 1.20$. Matched comparisons with gamma and lognormal favor Weibull for most component groups; support is less decisive for separately stored MHA query/key projections, and no tested single family cleanly describes matrices carrying a secondary weight population. Across 12 model entries spanning seven families, terminal FFN shape medians fall in a narrow band, $k \in [1.186, 1.204]$ (CV $= 0.51\%$), whereas query/key projections show architecture-associated departures. This stability is macroscopic only: in the five Pythia models whose released step-0 checkpoints permit a paired comparison, FFN and attention-output matrices remain near the reference shape despite large displacement and reorientation, so terminal shape similarity is not explained by parameter proximity alone. The fitted shape $k$ is read as a reference-relative central-body shape indicator and the scale $λ$ as a magnitude coordinate; neither is presented as a predictor of downstream performance. In a Qwen case study, the screen localizes a shallow-FFN secondary small-magnitude population, and direct raw-weight analysis of a flagged block traces much of that population to coherently suppressed intermediate channels. The method requires only released checkpoints and complements behavioral and structural analyses. The code and reference database are available at https://github.com/tiexinding/NPM-Weibull-public.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑