Abstract
The Group-Transformer introduces a novel architectural modification to the standard Transformer by incorporating "grouping" strategies similar to those found in efficient convolutional neural networks like MobileNet. By partitioning the feature space into independent groups and utilizing specialized intra- and inter-group operations, the model significantly reduces parameter counts and computational complexity (FLOPs). Experimental results on character-level language modeling benchmarks demonstrate that Group-Transformer outperforms standard scaled-down Transformers, offering a superior Pareto frontier for lightweight NLP applications.
Introduction
Large-scale Transformer models have achieved state-of-the-art performance across various natural language processing (NLP) tasks. However, their massive parameter counts—often ranging from hundreds of millions to billions—pose significant challenges for deployment on resource-constrained edge devices, such as smartphones. For real-time applications like auto-correct or text completion, models must be both compact and computationally efficient.
Traditionally, reducing a Transformer's size involves "thinning" (reducing hidden dimensions) or "shallowing" (reducing the number of layers). While these methods decrease complexity, they often lead to a substantial drop in performance as the model's capacity to represent complex dependencies is diminished. The Group-Transformer addresses this by sparsifying connections through a grouping strategy, allowing the model to maintain a high-dimensional feature space and network depth while reducing overall parameters.
Methodology: The Grouping Strategy
The core innovation of the Group-Transformer is the partitioning of the feature space into $G$ independent groups. This approach replaces fully connected layers with more efficient grouped operations.
Architectural Components
- Group Embedding: Characters are represented by a set of $G$ vectors instead of a single large vector, reducing the initial embedding complexity.
- Group Attention: The multi-head attention mechanism is modified to balance global information with local efficiency. While Keys ($K$) and Values ($V$) remain fully connected to preserve a global context, the Queries ($Q$) and the final output projection are split into intra-group (within-group) and inter-group (cross-group) operations.
- Group Feed-Forward (GFF) Layer: The standard position-wise feed-forward network is replaced with a GFF layer. This layer utilizes low-rank matrix approximation and a "shuffle" mechanism—inspired by ShuffleNet—to facilitate information flow between groups without the quadratic cost associated with standard linear layers.
Key Insights
A critical finding is that keeping a wide feature dimension with sparse, grouped connections is more effective than simply reducing the dimension size. Furthermore, the authors identified that "inter-group" connections (represented by grey dashed arrows in the architecture diagrams) are essential; without them, performance degrades significantly as groups become isolated. Ablation studies also showed that grouping Keys and Values led to performance drops, suggesting that attention heads require a global view of keys to function correctly.
Experimental Evaluation
The authors evaluated the Group-Transformer on standard character-level language modeling benchmarks: enwik8 (100MB of raw English Wikipedia), text8 (100MB of cleaned Wikipedia), and Wikitext-103 (for word-level extension).
Key Results
- Efficiency: Increasing the number of groups to 8 reduces the parameters in the feed-forward layer to just 20.3% of the original module's size.
- Performance: At a budget of approximately 4.2 million parameters, a 4-group Group-Transformer achieved a bits-per-character (bpc) of 1.222 on enwik8, outperforming a standard Transformer-XL (1.246 bpc) of equivalent size.
- Pareto Frontier: In small-scale settings (under 10M parameters), the Group-Transformer consistently provided a better trade-off between accuracy (BPC) and computational cost (FLOPs) compared to traditional depth or width reduction.
Conclusion and Future Work
The Group-Transformer demonstrates that grouping features is a viable path toward lightweight, high-performance Transformers. While highly effective for character-level modeling, the authors note that word-level models still face bottlenecks in the embedding layer, which remains a target for future compression research. Additionally, while theoretical FLOPs are reduced, practical wall-clock speedups on standard GPUs may require specialized kernel optimizations for grouped operations. Future work may explore combining grouping with other techniques like knowledge distillation or weight sharing to further push the limits of model efficiency.
Summary updated