Contextual Categorization Enhancement through LLMs Latent-Space
Zineddine Bettouche, Anas Safi, Andreas Fischer
TL;DR
The paper tackles semantic quality in large-scale textual categorization by leveraging transformer-derived encodings from Wikipedia and its categories into a latent space. It evaluates three approaches—Convex Hull, HNSW-based nearest-neighbor search, and a high-dimensional latent-space Reconsideration Probability filter—to assess and improve contextual category identity, introducing a mathematical RP mechanism with $RP(d_c, d_{ea}) = 100 e^{-k(d_{ea}-d_c)}$ and $k = \frac{-\ln(0.5)}{\text{median}(\{d_{ea}\})-d_c}$. A key contribution is showing that the exponential-decay RP filter can mitigate information loss from dimensionality reduction while enabling scalable recommendations and outlier detection, complemented by the use of hierarchical vectors that modestly boost clustering quality (Silhouette from 0.23 to 0.26). These results demonstrate a practical approach for improving contextual categorization in large, hierarchically organized corpora, with potential applicability to Wikipedia and similar datasets requiring scalable semantic alignment.
Abstract
Managing the semantic quality of the categorization in large textual datasets, such as Wikipedia, presents significant challenges in terms of complexity and cost. In this paper, we propose leveraging transformer models to distill semantic information from texts in the Wikipedia dataset and its associated categories into a latent space. We then explore different approaches based on these encodings to assess and enhance the semantic identity of the categories. Our graphical approach is powered by Convex Hull, while we utilize Hierarchical Navigable Small Worlds (HNSWs) for the hierarchical approach. As a solution to the information loss caused by the dimensionality reduction, we modulate the following mathematical solution: an exponential decay function driven by the Euclidean distances between the high-dimensional encodings of the textual categories. This function represents a filter built around a contextual category and retrieves items with a certain Reconsideration Probability (RP). Retrieving high-RP items serves as a tool for database administrators to improve data groupings by providing recommendations and identifying outliers within a contextual framework.
