Papers
Topics
Authors
Recent
Search
2000 character limit reached

MOHSA: Overlapped MHSA in Vision Transformers

Updated 22 June 2026
  • MOHSA is a variant of MHSA that introduces structured overlap between adjacent attention heads to enable direct cross-head information exchange.
  • It employs configurable overlap schemes, including fixed and layer-wise increasing or decreasing patterns, to optimize token mixing in vision transformers.
  • Empirical results demonstrate Top-1 accuracy improvements of up to 7.4% with only a modest increase in parameters and FLOPs across various vision benchmarks.

Multi-Overlapped-Head Self-Attention (MOHSA) is an architectural variant of the Multi-Head Self-Attention (MHSA) mechanism employed in Transformer models, particularly Vision Transformers (ViTs). MOHSA introduces a structured overlap between adjacent attention heads, enabling direct information exchange during attention computation, in contrast to the hard partitioning of query, key, and value (Q, K, V) representations in standard MHSA. This approach is designed to enhance token interaction and inter-head representational mixing with minimal computational overhead, yielding measurable gains on vision tasks across multiple architectures and benchmark datasets (Zhang et al., 2024).

1. Rationale for Overlapping Attention Heads

Traditional MHSA computes attention in hh independent heads, each operating on a disjoint dh=d/hd_h = d / h-dimensional chunk of Q, K, V, where dd is the model dimension. This head-wise decorrelation fosters diversity, but completely suppresses cross-head information flow at the point of attention, relying on later linear projections for any cross-head synthesis. In image recognition settings, this may hinder the model’s ability to aggregate diverse spatial or semantic relationships, which are often distributed across heads.

MOHSA addresses this by overlapping adjacent heads’ subspaces. For a given head ii, its QiQ'_i, KiK'_i, and ViV'_i are augmented with a weighted contribution from the immediate neighboring heads, allowing each head’s contextual window to “bleed over” and directly draw information from adjacent subspaces. This results in richer, more entangled representations, with only a small increase in parameter count and floating-point operations.

2. Mathematical Description

Let XRT×dX\in\mathbb{R}^{T\times d} denote a sequence of TT tokens. Projecting to query, key, and value yields:

Q=XWQ,K=XWK,V=XWV,Q = X W^Q,\quad K = X W^K,\quad V = X W^V,

with dh=d/hd_h = d / h0. In MHSA, dh=d/hd_h = d / h1, dh=d/hd_h = d / h2, dh=d/hd_h = d / h3 are partitioned along the feature axis:

dh=d/hd_h = d / h4

with analogous splits for dh=d/hd_h = d / h5 and dh=d/hd_h = d / h6. MOHSA instead defines, for overlap fraction dh=d/hd_h = d / h7:

dh=d/hd_h = d / h8

subject to boundary conventions (e.g., for dh=d/hd_h = d / h9, dd0). Each head thus aggregates its own and immediate neighbors’ representations.

The per-head attention is computed as:

dd1

and the output concatenation and projection:

dd2

where dd3 projects the result back to model dimension.

Alternatively, the overlap can be parametrized as concatenating portions dd4 and linearly projecting to dd5 for each head.

3. Overlap Schemes and Layerwise Scheduling

MOHSA enables various paradigms for controlling the overlap per layer. Let dd6 denote the number of overlap features at layer dd7, so dd8. The explored paradigms include:

  • Fixed 1: dd9 for all layers
  • Fixed Half: ii0 for all layers
  • inc-0(ii1): ii2, then increment by 1 every ii3 layers (0-indexed)
  • inc-1(ii4): ii5, then increment every ii6 layers (1-indexed)
  • dec-0(ii7)/dec-1(ii8): symmetric decrease schemes

For example, inc-0(2) across 12 ViT layers yields ii9. These variants allow for both fixed and depth-varying overlap to be studied, with empirical results showing that models with increasing or decreasing overlaps across depth can outperform those using constant overlap, especially in deeper architectures (Zhang et al., 2024).

4. Implementation Details and Computational Complexity

A MOHSA block proceeds as follows (condensed pseudocode):

QiQ'_i7

Relative to standard MHSA, the per-head compute grows as QiQ'_i0, where QiQ'_i1 is the average overlap. For typical overlaps QiQ'_i2, resulting in overheads of 5–15% for FLOPs and parameter count.

5. Empirical Evaluation

MOHSA was benchmarked on multiple Transformer backbones and datasets:

  • Models: ViT-Tiny, ViT-Small (12 heads, 12 layers), CaiT-xxs12/24 (4 heads, 12/24 layers plus class layers), Swin-Tiny (staged heads, 12 total layers)
  • Datasets: CIFAR-10, CIFAR-100, Tiny-ImageNet, ImageNet-1k
  • Training: 100 epochs + 20 warmup; AdamW optimizer; batch sizes: 128 (CIFAR/Tiny-INet), 512 (ImageNet); initial LR 5e-4 (ViT/CaiT), 2.5e-4 or 5e-4 (Swin-Tiny)

Top-1 accuracy was the principal evaluation metric, with parameter count and FLOPs also reported.

A summary of results:

Dataset Model Orig Acc (%) MOHSA Acc (%) ΔAcc Params Δ FLOPs Δ
CIFAR-10 ViT-Tiny 84.31 85.65 +1.34 +0.0M +0.0G
CIFAR-10 ViT-Small 86.53 87.30 +0.77 +0.6M +0.3G
CIFAR-10 CaiT-xxs12 77.04 80.04 +3.00 +0.0M +0.0G
CIFAR-100 ViT-Tiny 61.88 63.01 +1.13 +0.0M +0.0G
CIFAR-100 CaiT-xxs24 50.94 55.94 +5.00 +0.1M +0.1G
Tiny-INet ViT-Tiny 50.79 52.40 +1.61 +0.2M +0.1G
Tiny-INet CaiT-xxs24 42.46 49.87 +7.41 +0.4M +0.3G
ImageNet ViT-Tiny 69.25 70.31 +1.06 +0.5M +0.2G
ImageNet CaiT-xxs24 70.56 74.26 +3.70 +0.5M +0.3G

Absolute Top-1 gains of 0.2–7.4% were observed, with sub-10% increases in parameters and FLOPs (Zhang et al., 2024).

6. Model Behavior and Ablation Insights

Key insights from ablation studies:

  • Overlapping the value (QiQ'_i3) projections yields much of the benefit, but overlapping all (QiQ'_i4) is optimal.
  • Small fixed overlaps (QiQ'_i5 or QiQ'_i6) provide measurable gains, but schedules where the overlap dimension increases or decreases with layer depth (“inc”/“dec”) can further improve accuracy, especially in deeper models.
  • Deeper architectures (e.g., CaiT-xxs24) derive the greatest benefit, with performance boosts of 3–7% without additional model depth or head count. This suggests that head overlap facilitates better information mixing and gradient flow in deeper stacks.
  • Learning curves show that MOHSA models match the early-phase convergence of MHSA baselines but surpass them after several epochs, indicating improved learning stability and final capacity.

7. Applicability, Extensions, and Research Directions

MOHSA functions as a drop-in substitution for MHSA in any Transformer encoder, with immediate applicability to vision models. Several further lines of investigation are proposed:

  • End-to-end learnable overlaps, with per-head or per-layer coefficients
  • Non-local head interaction schemes, such as block-circulant or global mixing
  • Porting the approach to domains beyond vision, including language, speech, and graph Transformer models
  • Synergy with other head-interaction variants, such as re-attention or talking-heads architectures

The operational simplicity, minimal computational cost, and consistent performance improvement position MOHSA as a general mechanism for enhancing tokenwise and cross-head information propagation within attention-based architectures (Zhang et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Multi-overlapped MHSA (MOHSA).