Interpreting Transformer-Based Classifiers via Clustering

Transformer-based models, especially BERT-like architectures, have become the standard for solving Natural Language Processing (NLP) tasks: text classification, summarisation, question answering. Their high performance is undoubted, however, the key challenge remains interpretability. Understanding the reasons for the decisions of models is critical for increasing confidence in them, detecting bias, and complying with ethical and legal standards. Existing explanation methods focus on identifying individual important tokens or interactions only between adjacent tokens or their pairs, ignoring the global context. This limits their usefulness because such explanations often do not capture the logic of decision making at a level that humans can understand. To bridge this gap, we introduce an approach that translates model predictions into natural language explanations. This algorithm is fitted through clustering of transformer layers, cluster labels are extracted and indices are formed to select close examples. Given examples are fed into the Large Language Models (LLM) to identify key common features in natural language. Frequency analysis of the features in the examples forms the basis of evidence with certain probability. In the case study of detecting machine-generated texts, our approach reveals how classifiers might rely on stylistic cues or structural anomalies.

Authors

Institutions

Publication Details

Journal
Doklady Mathematics
Published
2025-10-01
DOI
https://doi.org/10.1134/s1064562425700401
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Interpreting Transformer-Based Classifiers via Clustering

G. M. Gritsai, A. V. Grabovoy
Doklady Mathematics
Topic Modeling
article

Interpreting Transformer-Based Classifiers via Clustering

G. M. Gritsai, A. V. Grabovoy
article en

Abstract

Transformer-based models, especially BERT-like architectures, have become the standard for solving Natural Language Processing (NLP) tasks: text classification, summarisation, question answering. Their high performance is undoubted, however, the key challenge remains interpretability. Understanding the reasons for the decisions of models is critical for increasing confidence in them, detecting bias, and complying with ethical and legal standards. Existing explanation methods focus on identifying individual important tokens or interactions only between adjacent tokens or their pairs, ignoring the global context. This limits their usefulness because such explanations often do not capture the logic of decision making at a level that humans can understand. To bridge this gap, we introduce an approach that translates model predictions into natural language explanations. This algorithm is fitted through clustering of transformer layers, cluster labels are extracted and indices are formed to select close examples. Given examples are fed into the Large Language Models (LLM) to identify key common features in natural language. Frequency analysis of the features in the examples forms the basis of evidence with certain probability. In the case study of detecting machine-generated texts, our approach reveals how classifiers might rely on stylistic cues or structural anomalies.

Doklady MathematicsVol. 112(2)
Moscow Institute of Physics and Technology (RU), Moscow Power Engineering Institute (RU), Institute of Physics and Technology (RU), Moscow Aviation Institute (RU)
Peace, Justice and strong institutions
Openalex Percentile: Top 12%
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.