TL;DR
Current methods for probing the factual knowledge of Large Language Models (LLMs) rely on manually written prompts, which often underestimate what the models actually "know." By automatically mining and paraphrasing diverse prompts and combining them through ensembling, this paper demonstrates that we can extract significantly more knowledge from models like BERT, raising retrieval accuracy on the LAMA benchmark from 31.1% to 39.6%.
What Problem Does This Paper Address?
We’ve all seen the "cloze-style" tests for AI: you give a model a sentence like "Barack Obama was born in [MASK]" and see if it fills in "Honolulu." This is how researchers probe the "world knowledge" hidden inside the weights of pre-trained models.
The catch is that LLMs are notoriously sensitive to how a question is phrased. If you change the prompt to "The birthplace of Barack Obama is [MASK]," the model might suddenly fail. Because researchers usually rely on a single, manually written prompt for each relation, they are only getting a lower bound estimate of the model's knowledge. If the prompt is suboptimal, we might conclude the model is "stupid" when, in reality, we just asked the question the wrong way. This paper seeks to "tighten" that lower bound by finding the best possible ways to query a model.
Methods
The authors propose two main ways to generate better prompts and a few ways to combine them:
- Mining-based Generation: The authors searched Wikipedia for sentences containing known subject-object pairs (e.g., "Obama" and "Honolulu"). They then extracted the "middle words" between the entities or used dependency parsing to find the shortest path between them to create templates like "x was born in y."
- Paraphrasing-based Generation: They took an existing prompt and used back-translation (translating a prompt from English to German and back to English) to generate semantically similar variations.
- Ensembling: Instead of picking just one "best" prompt, they used several. They tested:
- Top-1: Picking the single most accurate prompt based on a small training set.
- Rank-based Ensemble: Averaging the log probabilities from the top $K$ prompts.
- Optimized Ensemble: Using a small amount of data to learn a weighted average, giving more "vote" to the most reliable prompts for a specific relation.
Datasets
The study primarily uses the LAMA (Language Model Analysis) benchmark, specifically the T-REx subset, which contains 41 different relations (like "place of birth" or "owned by").
To ensure the models weren't just "cheating" by using surface-level patterns in entity names, they also tested on LAMA-UHN (Un-Helpful Names), a harder version of the dataset. Finally, they validated their findings on the Google-RE dataset.
Key Insights and Ideas
- LMs are Brittle: The paper confirms that LLMs are incredibly sensitive to small wording changes. For example, changing "x plays in y position" to "x plays at y position" resulted in a massive 23.2% accuracy gain for that specific relation.
- Mining Trumps Manual: Mined prompts often outperformed the "intuitive" prompts written by humans. This suggests that the way humans think about a relation isn't necessarily the way the model "learned" it during pre-training.
- Diversity Matters: When ensembling, mined prompts performed better than paraphrased ones. Why? Because mined prompts are more diverse, capturing different ways a relation appears in the wild (e.g., "x who converted to y" vs. "x is affiliated with the y religion"), whereas paraphrases tend to be lexically very similar.
- Cross-Model Consistency: Interestingly, prompts that worked well for BERT-base also tended to work well for BERT-large and even ERNIE. This suggests that "good" prompts might be capturing something fundamental about the English language or the common pre-training data, rather than just model-specific quirks.
Key Results
- Accuracy Boost: On the T-REx benchmark, using the best single discovered prompt raised BERT-base accuracy from 31.1% to 34.1%.
- Ensemble Power: When using the Optimized Ensemble method to combine multiple prompts, accuracy jumped to 39.6%.
- BERT-large: The gains were even more pronounced on larger models, with BERT-large reaching 43.9% accuracy using the Mine+Man ensemble.
- Harder Benchmarks: On the LAMA-UHN (the "hard" version), the automated methods still significantly outperformed manual prompts, proving the improvement wasn't just due to better "guessing" based on entity names.
Limitations and Future Work
- Single-Token Constraint: The study followed the original LAMA setup, which only predicts single-token objects (e.g., "Paris" but not "New York City"). This limits the scope of knowledge that can be retrieved.
- The "Why" is Still Missing: While the paper shows that certain prompts work better, it doesn't fully explain why a model prefers one specific preposition over another.
- Static Knowledge: This method probes what the model already knows. It doesn't address how to update that knowledge if facts change (e.g., a person changes their "position held").
- Future Direction: The authors suggest that these optimized prompts could be used to better "distill" knowledge from LMs into structured Knowledge Bases.
Summary updated