Skip to content

dhx20150812/Rowen

Repository files navigation

Retrieve Only When It Needs: Adaptive Retrieval Augmentation for Hallucination Mitigation in Large Language Models

About Rowen

We introduce a novel method, Rowen, a novel framework that enhances LLMs with a adaptive retrieval augmentation process tailored to address hallucinated outputs. This process is governed by a consistency-based uncertainty estimation module, which assesses the model's uncertainty regarding the input query by estimating semantic inconsistencies across different languages and models. Upon detecting high uncertainty on input questions, Rowen activates the retrieval of external information to rectify the model outputs. Overview

Requirements

Usage

  1. Run experiments on the TruthfulQA dataset
python run_truthfulqa.py --k K --threshold THRESHOLD --alpha ALPHA --qwen_model_name qwen-max-0428 --mode hybrid
  1. Run experiments on the StrategyQA dataset
python run_strategyqa.py --k K --threshold THRESHOLD --alpha ALPHA --qwen_model_name qwen-max-0428 --mode hybrid

Generated responses and evaluation results will be saved automatically.

Please be careful, the experiments are relatively expensive because Rowen calls OpenAI API multiple times for a single question. You can decrease the k (number of pertubed questions) in the file to reduce the cost.

Performance

Main Result of Rowen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages