트랜스포머의 중간 계층 건너뛰기 학습
Learning to Skip the Middle Layers of Transformers
June 26, 2025
저자: Tim Lawson, Laurence Aitchison
cs.AI
초록
조건부 계산(conditional computation)은 트랜스포머의 효율성을 높이기 위한 인기 있는 전략입니다. 기존 방법들은 종종 개별 모듈(예: 전문가 혼합 레이어)을 대상으로 하거나 레이어를 서로 독립적으로 건너뛰는 방식에 초점을 맞춥니다. 그러나 해석 가능성 연구에 따르면, 트랜스포머의 중간 레이어들은 더 큰 중복성을 보이며, 초기 레이어들은 정보를 토큰 위치로 집약하는 것으로 나타났습니다. 이러한 통찰을 바탕으로, 우리는 중간에서 바깥쪽으로 가변적인 수의 레이어를 동적으로 건너뛰는 새로운 아키텍처를 제안합니다. 특히, 학습된 게이팅 메커니즘이 입력에 기반하여 중앙 블록의 대칭적 범위를 우회할지 여부를 결정하고, 게이트된 어텐션 메커니즘이 건너뛴 토큰 위치에 대한 후속 토큰의 주의를 방지합니다. 잔차 노름은 '샌드위치' 또는 '퍼레이어노름(perilayernorm)' 방식으로 제어되며, 게이트 희소성은 적응형 정규화 손실로 관리됩니다. 우리는 '더 단순한' 토큰에 대한 계산 요구를 줄이고, 잠재적으로 다단계 표현 계층 구조의 출현을 촉진하는 것을 목표로 했지만, 조사된 규모에서 우리의 접근 방식은 더 적은 레이어를 가진 밀집 기준선과 비교하여 검증 교차 엔트로피와 추정된 FLOP 사이의 균형 개선을 달성하지 못했습니다. 우리는 코드를 https://github.com/tim-lawson/skip-middle에서 공개합니다.
English
Conditional computation is a popular strategy to make Transformers more
efficient. Existing methods often target individual modules (e.g.,
mixture-of-experts layers) or skip layers independently of one another.
However, interpretability research has demonstrated that the middle layers of
Transformers exhibit greater redundancy, and that early layers aggregate
information into token positions. Guided by these insights, we propose a novel
architecture that dynamically skips a variable number of layers from the middle
outward. In particular, a learned gating mechanism determines whether to bypass
a symmetric span of central blocks based on the input, and a gated attention
mechanism prevents subsequent tokens from attending to skipped token positions.
Residual norms are controlled with a 'sandwich' or 'perilayernorm' scheme and
gate sparsity with an adaptive regularization loss. We had aimed to reduce
compute requirements for 'simpler' tokens and potentially foster an emergent
multi-level representational hierarchy but, at the scales investigated, our
approach does not achieve improvements in the trade-off between validation
cross-entropy and estimated FLOPs compared to dense baselines with fewer
layers. We release our code at https://github.com/tim-lawson/skip-middle.