Sgatlin:稀疏门控线性专家提升Transformer计算效率与可解释性

Sparsely gated tiny linear experts

精选理由

这项研究用极简设计同时提升了Transformer的计算效率和可解释性,做模型压缩或可解释性研究的团队值得关注,尤其是对MoE稀疏化方向感兴趣的开发者可以看看。

AI 摘要

该研究提出了一种名为Sgatlin(稀疏门控线性神经元)的新型网络结构,通过将每个专家缩小为单个神经元并移除非线性激活函数,在保持稀疏性的同时提升了计算效率。在等计算量对比中,用Sgatlin替换Transformer的前馈层可改善语言模型的困惑度。此外,稀疏性和线性结构使得模型更易解释,无需额外训练即可分析前馈电路,发现其形成语义聚类并参与事实回忆。这项工作为构建计算高效且可解释的Transformer前馈层提供了新思路。

原文 · arXiv cs.LG

Sparsely gated tiny linear experts

Sparsity allows scaling model parameters without proportionally increasing computational cost. While mixture of experts (MoE) models are made increasingly sparse, individual experts typically remain large and dense. Here, we demonstrate that further increasing sparsity by shrinking each expert to consist of a single neuron and selecting a tiny fraction of many available neurons can improve compute efficiency and interpretability. Counterintuitively, the key to achieving both is removing the nonlinearity typically applied to the experts, resulting in a network of sparsely gated linear neurons (sgatlin). In an isoflop comparison, we find that replacing all transformer feedforward layers with sgatlin improves perplexity in language models across different compute budgets. At the same time, the sparsity and linearity of the resulting feedforward circuits present new opportunities for model interpretability. In a small-scale case study, we demonstrate that feedforward circuits in sgatlin can be interpreted without having to train additional replacement models. We find that they form semantically structured clusters and are causally implicated in factual recall. Our findings paint a possible path towards compute-efficient and interpretable transformer feedforward layers.