Official implementation of "Attention Misses Visual Risk: Risk-Adaptive Steering for Multimodal Safety Alignment" (ECCV 2026). [Paper]
Jonghyun Park | Minhyuk Seo | Chaewon Yeo | Jonghyun Choi†
† Corresponding author
conda create -n moras_llava python=3.10 -y
conda activate moras_llava
python -m pip install -r requirements.txtPlace all datasets under the repository-level datasets/ directory. The paths below are relative to the repository root.
| Benchmark | Required path |
|---|---|
| SPA-VL | Downloaded automatically from Hugging Face (sqrti/SPA-VL) |
| FigStep | datasets/safety/figstep/ (place the benchmark images directly in this directory) |
| MM-SafetyBench | datasets/safety/mmsafety/processed_questions/<scenario>.json and datasets/safety/mmsafety/images/<scenario>/SD_TYPO/<id>.jpg |
| JOOD | datasets/safety/AdvBenchM/jood_dataset.json; image paths in the JSON must resolve relative to the repository root |
| MM-Vet | datasets/utility/mm-vet/mm-vet.json and datasets/utility/mm-vet/images/ |
| GQA | datasets/utility/gqa/llava_gqa_testdev_balanced.jsonl and datasets/utility/gqa/images/ |
| MME | datasets/utility/MME/llava_mme.jsonl and datasets/utility/MME/MME_Benchmark_release_version/ |
| ScienceQA | datasets/utility/scienceqa/llava_test_CQM-A.json and datasets/utility/scienceqa/images/test/ |
For VLSafe-based calibration with parameters.get_baseline_cossim, use:
datasets/calibration/VLSafe/
├── images/
└── train/
├── VLSafe_harmlessnss_alignment.jsonl
└── vlsafe_convert_safe.jsonl
Run the following command from the LLaVA directory:
cd LLaVAGenerate the unsafe-state prototypes:
python -m parameters.get_unsafe_states --eval_model=llava_v1_5_7bCompute the baseline cosine similarity and sigmoid parameters:
python -m parameters.get_baseline_cossim --eval_model=llava_v1_5_7bAfter preparing the benchmark datasets, run inference from the LLaVA directory. For example, run MoRAS on SPA-VL with:
python -m eval.spavl --eval_model=llava_v1_5_7bOther supported safety benchmarks can be run in the same way:
python -m eval.figstep --eval_model=llava_v1_5_7b
python -m eval.mmsafety --eval_model=llava_v1_5_7b
python -m eval.jood --eval_model=llava_v1_5_7bFor utility evaluation:
python -m eval.mmvet --eval_model=llava_v1_5_7b
python -m eval.gqa --eval_model=llava_v1_5_7b
python -m eval.mme --eval_model=llava_v1_5_7b
python -m eval.sciqa --eval_model=llava_v1_5_7bOutputs are saved under LLaVA/results/<eval_model>/moras/.
If you find this work useful, please cite:
@inproceedings{park2026attention,
title={Attention Misses Visual Risk: Risk-Adaptive Steering for Multimodal Safety Alignment},
author={Park, Jonghyun and Seo, Minhyuk and Yeo, Chaewon and Choi, Jonghyun},
booktitle={European Conference on Computer Vision},
pages={38--56},
year={2026},
organization={Springer}
}