# Poster 28172

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/28172

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hi, I'm Anur and this is joint work with Aditi and Sampavna. And so we, in this work, we propose a hypergraph-based framework to defend against persuasive LLM attacks, especially ones that exploit natural language structure. So the challenge that these attacks propose is that these attacks, they go way beyond jailbreaks. They mimic human conversation, making it hard to distinguish manipulation from genuine input.
So most token level or model based defenses fail because they lack structural awareness.
And so our method, let's go deeper into it. What we have is that we start by creating something called forward edges. These are hypergraph edges. We tokenize the prompt and add forward edges to capture the sequential structure. And the cover tree that is built here is not meant for modeling, but to speed up the semantic neighborhood lookups when we later compute backward edges.
So our definition of a backward edge is that we start creating hyperedges between semantically related tokens. And as you can see, these tokens can be quite far apart in the prompt space. And so this captures the latent relationships that are missed by sequential models.
So then the result, the end result is a rich hypergraph and it models the multi-token relationships, it respects hierarchy, it avoids the curse of dimensionality and it lets us reason algebraically. So this is the core of our defense, it is a geometrical lens on prompts.
And so moving on, what we need to do is we need to create a metric space on the hypergraphs. And so how we do that is that we define a distance between tokens using a concept called S-walks, which is nothing but sequences of overlapping hyperedges. And so this gives us a proper metric space preserving both semantic proximity and structure.
To compare full prompts, we use the Gromov-Halstov distance. It embeds both the prompts into a shared space and then measures how structurally similar these prompts are. So this lets us rigorously compare safe versus malicious prompts.
So moving on, we also derive bounds on the generalization error by analyzing the distortion under the RBF kernel. So using the minimum enclosing ball, we connect the Gromov-Hausdorff distance with margin bounds and this gives us theoretical safety guarantees. These guarantees are something that some of the other defense mechanisms don't come with. And so this is a new contribution from our end.
Moving on to the empirical results, we evaluate our defense on four LLM models. We find that ours achieves the lowest attack success rate that is consistently below 9% and it outperforms token-based, graph-based and gradient-based defenses across the board.
And so if we move on to see persuasion prompts, here's a pattern called a misrepresentation pattern. The hyperstructure reveals attack motifs like stars, a star motif, a bifan motif, and a SWAP chain that you can see here. So these patterns, they reflect how ideas are connected to mislead and are invisible to standard defenses.
So, we then later on checked whether the persuasive attacks are the only ones that are hypergraph defense against, or can it also work for algorithmic attacks? And to our surprise, what we found is that even the adversarial prompts that are generated algorithmically, they show structure. And so here, for example, with the GCG attack, you find that it also shows these bridging sort of S walks.
And it creates these two clusters that clearly identify the original prompt and distinguish the adversarial string that was attached to it, right? And so this proves that our method generalizes from persuasive language to algorithmic attack strings as well.
Finally, I would like to thank you for listening patiently. And so I would like to end by saying that hypergraphs, they give us a powerful and a principled way to understand the problem structure and defend against evolving LLM attacks. Thank you.
