Transformer as Linear Expansion of Learngene
SXShiyu XiaMiaosen Zhang
Xu YangRuiming ChenHaokun Chen
Xin Geng SXShiyu Xia
Miaosen Zhang

Xu Yang
Ruiming Chen
Haokun Chen

Xin Geng
+6
We propose TLEG, which treats a shared Transformer module as a learngene and expands it linearly to produce and initialize Transformers of arbitrary depths. The key insight is that the relationship between layer position and weight value is well approximated by a linear function. After training one learngene via soft distillation, any depth can be initialized by linear expansion. On ImageNet-1K, TLEG matches or exceeds scratch-trained models while halving training cost, and outperforms existing initialization methods on downstream tasks (e.g., +6.87% on iNat 2019). For multi-depth deployment, it reduces stored parameters by ~19× and pre-training cost by ~5× versus pre-training and fine-tuning.

arXiv ·
· December 9, 2023