FLaG: Frequency-Domain Latent-attention Gated Pooling for Token Aggregation

Kewei Li, Rongying Zhang, Xueli Wang, Xiwen Gong, Zhongjian Wang +4 more
9/1/2026
cs.AIq-bio.BM

Official code: Kewei2023/AMPCliff (7 stars, Python, last commit 2026-08-28).

Abstract

Token aggregation converts token-level representations into fixed-dimensional sample representations, but most pooling methods operate only in the original token space. We introduce Frequency-Domain Latent-attention Gated Pooling (FLaG), a plug-in aggregation module that re-expresses encoder outputs in the Fourier domain before final pooling.

Show full abstract

FLaG represents the nonredundant rFFT spectrum through concatenated real and imaginary components, summarizes spectral tokens with learnable latent queries, derives a sample-conditioned channel gate, and reconstructs modulated token representations for downstream aggregation. We evaluate the same architecture across ESM2-based antimicrobial peptide (AMP) activity prediction, ResNet18 image classification on CIFAR-10 and CIFAR-100, and three RoBERTa-based language tasks. FLaG achieves the best macro-averaged Spearman correlation coefficient, RMSE, and Recall@50 across four AMP backbone-species settings and the highest top-1 accuracy on CIFAR 10. It also achieves the best mean results on five of seven language metrics, although mean pooling remains strongest on STSBenchmark. AMP-side mechanistic analyses reveal low-frequency prediction sensitivity across most encoder layers, with increased relative high-frequency sensitivity in the final layer, and pronounced peptide-specific positional responses. The residual gate broadly amplifies spectral channels while preserving the low-frequency-dominated energy profile, whereas latent cross-attention exhibits sample- and species-specific spectral allocation. Overall, FLaG provides a transferable frequency-domain aggregation bias across protein, visual, and textual representations, with benefits that depend on the backbone and downstream task. Supplementary materials, source code, and data are available at https://www.healthinformaticslab.org/supp/ and https://github.com/Kewei2023/AMPCliff/tree/FLaG.

View on arXivView PDF

Code Implementations(1)

Kewei2023/AMPCliffOfficial100%
71Python, ShellMar 10, 20243 months ago

Similar Papers

Cite this paper

@article{li2026flag,
  title  = {FLaG: Frequency-Domain Latent-attention Gated Pooling for Token Aggregation},
  author = {Kewei Li and Rongying Zhang and Xueli Wang and Xiwen Gong and Zhongjian Wang and Qiuchen Zhao and Lan Huang and Ruochi Zhang and Fengfeng Zhou},
  year   = {2026},
  eprint = {2609.00831},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.00831v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.00831.svg)](https://codeofpaper.com/paper/2609.00831)

Discussion