Interpreting Embedding Spaces by Conceptualization

Adi Simhi, Shaul Markovitch

Introduction

Modern Large Language Models (LLMs) represent text as high-dimensional vectors known as embeddings. While these vectors are mathematically powerful and enable state-of-the-art performance in various NLP tasks, they are notoriously opaque. A vector consisting of hundreds of floating-point numbers does not intuitively explain why a model perceives two sentences as similar or how it arrives at a specific classification. This lack of interpretability hinders our ability to debug models, compare different architectures, and detect hidden biases.

To bridge this gap, this paper introduces CES (Conceptualizing Embedding Spaces), a model-agnostic framework designed to transform "black box" latent embeddings into human-readable conceptual vectors. By mapping abstract dimensions to concrete concepts from a structured ontology like Wikipedia, CES provides a transparent window into a model's internal logic.

The CES Framework

The core objective of CES is to project any latent vector into a space where each dimension corresponds to a specific, human-understandable concept. The authors utilize the Wikipedia category graph as their primary ontology, treating each category name as a semantic anchor.

The process follows four primary steps:

  1. Concept Mapping: Concepts within the ontology are converted into text strings (e.g., "Artificial Intelligence").
  2. Latent Projection: These strings are passed through the target LLM to obtain their corresponding latent vectors.
  3. Conceptualization: To interpret a new input vector (such as a sentence embedding), the algorithm calculates its cosine similarity to the pre-computed concept vectors. This results in a new "conceptual vector" where high values indicate strong alignment with specific human-readable topics.
  4. Selective Refinement: Because ontologies like Wikipedia are massive, the authors developed a dynamic refinement algorithm. This allows the system to "zoom in" on relevant branches of the hierarchy—for instance, expanding the "Health" branch into more granular topics like "Virology" or "Epidemiology" when processing medical text—ensuring high resolution without overwhelming computational costs.
The CES projection process: mapping a latent vector $l$ to a conceptual vector $CE(l)$ based on similarity to concept embeddings.

Experimental Setup and Results

The researchers evaluated CES across several standard text classification benchmarks, including AG News, Ohsumed, BBC News, and DBpedia 14. A key finding was that replacing an LLM's original, optimized dimensions with CES-generated conceptual dimensions resulted in nearly identical classification accuracy. This indicates that the conceptual space is not merely a simplified summary but a high-fidelity representation of the model's actual internal logic.

Classifier Agreement and Interpretability

Classifiers trained on CES conceptual features showed remarkably high agreement with those trained on original latent features, with Cohen’s Kappa coefficients often exceeding 0.80. In the case of the BBC News dataset, agreement reached a near-perfect 0.95.

Beyond quantitative metrics, the framework's interpretability was validated through human trials. Graduate students were asked to classify documents based solely on the top three concepts identified by CES. The high accuracy of these human raters confirms that the extracted concepts effectively capture the semantic essence of the underlying text.

Examples of sentences and their top-3 extracted concepts (c1, c2, c3) using CES, demonstrating human-readable output.

Key Insights: Model "Personalities" and the Logit Lens

One of the most compelling applications of CES is the ability to compare different models' "semantic priorities." For example, when analyzing a sentence about AI bias, researchers found that SBERT prioritized concepts related to "prejudice," while other models focused more on technical aspects like "neural networks."

Furthermore, by applying CES to individual layers of models like BERT and GPT-2—a technique referred to as a "Conceptual Logit Lens"—the authors could observe the evolution of understanding. Early layers often focus on surface-level keywords, while deeper layers gradually refine these into abstract, semantically accurate concepts.

Conclusion and Future Work

CES offers a robust method for making LLM embeddings interpretable without requiring model retraining. While currently dependent on the quality of the underlying ontology (Wikipedia) and primarily focused on topical classification, it opens new avenues for model debugging and bias detection. Future work will explore the use of alternative knowledge graphs to broaden the scope of interpretable concepts to include sentiment, style, and more complex semantic relationships.

Summary updated

BibTeX
@inproceedings{simhi2023interpreting,
  author = {Adi Simhi and Shaul Markovitch},
  title = {{Interpreting Embedding Spaces by Conceptualization}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.106},
}
Figure