Introduction
Large Language Models (LLMs) represent text as high-dimensional embeddings. While these vectors capture deep semantic and syntactic relationships, they are essentially "black boxes." Standard visualization techniques like t-SNE or UMAP project these points into 2D, but they often collapse important topological structures or lack semantic context—leaving researchers to manually inspect thousands of data points to guess what a specific cluster represents.
Mapper graphs, a tool from Topological Data Analysis (TDA), offer a better way to summarize these spaces by grouping embeddings into "topological neighborhoods" (nodes) and showing how they overlap (edges). However, interpreting a Mapper graph is still a labor-intensive manual process. The authors address the need for scalable, automated, and verifiable interpretation of these complex topological structures through the Explainable Mapper framework.
The Explainable Mapper Framework
The framework consists of a visual analytics workspace and two specialized types of "Mapper Agents" designed to bridge the gap between raw vectors and human-readable insights.
Mapper Taxonomy
To facilitate systematic exploration, the authors define a clear hierarchy of explorable elements:
- Nodes: Represent clusters of data points sharing similar topological properties.
- Edges: Represent overlaps between nodes, indicating transitions or shared data points.
- Paths: Sequences of connected nodes showing the evolution of features.
- Components: Larger, disconnected subgraphs representing abstract topics or broad categories.
- Trajectories: Step-by-step transitions between two specific points, often visualized as a "random walk" through the space.
Explanation and Verification Agents
The core of the system lies in its multi-agent architecture. Explanation Agents utilize LLMs (specifically GPT-4o) to perform three primary operations: summarization of node features, comparison between different elements, and perturbation analysis.
To combat the risk of LLM hallucinations, Verification Agents are employed. These agents verify generated explanations by creating "perturbed" versions of the input data—such as rephrasing a sentence while maintaining the target word's context—and checking if the new embeddings still fall into the same topological neighborhood. This ensures that the linguistic patterns identified by the explainer are robust and not merely artifacts of a specific phrasing.
Experimental Evaluation
The framework was evaluated using several key datasets and models, including BERT-base, STREUSLE v4.2 (for preposition supersense disambiguation), and the Groningen Meaning Bank (GMB).
The tool successfully replicated known "BERTology" findings, such as the transition from lexical focus in lower layers to syntactic properties in middle layers (3-6) and task-specific semantic roles in upper layers. It also highlighted regions of "topological confusion," where nodes contained mixed linguistic labels, indicating areas where the model's internal representations are less distinct.
Key Insights: The Diverge-Converge Loop
A central contribution of this work is the "diverge-and-converge" strategy for interpretation.
In this loop, Explanation agents diverge the interpretive space by generating many possible hypotheses about the linguistic nature of a node or edge. Verification agents then converge the space by filtering out explanations that are not robust to data perturbations. This process results in "consistency scores" (ranging from 0.0 to 1.0) that quantify the reliability of an insight. For example, in a study of possessive pronouns, the agents achieved a high consistency score of 0.83, indicating that the generated explanations were highly reliable.
Conclusion
Explainable Mapper transforms the manual, error-prone process of interpreting TDA graphs into a scalable, agentic workflow. By combining the structural rigor of Mapper with the linguistic capabilities of LLMs and a robust verification loop, the framework allows researchers to uncover nuanced model behaviors—such as how BERT distinguishes temporal prepositions based on their role as "start" or "limit" markers. Future work aims to automate the verification of complex trajectories and incorporate direct human-in-the-loop feedback to further refine interpretive accuracy.
Summary updated