Relaxed Recursive Transformers: Effective Parameter Sharing with Layer-wise LoRA

要約

大規模な言語モデル(LLM)は展開するのに費用がかかります。
パラメーター共有は、サイズとコストを削減するための可能なパスを提供しますが、最新のLLMでのその有効性はかなり限られたままです。
この作業では、変圧器のパラメーター共有の形式として「レイヤータイ」を再訪し、既存のLLMをレイヤー間でパラメーターを共有する小さな「再帰変圧器」に変換するための新しい方法を導入し、パフォーマンスを最小限に抑えます。
ここでは、当社の再帰変圧器は、標準の前処理された変圧器から効率的に初期化されますが、一意のレイヤーの単一ブロックのみを使用して、ループで複数回繰り返されます。
深さごとの低ランク適応(LORA)モジュールを介して層を結ぶ制約に柔軟性を追加するリラックスした再帰変圧器を導入することにより、パフォーマンスをさらに向上させますが、それでもモデル全体のコンパクトさを維持します。
再帰モデル(例えば、再帰的なジェマ1B)は、同様のサイズのバニラ前モデル(Tinyllama 1.1bやPythia 1Bなど)と知識蒸留ベースラインの両方を上回ることを示し、元の「フルサイズ」モデル(例えば、ジェマ2B)のパフォーマンスのほとんどを回復することさえできます。
最後に、継続的な深さのバッチングを提案します。これは、早期出口と組み合わせたときに再帰的な変圧器によって有効になっている有望な新しい推論パラダイムです。
理論分析では、これが推論スループットの有意な(2〜3倍)ゲインにつながる可能性があることを示します。

要約(オリジナル)

Large language models (LLMs) are expensive to deploy. Parameter sharing offers a possible path towards reducing their size and cost, but its effectiveness in modern LLMs remains fairly limited. In this work, we revisit ‘layer tying’ as form of parameter sharing in Transformers, and introduce novel methods for converting existing LLMs into smaller ‘Recursive Transformers’ that share parameters across layers, with minimal loss of performance. Here, our Recursive Transformers are efficiently initialized from standard pretrained Transformers, but only use a single block of unique layers that is then repeated multiple times in a loop. We further improve performance by introducing Relaxed Recursive Transformers that add flexibility to the layer tying constraint via depth-wise low-rank adaptation (LoRA) modules, yet still preserve the compactness of the overall model. We show that our recursive models (e.g., recursive Gemma 1B) outperform both similar-sized vanilla pretrained models (such as TinyLlama 1.1B and Pythia 1B) and knowledge distillation baselines — and can even recover most of the performance of the original ‘full-size’ model (e.g., Gemma 2B with no shared parameters). Finally, we propose Continuous Depth-wise Batching, a promising new inference paradigm enabled by the Recursive Transformer when paired with early exiting. In a theoretical analysis, we show that this has the potential to lead to significant (2-3x) gains in inference throughput.

arxiv情報

著者 Sangmin Bae,Adam Fisch,Hrayr Harutyunyan,Ziwei Ji,Seungyeon Kim,Tal Schuster
発行日 2025-02-28 16:44:24+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.LG パーマリンク