Semantic-Preserving Adversarial Attacks on LLMs: An Adaptive Greedy Binary Search Approach

Chong Zhang, Xiang Li, Jia Wang, Shan Liang, Haochen Xue +1 more
5/26/2025
cs.CLcs.CR

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) increasingly rely on automatic prompt engineering in graphical user interfaces (GUIs) to refine user inputs and enhance response accuracy. However, the diversity of user requirements often leads to unintended misinterpretations, where automated optimizations distort original intentions and produce erroneous outputs. To address this challenge, we propose the Adaptive Greedy Binary Search (AGBS) method, which simulates common prompt optimization mechanisms while preserving semantic stability. Our approach dynamically evaluates the impact of such strategies on LLM performance, enabling robust adversarial sample generation. Through extensive experiments on open and closed-source LLMs, we demonstrate AGBS's effectiveness in balancing semantic consistency and attack efficacy. Our findings offer actionable insights for designing more reliable prompt optimization systems. Code is available at: https://github.com/franz-chang/DOBS

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2025semanticpreserving,
  title  = {Semantic-Preserving Adversarial Attacks on LLMs: An Adaptive Greedy Binary Search Approach},
  author = {Chong Zhang and Xiang Li and Jia Wang and Shan Liang and Haochen Xue and Xiaobo Jin},
  year   = {2025},
  eprint = {2506.18756},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.18756v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.18756.svg)](https://codeofpaper.com/paper/2506.18756)

Discussion