Skip to content

Röttger et al. (2025): "MSTS: A Multimodal Safety Test Suite for Vision-Language Models"

License

Notifications You must be signed in to change notification settings

paul-rottger/msts-multimodal-safety

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSTS: A Multimodal Safety Test Suite for Vision-Language Models in 11 Languages

This repo contains data and code for our paper "MSTS: A Multimodal Safety Test Suite for Vision-Language Models in 11 Languages".

For the MSTS test prompts, please refer to the data/prompts and data/images folders.

Repo Structure

├── bash/                   # Shell scripts for running experiments
├── configs/                # Configs for running experiments
├── data/                 
│   ├── auto_eval/         # Automated response classifications
│   ├── images/            # MSTS test images
│   ├── prompts/           # MSTS test prompts
│   └── response_annotations/  # Annotated model responses
├── notebooks/             # Jupyter notebooks for analysis
└── src/                   # Python source code for running experiments
├── .gitignore            # Git ignore rules
├── README.md             # This file
└── requirements.txt      # Python dependencies

Getting Started

Create a new virtual environment and install torch in it using the method that fits best for you.

Experiments in this repository have been conducted using torch==2.4.0.

Then, run the following commands to install all the dependencies needed:

# install all pypi requirements
pip install -r requirements.txt

# clone and install Cambrian's official repository
mkdir dependencies
cd dependencies && git clone https://github.com/cambrian-mllm/cambrian.git

Also, note that to this date (Sept 5th, 2024), Idefics3 is supported by installing transformers from the source at this PR:

huggingface/transformers#32473

Downloading and preprocessing the images

Use the scripts 0_download_images.py and 1_preprocess_images.py to retrieve and prepare our collection of unsafe images.

Running the experiments

To run the experiments, we use Python scripts (src) invoked through bash runners (bash). The input args to Python scripts are controlled by config JSON files (configs).

Each bash runner has a telling name to help understand what is being run:

  • run_\*: runs an arbitrary commercial model;
  • run_models: run all local models (use sbatch_run_models if you have access to SLURM);
  • text-only_runs and multilingual_runs run model completions with the text-only and multilingual prompt variants.

About

Röttger et al. (2025): "MSTS: A Multimodal Safety Test Suite for Vision-Language Models"

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •