{"url":"/method/spatial-reduction-attention","slug":"spatial-reduction-attention","name":"Spatial-Reduction Attention","full_name":"Spatial-Reduction Attention","full_name_withheld":false,"description_markdown":"**Spatial-Reduction Attention**, or **SRA**, is a [multi-head attention](https://paperswithcode.com/method/multi-head-attention) module used in the [Pyramid Vision Transformer](https://paperswithcode.com/method/pvt) architecture which reduces the spatial scale of the key $K$ and value $V$ before the attention operation. This reduces the computational/memory overhead. Details of the SRA in the stage $i$ can be formulated as follows:\r\n\r\n$$\r\n\\text{SRA}(Q, K, V)=\\text { Concat }\\left(\\operatorname{head}\\_{0}, \\ldots \\text { head }\\_{N\\_{i}}\\right) W^{O} $$\r\n\r\n$$\\text{ head}\\_{j}=\\text { Attention }\\left(Q W\\_{j}^{Q}, \\operatorname{SR}(K) W\\_{j}^{K}, \\operatorname{SR}(V) W\\_{j}^{V}\\right)\r\n$$\r\n\r\nwhere Concat $(\\cdot)$ is the concatenation operation. $W\\_{j}^{Q} \\in \\mathbb{R}^{C\\_{i} \\times d\\_{\\text {head }}}$, $W\\_{j}^{K} \\in \\mathbb{R}^{C\\_{i} \\times d\\_{\\text {head }}}$, $W\\_{j}^{V} \\in \\mathbb{R}^{C\\_{i} \\times d\\_{\\text {head }}}$, and $W^{O} \\in \\mathbb{R}^{C\\_{i} \\times C\\_{i}}$ are linear projection parameters. $N\\_{i}$ is the head number of the attention layer in Stage $i$. Therefore, the dimension of each head (i.e. $\\left.d\\_{\\text {head }}\\right)$ is equal to $\\frac{C\\_{i}}{N\\_{i}} . \\text{SR}(\\cdot)$ is the operation for reducing the spatial dimension of the input sequence ($K$ or $V$ ), which is written as:\r\n\r\n$$\r\n\\text{SR}(\\mathbf{x})=\\text{Norm}\\left(\\operatorname{Reshape}\\left(\\mathbf{x}, R\\_{i}\\right) W^{S}\\right)\r\n$$\r\n\r\nHere, $\\mathbf{x} \\in \\mathbb{R}^{\\left(H\\_{i} W\\_{i}\\right) \\times C\\_{i}}$ represents a input sequence, and $R\\_{i}$ denotes the reduction ratio of the attention layers in Stage $i .$ Reshape $\\left(\\mathbf{x}, R\\_{i}\\right)$ is an operation of reshaping the input sequence $\\mathbf{x}$ to a sequence of size $\\frac{H\\_{i} W\\_{i}}{R\\_{i}^{2}} \\times\\left(R\\_{i}^{2} C\\_{i}\\right)$. $W\\_{S} \\in \\mathbb{R}^{\\left(R\\_{i}^{2} C\\_{i}\\right) \\times C\\_{i}}$ is a linear projection that reduces the dimension of the input sequence to $C\\_{i}$. $\\text{Norm}(\\cdot)$ refers to layer normalization.","description_state":"present","introduced_year":null,"introduced_by":{"title":"Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions","paper":"/paper/pyramid-vision-transformer-a-versatile","first_author":"Wenhai Wang","n_authors":9,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/pyramid-vision-transformer-a-versatile"},"source":{"url":"https://arxiv.org/abs/2102.12122v2","title":"Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"General","area_id":"general","collection":"Attention Modules","url":"/methods/category/attention-modules","pwc_aliases":[]}],"n_papers_tagged":29,"archive_num_papers":29,"papers_newest_first":[{"paper":null,"title":"GLOVA: Global and Local Variation-Aware Analog Circuit Design with Risk-Sensitive Reinforcement Learning","date":"2025-05-16","arxiv_id":"2505.11208","n_code_links":0,"syntology":null},{"paper":null,"title":"Crystal Oscillators in OSNMA-Enabled Receivers: An Implementation View for Automotive Applications","date":"2025-01-25","arxiv_id":"2501.15123","n_code_links":0,"syntology":null},{"paper":null,"title":"Multipath Mitigation Technology-integrated GNSS Direct Position Estimation Plug-in Module","date":"2024-11-20","arxiv_id":"2411.13339","n_code_links":0,"syntology":null},{"paper":null,"title":"HRPVT: High-Resolution Pyramid Vision Transformer for medium and small-scale human pose estimation","date":"2024-10-29","arxiv_id":"2410.22079","n_code_links":0,"syntology":null},{"paper":null,"title":"Low-Rank Continual Pyramid Vision Transformer: Incrementally Segment Whole-Body Organs in CT with Light-Weighted Adaptation","date":"2024-10-07","arxiv_id":"2410.04689","n_code_links":0,"syntology":null},{"paper":null,"title":"Recasting Generic Pretrained Vision Transformers As Object-Centric Scene Encoders For Manipulation Policies","date":"2024-05-24","arxiv_id":"2405.15916","n_code_links":0,"syntology":null},{"paper":"/paper/rethinking-attention-gated-with-hybrid-dual","title":"Rethinking Attention Gated with Hybrid Dual Pyramid Transformer-CNN for Generalized Segmentation in Medical Imaging","date":"2024-04-28","arxiv_id":"2404.18199","n_code_links":1,"syntology":null},{"paper":"/paper/multi-layer-dense-attention-decoder-for-polyp","title":"Multi-Layer Dense Attention Decoder for Polyp Segmentation","date":"2024-03-27","arxiv_id":"2403.18180","n_code_links":1,"syntology":null},{"paper":"/paper/spectral-convolutional-transformer","title":"Heracles: A Hybrid SSM-Transformer Model for High-Resolution Image and Time-Series Analysis","date":"2024-03-26","arxiv_id":"2403.18063","n_code_links":2,"syntology":{"ran":4,"of":4,"unverified":0,"pointer_only":4}},{"paper":null,"title":"ROI-Aware Multiscale Cross-Attention Vision Transformer for Pest Image Identification","date":"2023-12-28","arxiv_id":"2312.16914","n_code_links":0,"syntology":null},{"paper":null,"title":"Distilling Knowledge from CNN-Transformer Models for Enhanced Human Action Recognition","date":"2023-11-02","arxiv_id":"2311.01283","n_code_links":0,"syntology":null},{"paper":null,"title":"SeUNet-Trans: A Simple yet Effective UNet-Transformer Model for Medical Image Segmentation","date":"2023-10-16","arxiv_id":"2310.09998","n_code_links":0,"syntology":null},{"paper":"/paper/dat-spatially-dynamic-vision-transformer-with","title":"DAT++: Spatially Dynamic Vision Transformer with Deformable Attention","date":"2023-09-04","arxiv_id":"2309.01430","n_code_links":1,"syntology":{"ran":2,"of":10,"unverified":8,"pointer_only":0}},{"paper":"/paper/a-denoised-mean-teacher-for-domain-adaptive","title":"A denoised Mean Teacher for domain adaptive point cloud registration","date":"2023-06-26","arxiv_id":"2306.14749","n_code_links":1,"syntology":null},{"paper":null,"title":"A 3-step Low-latency Low-Power Multichannel Time-to-Digital Converter based on Time Residual Amplifier","date":"2023-06-01","arxiv_id":"2306.00433","n_code_links":0,"syntology":null},{"paper":null,"title":"Neural correlates of cognitive ability and visuo-motor speed: validation of IDoCT on UK Biobank Data","date":"2023-05-30","arxiv_id":"2305.18804","n_code_links":0,"syntology":null},{"paper":"/paper/pvt-ssd-single-stage-3d-object-detector-with","title":"PVT-SSD: Single-Stage 3D Object Detector with Point-Voxel Transformer","date":"2023-05-11","arxiv_id":"2305.06621","n_code_links":1,"syntology":null},{"paper":null,"title":"Sector Patch Embedding: An Embedding Module Conforming to The Distortion Pattern of Fisheye Image","date":"2023-03-26","arxiv_id":"2303.14645","n_code_links":0,"syntology":null},{"paper":"/paper/chasing-clouds-differentiable-volumetric","title":"Chasing Clouds: Differentiable Volumetric Rasterisation of Point Clouds as a Highly Efficient and Accurate Loss for Large-Scale Deformable 3D Registration","date":"2023-01-01","arxiv_id":null,"n_code_links":1,"syntology":null},{"paper":null,"title":"Exploring the Relationship Between Architectural Design and Adversarially Robust Generalization","date":"2023-01-01","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":"/paper/efficienttrain-exploring-generalized","title":"EfficientTrain: Exploring Generalized Curriculum Learning for Training Visual Backbones","date":"2022-11-17","arxiv_id":"2211.09703","n_code_links":1,"syntology":null},{"paper":null,"title":"Exploring the Relationship between Architecture and Adversarially Robust Generalization","date":"2022-09-28","arxiv_id":"2209.14105","n_code_links":0,"syntology":null},{"paper":"/paper/uniform-masking-enabling-mae-pre-training-for","title":"Uniform Masking: Enabling MAE Pre-training for Pyramid-based Vision Transformers with Locality","date":"2022-05-20","arxiv_id":"2205.10063","n_code_links":1,"syntology":null},{"paper":null,"title":"Uncertainty-Cognizant Model Predictive Control for Energy Management of Residential Buildings with PVT and Thermal Energy Storage","date":"2022-01-21","arxiv_id":"2201.08909","n_code_links":0,"syntology":null},{"paper":"/paper/vision-transformer-with-deformable-attention","title":"Vision Transformer with Deformable Attention","date":"2022-01-03","arxiv_id":"2201.00520","n_code_links":2,"syntology":{"ran":8,"of":10,"unverified":2,"pointer_only":0}},{"paper":"/paper/dynamic-token-normalization-improves-vision-1","title":"Dynamic Token Normalization Improves Vision Transformers","date":"2021-12-05","arxiv_id":"2112.02624","n_code_links":1,"syntology":{"ran":1,"of":1,"unverified":0,"pointer_only":1}},{"paper":null,"title":"Partial Variable Training for Efficient On-Device Federated Learning","date":"2021-10-11","arxiv_id":"2110.05607","n_code_links":0,"syntology":null},{"paper":"/paper/point-voxel-transformer-an-efficient-approach","title":"PVT: Point-Voxel Transformer for Point Cloud Learning","date":"2021-08-13","arxiv_id":"2108.06076","n_code_links":2,"syntology":null},{"paper":"/paper/pyramid-vision-transformer-a-versatile","title":"Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions","date":"2021-02-24","arxiv_id":"2102.12122","n_code_links":11,"syntology":{"ran":22,"of":30,"unverified":8,"pointer_only":1}}],"papers_shown":29,"tasks":[{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":7},{"task":"/task/object-detection","name":"Object Detection","papers":6},{"task":"/task/segmentation","name":"Segmentation","papers":4},{"task":"/task/image-classification","name":"Image Classification","papers":3},{"task":"/task/instance-segmentation","name":"Instance Segmentation","papers":3},{"task":"/task/inductive-bias","name":"Inductive Bias","papers":2},{"task":"/task/medical-image-segmentation","name":"Medical Image Segmentation","papers":2},{"task":"/task/quantization","name":"Quantization","papers":2},{"task":"/task/self-supervised-learning","name":"Self-Supervised Learning","papers":2},{"task":"/task/image-classification","name":"image-classification","papers":2},{"task":"/task/object-detection-1","name":"object-detection","papers":2},{"task":"/task/3d-object-detection","name":"3D Object Detection","papers":1},{"task":"/task/3d-part-segmentation","name":"3D Part Segmentation","papers":1},{"task":"/task/3d-point-cloud-classification","name":"3D Point Cloud Classification","papers":1},{"task":"/task/action-recognition-in-videos","name":"Action Recognition","papers":1},{"task":"/task/autonomous-driving","name":"Autonomous Driving","papers":1},{"task":"/task/computational-efficiency","name":"Computational Efficiency","papers":1},{"task":"/task/continual-semantic-segmentation","name":"Continual Semantic Segmentation","papers":1},{"task":"/task/data-augmentation","name":"Data Augmentation","papers":1},{"task":"/task/decoder","name":"Decoder","papers":1}],"tasks_shown":20,"n_tasks":43,"usage_by_year":[{"year":"2021","papers":4},{"year":"2022","papers":5},{"year":"2023","papers":11},{"year":"2024","papers":7},{"year":"2025","papers":2}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/spatial-reduction-attention"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}