# BarrierSteer: LLM Safety via Learning Barrier Steering

*Thanh Tran, Arun Verma, Kiwan Wong, Bryan Kian Hsiang Low, Daniela Rus, Wei Xiao*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/148333) · [OpenReview](https://openreview.net/forum?id=ycSLi4NJY3) · [alphaXiv](https://www.alphaxiv.org/abs/2602.20102) · [Open on the map](../papers.html#p148333)

Category: [AI Safety, Security & Alignment](../pcat/16.md) › [LLM Safety Alignment](../pgroup/208.md) · Type: new method · Keywords: LLM safety, adversarial attacks, Control Barrier Functions, latent space steering, safety constraints

Areas: [Safety & Security](../areas/safety.md) › Safe Alignment › Steering Safety Across Modalities

## Summary
BarrierSteer is a framework that embeds learned nonlinear safety constraints as Control Barrier Functions in the LLM's latent space to steer unsafe generations.

## Explained to a 5-year-old
Big computer programs called language models sometimes write words that are not nice or safe. To help them be nicer, we give them hidden rules that act like invisible fences. These rules watch the program's thinking and push it away from saying bad things. The rules are combined together so the program can still talk normally while staying safe. This makes it safer to use the program in important places like doctors or banks.

## Explained to a 5-year-old, longer
Language models are computer programs that can write sentences like a person. Sometimes they write sentences that are not good or could be dangerous. To stop that, researchers created a new way to help the models stay safe. They added hidden safety rules that work like invisible walls around the model's thoughts. These rules watch what the model is thinking and gently push it away from unsafe ideas. The safety rules are built from classifiers that learn what is safe and what is not. Many different safety rules can be combined together without changing the model's main abilities. This means the model can still answer questions well, but it will avoid saying harmful things. The approach also has a theory behind it, meaning it is mathematically sound. Experiments show that the model makes fewer mistakes when trying to trick it into saying bad things. It also reduces the number of unsafe answers compared to older methods. Overall, this helps make language models safer for important uses like talking to doctors or banks.

## For a technical reader
BarrierSteer introduces a safety framework that treats learned classifiers as Control Barrier Functions within the LLM's hidden states. By steering unsafe latent trajectories during generation, it prevents the model from producing harmful content without altering its core parameters. Multiple safety constraints are efficiently merged, preserving the model's original performance and utility. Theoretical analysis guarantees that the steering is computationally efficient and safe when the learned barriers accurately reflect the desired safety properties. Experiments across several models show that BarrierSteer markedly reduces adversarial attack success and unsafe generations compared to existing defenses.

## Problem
Large language models can generate unsafe or adversarial content, making their deployment risky. Existing safety mechanisms often lack theoretical grounding or degrade model performance.

## Method
The approach treats hidden-state safety classifiers as Control Barrier Functions, enabling constraint-guided steering of unsafe latent trajectories during generation. Multiple safety constraints are composed via efficient merging without modifying the underlying model parameters. This yields a principled, computationally efficient steering method with theoretical guarantees when the learned barriers capture the intended safety property.

## Results
The approach significantly lowers adversarial attack success rates and unsafe content generation compared to existing methods.

## Contributions
A framework that embeds learned safety constraints as Control Barrier Functions in latent space, enabling constraint-guided steering without altering model parameters, and theoretical analysis showing guarantees under appropriate barrier conditions.

## Practical relevance
Provides a practical safety mechanism for deploying LLMs in high-stakes settings while preserving model utility.

## Research questions this paper is counted under

- [How can we reliably prevent large language models from generating harmful content across diverse contexts and modalities?](../q/24.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/148333)
