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

Skip to content

The implementation of the interpretability and model editing experiments from NeurIPS 2024 paper : https://arxiv.org/abs/2406.04236.

License

Notifications You must be signed in to change notification settings

microsoft/MLLMInterpret

Repository files navigation

Understanding Information Storage and Transfer in Multimodal Language Models

This is the implementation of the interpretability and model editing experiments from NeurIPS 2024 paper : https://arxiv.org/abs/2406.04236.

Figure 1: heatmap plots showing the information retrieved from layers of two models. On the left is LLaVA-7B (an MLLM) and on the right LLAMA (Vicuna)-7B (an LLM). THe plot shows the early layers in the MLLM are causal, but that middle layers are causal for the LLM.

================================================

Constraint Annotations

The constraint annotations are in ./data_constraints. The directory contains constraints for OK-VQA, Multimodal Known and Multimodal Movies.

================================================

Images used for Probe Dataset

For OK-VQA, we use the val set images from https://okvqa.allenai.org/. For Multimodal Known the images are at: Link 1 and for Multimodal Movies the images are at: Link 2.

================================================

Running the Scripts

Our codebase is built on Llava's code. Clone Llava and transfer the code from this repository to ./llava/eval .

  1. Multimodal Causal Trace: python -m llava.eval.multimodal_trace --trace_answer <Answer for the prompt> --trace_question <Question> --trace_image <Image Path> --trace_constraint <Constraint in the question>

  2. Multimodal Edit: python -m llava.eval.multimodal_edit --edit_prompt <Prompt used for running model editing> --edit_constraint <Constraints in th prompt> --edit_target <Target Answer> --edit_og_answer <Original Answer to the prompt>

================================================

Notes : Although the current script is optimized for Llava, these scripts can be modified towards applying it on any multimodal language model. Reach out to [email protected] for any questions.

About

The implementation of the interpretability and model editing experiments from NeurIPS 2024 paper : https://arxiv.org/abs/2406.04236.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages