Exploring Narrative Clustering in Large Language Models: A Layerwise Analysis of BERT

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Banerjee, Awritrojit, Schilling, Achim, Krauss, Patrick
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916566240591872
author Banerjee, Awritrojit
Schilling, Achim
Krauss, Patrick
author_facet Banerjee, Awritrojit
Schilling, Achim
Krauss, Patrick
contents This study investigates the internal mechanisms of BERT, a transformer-based large language model, with a focus on its ability to cluster narrative content and authorial style across its layers. Using a dataset of narratives developed via GPT-4, featuring diverse semantic content and stylistic variations, we analyze BERT's layerwise activations to uncover patterns of localized neural processing. Through dimensionality reduction techniques such as Principal Component Analysis (PCA) and Multidimensional Scaling (MDS), we reveal that BERT exhibits strong clustering based on narrative content in its later layers, with progressively compact and distinct clusters. While strong stylistic clustering might occur when narratives are rephrased into different text types (e.g., fables, sci-fi, kids' stories), minimal clustering is observed for authorial style specific to individual writers. These findings highlight BERT's prioritization of semantic content over stylistic features, offering insights into its representational capabilities and processing hierarchy. This study contributes to understanding how transformer models like BERT encode linguistic information, paving the way for future interdisciplinary research in artificial intelligence and cognitive neuroscience.
format Preprint
id arxiv_https___arxiv_org_abs_2501_08053
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Exploring Narrative Clustering in Large Language Models: A Layerwise Analysis of BERT
Banerjee, Awritrojit
Schilling, Achim
Krauss, Patrick
Computation and Language
Artificial Intelligence
This study investigates the internal mechanisms of BERT, a transformer-based large language model, with a focus on its ability to cluster narrative content and authorial style across its layers. Using a dataset of narratives developed via GPT-4, featuring diverse semantic content and stylistic variations, we analyze BERT's layerwise activations to uncover patterns of localized neural processing. Through dimensionality reduction techniques such as Principal Component Analysis (PCA) and Multidimensional Scaling (MDS), we reveal that BERT exhibits strong clustering based on narrative content in its later layers, with progressively compact and distinct clusters. While strong stylistic clustering might occur when narratives are rephrased into different text types (e.g., fables, sci-fi, kids' stories), minimal clustering is observed for authorial style specific to individual writers. These findings highlight BERT's prioritization of semantic content over stylistic features, offering insights into its representational capabilities and processing hierarchy. This study contributes to understanding how transformer models like BERT encode linguistic information, paving the way for future interdisciplinary research in artificial intelligence and cognitive neuroscience.
title Exploring Narrative Clustering in Large Language Models: A Layerwise Analysis of BERT
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2501.08053