Pool Me Wisely: On the Effect of Pooling in Transformer-Based Models

Sofiane Ennadir, Levente Zólyomi, Oleg Smirnov, Tian-Ze Wang, J. Pertoft +2 more
10/1/2025
transformer-attention

No confident code implementation found for this paper.

Abstract

Transformer models have become the dominant backbone for sequence modeling, leveraging self-attention to produce contextualized token representations. These are typically aggregated into fixed-size vectors via pooling operations for downstream tasks.

Show full abstract

While much of the literature has focused on attention mechanisms, the role of pooling remains underexplored despite its critical impact on model behavior. In this paper, we introduce a theoretical framework that rigorously characterizes the expressivity of Transformer-based models equipped with widely used pooling methods by deriving closed-form bounds on their representational capacity and the ability to distinguish similar inputs. Our analysis extends to different variations of attention formulations, demonstrating that these bounds hold across diverse architectural variants. We empirically evaluate pooling strategies across tasks requiring both global and local contextual understanding, spanning three major modalities: computer vision, natural language processing, and time-series analysis. Results reveal consistent trends in how pooling choices affect accuracy, sensitivity, and optimization behavior. Our findings unify theoretical and empirical perspectives, providing practical guidance for selecting or designing pooling mechanisms suited to specific tasks. This work positions pooling as a key architectural component in Transformer models and lays the foundation for more principled model design beyond attention alone.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ennadir2025pool,
  title  = {Pool Me Wisely: On the Effect of Pooling in Transformer-Based Models},
  author = {Sofiane Ennadir and Levente Zólyomi and Oleg Smirnov and Tian-Ze Wang and J. Pertoft and Filip Cornell and Le-Le Cao},
  year   = {2025},
  eprint = {2510.03339},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2510.03339},
  url    = {https://doi.org/10.48550/arXiv.2510.03339},
  journal = {Neural Information Processing Systems}
}

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/2510.03339.svg)](https://codeofpaper.com/paper/2510.03339)

Discussion