NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Inference-Time Vulnerability Beyond Shallow Safety: Alignment Along Generation Trajectories

Kyungmin Park, Taesup Kim

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: AI Safety, Security & Alignment › LLM Safety Alignment · Type: new method · Keywords: inference-time vulnerability, safety alignment, generation trajectories, mid-sequence injection, LLM safety

Areas: Safety & Security › Safe Alignment › Refusal and Activation Steering

Summary

The paper proposes aligning models on generation trajectories with simulated mid-sequence perturbations to improve robustness against inference-time injection attacks.

Explained to a 5-year-old

Big computer programs called language models try to answer questions safely. Sometimes someone can sneak a tiny word into the answer that makes the program say something bad. The program only checks safety at the beginning, so later tricks can get through. The researchers taught the program to think about the whole answer step by step, so it can see tricks coming. Now the program is harder to trick and stays safer when someone tries to mess with it.

Explained to a 5-year-old, longer

Big computer programs called language models try to answer questions and talk to people. They are supposed to be safe and not say bad things. Sometimes a person can add a tiny word or sentence while the program is writing, and that can make the program say something harmful. Right now, the safety check only looks at the first few words, so later tricks can slip through. The researchers found out that this problem is bigger than just the first words; it can happen at any point while the program is writing. They also discovered that looking inside the program’s brain does not always tell if it will be safe. To fix this, they taught the program to think about the whole writing process, like practicing a story from start to finish. They made the program see what happens if someone tries to trick it in the middle of writing. By doing this practice, the program learns to notice tricks earlier and stay safe. This new way of training helps the program be safer when someone tries to mess with it. It works not only for tricks in the middle but also for tricks that happen early. So the program becomes more robust and less likely to say bad things.

For a technical reader

Current safety alignment for language models typically focuses on the first few tokens of generation, leaving later tokens vulnerable to injection attacks. The paper shows that brief token injections at any point can drastically alter the model's safety behavior, and that internal alignment signals do not reliably predict this robustness. To address this, the authors train models on full generation trajectories that simulate mid-sequence perturbations, encouraging the model to maintain safety throughout the entire output. This trajectory-based training improves resistance to both mid-sequence and early-token attacks without requiring changes to the model architecture. The result is a more reliable safety mechanism that can be integrated into existing LLM pipelines with minimal overhead.

Problem

Safety-aligned language models can be subverted by brief token injections at any point during generation, making them vulnerable beyond early-token safety. Additionally, alignment in hidden states does not guarantee robustness, indicating a need for methods that consider the full generation trajectory.

Method

The approach aligns models directly on generation trajectories by simulating mid-sequence token injections and optimizing against these perturbations. This training encourages robustness to injections at any generation step and improves safety across the whole sequence.

Results

The approach improves robustness to mid-sequence injection attacks and generalizes to early-token attacks, yielding safer generation under perturbation.

Contributions

It identifies a broader class of inference-time vulnerabilities beyond shallow safety, shows that hidden-state alignment does not predict robustness, and proposes trajectory-based alignment training to enhance safety across the entire generation process.

Research questions this paper is counted under

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