Whether LLMs Know If They Know: Identifying Knowledge Boundaries via Debiased Historical In-Context Learning

Bo Lv, Nayu Liu, Yang Shen, Xin Liu, Ping Luo, Yue YuACL 2025

Abstract

Large Language Models (LLMs) often struggle with metacognition—the ability to accurately assess their own knowledge boundaries. This failure is frequently rooted in deep-seated biases toward specific response tokens rather than a lack of underlying knowledge. We introduce Debiased Historical In-Context Learning (DH-ICL), a method that reframes self-assessment as a pattern-matching task. By leveraging a model's own history of successes and failures and applying a novel bias calibration technique, DH-ICL enables more reliable "Active Retrieval" in RAG systems, triggering external searches only when truly necessary.

Introduction

In the context of Retrieval-Augmented Generation (RAG), "Active Retrieval" (AR) is essential for balancing performance and cost. An ideal AR system queries the LLM's internal knowledge first: if the model knows the answer, it responds directly; otherwise, it triggers an external search. However, LLMs are notoriously poor at identifying their own limits. They often exhibit "prior cognitive biases"—for example, Llama-2-7B has a massive statistical preference for the token "true," while the 13B version prefers "false," regardless of factual accuracy. Existing solutions often require expensive, domain-specific auxiliary classifiers.

Methodology: Debiased Historical In-Context Learning (DH-ICL)

The proposed DH-ICL approach shifts the paradigm from abstract "reflection" to concrete "comparison" using three core components:

  1. Historical Response Logs: The system maintains a record of the model’s past performance. Questions where the model's output matched the ground truth are logged as "known" (true), while others are "unknown" (false).
  2. Historical In-Context Learning (ICL): For a new query, the system retrieves the $k$ most similar historical instances. These serve as few-shot examples, framing the task as a structured pattern-recognition problem: "In the past, you knew X but did not know Y."
  3. Historical Bias Calibration: To counteract the model's inherent token preferences, the system calculates a "bias offset" based on logit deviations in historical examples. This offset is applied to the current query's logits to produce a debiased final decision.
Overview of the DH-ICL methodology, illustrating the integration of historical logs, in-context learning, and logit-based bias calibration.

Experimental Evaluation

The researchers evaluated DH-ICL across four diverse Question Answering (QA) benchmarks: TriviaQA (general knowledge), WebQuestions (search-based), and TAQA/FreshQA (time-sensitive). They also introduced the KB-SAT (Knowledge Boundary Self-Assessment Test Set), a balanced dataset specifically designed to measure self-assessment accuracy.

The Token Preference Trap

A key finding is that LLM self-assessment is heavily influenced by the specific labels used in the prompt. Shifting from "true/false" to "yes/no" or "1/2" significantly alters the model's prediction distribution, even when the underlying knowledge remains constant.

Visualization of token preference bias in Llama-2-7B across various label pairs, demonstrating how choice of words radically shifts prediction distributions.

Key Results and Insights

  • Efficiency and Performance: On TriviaQA, DH-ICL allowed Llama-2-7B to match the performance of an "Always-Retrieve" strategy while reducing retrieval calls by 50%.
  • Benchmarking: DH-ICL significantly outperformed non-training baselines like FLARE and matched the performance of state-of-the-art training-based methods (e.g., UAR) without requiring any fine-tuning.
  • Robustness: The method proved effective even with random historical examples, suggesting that the "exemplar-driven" framing is the primary driver of success.

Conclusion and Future Work

DH-ICL demonstrates that treating self-awareness as a pattern-matching task is more effective than relying on an LLM's abstract reasoning. While the current method requires a "warm-up" phase to build historical logs, it offers a training-free path to more reliable metacognition. Future research will focus on automating the validation of historical logs and managing "knowledge drift" in dynamic, time-sensitive environments.

Summary updated

BibTeX
@inproceedings{lv2025whether,
  author = {Bo Lv and Nayu Liu and Yang Shen and Xin Liu and Ping Luo and Yue Yu},
  title = {{Whether LLMs Know If They Know: Identifying Knowledge Boundaries via Debiased Historical In-Context Learning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure