LayerFlow : Layer-wise Exploration of LLM Embeddings using Uncertainty-aware Interlinked Projections

Rita Sevastjanova 1 , Robin Gerling 2 , Thilo Spinner 1 and Mennatallah El-Assady 1 1 ETH Zurich, Switzerland 2 University of Konstanz, Germany · 2025

Read LayerFlow : Layer-wise Exploration of LLM Embeddings using Uncertainty-aware Interlinked Projections by Rita Sevastjanova 1 , Robin Gerling 2 , Thilo Spinner 1 and Mennatallah El-Assady 1 1 ETH Zurich, Switzerland 2 University of Konstanz, Germany (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-10504.txt.

Introduction

Inside a language model, each word becomes a list of numbers that shifts layer by layer, and researchers want to see what those shifts mean. Rita Sevastjanova and three co-authors present a workspace in 2025, LayerFlow, that flattens the numbers into scatter plots linked across layers. Flattening warps distances, so the tool shows its own doubt as part of the display.

Hull shapes, distance readouts, cluster notes, and quality scores all warn where the flat view may mislead. Expert users replayed known studies inside the workspace to test it. The authors argue that honest pictures of embeddings must carry their uncertainty openly. The tool targets researchers who probe what models have learned.

Catalog record

CREATORRita Sevastjanova 1 , Robin Gerling 2 , Thilo Spinner 1 and Mennatallah El-Assady 1 1 ETH Zurich, Switzerland 2 University of Konstanz, Germany
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE52 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2504-10504

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

LayerFlow : Layer-wise Exploration of LLM Embeddings using Uncertainty-aware Interlinked Projections Rita Sevastjanova 1 , Robin Gerling 2 , Thilo Spinner 1 and Mennatallah El-Assady 1 1 ETH Zurich, Switzerland 2 University of Konstanz, Germany Abstract Large language models (LLMs) represent words through contextual word embeddings encoding different language properties like semantics and syntax. Understanding these properties is crucial, especially for researchers investigating language model capabilities, employing embeddings for tasks related to text similarity, or evaluating the reasons behind token importance as measured through attribution methods. Applications for embedding exploration frequently involve dimensionality reduction techniques, which reduce high-dimensional vectors to two dimensions used as coordinates in a scatterplot. This data transformation step introduces uncertainty that can be propagated to the visual representation and influence users’ interpretation of the data. To communicate such uncertainties, we present LayerFlow – a visual analytics workspace that displays embeddings in an interlinked projection design and communicates the transformation, representation, and interpretation uncertainty. In particular, to hint at potential data distortions and uncertainties, the workspace includes several visual components, such as convex hulls showing 2D and HD clusters, data point pairwise distances, cluster summaries, and projection quality metrics. We show the usability of the presented workspace through replication and expert case studies that highlight the need to communicate uncertainty through multiple visual components and different data perspectives. \SpecialIssuePaper \CGFccby Volume: 44 Issue: 3 ccs Human-centered computing Visual analytics ccs Mathematics of computing Dimensionality reduction † † year: 2025 † † year: 2025 † † editors: W. Aigner, N. Andrienko, and B. Wang † † subject: Eurographics Conference on Visualization CGF Vol No † † teaser: LayerFlow supports the analysis of contextual word embedding properties. To increase the awareness of the potential uncertainty within the transformation, representation, and interpretation steps of the used processing pipeline, we utilize multiple visual components such as cluster convex-hulls, pairwise distances, cluster summaries, projection quality metrics, and connections of k-nearest neighbors. 1 Introduction In recent years, a large number of deep-learning-based language models (e.g., BERT [ DCLT19 ] ) have emerged, demonstrating remarkable performance in natural language processing (NLP) and understanding tasks. These models learn from large text datasets, acquiring language structures in an unsupervised manner. Thereby, they produce contextual word embeddings, representing words through vectors encoding different language properties. Extensive research has been conducted to understand the linguistic properties embedded in these vectors. For instance, research indicates that BERT’s middle layers capture syntactic features like dependency trees while early layers encode lexical features [ RKR20 ] . Analyzing these properties helps researchers better understand how language models process data and aids in developing models that generalize well, reducing biases and improving inclusivity. A key focus in embedding analysis is visually exploring similarities to identify patterns in embedding clusters. The development of such visualizations has been an active field of study since the introduction of early static word embeddings like word2vec [ MSC*13 ] and Glove [ PSM14 ] . Early visual methods focused on analogies [ LBT*17 ] and local word neighborhoods [ HG18 ] and have since evolved to address properties of contextual language models including approaches that allow to inspect embedding neighborhoods [ BCS22 ] , compare embeddings of multiple corpora [ SWP22 ] , models [ SCR*22 , BCS22 ] , or model’s layers [ SKB*21 , SKB*22 ] . The current methods for embedding exploration often utilize dimensionality reduction techniques to reduce the high-dimensional (HD) vectors to two dimensions (2D) that are then used as coordinates to display words in a scatterplot. Dimensionality reduction methods often exhibit well-known limitations. For instance, linear methods, like PCA [ JC16 ] , are limited in detecting non-linear properties and can cause data points that are distant from each other in the HD space to appear close in the reduced space, potentially leading to a failure in preserving neighborhood relationships [ MHHS18 ] . Other methods, such as UMAP [ MHSG18 ] , focus on preserving local neighborhoods but may fail to represent the distances between data points. Consequently, the resulting representations may not fully capture all true relationships and similarities within the HD data, introducing distortion. As emphasized by Nonato et al. [ NA19 ] , possibility of distortions between original and visual neighborhoods introduces uncertainties that impact the human analytic process. Haghighatkhah et al. [ HEF*22 ] in their work on text analysis separate this uncertainty into three types, i.e., transformation , representation , and interpretation uncertainty. They show that due to transformation steps like dimensionality reduction, the visual representation might not be faithful to the underlying data, thus also influencing uncertainty in the analyst’s interpretation of the visualized word neighborhoods [ HEF*22 ] . Communication of potential uncertainties in the low-dimensional space is thus crucial for many use-cases involving dimensionality reduction, including word embedding analysis. According to Hullman et al. [ HQC*19 ] , accounting for uncertainty is critical to effectively reasoning about visualized data. Various ways of visualizing such uncertainties have been explored in prior work [ PKH14 , JED*20 , FWM*18 ] , whereby much focus has been put into communicating the uncertainty in projection visualizations (see, e.g., [ JED*20 , NA19 , Aup07 ] ). In this paper, we aim to communicate the uncertainty in the embedding exploration process, addressing the uncertainty introduced by transformation, representation, and interpretation steps [ HEF*22 ] . Building upon our prior work that introduces an interlinked projection approach for embedding investigation [ SKB*21 ] , we present LayerFlow , an embedding exploration workspace that combines multiple visual components for uncertainty communication. In this work, we support the combination of 2D and HD clusters, pairwise distance representations, and cluster summaries, as well as incorporate a set of projection quality metrics and representations of k-nearest neighborhoods to increase the user awareness of potential projection distortions. To summarize, we present (1) LayerFlow , a novel workspace for embedding exploration utilizing multiple visual components for communication of data transformation, representation, and interpretation uncertainty; (2) evaluation through case studies and expert interviews, along with a replication of findings from previous research on the linguistic properties encoded in embeddings. 2 Related Work In the following, we describe the prior work related to embedding visualization and projection uncertainty. 2.1 Word Embedding Visualizations Since the development of the first static word embedding models (e.g., word2vec [ MSC*13 ] and Glove [ PSM14 ] ), visualization methods have been developed to support the analysis of embedding properties. The first tools facilitated analogies [ LBT*17 ] and the analysis of word local neighborhoods [ HG18 ] . The development of contextual language models introduced new aspects that were incorporated into visualizations, e.g., the properties of the word contexts. Berger [ Ber20 ] explored correlations between embedding clusters in BERT [ DCLT19 ] . EmbComb [ HKMG20 ] employs diverse metrics to measure variations in the local structure around embedding objects, such as tokens. Embedding Comparator [ BCS22 ] enables comparing embeddings through small multiples, while calculating and visualizing similarity scores based on shared nearest neighbors in their local neighborhoods. Emblaze [ SWP22 ] utilizes an animated scatterplot and incorporates visual augmentations to represent changes in the analyzed embedding spaces. Our prior work, LMFingerprints [ SKB*22 ] , applies scoring

Read the complete text