Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAGICS-LAB/hallucination

Repository files navigation

Are Hallucinations Bad Estimations?

This is the code for the paper Are Hallucinations Bad Estimations? You can use this repo to reproduce the results in the paper.

Environment Setup

Usage

  1. Clone the repository
    gh repo clone MAGICS-LAB/hallucination
    cd hallu
  2. Create and activate a virtual environment
    conda create -n hallu python=3.11
    conda activate hallu
  3. Install required packages
    pip install -r requirements.txt

Synthetic Coin Flipping Problem

Please refer to coinflip_experiment.ipynb.

Open-Ended Text Questions

python hallucination_llm.py

Open-Ended Text-to-Image

  1. Fine-tune Unet
    python text_to_img_exp/fine-tune_text_to_img.py
        -- output_dir "./model"
  2. Hallucination Rate Analysis with Frozen Model
    python text_to_img_exp/hallucination_text_to_img_report.py                  
        --checkpoints_glob "./model/checkpoint-*/unet"

Plotting

python plotting_llm.py # for plotting of Figure 4
python plotting_text_to_img.py # for plotting of Figure 5
python ablation_plotting_text_to_img.py # for ablation study plots

Citation

If you find our work useful, please cite:

@article{liu2025hallucinations,
  title={Are Hallucinations Bad Estimations?},
  author={Liu, Hude and Hu, Jerry Yao-Chieh and Zhang, Jennifer Yuntong and Song, Zhao and Liu, Han},
  journal={arXiv preprint arXiv:2509.21473},
  year={2025}
}

About

Are Hallucinations Bad Estimations?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •