A General Framework for Producing Interpretable Semantic Text Embeddings

Yiqun Sun, Qiang Huang, Yixuan Tang, Anthony Kum Hoe Tung, Jun Yu

TL;DR

Researchers have developed CQG-MBQA, a novel framework that transforms opaque, "black-box" text embeddings into a series of human-readable yes/no questions. By using contrastive learning to generate highly specific questions and a multi-task model to answer them efficiently, the framework achieves performance comparable to state-of-the-art models while reducing inference costs to a tiny fraction (0.017%) of traditional LLM-based methods.

What Problem Does This Paper Address?

In modern Natural Language Processing (NLP), text embeddings are the "secret sauce" behind everything from search engines to Retrieval-Augmented Generation (RAG). However, these embeddings are usually just long strings of numbers—dense vectors—that are impossible for a human to interpret. If a model decides two legal documents are similar, a human lawyer cannot simply look at the vector to understand why.

Previous attempts to fix this used "interpretable dimensions," where each slot in a vector corresponds to the answer to a specific question (e.g., "Is this text about AI?"). But these methods faced a "Goldilocks" problem: questions were either too generic (generated by basic LLM prompts), too expensive to produce at scale, or required extensive manual labor from domain experts. The core challenge was to create questions that are both discriminative (able to tell similar things apart) and efficient (cheap to compute).

Methods

To address these challenges, the authors introduce a two-phase framework:

The CQG-MBQA framework pipeline, illustrating both the Contrastive Question Generation (CQG) and Multi-task Binary Question Answering (MBQA) phases.
  1. Contrastive Question Generation (CQG): Instead of asking an LLM to "generate questions about this text," CQG uses contrastive principles. It clusters the text corpus in a semantic space and identifies "hard negatives"—texts that are semantically close but fundamentally different. It then prompts an LLM to generate questions that would result in a "yes" for a specific cluster but a "no" for its neighbors. For example, instead of asking "Is it an animal?", it might ask, "Does the animal use echolocation to hunt?" to distinguish dolphins from sharks.
  2. Multi-task Binary Question Answering (MBQA): Using an LLM to answer thousands of questions for millions of documents is prohibitively expensive. To solve this, the authors train a small, efficient model. They take a frozen pre-trained encoder and add thousands of tiny "heads" (simple Multi-Layer Perceptrons), each trained to predict the LLM's "yes/no" answer for a specific question. This allows the system to generate the entire interpretable embedding in a single forward pass.

Datasets

The framework was trained and evaluated using several major benchmarks:

  • MEDI2: A massive, diverse text corpus used for the initial training of the question-answering heads.
  • MTEB (Massive Text Embedding Benchmark): The primary evaluation suite, covering tasks like Semantic Textual Similarity (STS), Retrieval (e.g., MS MARCO, NFCorpus), and Clustering (e.g., RedditClustering).
  • MS MARCO: Used specifically for a rigorous cost and scalability analysis.

Key Insights and Ideas

  • Contrastive is Key: The breakthrough insight is that interpretability requires specificity. By forcing the LLM to look at what separates two similar clusters during question generation, the resulting dimensions are far more useful for downstream tasks than generic topical questions.
  • Cognitive Load as a Metric: The paper emphasizes that interpretability isn't just about having words; it's about how much effort a human needs to understand the vector. They measure "Cognitive Load" by the number of "yes" answers a user has to process. CQG-MBQA produces sparser, more meaningful "yes" hits than previous methods.
  • The Efficiency Leap: By distilling LLM knowledge into the MBQA multi-task heads, the authors bypassed the "LLM tax." They turned a task that would cost an estimated $244,551 in API fees into one that costs about $41.

Key Results

Performance comparison on Semantic Textual Similarity (STS) tasks, showing CQG-MBQA outperforming other interpretable models.
  • Performance: CQG-MBQA achieved an average Spearman correlation of 77.60 on STS tasks, significantly outperforming earlier interpretable models like QAEmb (65.20) and rivaling several high-end black-box models.
  • Interpretability: The model achieved a 2.5x to 3.6x lower cognitive load compared to existing interpretable baselines, meaning the dimensions it chooses are much easier for humans to scan and understand.
  • Accuracy: The small MBQA model was able to replicate the "gold standard" LLM answers with 96% accuracy, proving that the distillation process successfully retains the LLM's reasoning capabilities.

Limitations and Future Work

While a major step forward, the authors note a few areas for growth:

  • Encoder Dependency: The quality of the interpretable dimensions is still somewhat tethered to the quality of the underlying "black-box" encoder used to cluster the data initially.
  • Threshold Tuning: There is a trade-off between embedding quality and interpretability. Higher thresholds for "yes" answers make the model easier to read but can cause it to lose subtle semantic nuances.
  • Single Language Focus: The current study focuses on English. Future work could involve expanding the framework to multilingual settings, where "interpretable dimensions" might need to account for cultural or linguistic shifts in how questions are framed.

Summary updated

BibTeX
@inproceedings{sun2025general,
  author = {Yiqun Sun and Qiang Huang and Yixuan Tang and Anthony Kum Hoe Tung and Jun Yu},
  title = {{A General Framework for Producing Interpretable Semantic Text Embeddings}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=23uY3FpQxc},
}
Figure