Monday, October 26, 2026
Science
No Result
View All Result
  • Login
  • HOME
  • SCIENCE NEWS
  • CONTACT US
  • HOME
  • SCIENCE NEWS
  • CONTACT US
No Result
View All Result
Scienmag
No Result
View All Result
Home Science News Technology and Engineering

Attention pooling trims batch-one GPU memory by 62% in transformer hashing

October 26, 2026
in Technology and Engineering
Denise Maddox
By Denise Maddox Scienmag Editorial Profile - Mechanical Engineering
Reading Time: 5 mins read
0
Attention pooling trims batch-one GPU memory by 62% in transformer hashing

Attention pooling trims batch-one GPU memory by 62% in transformer hashing

65
SHARES
587
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

A learnable attention-pooling layer reduced batch-one GPU memory use by 62.0% compared with a matched Vision Transformer Hashing configuration on a single NVIDIA GeForce RTX 4090, while producing nearly identical retrieval accuracy in controlled experiments on the MS-COCO and NUS-WIDE image-retrieval benchmarks. The system reached 91.13% mean average precision at up to 5,000 retrieved images on MS-COCO and 88.63% on NUS-WIDE after hybrid re-ranking. Against the matched concatenation baseline, attention pooling reduced model footprint by 63.1%, increased throughput by 21.7% and changed the final accuracy by only 0.15 and 0.31 percentage points, favoring attention pooling on the two datasets. Because repeated-run uncertainty was unavailable, the researchers described the accuracy results as comparable rather than significantly better.

Content-based image retrieval aims to find visually or semantically related images without comparing every pair through a computationally expensive neural representation. Hash-based systems map images to compact binary codes, allowing a database to be searched through fast bit operations. Modern deep hashing models learn the image representation and the code jointly, but conventional heads can become large when they flatten or concatenate many feature vectors. Vision Transformer Hashing, or VTS, has particularly acute head overhead because a transformer produces a sequence of patch tokens in addition to a class token. The study tested whether a compact, image-adaptive aggregation operation could replace that concatenation while maintaining comparable retrieval effectiveness.

The researchers based their system on the supervised Central Similarity Quantization framework and a ViT-B/16 encoder initialized from a supervised ImageNet-21k checkpoint. The backbone had 12 transformer encoder layers, a hidden dimension of 768, 12 attention heads and 16-by-16-pixel patches. Instead of feeding the flattened patch sequence into the hash projection layer, the proposed module used multi-head cross-attention with a single learnable query. The query was projected into a 64-dimensional key space and compared with every patch token using scaled dot products. A softmax converted the scores into image-dependent weights, and the corresponding projected token values were combined into a pooled representation. Twelve attention heads learned complementary token relationships before their outputs were concatenated and projected back to the encoder’s 768-dimensional space. The class token was not included in this pooling operation.

The pooled representation passed through a two-layer head with 1,024 hidden units, ReLU activation and 0.5 dropout, producing the real-valued hash embedding used during training. At inference, element-wise sign thresholding converted that embedding into a binary code. The separately retained class token supplied a continuous descriptor. This division made the two retrieval stages complementary: the binary code determined a broad set of promising matches, while the class-token descriptor could refine the order of those candidates. Both representations came from the same fine-tuned ViT forward pass, so the hybrid method did not require a second feature-extraction network or a second transformer backbone.

For the first retrieval stage, the system computed Hamming distance between the query code and all database codes, then retained the 10,000 nearest candidates. In the second stage, it calculated cosine similarity between the query’s class-token descriptor and the descriptors of those candidates, sorting them in descending order. The procedure confines continuous similarity calculations to the shortlist rather than the full database. It also avoids the computational cost of a separate encoder, although it requires storage of dense descriptors in addition to compact binary codes and does not eliminate the cost of candidate re-ranking. The same mechanism operates for every database image: a binary code and a continuous descriptor are produced together, while a query goes through the model once before the two ranking stages.

Evaluation followed multi-label protocols on MS-COCO and NUS-WIDE. The MS-COCO experiment used 4,952 queries, 10,000 training images and a retrieval database of 107,266 images, with similarity defined by at least one shared category among 80 object classes. NUS-WIDE contained 269,648 images annotated with 81 concept tags; the researchers selected the 21 most frequent categories, using 2,100 queries, 10,500 training images and 183,234 database images, for 195,834 images in total. Query, training and database partitions were mutually exclusive, and no training image was included in the retrieval database. Accuracy was measured as mean average precision with up to 5,000 results, and the principal controlled comparisons used 16-bit codes.

Attention pooling was among the best-performing controlled variants. In hash-only retrieval, it achieved 85.60% mAP@5000 on NUS-WIDE and 81.99% on MS-COCO, trailing matched VTS-style concatenation by 0.03 and 0.12 percentage points. On MS-COCO, it was 6.04 points above average pooling and 5.80 points above class-token pooling. After continuous re-ranking, attention produced 88.63% on NUS-WIDE and 91.13% on MS-COCO, compared with controlled concatenation at 88.32% and 90.98%. The experiments did not directly test whether the learned attention weights identified semantically meaningful image regions. Instead, the small margins relative to concatenation, combined with the absence of repeated-run uncertainty, support a conclusion of comparable retrieval performance rather than a demonstrated accuracy improvement.

A factorial ablation showed that most of the final accuracy improvement came from the second retrieval stage rather than from the new pooling operation. Adding class-token re-ranking raised the controlled concatenation model by 2.69 points on NUS-WIDE and 8.87 points on MS-COCO. The corresponding increases for attention pooling were 3.03 and 9.14 points. Every tested pooling strategy benefited from re-ranking. These within-model gains support the measured value of refining a Hamming-space shortlist with continuous features already generated by the hashing model, but they do not show that attention pooling itself caused the final hybrid scores. Changes in pooling also change the Stage-1 candidate set and the learned class-token descriptor, so hybrid differences can reflect both stages.

The resource measurements showed a clearer separation between the two designs. Attention pooling reduced the reported model footprint from 918 MiB to 339 MiB and batch-one GPU memory from 0.92 GiB to 0.35 GiB. Throughput rose from 304 to 370 images per second, while batch-512 memory use declined from 5.28 to 4.72 GiB. These figures describe the hashing model and the specified RTX 4090 setup; they do not include database storage or candidate re-ranking time. Longer codes improved accuracy for both methods: moving from 16 to 32 bits increased attention pooling’s mAP by 1.73 points on NUS-WIDE and 6.91 points on MS-COCO, with 32-bit attention also exceeding the corresponding concatenation results by 0.30 and 0.55 points. The gains come with doubled binary-code storage, and the study did not report whether longer codes changed latency, arithmetic operations or GPU memory.

Several qualifications constrain the findings. The efficiency results came from a single RTX 4090, while database storage, candidate re-ranking time, training time, arithmetic cost and repeated-run variability were not reported. The researchers selected checkpoints using the same query set used for final reporting because no separate validation split was available, which may make the reported accuracy optimistic. Hybrid retrieval also stores high-dimensional class-token descriptors alongside binary codes, potentially offsetting some database-storage savings. Within those limits, the study presents a practical architecture: attention pooling makes the Stage-1 transformer hashing model substantially lighter, while cosine re-ranking supplies the largest observed accuracy gains. The result is a compact binary search followed by higher-resolution ranking, not evidence that learned attention weights capture particular semantic regions or transfer to object localization and other dense-perception tasks.

Subject of Research: Efficient Vision Transformer hashing using attention pooling and dense re-ranking for large-scale image retrieval

Article Title: Attention-enhanced vision transformer hashing for hybrid image retrieval

Article References: Nguyen, U., Le Ba, H., & Dao Thi Thuy, Q. (2026). Attention-enhanced vision transformer hashing for hybrid image retrieval. Discover Artificial Intelligence, 6(1), Article 1164. https://doi.org/10.1007/s44163-026-02163-6

Image Credits: AI Generated

DOI: 10.1007/s44163-026-02163-6

Keywords: Vision Transformer hashing, Attention pooling, Image retrieval, Deep hashing, Binary codes, Dense re-ranking, MS-COCO, NUS-WIDE, GPU memory, Inference efficiency, Attention-enhanced, vision

Cite Scienmag News

Denise Maddox. (October 26, 2026). Attention pooling trims batch-one GPU memory by 62% in transformer hashing. Scienmag. https://scienmag.com/attention-pooling-trims-batch-one-gpu-memory-by-62-in-transformer-hashing/

Denise Maddox. "Attention pooling trims batch-one GPU memory by 62% in transformer hashing." Scienmag, 26 October 2026, https://scienmag.com/attention-pooling-trims-batch-one-gpu-memory-by-62-in-transformer-hashing/. Accessed 26 October 2026.

Denise Maddox. "Attention pooling trims batch-one GPU memory by 62% in transformer hashing." Scienmag. October 26, 2026. https://scienmag.com/attention-pooling-trims-batch-one-gpu-memory-by-62-in-transformer-hashing/

Tags: attention poolingAttention-enhancedbatch-one GPU memory savingsbinary code-based image searchbinary codesdeep hashingdeep hashing model size reductionDense re-rankingGPU memoryGPU memory optimization in transformer hashinghybrid re-ranking in image retrievalimage retrievalimage retrieval accuracy benchmarksinference efficiencyMS-COCOMS-COCO and NUS-WIDE benchmark resultsneural network memory and computational efficiencyNUS-WIDEthroughput improvement in image retrieval systemstransformer model footprint reductionvisionVision Transformer hashingvision transformer hashing efficiency
Share26Tweet16
Previous Post

Captive Rüppell’s vultures display extensive, graded vocal repertoires

Next Post

American College of Lifestyle Medicine welcomes national resolution advancing nature as a foundation for health and well-being

Related Posts

Causal AI improves cross-domain dance scoring in 125-dancer study
Technology and Engineering

Causal AI improves cross-domain dance scoring in 125-dancer study

October 26, 2026
Chicago taxi-demand model reports higher spatial equity with modest accuracy cost
Technology and Engineering

Chicago taxi-demand model reports higher spatial equity with modest accuracy cost

October 26, 2026
GenAI in Islamic Education Needs Human Mediation and Source Verification
Technology and Engineering

GenAI in Islamic Education Needs Human Mediation and Source Verification

October 26, 2026
Conceptual essay maps risks of simulating living ex-partners with generative AI
Technology and Engineering

Conceptual essay maps risks of simulating living ex-partners with generative AI

October 26, 2026
Physiology-driven system adapts immersive exhibition spaces in real time
Technology and Engineering

Physiology-driven system adapts immersive exhibition spaces in real time

October 26, 2026
AI framework predicts music skills and adapts training recommendations
Technology and Engineering

AI framework predicts music skills and adapts training recommendations

October 26, 2026
Next Post
American College of Lifestyle Medicine welcomes national resolution advancing nature as a foundation for health and well-being

American College of Lifestyle Medicine welcomes national resolution advancing nature as a foundation for health and well-being

  • Mothers who receive childcare support from maternal grandparents show more optimized

    Mothers who receive childcare support from maternal grandparents show more parental warmth, finds NTU Singapore study

    27656 shares
    Share 11059 Tweet 6912
  • University of Seville Breaks 120-Year-Old Mystery, Revises a Key Einstein Concept

    1061 shares
    Share 424 Tweet 265
  • Bee body mass, pathogens and local climate influence heat tolerance

    682 shares
    Share 273 Tweet 171
  • Researchers record first-ever images and data of a shark experiencing a boat strike

    546 shares
    Share 218 Tweet 137
  • Groundbreaking Clinical Trial Reveals Lubiprostone Enhances Kidney Function

    531 shares
    Share 212 Tweet 133
Science

Embark on a thrilling journey of discovery with Scienmag.com—your ultimate source for cutting-edge breakthroughs. Immerse yourself in a world where curiosity knows no limits and tomorrow’s possibilities become today’s reality!

RECENT NEWS

  • NIH-funded study probes PFAS and pre-diagnostic changes in IBD
  • Causal AI improves cross-domain dance scoring in 125-dancer study
  • Tumor vessel patterns linked to survival in colorectal cancer
  • Shanghai’s primary hospitals supplied most diabetes medicines as costs fell

Categories

  • Agriculture
  • Anthropology
  • Archaeology
  • Athmospheric
  • Biology
  • Biotechnology
  • Blog
  • Bussines
  • Cancer
  • Chemistry
  • Climate
  • Earth Science
  • Editorial Policy
  • Marine
  • Mathematics
  • Medicine
  • Pediatry
  • Policy
  • Psychology & Psychiatry
  • Science Education
  • Science News
  • Social Science
  • Space
  • Technology and Engineering

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,151 other subscribers

© 2025 Scienmag - Science Magazine

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • HOME
  • SCIENCE NEWS
  • CONTACT US

© 2025 Scienmag - Science Magazine

Discover more from Science

Subscribe now to keep reading and get access to the full archive.

Continue reading