NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Local Topology Measures of Contextual Language Model Latent Spaces With Applications to Dialogue Term Extraction

Benjamin Matthias Ruppik, Michael Heck, Carel van Niekerk, Renato Vukovic, Hsien-Chin Lin, Shutong Feng, Marcus Zibrowius, Milica Gasic · DOI

Abstract

Traditional sequence tagging models often struggle with term ambiguity when processing sentences in isolation. This research introduces a method to enhance dialogue term extraction by analyzing the local topology of word embeddings within a large-scale datastore. By leveraging Topological Data Analysis (TDA), specifically persistent homology, the authors extract features that describe the "shape" of a word's semantic neighborhood. These features provide information independent of standard language model metrics like perplexity. Evaluations on MultiWOZ and Schema-Guided Dialogue (SGD) datasets show that incorporating topological features improves precision and F1-scores, particularly in zero-shot transfer learning across different domains.

Introduction

Identifying specific terms in dialogue—such as restaurant names or movie titles—is a core task in natural language processing. Standard models typically convert tokens into embeddings and predict tags based on local sentence context. However, words like "Prince" can be highly ambiguous depending on the broader corpus (e.g., a royal figure vs. a restaurant name). Furthermore, as large language models (LLMs) become increasingly opaque or accessible only via APIs, fine-tuning for specific tasks becomes difficult. This paper proposes a non-invasive way to improve performance by studying the local neighborhood of embeddings within a massive "datastore" of reference vectors.

Methodology: Topological Feature Extraction

The proposed pipeline moves beyond simple vector similarity by examining the geometric structure of the latent space.

Overview of the proposed pipeline for extracting topological features from contextual embedding neighborhoods.

The process involves four key stages:

  1. Datastore Construction: A reference corpus is converted into a collection of embedding vectors.
  2. Neighborhood Extraction: For a target token, the $n$ nearest neighbors are retrieved from the datastore.
  3. Persistent Homology: TDA is applied to analyze how clusters and holes form and persist in the neighborhood as a distance threshold varies.
  4. Feature Vectorization: These topological "shapes" are converted into numerical features, such as Persistence Images (PI) and Codensity measures.

These features are then concatenated with the original word embeddings and fed into a Transformer-based BIO-tagger.

Key Insights

A critical finding is that topological measures have low correlation with language model perplexity. This suggests that TDA captures structural information about the data manifold that the model's standard prediction heads ignore. Content-heavy words typically exhibit more "spread out" and topologically complex neighborhoods compared to function words like "the" or "of." Crucially, this approach is contextual; the neighborhood of a word changes based on its usage in a sentence, allowing for dynamic disambiguation.

Results and Discussion

The inclusion of topological features consistently outperformed baseline RoBERTa models. On the SGD dataset, which tests transfer learning to unseen domains, the model using contextual Persistence Images achieved an F1-score of 53.97, compared to the baseline's 52.39.

Qualitative comparison of term extraction between the baseline RoBERTa model and the topologically-enhanced variants.

Qualitative analysis (see above) reveals that the topological model is significantly better at identifying long, multi-word terms. For instance, while the baseline model often truncates complex names like "the yellow chilli by chef sanjeev kapoor," the enhanced model correctly identifies the entire span by leveraging the global semantic structure provided by the datastore.

Conclusion

By treating the latent space of language models as a manifold with semantically meaningful local variations, this work demonstrates that TDA can provide a powerful, complementary signal for sequence tagging. While computational costs for nearest-neighbor searches remain a challenge, the gains in precision and cross-domain robustness highlight the potential of topological features in modern NLP pipelines.

Summary updated

BibTeX
@inproceedings{ruppik2024local,
  author = {Benjamin Matthias Ruppik and Michael Heck and Carel van Niekerk and Renato Vukovic and Hsien-Chin Lin and Shutong Feng and Marcus Zibrowius and Milica Gasic},
  title = {{Local Topology Measures of Contextual Language Model Latent Spaces With Applications to Dialogue Term Extraction}},
  booktitle = {SIGDIAL},
  year = {2024},
  doi = {10.18653/v1/2024.sigdial-1.31},
}
Figure