Methods › General › Attention Mechanisms › Class Attention

Class Attention

36 papers tagged archive 2025-07-28

Introduced by Hugo Touvron et al. in Going deeper with Image Transformers

archive 2025-07-28 Description, source and code snippet are the archive's method entry.

A Class Attention layer, or CA Layer, is an attention mechanism for vision transformers used in CaiT that aims to extract information from a set of processed patches. It is identical to a self-attention layer, except that it relies on the attention between (i) the class embedding x_(class) (initialized at CLS in the first CA) and (ii) itself plus the set of frozen patch embeddings x_(patches) .

Considering a network with h heads and p patches, and denoting by d the embedding size, the multi-head class-attention is parameterized with several projection matrices, W_q, Wₖ, Wᵥ, Wₒ ∈𝐑^(d ×d), and the corresponding biases b_q, bₖ, bᵥ, bₒ ∈𝐑ᵈ . With this notation, the computation of the CA residual block proceeds as follows. We first augment the patch embeddings (in matrix form) as z=[x_(class), x_(patches)]. We then perform the projections:

Q=W_q x_(class)+b_q

K=Wₖ z+bₖ

V=Wᵥ z+bᵥ

The class-attention weights are given by

A=Softmax(Q . Kᵀ / √(d / h))

where Q . Kᵀ ∈𝐑^(h ×1 ×p). This attention is involved in the weighted sum A ×V to produce the residual output vector

out_(CA)=Wₒ A V+bₒ

which is in turn added to x_(class) for subsequent processing.

PaperSource

Papers archive 2025-07-28

30 shown of 36, newest first. Repository counts are the archive's code-links table. A Syntology line states what Syntology ran from that paper's harvested code; it is per sample and not a correctness claim.

Tasks archive 2025-07-28

20 shown of 49 tasks the archive attaches to papers tagged with this method, by distinct papers. A task without a page in the catalog is plain text.

TaskPapers
Image Classification3
Semantic Segmentation3
Transfer Learning3
Efficient ViTs2
Knowledge Distillation2
Natural Language Understanding2
Object Detection2
Visual Prompt Tuning2
image-classification2
Authorship Attribution1
Automatic Speech Recognition1
Automatic Speech Recognition (ASR)1
BIG-bench Machine Learning1
Classification1
Common Sense Reasoning1
Computed Tomography (CT)1
Continual Learning1
Decision Making1
Denoising1
Dimensionality Reduction1

Usage over time archive 2025-07-28

Papers per year tagged with Class Attention: 2021 to 2025, peak 23 23 0 2021: 23 papers 2021 2022: 4 papers 2022 2023: 4 papers 2023 2024: 3 papers 2024 2025: 2 papers 2025
Papers per year the archive tags with this method, by the paper's archive date (36 dated). Bars are counts, not a trend claim.

Components: the archive holds no method-to-method composition, so PwC's Components table cannot be rebuilt; the Papers list carries no Results column for the same reason (the archive does not join its leaderboard rows to method tags).

Categories archive 2025-07-28

Attention MechanismsAttention

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections