Skip to main content
QUICK REVIEW

[Paper Review] Lessons on Parameter Sharing across Layers in Transformers

Sho Takase, Shun Kiyono|arXiv (Cornell University)|Apr 13, 2021
Topic ModelingComputer Science25 references24 citations
TL;DR

This paper proposes three parameter sharing strategies—sequence, cycle, and cycle(rev)—for Transformers that assign parameters to M out of N layers instead of sharing a single set of parameters across all layers, as in Universal Transformers. The method achieves better BLEU scores with reduced computational cost, outperforming Universal Transformers in machine translation, speech recognition, and language modeling under equivalent parameter and training time budgets.

ABSTRACT

We propose a parameter sharing method for Transformers (Vaswani et al., 2017). The proposed approach relaxes a widely used technique, which shares parameters for one layer with all layers such as Universal Transformers (Dehghani et al., 2019), to increase the efficiency in the computational time. We propose three strategies: Sequence, Cycle, and Cycle (rev) to assign parameters to each layer. Experimental results show that the proposed strategies are efficient in the parameter size and computational time. Moreover, we indicate that the proposed strategies are also effective in the configuration where we use many training data such as the recent WMT competition.

Motivation & Objective

  • To address the inefficiency of Universal Transformers, which use a single set of parameters across all layers and incur high computational costs due to large weight matrices.
  • To explore parameter sharing strategies that allow stacking more layers with smaller individual weight matrices, improving expressiveness while reducing computational load.
  • To evaluate whether relaxing the one-layer parameter sharing constraint (as in Universal Transformers) leads to better performance and efficiency in various NLP and speech tasks.
  • To compare the proposed strategies against Universal Transformers under identical parameter counts and training time budgets.
  • To assess the effectiveness of the proposed strategies across different Transformer architectures (Post-LN and Pre-LN) and task types.

Proposed method

  • The proposed method constructs an N-layered Transformer encoder-decoder by reusing parameters from M independent layers, where 1 ≤ M ≤ N, instead of sharing parameters from a single layer across all N layers.
  • Three parameter assignment strategies are introduced: sequence (assigning the same parameters to sequential blocks of size ⌊N/M⌋), cycle (cyclic reuse of M layers), and cycle(rev) (reversed cyclic reuse for better gradient flow in deeper models).
  • The algorithm initializes M new layers and assigns subsequent layers by either reusing the previous layer (sequence), cycling through the M base layers (cycle), or using a reversed cycle pattern (cycle(rev)) to improve training dynamics.
  • The method is applied to both encoder and decoder sides using the same assignment logic, enabling efficient parameter sharing while maintaining model depth and expressiveness.
  • Experiments are conducted using both Post-LN and Pre-LN Transformer architectures to evaluate generalization across different normalization schemes.
  • The approach is evaluated on machine translation (WMT), automatic speech recognition, and language modeling tasks, with comparisons to Universal Transformers under fixed parameter counts and training time budgets.

Experimental results

Research questions

  • RQ1Can relaxing the one-layer parameter sharing constraint in Universal Transformers lead to better performance and reduced computational cost?
  • RQ2Does the proposed parameter sharing strategy—using M independent layers instead of one—improve efficiency in terms of parameter count and training time?
  • RQ3How do the sequence, cycle, and cycle(rev) strategies compare to Universal Transformers in machine translation, speech recognition, and language modeling tasks?
  • RQ4Does the performance gain of the proposed method hold under identical training time budgets, where computational efficiency is critical?
  • RQ5Are the proposed strategies effective across different Transformer architectures, such as Post-LN and Pre-LN?

Key findings

  • The proposed strategies achieved slightly better BLEU scores than Universal Transformers when using the same number of parameters (M=6, N=12), while reducing computational time.
  • Under the same training time budget (M=6, N=18), the proposed method outperformed Universal Transformers in machine translation, demonstrating superior efficiency.
  • The proposed strategies showed consistent improvements over Universal Transformers in high-resource settings, including the WMT English-to-German translation task.
  • The method was effective across multiple modalities, outperforming Universal Transformers in both automatic speech recognition and language modeling tasks.
  • The cycle(rev) strategy showed particular benefit in deeper models, likely due to improved gradient flow from the reversed cyclic pattern.
  • The performance gains were observed in both Post-LN and Pre-LN Transformer configurations, indicating broad applicability across architectural variants.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.