Manuscript Offprint

arXiv:2609.00831

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

Kewei Li, Rongying Zhang, Xueli Wang, Xiwen Gong, Zhongjian Wang, Qiuchen Zhao, Lan Huang, Ruochi Zhang, Fengfeng Zhou

Correspondence may be addressed to Drs. Ruochi Zhang (zrc720@gmail.com), and Fengfeng Zhou (FengfengZhou@gmail.com or ffzhou@jlu.edu.cn).

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. 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. Physicochemical probing further shows that the normalized DC representation preserves substantial global peptide information, while its association with antimicrobial activity differs between bacterial species. 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.

Keywords: Frequency-domain token aggregation; latent-attention; spectral gating; representation learning; antimicrobial peptide activity prediction.

References (51)

  • AMP-BERT: Prediction of antimicrobial peptide function based on a BERT model
  • Aggregating residue-level protein language model embeddings with optimal transport
  • Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences
  • An image is worth 16x16 words: Transformers for image recognition at scale
  • Bert: Pre-training of deep bidirectional transformers for language understanding
  • Set transformer: A framework for attention-based permutation-invariant neural networks
  • Sentence-bert: Sentence embeddings using siamese bert-networks
  • A structured self-attentive sentence embedding
  • Better plain vit baselines for imagenet-1k (opens arXiv in a new tab)
  • Token pooling in vision transformers for image classification
  • Evolutionary-scale prediction of atomic-level protein structure with a language model
  • Machine learning for antimicrobial peptide identification and design
  • Deep residual learning for image recognition
  • RoBERTa: A Robustly Optimized BERT Pretraining Approach
  • Nv-embed: Improved techniques for training llms as generalist embedding models
  • Pooling and attention: What are effective designs for llm-based embedding models? (opens arXiv in a new tab)
  • Perceiver io: A general architecture for structured inputs & outputs
  • Perceiver: General perception with iterative attention
  • Universal pooling—a new pooling method for convolutional neural networks
  • Fnet: Mixing tokens with fourier transforms
  • On the spectral bias of neural networks
  • Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting
  • Language through a prism: A spectral approach for multiscale language representations
  • GFNet: Global filter networks for visual recognition
  • EvoPool: Evolution-Guided Pooling of Protein Language Model Embeddings
  • Squeeze-and-excitation networks
  • AMPCliff: Quantitative definition and benchmarking of activity cliffs in antimicrobial peptides (opens the publisher in a new tab)
  • Learning multiple layers of features from tiny images
  • Mteb: Massive text embedding benchmark
  • Pool PaRTI: a PageRank-based pooling method for identifying critical residues and enhancing protein sequence representations
  • Improving language understanding by generative pre-training
  • Attention-based deep multiple instance learning
  • Active learning enhances classification of histopathology whole slide images with attention-based multiple instance learning
  • Attention is not explanation
  • BERT rediscovers the classical NLP pipeline
  • Tree cross attention
  • Semi-supervised classification with graph convolutional networks
  • Enzyme activity prediction of sequence variants on novel substrates using improved substrate encodings and convolutional pooling
  • Attention is all you need
  • Layer Normalization
  • On layer normalization in the transformer architecture
  • Understanding and improving layer normalization
  • Text embeddings by weakly-supervised contrastive pre-training (opens arXiv in a new tab)
  • jina-embeddings-v3: Multilingual embeddings with task lora (opens arXiv in a new tab)
  • One embedder, any task: Instruction-finetuned text embeddings
  • Supervised learning of universal sentence representations from natural language inference data
  • MEXMA: Token-level objectives improve sentence representations
  • Ditto: A simple and efficient approach to improve sentence embeddings
  • Which layer is learning faster? a systematic exploration of layer-wise convergence rate for deep neural networks
  • Utilizing image transforms and diffusion models for generative modeling of short and long time series
  • Frequency adaptive normalization for non-stationary time series forecasting