This repository contains the official pytorch implementation of the ICLR2026 paper: "Hallucination-aware Intermediate Representation Edit in Large Vision-Language Models".
conda create HIRE python=3.10
conda activate HIRE
git clone https://github.com/ASGO-MM/HIRE
cd HIRE
pip install -r requirements.txt- To train the editor, please download and extract the images and annotations from this link.
- To train the router, please download and extract the MSCOCO 2014 dataset from this link.
About model Pre-trained checkpoints
- LLaVA-1.5: Download LLaVA-1.5 merged 7B
First, extract the positive and negative hidden_states.
bash train_hire/scripts/extract_hidden_states.shNeed to specify "model_path", "data_path","hidden_states_path"
Then, train the editor.
bash train_hire/scripts/train_hire_editor.shNeed to specify "model_path", "data_path","hidden_states_path"
Finally, train the router.
bash train_hire/scripts/train_hire_router.shNeed to specify "hidden_states_path", "checkpoint_path","direction_save_path"
bash train_hire/scripts/generate_caption.shNeed to specify "editor-model-path", "model-path", "image-folder", "anno-folder", chair-path"
This codebase is based on LLaVA, TruthX, CHAIR. Many thanks to the authors for generously sharing their codes!
