Abstract
Large Language Models (LLMs) frequently prioritize memorized parametric knowledge over provided contextual information, a phenomenon known as entity bias. This paper establishes a formal causal framework to diagnose this behavior and introduces two mitigation strategies: a "convex hull" perturbation for white-box training and a placeholder-based prompting strategy for black-box APIs. Our results show that these interventions significantly improve out-of-distribution (OOD) performance, with gains of up to 20.5 points in accuracy for black-box models.
Introduction
When an LLM is asked to reason about a famous entity, such as Bill Gates, it often relies on its internal training data rather than the specific context provided in the prompt. For instance, if a prompt describes Gates as a tourist visiting a building, the model might still identify his role as "founder" due to strong internal associations. This "entity bias" hinders the model's ability to generalize to novel or counterfactual scenarios where contextual knowledge should override parametric memory.
Causal Framework for Entity Bias
To systematically address this, we define a Structured Causal Model (SCM) that characterizes the relationships between input text ($X$), specific entities ($E$), internal model representations ($M$), and the final output ($Y$).
Unlike previous methods that are often computationally expensive or require full model access, our framework focuses on interventions at the input layer to decouple the entity's identity from the contextual relationships described in the text.
Intervention Strategies
White-Box: Convex Hull Perturbation
For models where internal embeddings are accessible (e.g., RoBERTa), we propose a training-time intervention. Instead of using a fixed entity embedding, we identify the $k$-nearest neighbors of the entity in the embedding space. We then perturb the entity's representation by replacing it with a random point within the convex hull formed by these neighbors.
This approach "blurs" the specific identity of the entity, preventing the model from taking shortcuts based on memorized facts, while preserving the general semantic category (e.g., "Person" or "Businessman") necessary for the task.
Black-Box: Placeholder Prompting
For proprietary models like GPT-3.5, we utilize a four-step in-context intervention. We replace target entities with abstract placeholders (e.g., [subject_entity]) and provide a definition block: "Assume [subject_entity] can be any of Steve Jobs, Bill Gates, or Jeff Bezos." By presenting the entity as a member of a set rather than a specific individual, we force the model to prioritize the relational logic within the prompt over its internal knowledge of any single individual.
Experimental Results
We evaluated these methods on Relation Extraction (RE) using TACRED and EntRED, and Machine Reading Comprehension (MRC) using TriviaQA and Natural Questions.
- White-Box Models: The convex hull intervention improved OOD performance for RoBERTa on RE by 5.7 points and for SpanBERT on MRC by 9.1 points.
- Black-Box Models: GPT-3.5 saw an improvement of up to 20.5 points in Exact Match accuracy on MRC tasks. Furthermore, the "memorization ratio"—the frequency with which the model ignores context in favor of memory—dropped by 17.6 points in RE tasks.
Conclusion
Causal interventions provide a practical and effective means of mitigating entity bias in both open-source and black-box LLMs. By strategically perturbing entity representations or using abstract placeholders, we can encourage models to rely on contextual reasoning, leading to more robust performance on out-of-distribution data.
Summary updated