SECA: Semantically Equivalent and Coherent Attacks for Eliciting LLM Hallucinations

Buyun Liang, Liangzu Peng, Jinqi Luo, Darshan Thaker, Kwan Ho Ryan Chan, Rene Vidal

Abstract

Large Language Models (LLMs) frequently exhibit hallucinations—confident but incorrect outputs. While adversarial attacks have been used to probe these vulnerabilities, most existing methods rely on "gibberish" tokens or significant meaning shifts that do not reflect natural human interaction. This paper introduces SECA (Semantically Equivalent and Coherent Attacks), a framework that generates realistic, human-like adversarial prompts. By rephrasing questions to maintain semantic equivalence and linguistic coherence, SECA successfully elicits hallucinations in models that previously answered the original queries correctly. Our results demonstrate a universal vulnerability across both open-source and proprietary models, highlighting a fundamental brittleness in current LLM reasoning.

Introduction: The Challenge of Realistic Robustness

As LLMs are increasingly integrated into critical workflows, understanding their failure modes is paramount. Traditional adversarial attacks often involve inserting nonsensical strings (e.g., "with@Now"!") to trigger errors. While these reveal technical bugs, they fail to capture how models might break during standard human usage. A more significant concern is whether a model remains robust when a user simply rephrases a question.

The SECA attack addresses this by focusing on two constraints: Semantic Equivalence (SE), ensuring the prompt's meaning remains unchanged, and Semantic Coherence (SC), ensuring the prompt remains fluent and natural.

Figure 1: Overview of the SECA attack. A semantically equivalent rephrase of a simple math problem causes the LLM to hallucinate a wrong answer despite answering the original query correctly.

Methodology: Optimizing for Hallucination

SECA formulates the search for adversarial prompts as a constrained optimization problem. The objective is to find a prompt $x$ that maximizes the probability of an incorrect target answer $y^*$, while strictly adhering to SE and SC constraints.

To achieve this without white-box access to model gradients, SECA employs a multi-stage iterative process:

  1. Candidate Proposal: A lightweight "proposer" model (e.g., GPT-4.1-Nano) generates diverse rephrasings using various linguistic styles.
  2. Feasibility Filtering: A more capable "judge" model (e.g., GPT-4o-Mini) evaluates candidates against five rigorous semantic equivalence criteria, such as mutual entailment and absence of extraneous information.
  3. Iterative Refinement: The algorithm selects the most adversarial candidates—those that most significantly shift the target model's output probability—and uses them as seeds for the next generation of rephrasings.

Experimental Setup

The framework was evaluated using the MMLU (Massive Multitask Language Understanding) dataset, spanning 16 subjects including Mathematics, Law, and Computer Security. To ensure the attacks targeted true hallucinations rather than simple knowledge gaps, the researchers only attacked questions that the models initially answered correctly.

Results and Discussion

SECA demonstrated remarkable effectiveness across a wide range of models, including Llama-3, Qwen-2.5, and GPT-4o.

Attack Success and Semantic Integrity

The Attack Success Rate (ASR) saw significant increases across all tested models. For instance, on Llama-3-8B, the ASR rose from a baseline of 63.5% to 81.2%. More impressively, SECA maintained near-zero semantic errors, a feat that previous methods like GCG (Greedy Coordinate Gradient) failed to achieve. GCG often produces gibberish that lowers model confidence so drastically that it cannot be effectively optimized toward a specific incorrect answer.

Figure 4: Performance metrics of SECA across various subjects and models. The radar charts show Attack Success Rate (ASR) and log-probability shifts, while the table highlights SECA's superior semantic integrity compared to GCG.

Insights into Model Failure

  • Complexity and Attention: Successful adversarial prompts were generally more verbose and lexically diverse. This suggests that complex sentence structures can distract the model's internal attention mechanisms, leading to reasoning errors.
  • The First-Token Trap: A critical finding was the "first-token" effect. If an adversarial prompt tricks the model into outputting an initial incorrect token (e.g., a wrong multiple-choice letter), the model tends to generate a "hallucinated rationale" to justify that choice rather than correcting itself during the generation process.

Conclusion and Future Work

SECA reveals that current LLMs are highly sensitive to subtle linguistic variations. Even when a model "knows" the answer to a question, a polite or verbose rephrase can trigger a confident hallucination. While SECA is computationally intensive—requiring approximately two minutes per attack—it provides a vital tool for systematically red-teaming models for real-world reliability. Future research will explore untargeted versions of the attack and its effectiveness against emerging "reasoning-heavy" models.

Summary updated

BibTeX
@inproceedings{liang2025seca,
  author = {Buyun Liang and Liangzu Peng and Jinqi Luo and Darshan Thaker and Kwan Ho Ryan Chan and Rene Vidal},
  title = {{SECA: Semantically Equivalent and Coherent Attacks for Eliciting LLM Hallucinations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=8Flpo0zaaO},
}
Figure