Abstract
Multi-head self-attention (MSA) endows vision Transformers (ViTs) with the ability of modeling long-range interactions between tokens. However, recent works have uncovered that current arbitrary attention makes tokens distracted by extraneous dependencies, complicating the understanding of ViTs and hindering the overall optimization of ViTs. In this paper, we propose Constituent Attention (CA), a straightforward yet effective constraint on MSA to resolve aforementioned issues in different variants of ViTs with negligible overhead. Specifically, CA is designed to encourage the mutual attention between spatially connectable tokens via gathering such token pairs to the same group (termed constituent). Furthermore, with the layers going deeper in ViTs, small adjacent constituents are gradually merged into larger ones, exploring hierarchical structures in the visual objectives. Extensive experiments on four popular benchmarks demonstrate that CA assists the optimization of ViTs and contributes to significant performance gains especially at data-scarce scenarios. Moreover, the layer-wise reasoning mechanism aids ViTs in more consistent and progressive attention across different layers, rendering the inner workings easier to interpret. Our code is publicly available at https://github.com/zju-vipa/ConstituentAttention.
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.