Table of Contents
Fetching ...

Refine Knowledge of Large Language Models via Adaptive Contrastive Learning

Yinghui Li, Haojing Huang, Jiayi Kuang, Yangning Li, Shu-Yu Guo, Chao Qu, Xiaoyu Tan, Hai-Tao Zheng, Ying Shen, Philip S. Yu

TL;DR

This work tackles LLM hallucinations by modeling the model's own knowledge boundaries through a quadrant-based framework defined by IK and IDK thresholds. It introduces Adaptive Contrastive Learning that constructs quadrant-specific positive and negative samples and uses tailored loss functions to preserve known knowledge, solidify uncertain knowledge, and forget incorrect or unknown knowledge. The approach yields significant improvements in Truthful Rate and knowledge awareness on in-distribution and out-of-distribution data, with further gains when integrated with retrieval-augmented generation. These results demonstrate a practical path toward more honest, reliable LLMs and offer actionable insights into threshold selection, loss design, and sampling strategies for knowledge-focused fine-tuning.

Abstract

How to alleviate the hallucinations of Large Language Models (LLMs) has always been the fundamental goal pursued by the LLMs research community. Looking through numerous hallucination-related studies, a mainstream category of methods is to reduce hallucinations by optimizing the knowledge representation of LLMs to change their output. Considering that the core focus of these works is the knowledge acquired by models, and knowledge has long been a central theme in human societal progress, we believe that the process of models refining knowledge can greatly benefit from the way humans learn. In our work, by imitating the human learning process, we design an Adaptive Contrastive Learning strategy. Our method flexibly constructs different positive and negative samples for contrastive learning based on LLMs' actual mastery of knowledge. This strategy helps LLMs consolidate the correct knowledge they already possess, deepen their understanding of the correct knowledge they have encountered but not fully grasped, forget the incorrect knowledge they previously learned, and honestly acknowledge the knowledge they lack. Extensive experiments and detailed analyses on widely used datasets demonstrate the effectiveness of our method.

Refine Knowledge of Large Language Models via Adaptive Contrastive Learning

TL;DR

This work tackles LLM hallucinations by modeling the model's own knowledge boundaries through a quadrant-based framework defined by IK and IDK thresholds. It introduces Adaptive Contrastive Learning that constructs quadrant-specific positive and negative samples and uses tailored loss functions to preserve known knowledge, solidify uncertain knowledge, and forget incorrect or unknown knowledge. The approach yields significant improvements in Truthful Rate and knowledge awareness on in-distribution and out-of-distribution data, with further gains when integrated with retrieval-augmented generation. These results demonstrate a practical path toward more honest, reliable LLMs and offer actionable insights into threshold selection, loss design, and sampling strategies for knowledge-focused fine-tuning.

Abstract

How to alleviate the hallucinations of Large Language Models (LLMs) has always been the fundamental goal pursued by the LLMs research community. Looking through numerous hallucination-related studies, a mainstream category of methods is to reduce hallucinations by optimizing the knowledge representation of LLMs to change their output. Considering that the core focus of these works is the knowledge acquired by models, and knowledge has long been a central theme in human societal progress, we believe that the process of models refining knowledge can greatly benefit from the way humans learn. In our work, by imitating the human learning process, we design an Adaptive Contrastive Learning strategy. Our method flexibly constructs different positive and negative samples for contrastive learning based on LLMs' actual mastery of knowledge. This strategy helps LLMs consolidate the correct knowledge they already possess, deepen their understanding of the correct knowledge they have encountered but not fully grasped, forget the incorrect knowledge they previously learned, and honestly acknowledge the knowledge they lack. Extensive experiments and detailed analyses on widely used datasets demonstrate the effectiveness of our method.

Paper Structure

This paper contains 39 sections, 7 equations, 4 figures, 6 tables.

Figures (4)

  • Figure 1: The illustration of our adaptive contrastive learning. Based on the multiple sampling responses of the model, we represent the knowledge regions with different mastery capabilities, and construct different positive and negative examples of adaptive contrastive learning to help the model better consolidate what is known.
  • Figure 2: The illustration of the knowledge boundaries and the sample response.
  • Figure 3: The examples of the contrastive learning data. $Quadrant-2$ should contain the knowledge that models know that they don't know. Unfortunately, the initial model without our optimization does not have the ability to distinguish this kind of knowledge.
  • Figure 4: Accuracy Distribution for Known and Unknown Questions in TriviaQA.