Context-faithful Prompting for Large Language Models

TL;DR

Enhance LLMs' contextual faithfulness using opinion-based prompts and counterfactual demonstrations, significantly reducing memorization ratio.

cs.CL πŸ”΄ Advanced 2023-03-21 4 views
Wenxuan Zhou Sheng Zhang Hoifung Poon Muhao Chen
LLMs contextual faithfulness opinion-based prompts counterfactual demonstrations NLP

Key Findings

Methodology

The study introduces opinion-based prompts and counterfactual demonstrations to improve LLMs' contextual faithfulness. Opinion-based prompts transform questions into inquiries about the narrator's opinion, while counterfactual demonstrations use instances with false facts to enhance performance in knowledge conflict scenarios.

Key Results

  • On the Natural Questions dataset, using opinion-based prompts and counterfactual demonstrations reduced the memorization ratio from 35.2% to 3.0%.
  • Significant improvement in relation extraction tasks, with F1 score increasing from 81.0% to 84.7%.
  • In prediction with abstention tasks, accuracy increased to 87.8%, significantly outperforming the baseline.

Significance

This research significantly enhances LLMs' contextual faithfulness, addressing the issue of over-reliance on parametric knowledge, providing new solutions for the NLP field.

Technical Contribution

Proposes prompt strategies that require no additional training, significantly improving contextual faithfulness, offering a cost-effective method applicable to models of different scales.

Novelty

First to apply opinion-based prompting to enhance LLMs' contextual faithfulness, combined with counterfactual demonstrations, providing an innovative solution.

Limitations

  • In complex contexts, models may still make incorrect predictions, especially when context information is incomplete.
  • Counterfactual demonstrations require careful design to ensure effectiveness.

Future Work

Future work could explore more context prompting strategies and investigate the effectiveness of these methods on larger datasets.

AI Executive Summary

Large language models often rely on parametric knowledge when handling context-sensitive tasks, leading to incorrect predictions due to overlooked contextual cues. Existing solutions have not effectively addressed this issue.

This paper introduces two novel prompting strategies: opinion-based prompts and counterfactual demonstrations. Opinion-based prompts transform questions into inquiries about the narrator's opinion, forcing the model to focus on context. Counterfactual demonstrations enhance model performance in knowledge conflict scenarios by using instances with false facts.

Experimental results show these strategies significantly improve contextual faithfulness. On the Natural Questions dataset, memorization ratio decreased from 35.2% to 3.0%, and in relation extraction tasks, F1 score increased from 81.0% to 84.7%. These findings provide new solutions for the NLP field.

Deep Dive

Abstract

Large language models (LLMs) encode parametric knowledge about world facts and have shown remarkable performance in knowledge-driven NLP tasks. However, their reliance on parametric knowledge may cause them to overlook contextual cues, leading to incorrect predictions in context-sensitive NLP tasks (e.g., knowledge acquisition tasks). In this paper, we seek to assess and enhance LLMs' contextual faithfulness in two aspects: knowledge conflict and prediction with abstention. We demonstrate that LLMs' faithfulness can be significantly improved using carefully designed prompting strategies. In particular, we identify opinion-based prompts and counterfactual demonstrations as the most effective methods. Opinion-based prompts reframe the context as a narrator's statement and inquire about the narrator's opinions, while counterfactual demonstrations use instances containing false facts to improve faithfulness in knowledge conflict situations. Neither technique requires additional training. We conduct experiments on three datasets of two standard NLP tasks, machine reading comprehension and relation extraction, and the results demonstrate significant improvement in faithfulness to contexts. Code and data are released at https://github.com/wzhouad/context-faithful-llm.

cs.CL