Abstract
Recent advancements in speech processing have been driven by large-scale pretrained Transformer models like HuBERT. However, standard methods for downstream task adaptation often rely on simplistic pooling of hidden states, potentially discarding rich structural information. This paper explores the application of Topological Data Analysis (TDA) to extract geometric signatures from neural network attention maps and embeddings. By leveraging $H_0$ persistent homology and Representation Topology Divergence (RTD), we demonstrate that topological features can significantly outperform traditional fine-tuning. Our approach achieves a new state-of-the-art on the CREMA-D emotion recognition dataset and provides a robust framework for model interpretability, revealing that specific attention heads act as "specialists" for linguistic and acoustic features.
Introduction
Large-scale Transformer models have revolutionized speech processing, yet they present significant challenges in efficiency and interpretability. Most downstream applications utilize "fine-tuning," where a classification head is added to the final layer's hidden states. This approach often overlooks the most informative layers and relies on simple averaging that loses complex structural relationships within the data. Furthermore, Transformers remain largely "black boxes," making it difficult to understand how individual attention heads represent the hierarchical nature of speech, from phonemes to sentences.
To address these issues, we propose using Topological Data Analysis (TDA) to capture the structural "signature" of speech representations. TDA allows us to treat high-dimensional data as geometric objects, identifying persistent features that traditional statistical methods might miss.
Methodology: Capturing the Shape of Speech
Our methodology utilizes a frozen HuBERT Base model as a feature extractor. We focus on three primary types of features:
- Algebraic Features: Basic metrics derived from attention maps, such as asymmetry and diagonal values.
- Topological Features of Attention: We treat attention maps as weighted graphs and compute $H_0$ persistent homologies. This process tracks how "connected components" in the data emerge and merge as a connectivity threshold is varied. The results are visualized as barcodes, where the length of each bar represents the "persistence" of a specific structural feature.
- Representation Topology Divergence (RTD): This metric measures the topological dissimilarity between different model layers or between the model's internal representations and the original input signal.
As shown in Figure 5, these barcodes naturally reflect the hierarchy of speech. Shorter bars typically correspond to fine-grained units like phonemes, while longer bars represent the integration of these units into words and phrases. This suggests that the model's internal geometry is intrinsically aligned with linguistic structure. To maintain focus on the features themselves, we employ a simple logistic regression with $L_1$ regularization for classification tasks.
Experimental Results and Discussion
We evaluated our TDA-based approach across five diverse speech tasks: emotion recognition (IEMOCAP, CREMA-D), synthetic speech detection (ASVSpoof), speaker verification (VoxCeleb1), and word classification (FSDD).
Performance Breakthroughs
Our method achieved a new state-of-the-art accuracy of 80.155% on the CREMA-D dataset, a substantial improvement over the previous best of 70.47%. In the ASVSpoof task, we reached an Equal Error Rate (EER) of 1.946%, significantly outperforming the HuBERT baseline of 6.649%.
Interpretability and "Specialist" Heads
A key insight from our topological analysis is the identification of "specialist" attention heads. By examining topological separation, we found that certain heads can distinguish between natural and synthetic speech with near-perfect accuracy without any task-specific training.
Figure 4 illustrates how specific heads in various layers (e.g., Layer 6, Head 5) exhibit clear bimodal distributions, effectively acting as zero-shot classifiers for complex acoustic properties. This confirms that middle layers often contain more useful structural information than the final layer, and TDA provides the necessary tools to mine this information.
Conclusion and Future Work
This study demonstrates that TDA offers a powerful, interpretable lens for analyzing and improving speech Transformers. By capturing the geometric signatures of data, we can achieve superior performance on downstream tasks while gaining insights into the model's internal hierarchy.
Future work will focus on the computational challenges of higher-dimensional homology ($H_1$) to identify more complex structures like "loops" in data. Additionally, we aim to adapt TDA for frame-by-frame sequence prediction tasks like Automatic Speech Recognition (ASR) and explore its potential for model compression by identifying and pruning topologically redundant attention heads.
Summary updated