Not typos only
Character noise is easy to spot. Natural paraphrases are not.
1 University of British Columbia, Vancouver, Canada
Clinically plausible prompt rewrites—not typos, not jailbreaks—can flip ultrasound vision–language model predictions. We introduce SonoPromptAttack: LLM edits guided by Monte Carlo Tree Search.
Ultrasound Med-VLMs are queried in natural language. In POCUS and decentralized care, prompts are informal, abbreviated, or noisy— shorthand from a busy clinic, not a hand-crafted jailbreak.
Prior safety work often tests obviously unsafe instructions. We study something quieter: meaning-preserving rewrites that a clinician could type without intending harm—and still flip the answer.
Character noise is easy to spot. Natural paraphrases are not.
Same diagnostic question. Different wording. Different prediction.
Benign ↔ malignant is not a cosmetic error—it changes the care path.
SonoPromptAttack never touches the ultrasound image and never needs gradients. An attacker LLM suggests small, meaning-preserving span replacements—synonyms, light reordering, punctuation—while answer option tokens stay locked.
Invalid proposals are dropped by rule (exact span, English-only, no duplicates). Rejection feedback is fed back so the next round is less wasteful. Surviving edits grow a search tree of candidate questions.
Monte Carlo Tree Search chooses which wording branch to try next, scores each rewrite by how much the target model’s confidence shifts, and continues until the answer flips or the budget runs out (at most 80 model queries and 8 edit steps).
We evaluate on U2-Bench ultrasound questions: disease diagnosis (what is wrong?) and lesion localization (where is it?), across five medical vision–language models. Attack success is counted only when the model was correct before the rewrite.
Interactive explorer Browse 200 recorded successful attacks by proposer, target model, and task.
Disease diagnosis — higher attack success and similarity are better; lower perplexity (more fluent text) is better. Highlighted rows are SonoPromptAttack.
| Method | MedGemma-4B | MedGemma-27B | QoQ-Med-7B | QoQ-Med-32B | LLaVA-Med-7B | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Success | Similar | Fluency | Success | Similar | Fluency | Success | Similar | Fluency | Success | Similar | Fluency | Success | Similar | Fluency | |
| Random typos | 23.5 | 96.4 | 161 | 27.3 | 96.5 | 147 | 28.1 | 96.3 | 134 | 21.9 | 95.6 | 270 | 9.1 | 96.4 | 106 |
| Greedy typos | 18.6 | 98.3 | 27.9 | 26.4 | 99.0 | 26.6 | 22.8 | 98.6 | 56.2 | 20.3 | 97.5 | 77.0 | 29.5 | 97.7 | 34.4 |
| TextFooler | 16.5 | 98.8 | 30.6 | 22.9 | 99.5 | 18.6 | 17.4 | 99.2 | 25.8 | 24.1 | 98.6 | 38.6 | 12.2 | 99.8 | 16.6 |
| DeepWordBug | 15.0 | 99.0 | 38.6 | 24.5 | 99.2 | 25.4 | 17.9 | 98.7 | 42.8 | 19.9 | 97.9 | 50.7 | 5.9 | 99.9 | 16.3 |
| Ours · Qwen 7B | 27.0 | 98.9 | 14.5 | 34.8 | 98.9 | 14.4 | 24.4 | 98.8 | 14.1 | 27.2 | 99.0 | 14.8 | 14.0 | 98.9 | 11.1 |
| Ours · Qwen 14B | 42.9 | 98.7 | 16.6 | 52.0 | 98.8 | 16.8 | 40.1 | 98.6 | 16.4 | 35.2 | 98.9 | 17.4 | 15.9 | 99.1 | 10.9 |
| Ours · Gemma E4B | 47.9 | 99.1 | 18.2 | 60.9 | 99.2 | 18.2 | 45.3 | 99.1 | 19.9 | 32.7 | 99.1 | 18.4 | 18.0 | 99.2 | 11.7 |
| Ours · Gemma 12B | 38.4 | 98.7 | 19.4 | 40.3 | 98.9 | 17.8 | 32.4 | 98.5 | 20.8 | 26.3 | 98.8 | 19.5 | 19.8 | 99.3 | 11.1 |
On disease diagnosis, SonoPromptAttack has the highest attack success for four of five models (second on LLaVA-Med-7B) and produces the most fluent rewrites overall.
Lesion localization — typo-style attacks can flip answers often, but the text becomes hard to read. Highlighted rows are SonoPromptAttack.
| Method | MedGemma-4B | MedGemma-27B | QoQ-Med-7B | QoQ-Med-32B | LLaVA-Med-7B | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Success | Similar | Fluency | Success | Similar | Fluency | Success | Similar | Fluency | Success | Similar | Fluency | Success | Similar | Fluency | |
| Random typos | 100 | 95.7 | 84.4 | 93.0 | 96.4 | 34.4 | 96.3 | 95.2 | 79.1 | 21.1 | 95.0 | 36.3 | 100 | 96.5 | 33.6 |
| DeepWordBug | 100 | 98.4 | 14.3 | 88.4 | 98.7 | 13.8 | 50.7 | 98.0 | 15.0 | 18.0 | 98.6 | 15.6 | 83.6 | 98.4 | 18.9 |
| Ours · Qwen 7B | 95.2 | 98.2 | 7.8 | 87.5 | 98.3 | 8.1 | 29.4 | 99.1 | 8.0 | 32.6 | 98.5 | 8.1 | 77.1 | 97.6 | 7.5 |
| Ours · Qwen 14B | 85.7 | 99.7 | 9.1 | 90.0 | 99.7 | 9.3 | 44.1 | 99.7 | 9.1 | 34.0 | 99.7 | 9.3 | 62.3 | 99.5 | 9.8 |
| Ours · Gemma E4B | 95.2 | 99.4 | 9.3 | 87.5 | 99.4 | 9.1 | 39.7 | 99.4 | 9.3 | 38.9 | 99.4 | 9.4 | 34.4 | 99.1 | 10.3 |
| Ours · Gemma 12B | 100 | 99.6 | 9.8 | 80.0 | 99.2 | 9.5 | 50.0 | 98.6 | 10.7 | 29.9 | 99.2 | 10.4 | 36.9 | 98.0 | 10.4 |
On lesion localization, every SonoPromptAttack variant produces the most fluent text for all five models—and the closest match to the original meaning—without relying on garbled characters.
Average scores hide big differences by anatomy. Lung questions are often easy to flip (about 47–66% mean success depending on the model). On MedGemma-4B, skin and knee questions are also fragile (~69% and ~71%). PCOS and some thyroid cases hold up much better for certain models. Robustness checks should break results down by anatomy—not only report one overall number.
Bars show mean attack success by anatomy for MedGemma-4B (higher = more vulnerable).
Baseline methods often succeed by injecting typos or swapping clinical terms. SonoPromptAttack aims for rewrites a clinician could still read: natural wording, correct grammar, and the same diagnostic intent—checked by an automated language judge.
hre a radiologist · breasd
torso sound — drifts off the anatomy
integrate these findings
Across both tasks, SonoPromptAttack ranks best or second-best on quality scores (naturalness, grammar, intent) in most settings—while remaining competitive on attack success and leading on fluency.
We keep the same rewrite model, filters, and query budget (80 model checks, at most 8 edit steps) and only change how candidates are chosen. The chart below is for lesion localization on LLaVA-Med-7B, with Qwen2.5-7B proposing the rewrites.
Spending the same budget more carefully matters: greedy search gets stuck on weak early edits, while Monte Carlo Tree Search roughly doubles the best baseline.
@misc{medghalchi2026minoreditsmatterllmdriven,
title = {When Minor Edits Matter: LLM-Driven Prompt Attack for Medical VLM Robustness in Ultrasound},
author = {Yasamin Medghalchi and Milad Yazdani and Amirhossein Dabiriaghdam and Moein Heidari and Mojan Izadkhah and Zahra Kavian and Giuseppe Carenini and Lele Wang and Dena Shahriari and Ilker Hacihaliloglu},
year = {2026},
eprint = {2603.21047},
archivePrefix = {arXiv},
primaryClass = {cs.CV},
url = {https://arxiv.org/abs/2603.21047}
}