[Paper Review] Dynamic Group Transformer: A General Vision Transformer Backbone with Dynamic Group Attention
This paper proposes Dynamic Group Transformer (DGT), a general vision transformer backbone that replaces fixed-window self-attention with Dynamic Group Attention (DG-Attention), which adaptively clusters queries into groups based on content similarity and selects relevant keys/values for each group. The method achieves state-of-the-art performance across image classification, semantic segmentation, object detection, and instance segmentation, with DGT-T reaching 83.8% Top-1 accuracy on ImageNet-1k and DGT-B achieving 85.0% Top-1 accuracy.
Recently, Transformers have shown promising performance in various vision tasks. To reduce the quadratic computation complexity caused by each query attending to all keys/values, various methods have constrained the range of attention within local regions, where each query only attends to keys/values within a hand-crafted window. However, these hand-crafted window partition mechanisms are data-agnostic and ignore their input content, so it is likely that one query maybe attends to irrelevant keys/values. To address this issue, we propose a Dynamic Group Attention (DG-Attention), which dynamically divides all queries into multiple groups and selects the most relevant keys/values for each group. Our DG-Attention can flexibly model more relevant dependencies without any spatial constraint that is used in hand-crafted window based attention. Built on the DG-Attention, we develop a general vision transformer backbone named Dynamic Group Transformer (DGT). Extensive experiments show that our models can outperform the state-of-the-art methods on multiple common vision tasks, including image classification, semantic segmentation, object detection, and instance segmentation.
Motivation & Objective
- To address the limitations of fixed-window attention mechanisms in vision transformers, which are data-agnostic and may attend to irrelevant keys/values.
- To reduce the quadratic computation complexity of global self-attention while preserving long-range dependency modeling.
- To develop a flexible, content-dependent attention mechanism that dynamically groups queries and selects relevant keys/values without spatial constraints.
- To design a general-purpose vision transformer backbone that performs competitively across diverse vision tasks.
Proposed method
- Dynamic Group Attention (DG-Attention) dynamically partitions queries into groups based on their similarity to learned cluster centroids, enabling content-aware grouping.
- For each group, the cluster centroid is used to select the most relevant subset of keys/values from the full set, reducing irrelevant attention.
- The method avoids spatial constraints by allowing selected keys to be scattered across the feature map, not confined to local windows.
- The grouping mechanism is differentiable and end-to-end trainable, enabling joint optimization of clustering and attention.
- The approach maintains computational efficiency by limiting attention scope per group and using group-wise matrix multiplication for efficient GPU computation.
- The DGT backbone is scaled into variants (DGT-T, DGT-S, DGT-B) with 24M, 52M, and 90M parameters, respectively, for diverse deployment needs.
Experimental results
Research questions
- RQ1Can a content-adaptive attention mechanism outperform fixed-window attention in vision transformers by dynamically selecting relevant keys based on input-dependent query grouping?
- RQ2How can dynamic grouping of queries reduce computational cost while preserving long-range dependencies in high-resolution feature maps?
- RQ3To what extent can a general-purpose vision transformer backbone with dynamic grouping achieve state-of-the-art performance across diverse vision tasks?
- RQ4Does the absence of spatial constraints in key selection lead to improved modeling of non-local, semantically relevant features?
Key findings
- DGT-T achieves 83.8% Top-1 accuracy on ImageNet-1k, surpassing previous SOTA methods on image classification.
- On the ADE20K dataset, DGT-T achieves 50.2% mIoU for semantic segmentation, outperforming existing methods.
- For object detection on COCO, DGT-T attains 47.7% box mAP, demonstrating strong generalization across dense prediction tasks.
- DGT-B achieves 85.0% Top-1 accuracy on ImageNet-1k and 51.2% mIoU on ADE20K, setting new SOTA results in both classification and segmentation.
- Visualization results confirm that different query groups attend to scattered, semantically relevant keys rather than being restricted to local windows.
- The proposed group-wise matrix multiplication implementation enables efficient GPU computation with reduced global memory usage, supporting scalable training and inference.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.