Papers › HydraViT: Stacking Heads for a Scalable ViT

HydraViT: Stacking Heads for a Scalable ViT

26 Sep 2024arXiv:2409.17978archive 2025-07-28

Janek Haberer, Ali Hojjat, Olaf Landsiedel

The architecture of Vision Transformers (ViTs), particularly the Multi-head Attention (MHA) mechanism, imposes substantial hardware demands. Deploying ViTs on devices with varying constraints, such as mobile phones, requires multiple models of different sizes. However, this approach has limitations, such as training and storing each required model separately. This paper introduces HydraViT, a novel approach that addresses these limitations by stacking attention heads to achieve a scalable ViT. By repeatedly changing the size of the embedded dimensions throughout each layer and their corresponding number of attention heads in MHA during training, HydraViT induces multiple subnetworks. Thereby, HydraViT achieves adaptability across a wide spectrum of hardware environments while maintaining performance. Our experimental results demonstrate the efficacy of HydraViT in achieving a scalable ViT with up to 10 subnetworks, covering a wide range of resource constraints. HydraViT achieves up to 5 p.p. more accuracy with the same GMACs and up to 7 p.p. more accuracy with the same throughput on ImageNet-1K compared to the baselines, making it an effective solution for scenarios where hardware availability is diverse or varies over time. Source code available at https://github.com/ds-kiel/HydraViT.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2409.17978")

Code

Syntology Ran 14 of 16 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 14 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 14 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ds-kiel/hydravit officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 14 ran; 0 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

14ran
2unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ds-kiel/HydraViT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

adaptive_avgmax_pool2d ds-kiel/HydraViT/timm/layers/adaptive_avgmax_pool.py official repository ran fingerprinted MIT (permissive) · 39934307038ef5a9 · report
adaptive_catavgmax_pool2d ds-kiel/HydraViT/timm/layers/adaptive_avgmax_pool.py official repository ran fingerprinted MIT (permissive) · fa9e3a5ceeac7703 · report
adaptive_pool_feat_mult ds-kiel/HydraViT/timm/layers/adaptive_avgmax_pool.py official repository ran fingerprinted MIT (permissive) · 13295c0de28cc1f1 · report
checkpoint_filter_fn ds-kiel/HydraViT/timm/models/hydravit.py official repository ran MIT (permissive) · a0b1f77ef449514b · report
get_init_weights_vit ds-kiel/HydraViT/timm/models/hydravit.py official repository ran MIT (permissive) · 0bbab6441363adb9 · report
hard_sigmoid_jit ds-kiel/HydraViT/timm/layers/activations_jit.py official repository ran MIT (permissive) · 91c27523dde7eb4a · report
mish ds-kiel/HydraViT/timm/layers/activations.py official repository ran fingerprinted MIT (permissive) · 801c85b8903bfff5 · report
mish_jit ds-kiel/HydraViT/timm/layers/activations_jit.py official repository ran MIT (permissive) · 14eddd8cc4c65fe0 · report
sigmoid ds-kiel/HydraViT/timm/layers/activations.py official repository ran fingerprinted MIT (permissive) · d83b6ecf3cdc1d6a · report
swish ds-kiel/HydraViT/timm/layers/activations.py official repository ran fingerprinted MIT (permissive) · 717e4d22b6d103e6 · report
swish_bwd ds-kiel/HydraViT/timm/layers/activations_me.py official repository ran fingerprinted MIT (permissive) · 664ed3a2c3b8ab90 · report
swish_fwd ds-kiel/HydraViT/timm/layers/activations_me.py official repository ran fingerprinted MIT (permissive) · 55d18267472fb7c9 · report
swish_jit ds-kiel/HydraViT/timm/layers/activations_jit.py official repository ran MIT (permissive) · 8e341f8585b3fe94 · report
swish_me ds-kiel/HydraViT/timm/layers/activations_me.py official repository ran fingerprinted MIT (permissive) · 7d1389c0f75235c7 · report
resize_pos_embed ds-kiel/HydraViT/timm/models/hydravit.py official repository unverified MIT (permissive) · ed04551ca8295bde · report
validate ds-kiel/HydraViT/validate.py official repository unverified MIT (permissive) · e826d2b8a200b367 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionLinear LayerMulti-Head AttentionSoftmax

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