Abstract
Petroni et al. (2019) demonstrated that it is possible to retrieve world facts from a pre-trained language model by expressing them as cloze-style prompts and interpret the model's prediction accuracy as a lower bound on the amount of factual information it encodes. Subsequent work has attempted to tighten the estimate by searching for better prompts, using a disjoint set of facts as training data. In this work, we make two complementary contributions to better understand these factual probing techniques. First, we propose OptiPrompt, a novel and efficient method which directly optimizes in continuous embedding space. We find this simple method is able to predict an additional 6.4% of facts in the LAMA benchmark. Second, we raise a more important question: Can we really interpret these probing results as a lower bound? Is it possible that these prompt-search methods learn from the training data too? We find, somewhat surprisingly, that the training data used by these methods contains certain regularities of the underlying fact distribution, and all the existing prompt methods, including ours, are able to exploit them for better fact prediction. We conduct a set of control experiments to disentangle "learning" from "learning to recall", providing a more detailed picture of what different prompts can reveal about pre-trained language models.
Introduction
The release of the LAMA (LAnguage Model Analysis) benchmark sparked significant interest in treating pre-trained language models (LMs) like BERT as structured knowledge bases. By using cloze-style prompts—such as "Dante was born in [MASK]"—researchers aim to measure the factual knowledge encoded during pre-training. However, a model's failure to answer correctly might stem from a suboptimal prompt rather than a lack of knowledge. This has led to efforts to "tighten the bound" by searching for more effective prompts.
This paper addresses a critical ambiguity in this paradigm: are optimized prompts truly eliciting latent knowledge, or are they simply learning to exploit statistical regularities in the training data provided to the probe?
Methods: OptiPrompt and Control Tasks
We introduce OptiPrompt, a method that optimizes continuous "soft prompts" directly in the embedding space. Unlike previous methods like AutoPrompt, which search for discrete vocabulary tokens (e.g., "trigger" words), OptiPrompt inserts a sequence of continuous vectors and optimizes them via gradient descent to maximize the likelihood of the correct object. This approach is more computationally efficient and flexible than discrete searches.
To investigate whether probes "cheat" by learning from training data, we employ several control experiments:
- Random Model (RM): A BERT model with completely random weights.
- Random Embeddings (RE): A model where only the input embeddings are randomized.
- Data Partitioning: Splitting LAMA into "Easy" and "Hard" (LAMA-UHN) subsets to isolate performance gains.
Key Results and Analysis
OptiPrompt achieves a new state-of-the-art on the LAMA benchmark, improving accuracy from 42.2% to 48.6% (a 6.4% absolute gain). On the more challenging LAMA-UHN split, which filters out examples where the answer can be guessed from the subject name alone, OptiPrompt improves accuracy from 31.3% to 38.4%.
Crucially, our control experiments reveal that even with a randomly initialized model, OptiPrompt can achieve non-trivial accuracy. As shown in the performance comparison above, a powerful probe can "learn" to map subject features to common objects based on training data regularities, independent of the LM's actual knowledge. For instance, a probe might learn to predict "French" for any subject associated with certain linguistic patterns, regardless of the specific entity's history.
Discussion and Conclusion
While OptiPrompt is highly effective at eliciting knowledge, the "Learning vs. Recalling" dilemma suggests that probing results must be interpreted with caution. The performance gains in continuous prompts come from both better elicitation of latent knowledge and exploitation of training data biases.
Future research in factual probing should adopt stricter control tasks, such as the Random Model baseline, to ensure that reported "knowledge" is not merely an artifact of the probe over-fitting to the training distribution. Furthermore, while continuous prompts offer superior performance, they sacrifice the interpretability of discrete, human-readable prompts.
Summary updated