potentialpaper

Stay Centered: Semantic Barycenter Alignment for LLM Jailbreak Defense

Feng Wu, Weiqi Wang, Zhiyi Tian

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Jailbreak defenses in large language models (LLMs) are essential for ensuring model security, maintaining user trust, and supporting the sustainable development of AI applications. However, the most widely adopted defenses based on intent extraction currently rest on unstable foundations, marked by excessive dependence on target/safety LLM's security performance, prompts engineering, and limited explainability. These limitations render the defense architecture inherently passive, struggling to effectively counter evolving jailbreak. In this paper, we propose Semantic Barycenter Alignment (SBA), a novel defense method grounded in optimal transport (OT) theory. Specifically, we reinterpret intent extraction as a semantic projection task on a latent embedding manifold, mapping each user prompt to its class barycenter—a region models recognize more easily. In this process, we instruction-tune an LLM to extract input intents and use Sinkhorn divergence to quantify semantic alignment with target intents, measuring minimal deformation in Wasserstein space. During defense, the intent extractor serves as the upstream stage in the defense pipeline, passing intents aligned with the manifold barycenter to lightweight safety LLMs (e.g., Llama-Guard3-1B) for jailbreak detection. Empirical results show that SBA exhibits zero-shot robustness and steers intent embeddings toward the manifold barycenter of their semantic classes, reducing intra-class variance and simplifying downstream jailbreak detection. Moreover, built on a principled OT theory, SBA offers greater interpretability, removes reliance on prompt-specific heuristics, and reduces dependency on downstream LLM performance—providing a more proactive foundation for jailbreak defense. Code: \url{https://anonymous.4open.science/r/SBA-EE42}. \textcolor{red}{Warning: This paper may contain content that has the potential to be offensive and harmful.}

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

add · history

No versions are recorded yet: its preprint, the venues it went to and what they decided, the camera-ready. Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…