Abstract
Large-scale pre-trained language models (LMs) like BERT are often treated as repositories of factual knowledge. Researchers use "factual probing"—querying the model with cloze-style prompts—to assess this knowledge. However, this paper questions whether optimized probes are truly recalling stored facts or simply learning to exploit training data regularities. We introduce OPTIPROMPT, a novel method that optimizes prompts in continuous embedding space. While OPTIPROMPT achieves state-of-the-art performance on the LAMA benchmark, our control experiments with randomized models reveal that a significant portion of probing success is attributable to the probe's ability to "learn" the task during optimization, rather than the model's inherent knowledge.
Introduction
In recent years, the NLP community has increasingly viewed pre-trained LMs as "knowledge bases." To evaluate the extent of this knowledge, factual probing has become a standard diagnostic tool. For example, to test if a model knows where Dante was born, one might provide the prompt "Dante was born in [MASK]" and check if the model predicts "Florence."
As shown in Figure 1, factual probing differs from linguistic probing (which identifies grammatical structures) by attempting to extract specific relational triples $(X, R, Y)$. However, human-written prompts are often sub-optimal. This led to the development of automated prompt-search methods like AutoPrompt, which use a small training set to find the most effective discrete tokens to trigger the model's memory. This paper identifies a fundamental tension in this approach: is the optimization process helping the model recall facts, or is it learning the facts from the training data?
The OPTIPROMPT Method
The authors propose OPTIPROMPT, which moves beyond the limitations of discrete word searches. Instead of searching for a string of existing tokens (e.g., "X was born in [MASK]"), OPTIPROMPT treats the prompt as a sequence of continuous vectors within the model's embedding space.
In standard probing, the input is restricted to the model's vocabulary: [X] [born] [in] [MASK]. In contrast, OPTIPROMPT optimizes a set of learned dense vectors: [X] [V1] [V2] [V3] [MASK]. By using gradient descent to tune these vectors directly, OPTIPROMPT can explore the entire embedding space, making it both more efficient and more effective at eliciting latent information than discrete methods.
The "Learning" Trap: Control Probes
A core contribution of this work is the "reality check" provided by control probes. If a prompt is tuned on a training set of facts, it might learn to predict the most frequent answer (the "majority label") or exploit shallow correlations (e.g., associating Italian names with Rome). To disentangle "learning" from "recall," the authors conducted experiments on:
- Random Models: Probing a BERT model with completely randomized weights.
- Random Embeddings: Reinitializing only the input embeddings while keeping the transformer weights frozen.
If a probe can achieve high accuracy on a random model, it is clearly learning the data distribution of the training set rather than extracting knowledge from the pre-trained parameters.
Results and Analysis
OPTIPROMPT sets a new state-of-the-art on the LAMA benchmark with 48.6% accuracy, a significant jump over AutoPrompt's 42.2%. It also shows superior robustness on the LAMA-UHN (UnHelpfulNames) split, which filters out entities where the name itself provides a strong hint.
However, Figure 3 reveals a sobering truth. On a Random Model, OPTIPROMPT still manages to achieve nearly 20% accuracy for certain relations. This performance is entirely driven by the optimization process "learning" the task. Furthermore, a large portion of the performance in pre-trained models comes from predicting the "Majority Label" (the blue bars in Figure 3). For some relations, optimized prompts act as task-specific classifiers that ignore the subject $X$ and simply output the most common object $Y$ from the training set.
Conclusion
While continuous prompt optimization like OPTIPROMPT is a powerful tool for eliciting knowledge from LMs, it also highlights the fragility of current probing benchmarks. The line between "recalling" a fact and "learning" a shortcut is thin. Future research must focus on developing more rigorous evaluation frameworks that can distinguish between a model's inherent knowledge and the artifacts of the probing process itself.
Reference: Zhong, Z., Friedman, D., & Chen, D. (2021). Factual Probing Is [MASK]: Learning vs. Learning to Recall. arXiv:2104.05240v2 [cs.CL].
Summary updated