Papers › ETA: Evaluating Then Aligning Safety of Vision Language Models at Inference Time

ETA: Evaluating Then Aligning Safety of Vision Language Models at Inference Time

9 Oct 2024arXiv:2410.06625archive 2025-07-28

Yi Ding, Bolian Li, Ruqi Zhang

Vision Language Models (VLMs) have become essential backbones for multimodal intelligence, yet significant safety challenges limit their real-world application. While textual inputs are often effectively safeguarded, adversarial visual inputs can easily bypass VLM defense mechanisms. Existing defense methods are either resource-intensive, requiring substantial data and compute, or fail to simultaneously ensure safety and usefulness in responses. To address these limitations, we propose a novel two-phase inference-time alignment framework, Evaluating Then Aligning (ETA): 1) Evaluating input visual contents and output responses to establish a robust safety awareness in multimodal settings, and 2) Aligning unsafe behaviors at both shallow and deep levels by conditioning the VLMs' generative distribution with an interference prefix and performing sentence-level best-of-N to search the most harmless and helpful generation paths. Extensive experiments show that ETA outperforms baseline methods in terms of harmlessness, helpfulness, and efficiency, reducing the unsafe rate by 87.5% in cross-modality attacks and achieving 96.6% win-ties in GPT-4 helpfulness evaluation. The code is publicly available at https://github.com/DripNowhy/ETA.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.06625")

Code

Syntology Ran 9 of 11 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · violated contract; 3 ran · our draft was wrong; 5 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

dripnowhy/eta officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 9 ran; 0 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
3ran · our draft was wrong
5ran
2unverified

Licence: 11 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from dripnowhy/eta. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calculate_safety_scores dripnowhy/eta/eval_usr.py official repository ran no licence file found · pointer only · da2114a8052b6d55 · report
check_success_attack dripnowhy/eta/eval_asr.py official repository ran no licence file found · pointer only · 8e8f6b744fcf648c · report
collate_fn dripnowhy/eta/llava/eval/model_vqa_loader_eta.py official repository ran no licence file found · pointer only · b3b9db8ec8e0d1d1 · report
encode_image dripnowhy/eta/helpfulscore_ai.py official repository ran · our draft was wrong no licence file found · pointer only · f41cb1a19b154297 · report
get_chunk dripnowhy/eta/llava/eval/model_vqa_loader_eta.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 42a46570620cd9fa · report
gpt4_eval dripnowhy/eta/helpfulscore_ai.py official repository ran no licence file found · pointer only · eae64eb562f6b0d1 · report
gpt4_eval dripnowhy/eta/helpful_wintie_ai.py official repository ran no licence file found · pointer only · 6d82575864d8ddeb · report
is_none dripnowhy/eta/llava/eval/model_vqa_mmbench_eta.py official repository ran · violated contract no licence file found · pointer only · bae18947b56f2be1 · report
split_list dripnowhy/eta/llava/eval/model_vqa_loader_eta.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 076c252c52cbb161 · report
evaluate_safety dripnowhy/eta/eval_usr.py official repository unverified no licence file found · pointer only · 85e3fe4d95b795f8 · report
get_stopping_criteria dripnowhy/eta/modeling_internlm_xcomposer2.py official repository unverified no licence file found · pointer only · 14c54d6727f29560 · report

Tasks

Sentence

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGPT-4Label SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections