Statistical Knowledge Assessment for Large Language Models

Qingxiu Dong, Jingjing Xu, Lingpeng Kong, Zhifang Sui, Lei Li

Introduction: The Illusion of Accuracy

Large Language Models (LLMs) are notoriously "brittle" when it comes to factual knowledge. A model might correctly identify William Shakespeare as a playwright in one prompt, but fail completely if you refer to him by his well-known alias, the "Swan of Avon."

Most current benchmarks evaluate LLMs based on accuracy: did the model get the answer right for a specific, fixed prompt? However, accuracy does not guarantee reliability. A truly reliable model should provide the same factual information regardless of how the question is phrased (e.g., "What is X's job?" versus "X worked as a...").

Accurate vs. Reliable LLMs

Existing evaluation methods, such as LAMA, were designed primarily for Masked Language Models like BERT and often rely on a single prompt template. These methods are highly susceptible to "spurious correlations"—instances where a model guesses an answer based on superficial linguistic patterns rather than actual stored knowledge. To address this, researchers have introduced KaRR (Knowledge Assessment Risk Ratio), a statistical framework designed to measure factual reliability rather than mere accuracy.

Methodology: The KaRR Framework

The authors propose KaRR, a metric inspired by the "Risk Ratio" used in statistics and epidemiology. The core idea is to treat a specific prompt as an "exposure" and measure how much it increases the probability of the model generating the correct answer compared to "random chance."

The KaRR Methodology

Key components of the KaRR approach include:

  • Probabilistic Graphical Modeling: The researchers model the relationship between symbolic facts (Subject, Relation, Object) and their various textual "aliases" (e.g., "Shakespeare" vs. "Swan of Avon").
  • The KaRR Formula: The metric calculates the ratio between the probability of the model generating the correct object given a specific subject and relation, versus the probability of it generating that object by chance (based on the subject alone or the relation alone).
  • Joint Influence: KaRR combines two distinct perspectives: how much the relation helps given the subject, and how much the subject helps given the relation.
  • MCMC Sampling: To make the mathematics computationally feasible across millions of facts, Markov Chain Monte Carlo (MCMC) sampling is used to estimate the denominators of these probability ratios.

A Massive Assessment Suite

To power this evaluation, the researchers built an assessment suite that dwarfs previous efforts in scale and scope. Utilizing the T-REx knowledge graph (derived from Wikipedia) and Wikidata, the suite includes 994,123 entities and 600 relations, encompassing over 1.39 million text aliases.

To validate KaRR against human judgment, they also created a high-quality subset of 410 facts with 4,140 manually written prompts, accompanied by human-graded responses for GPT2-XL.

Key Findings and Results

By evaluating 20 different LLMs against this massive suite, the authors uncovered several critical insights about how models store and retrieve knowledge:

  • Strong Human Correlation: KaRR scores demonstrated a strong correlation (0.43 Kendall’s $\tau$) with human expert assessments, significantly outperforming previous automated baselines.
  • The "Alpaca" Paradox: Surprisingly, instruction tuning is not always beneficial for factual reliability. While Vicuna (tuned on user conversations) showed improvement over its base LLaMA model, Alpaca (tuned on synthetic instructions) actually saw its factual reliability decrease. This suggests that certain types of tuning data can "wash out" or conflict with the factual knowledge gained during pre-training.
  • Scaling Laws Hold True: For models sharing the same architecture (such as the OPT or LLaMA families), factual knowledge scales predictably with model size. Larger models do not just know more facts; they are significantly more consistent in how they retrieve them.
  • Top Performers: In the evaluation of 20 LLMs, OPT-175B and LLaMA2-65B emerged as the most factually reliable models.
  • Resilience to Bias: KaRR proved highly robust against spurious correlations, effectively ignoring cases where a model predicts a common entity simply because the prompt template usually results in that entity.

Limitations and Future Work

While KaRR offers a significant step forward in evaluating LLM reliability, it has limitations. Most notably, it requires access to the model's output probability distribution (logits), making it difficult to apply to "black box" APIs like GPT-4 or Claude. Additionally, the current implementation focuses strictly on "atomic" knowledge triplets (Subject-Relation-Object) and does not account for complex, multi-hop reasoning.

Even with sampling techniques, calculating KaRR across millions of facts is computationally expensive. However, the authors suggest that identifying these "reliability gaps" is a crucial first step toward targeted knowledge editing—allowing developers to fix the specific areas where a model's knowledge is stored inconsistently.

Summary updated

BibTeX
@inproceedings{dong2023statistical,
  author = {Qingxiu Dong and Jingjing Xu and Lingpeng Kong and Zhifang Sui and Lei Li},
  title = {{Statistical Knowledge Assessment for Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=pNtG6NAmx0},
}
Figure