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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Behrendt, Maike, Wagner, Stefan Sylvius, Harmeling, Stefan
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917010298896384
author Behrendt, Maike
Wagner, Stefan Sylvius
Harmeling, Stefan
author_facet Behrendt, Maike
Wagner, Stefan Sylvius
Harmeling, Stefan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2505_15696
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregation
Behrendt, Maike
Wagner, Stefan Sylvius
Harmeling, Stefan
Computation and Language
Machine Learning
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.
title MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregation
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2505.15696