MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregation

Maike Behrendt, Stefan Sylvius Wagner, Stefan Harmeling
5/21/2025
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

The [CLS] token in BERT is commonly used as a fixed-length representation for classification tasks, yet prior work has shown that both other tokens and intermediate layers encode valuable contextual information. In this work, we study lightweight extensions to BERT that refine the [CLS] representation by aggregating information across layers and tokens. Specifically, we explore three modifications: (i) max-pooling the [CLS] token across multiple layers, (ii) enabling the [CLS] token to attend over the entire final layer using an additional multi-head attention (MHA) layer, and (iii) combining max-pooling across the full sequence with MHA. Our approach, called MaxPoolBERT, enhances BERT's classification accuracy (especially on low-resource tasks) without requiring new pre-training or significantly increasing model size. Experiments on the GLUE benchmark show that MaxPoolBERT consistently achieves a better performance than the standard BERT base model on low resource tasks of the GLUE benchmark.

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!

Cite this paper

@article{behrendt2025maxpoolbert,
  title  = {MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregation},
  author = {Maike Behrendt and Stefan Sylvius Wagner and Stefan Harmeling},
  year   = {2025},
  eprint = {2505.15696},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.15696v2}
}

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

Discussion