Efficient Universal Goal Hijacking with Semantics-guided Prompt Organization

Yihao Huang, Chong Wang, Xiaojun Jia, Qing Guo, Felix Juefei-Xu, Jian Zhang, Yang Liu, Geguang Pu

Abstract

Universal goal hijacking aims to find a single adversarial suffix that forces a Large Language Model (LLM) to produce a specific malicious output regardless of the user's prompt. Existing methods are computationally expensive and ignore the semantic structure of training data. We present POUGH (Efficient Universal Goal Hijacking with Semantics-guided Prompt Organization), which introduces an iterative optimization algorithm (I-UGH) alongside semantics-guided sampling and ranking strategies. POUGH achieves a 93.41% Attack Success Rate (ASR) on Llama-2-7b, outperforming the state-of-the-art M-GCG by nearly 40% while requiring only ~26% of the computation time.

Introduction

Goal hijacking is a form of prompt injection where an attacker appends a "suffix" to a user's prompt to override the LLM’s original purpose and force it to produce a specific, often harmful, output. While typical attacks are prompt-dependent, universal goal hijacking seeks a single, fixed suffix that works for any arbitrary user prompt.

Figure 1: Illustration of the universal goal hijacking scenario where a fixed suffix overrides diverse user prompts to produce a malicious response.

Previous methods like M-GCG (Multi-Prompt Greedy Coordinate Gradient) are computationally intensive, requiring gradient calculations across an entire training set at every iteration. Furthermore, these methods treat training prompts as a static block, ignoring how the choice and sequence of those prompts affect the optimization process. POUGH addresses these inefficiencies by organizing prompts semantically to guide the optimization path.

The POUGH Framework

POUGH consists of three core components designed to maximize both attack success and computational efficiency:

  1. Iterative Optimization Algorithm (I-UGH): Instead of optimizing against all training prompts simultaneously, I-UGH employs a curriculum-based approach. It starts with a single prompt and only increases the pool size once the current suffix achieves a success threshold (0.8 ASR) on the existing subset. This drastically reduces early-stage computational overhead.
  2. Semantics-guided Sampling: To ensure universality, the training set must be semantically diverse. POUGH uses a greedy strategy to select a subset of prompts from a large pool that exhibit the lowest mutual semantic similarity, measured via cosine similarity of LLM hidden state embeddings.
  3. Semantics-guided Ranking: The order in which prompts are introduced matters. POUGH ranks selected training prompts by their semantic similarity to the target malicious response. Prioritizing prompts that are semantically "closer" to the goal provides better gradient guidance, leading to faster convergence.

Experimental Results

The authors evaluated POUGH using the Alpaca dataset for normal prompts and AdvBench for malicious target categories (e.g., fraud, racism, suicide). The method was tested against several popular open-source models, including Llama-2-7b, Vicuna-7b, and Mistral-7B.

Table 1: Performance comparison of POUGH against baseline methods across various target response categories, showing Attack Success Rate (ASR) and computational time (#NC).

Key Findings

  • Superior Performance: On Llama-2-7b, POUGH achieved an ASR of 93.41%, compared to 54.26% for the previous state-of-the-art (M-GCG).
  • Efficiency Gains: POUGH reached these results using only ~26% of the computational time required by M-GCG. This is largely attributed to the I-UGH algorithm's ability to avoid redundant calculations on large prompt sets during early optimization phases.
  • The Necessity of Diversity: Experiments confirmed that semantic diversity in the training set is critical. Training on semantically identical prompts resulted in a failure to generalize, with ASR dropping as low as 5% on general test sets.
  • Model Robustness: The attack remained effective across different architectures, maintaining high ASRs on Vicuna (85.06%) and Mistral (81.29%).

Conclusion and Future Work

POUGH demonstrates that universal goal hijacking is a significant and efficient threat to LLMs when semantic guidance is applied to the optimization process. By starting with simple cases and gradually increasing complexity, attackers can find potent adversarial suffixes with a fraction of the traditional computational cost. Future research will focus on cross-model universality—finding a single suffix that works across different model families—and optimizing for longer, more complex malicious responses.

Summary updated

BibTeX
@inproceedings{huang2025efficient,
  author = {Yihao Huang and Chong Wang and Xiaojun Jia and Qing Guo and Felix Juefei-Xu and Jian Zhang and Yang Liu and Geguang Pu},
  title = {{Efficient Universal Goal Hijacking with Semantics-guided Prompt Organization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure