Abstract
Text embedding models are fundamental to modern semantic search and information retrieval. However, these models often suffer from a significant "name bias," where identity-specific information like character names is prioritized over the actual semantic meaning or plot of the text. This paper demonstrates that such bias is pervasive across both open-source and proprietary models. We propose a simple, training-free mitigation strategy: anonymizing text during inference by removing proper nouns. Our results show that this approach dramatically improves a model's ability to capture true thematic similarity, leading to substantial gains in performance on semantic tasks without requiring costly retraining.
The Problem: Identity Over Semantics
When utilizing state-of-the-art embedding models, such as OpenAI's text-embedding-3-small or HuggingFace's all-MiniLM-L6-v2, the expectation is that they capture the underlying theme or intent of a sentence. However, research reveals that these models are easily distracted by "identity-specific information."
Consider the following three stories:
- Story 1: Alejandro gently examined the injured bird. He gave it food.
- Story 2: Jelani tenderly inspected the wounded bird and gave it a meal to eat.
- Story 3: Alejandro tracked the injured bird. He used it as his food.
Thematically, Story 1 and Story 2 are nearly identical (rescuing a bird), while Story 3 is the opposite (hunting a bird). Ideally, a model should find Story 1 and 2 highly similar. Instead, many models rate Story 1 and 3 as more similar simply because they share the name "Alejandro."
This "name bias" has serious implications for applications like plagiarism detection and semantic search, where a model might incorrectly surface documents based on shared names rather than relevant content.
Methodology
The authors employed a two-pronged approach to address this issue:
1. Benchmarking via Perturbation
To quantify bias, the researchers developed a "Perturb Text" algorithm. They took a base text and generated 20 variants by systematically replacing person and country names with random alternatives while keeping the narrative structure intact. In an unbiased model, the cosine similarity between these variants should ideally be 1.0.
2. Anonymization at Inference
Rather than retraining massive models, the authors proposed anonymizing text before generating embeddings. They utilized Large Language Models (LLMs) like Gemini and Claude to identify and remove proper nouns (names, locations, organizations). They found that simply removing names (replacing them with an empty string) was more effective than replacing them with placeholders like CHAR_A, which could introduce new, subtle biases.
Key Results
The study confirmed that name bias is a universal issue, affecting both small open-source models and large proprietary ones.
As shown in the table above, many models (e.g., multi-qa-distilbert-cos-v1) show significantly higher similarity for the name-matched pair (Story 1, Story 3) than the semantically-matched pair (Story 1, Story 2). In some cases, the similarity for the name-matched pair is nearly double that of the thematic pair.
Other key findings include:
- Semantic Similarity Task (STS): On a custom "trap" dataset designed to trigger name bias, original models performed worse than random guessing. After anonymization, AUC-ROC scores improved to 0.95–1.0.
- Human Alignment: Using the
SummEvalbenchmark, anonymization improved the correlation between model embeddings and human ratings by approximately 30% for models likeall-distilroberta-v1.
Insights and Limitations
The core insight is that embedding models "over-index" on names because they are trained on massive internet datasets where names are often tied to specific contexts. Anonymization serves as a powerful "thematic" fix that preserves the grammatical skeleton of a narrative.
However, some limitations remain:
- Task Specificity: Anonymization is unsuitable for searches where identity is the primary criteria (e.g., searching for a specific historical figure).
- Language Scope: The study focused on English; further research is needed to see how these biases manifest in other languages.
Ultimately, this work highlights a fundamental challenge in NLP: building models that inherently prioritize narrative structure and semantic meaning over proper nouns.
Summary updated