DAGFormer:面向Transformer跨层连接的全局拓扑预测
研究论文 · 2026/10/19
我们提出DAGFormer,一种Transformer语言模型,其跨层连接由联合训练的拓扑预测器规划。除标准Transformer中的残差连接外,DAGFormer还添加从早期层到后期层的直接连接,预测器根据输入token控制每个连接的强度。与现有分别设置每层连接的跨层路由架构不同,DAGFormer一次性规划整个模型的路由。在75M到1B参数的匹配OLMo-2对上,DAGFormer将WikiText-2困惑度比普通Transformer降低17%到25%,且1B DAGFormer在5B token上训练优于普通模型在10B token上训练。在相同数据和预算下与四个路由基线相比,它在75M、300M和1B上达到最低困惑度。该增益延续到13个常识、科学、阅读和数学评估任务(300M和1B上平均准确率高2.0到2.5分)以及指令微调(对普通Transformer的AlpacaEval胜率63%到70%,领先所有路由基线),在结构化剪枝下DAGFormer在六种设置中的五种退化最小。
DAGFormer通过全局拓扑预测器动态规划跨层连接,在多个规模上显著降低困惑度并提升下游任务表现,且数据效率高、鲁棒性强,为Transformer架构设计提供了新思路。
We propose DAGFormer, a Transformer language model whose cross-layer connections are planned by a jointly trained topology predictor. Beyond the residual connections in a standard Transformer, DAGFormer adds direct connections from earlier layers to later ones, and the predictor controls the strength of every connection based on input tokens. Unlike existing cross-layer routing architectures, which set each layer's connections separately, DAGFormer plans the routing of the whole model at once. On matched OLMo-2 pairs from 75M to 1B parameters, DAGFormer lowers WikiText-2 perplexity by 17% to 25% over the vanilla Transformer, and a 1B DAGFormer trained on 5B tokens outperforms the vanilla model trained on 10B. Against four routing baselines with the same data and budget, it reaches the lowest perplexity at 75M, 300M and 1B. The gain carries over to 13 commonsense, science, reading and math evaluation tasks (2.0 to 2.5 points higher mean accuracy at 300M and 1B) and to instruction finetuning (63% to 70% AlpacaEval win rate against the vanilla Transformer, leading every routing baseline), and under structured pruning DAGFormer degrades the least in five of six settings.