Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: He, Shwai, Ge, Tao, Sun, Guoheng, Tian, Bowei, Wang, Xiaoyang, Yu, Dong
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:https://arxiv.org/abs/2410.13184
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908535757996032
author He, Shwai
Ge, Tao
Sun, Guoheng
Tian, Bowei
Wang, Xiaoyang
Yu, Dong
author_facet He, Shwai
Ge, Tao
Sun, Guoheng
Tian, Bowei
Wang, Xiaoyang
Yu, Dong
contents Traditional transformer models often allocate a fixed amount of computational resources to every input token, leading to inefficient and unnecessary computation. To address this, the Mixture of Depths (MoD) was introduced to dynamically adjust the computational depth by skipping less important layers. Despite its promise, current MoD approaches remain under-explored and face two main challenges: (1) high training costs due to the need to train the entire model along with the routers that determine which layers to skip, and (2) the risk of performance degradation when important layers are bypassed. In response to the first issue, we propose Router-Tuning, a method that fine-tunes only the router on a small dataset, drastically reducing the computational overhead associated with full model training. For the second challenge, we propose MindSkip, which deploys Attention with Dynamic Depths. This method preserves the model's performance while significantly enhancing computational and memory efficiency. Extensive experiments demonstrate that our approach delivers competitive results while dramatically improving the computation efficiency, e.g., 21\% speedup and only a 0.2\% performance drop. The code is released at https://github.com/CASE-Lab-UMD/Router-Tuning.
format Preprint
id arxiv_https___arxiv_org_abs_2410_13184
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Router-Tuning: A Simple and Effective Approach for Enabling Dynamic-Depth in Transformers
He, Shwai
Ge, Tao
Sun, Guoheng
Tian, Bowei
Wang, Xiaoyang
Yu, Dong
Computation and Language
Traditional transformer models often allocate a fixed amount of computational resources to every input token, leading to inefficient and unnecessary computation. To address this, the Mixture of Depths (MoD) was introduced to dynamically adjust the computational depth by skipping less important layers. Despite its promise, current MoD approaches remain under-explored and face two main challenges: (1) high training costs due to the need to train the entire model along with the routers that determine which layers to skip, and (2) the risk of performance degradation when important layers are bypassed. In response to the first issue, we propose Router-Tuning, a method that fine-tunes only the router on a small dataset, drastically reducing the computational overhead associated with full model training. For the second challenge, we propose MindSkip, which deploys Attention with Dynamic Depths. This method preserves the model's performance while significantly enhancing computational and memory efficiency. Extensive experiments demonstrate that our approach delivers competitive results while dramatically improving the computation efficiency, e.g., 21\% speedup and only a 0.2\% performance drop. The code is released at https://github.com/CASE-Lab-UMD/Router-Tuning.
title Router-Tuning: A Simple and Effective Approach for Enabling Dynamic-Depth in Transformers
topic Computation and Language
url https://arxiv.org/abs/2410.13184