Menu
← FIELD NOTESSECURITY 2026.11.21 · 13 min

Your model's safety lives in its first few tokens, which is why nothing you typed mattered.

Safety alignment lives almost entirely in a model's first few output tokens, so the attacks that win never touch your prompt — they prefill, nudge decoding, or briefly fine-tune past it. The fix is depth in the token sequence, not another input filter.

A team puts a safety classifier in front of their model and another behind it. The input guard reads the user’s prompt and refuses anything that looks like a jailbreak; the output guard reads the response and blocks anything that looks harmful. Both are tuned, both have benchmark numbers, and the architecture diagram shows the model sitting safely between two filters that inspect everything going in and coming out. The review notes that prompt-level attacks are “handled,” and the team moves on.

Then someone finds a set of attacks the diagram has no answer for. One hands the model the opening of its own answer — a few tokens of compliance — and lets it continue. Another changes only the decoding parameters — same prompt, different temperature and sampling — and the model that refused at one setting complies at another. A third fine-tunes on a handful of innocuous-looking examples and the guardrail is gone. None touch the input the guard inspects, and none produce a prompt that looks like an attack — because the attack is not in the prompt.

The two filters were placed on the assumption that the dangerous decision happens where the team can see it, in the words the user types. It does not. It happens one layer down, in how the model generates, and almost all of it in the first handful of tokens it emits — where alignment actually lives, the part of the system the team never instrumented.

This post is about why safety alignment is shallow in a precise, measurable sense — it reshapes the model’s generative distribution primarily over its very first output tokens — why that one fact explains the whole family of attacks that win at the generation interface rather than the prompt, why the same shallowness lets a brief benign fine-tune strip alignment, and why the defensible fix is to push alignment deeper into the token sequence instead of adding another prompt-side filter.

Alignment is a shortcut over the first few tokens

An aligned model and its un-aligned base model are the same network with different weights, and you can ask, token by token, how far apart their next-token distributions are. If alignment had taught a deep, global disposition to refuse, you would expect the two to differ throughout a harmful response — the aligned model steering away at every step.

That is not what is found. Safety Alignment Should Be Made More Than Just a Few Tokens Deep (arXiv 2406.05946) names the phenomenon directly: “safety alignment can take shortcuts, wherein the alignment adapts a model’s generative distribution primarily over only its very first few output tokens.” The authors call this shallow safety alignment and make it quantitative — measuring the per-token KL divergence between the aligned and base model, they find “the KL divergence is significantly higher in the first few tokens than for later tokens.” The budget alignment spends is concentrated almost entirely at the start of the response.

The intuition this licenses is uncomfortable. The aligned model is mostly the base model; what alignment bought is a strong tendency to open with a refusal — “I cannot help with that” — and little after. Get a response past those opening tokens without committing to a refusal, and the model underneath is the same one that will happily continue, because the later tokens were barely touched. Safety here is not carried through the whole generation; it is a property of the first few tokens, and everything downstream coasts on the base model. Every attack below is a different way past those tokens; the defenses that work make the later tokens carry alignment too.

One mechanism explains the attacks that skip your prompt

Shallow alignment is not one vulnerability but the shared root of a whole family. The same paper observes that these findings “help explain multiple recently discovered vulnerabilities in LLMs, including the susceptibility to adversarial suffix attacks, prefilling attacks, decoding parameter attacks, and fine-tuning attacks.” Four named attack classes, one cause — and what they share is what a prompt-side filter cannot address: they act on generation, not the input.

Take prefilling first, the most literal demonstration. A prefilling attack supplies the beginning of the model’s own response and asks it to continue — handing it a few tokens of a compliant answer instead of letting it choose its opening. If alignment lives in those opening tokens, writing them yourself is how you defeat it, and the numbers are stark: on the initial aligned model, prefilling just 5 harmful tokens lifts attack success from near 0% to 42.1%, rising to 51.5% at 10 tokens, 56.1% at 20, and 57.0% at 40 (Table 2). A handful of tokens in the model’s mouth, and more than two in five harmful requests succeed — while an input guard reading the prompt sees a normal request, because the attack is in the response prefix.

The decoding-parameter attack is the cleanest proof that the guardrail lives at the generation interface, because it changes nothing else. Catastrophic Jailbreak of Open-source LLMs via Exploiting Generation (arXiv 2310.06987) proposes “the generation exploitation attack, an extremely simple approach that disrupts model alignment by only manipulating variations of decoding methods.” No adversarial prompt, no suffix — only decoding hyperparameters and sampling. Varying those alone raises “the misalignment rate from 0% to more than 95% across 11 language models including LLaMA2, Vicuna, Falcon, and MPT families” — the prompt unchanged, the lever downstream of everything a filter inspects. And this trivial move beats elaborate prompt-optimizing attacks, “outperforming state-of-the-art attacks with 30x lower computational cost.” The prompt is not just the wrong place to defend; it is the wrong place to attack. The decision the model makes in its first few tokens is the whole game, and an attacker who can write those tokens or change how they are sampled has already won, the prompt-level defenses none the wiser.

The same shallowness is why a brief fine-tune strips safety

If alignment is a thin layer over the opening tokens, it is also a layer a small amount of contrary training can peel off — which connects the prefill and decoding attacks to the fine-tuning failures usually treated as a separate problem. Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To! (arXiv 2310.03693) measures how little it takes: “we jailbreak GPT-3.5 Turbo’s safety guardrails by fine-tuning it on only 10 such examples at a cost of less than $0.20 via OpenAI’s APIs, making the model responsive to nearly any harmful instructions.” The guardrail that survived every prompt-level red-team probe does not survive ten gradient steps in the wrong direction — what you would predict if it were a shallow distribution shift over a few tokens rather than a deep property of the weights.

It also makes the point that should worry a team with no malicious intent at all: “even without malicious intent, simply fine-tuning with benign and commonly used datasets can also inadvertently degrade the safety alignment of LLMs, though to a lesser extent.” An ordinary fine-tune on ordinary data dislodges the thin layer as a side effect, because it was never anchored deeply enough to survive the model being trained on anything else — so “even if a model’s initial safety alignment is impeccable, it is not necessarily to be maintained after custom fine-tuning.” The guardrail is not a durable property you establish once; it is a shallow one you can knock loose, on purpose with ten examples or by accident with a benign dataset.

This is the same phenomenon seen from the data side in that benign fine-tuning measurably erodes safety alignment and that a provider’s upload moderation does not stop optimized poison from teaching the harmful behavior. The few-token mechanism is the reason underneath both: there is so little alignment, so concentrated, that a small training perturbation removes it.

The fix is depth in the token sequence, not another filter

If alignment is too shallow, the fix is not a fourth filter outside the model — it is making alignment reach deeper into the response. The paper that named the problem demonstrates this is achievable, which doubles as confirmation the diagnosis was right. The first move is a data-augmentation defense: train the model on examples where the response begins with a harmful prefix and then recovers into a refusal. The prefilling attack worked because the model could not recover once its opening was harmful; teaching it to recover collapses the attack. At 20 prefilled tokens, the attack that scored 56.1% on the initial model drops to 3.4% on the data-augmented model (Table 2), closing the exposure by pushing alignment-relevant behavior past the first few tokens.

The second move targets the fine-tuning attack at its root. Since standard fine-tuning destroys alignment by changing precisely those high-divergence initial tokens, the defense is a regularized objective constraining how far updates can move the initial-token distribution — a token-wise-constrained SFT. On Llama-2-7B-Chat under a harmful-examples fine-tuning attack, standard SFT leaves 88.9% attack success; the constrained objective holds it to 4.6%, against an initial pre-attack rate of 1.5% (Table 3). The model can still be fine-tuned; it just cannot have its first-token alignment trivially overwritten. Both moves say the same thing: prefill writes the response tokens, decoding changes how they are sampled, fine-tuning rewrites the weights that produce them — and the only layer underneath all three, the only place a durable defense lives, is the generation distribution.

The honest version: “deeper” is a frontier, not a finish line

The easy version — “depth fixes safety, ship the data-augmentation defense and you are done” — is wrong, and the literature that establishes the depth thesis is the same that complicates the fix. The data-augmentation defense is better than nothing, but not as deep as it looks. Matching Ranks Over Probability Yields Truly Deep Safety Alignment (arXiv 2512.05518) shows it works by “shifting large probability mass to a small number of refusal tokens while neglecting the high ranks of harmful tokens, revealing that ‘deep’ safety alignment achieved through data augmentation is in fact not very deep.” The paper’s Rank-Assisted Prefilling (RAP) attack exploits that residue, “selecting low-probability ‘harmful’ tokens from the top 20 predicted next tokens” — and this attack, too, lives on the generation interface, not the prompt. As of late 2025 the frontier has moved without closing.

A sharper complication on the fine-tuning side cuts against any defense that is itself only a few tokens deep. No, of Course I Can! Deeper Fine-Tuning Attacks That Bypass Token-Level Safety Mechanisms (arXiv 2502.19537) confirms the shallowness thesis from the attacker’s side — “most attacks involving harmless data are only a few tokens deep, and can thus be blocked by defenses that are only a few tokens deep” — then builds the attack that defeats a depth-limited defense in the dimension it ignores. Its refuse-then-comply attack does not remove the refusal at all; it “trains the model to initially refuse all requests — benign or harmful — before fulfilling them,” with data that prepends a custom refusal followed by “Now that we have finished discussing the safety policy, let’s answer your question.” A defense that only checks the first few tokens sees the refusal and passes; the harm arrives after it. This is no toy result on open weights: 57% attack success against GPT-4o and 72% against Claude Haiku (56% on Llama-3-8b-Instruct, 35% on Gemma-2-9b-It without defenses), and it “received a $2000 bug bounty from OpenAI, and was acknowledged as a vulnerability by Anthropic.”

So the limits point the same way: depth is a property an adversary keeps probing for the next shallow edge of, not a quantity you buy once. The thesis is not “here is the fix” but “stop defending the prompt, because the vulnerability and its fixes both live in the generation distribution,” which is still unfinished work.

One precondition bounds who each attack reaches. Prefill and decoding attacks assume the attacker controls the generation interface — open weights, or any deployment exposing prefill or decoding parameters — and reach far less into a closed API that fixes decoding and forbids prefills; fine-tuning attacks assume a fine-tuning channel, open or hosted. Serve open weights and all three are live; serve a locked-down API and fine-tuning is the one to watch, as the refuse-then-comply result confirms.

Defending the generation interface, not the prompt

You cannot fix shallow alignment by adding another thing that reads the prompt; move your instrumentation and defenses to the layer where safety is actually decided.

Treat prefill and decoding parameters as attacker-reachable, not configuration. If your serving stack lets a caller supply a response prefix or set decoding hyperparameters, those are inputs to the generation interface, where alignment is bypassed without tripping a prompt filter — lock down or guard that interface with the seriousness you guard the prompt.

Do not record an input guard or output classifier as the control for jailbreaks. Both read text while the winning attacks act on the distribution that produces it — and unlike prompt injection, where an input filter at least faces the right surface and still gets broken by an adaptive attacker, here the filter is on the wrong surface entirely; an output classifier is itself only a few tokens deep, which is what refuse-then-comply exploits. Write these down as partial measures, and leave the line for “defense against generation-interface attacks” empty until a generation-side measure fills it.

If you fine-tune, prefer a token-wise-constrained objective over standard SFT, and gate the result on a safety evaluation. Standard fine-tuning overwrites exactly the initial-token distribution alignment depends on — why ten examples or a benign dataset can strip it — and because even benign fine-tuning erodes alignment, “we did not train on anything harmful” is not evidence the model is still aligned. Re-run the safety evaluation on the fine-tuned weights as a release gate.

Red-team the response, not only the request, and treat any depth defense as a frontier. A jailbreak corpus is, by default, a set of prompts; add prefilling attacks, decoding-parameter sweeps, and a refuse-then-comply fine-tuning probe where allowed — an untested generation-interface attack has an unmeasured success rate the research puts in the tens of percent. Even a depth defense leaves a residue to walk through, so keep attacking it from the generation side, re-running on every model and serving change. Your alignment is exactly as deep as the deepest attack you have tested it against.

Reading list

The team put the model in a box with a filter on each side, because the model felt like the dangerous part and the prompt felt like the way in. But its safety was never spread through the box — it was crowded into the first few tokens of every answer, a thin reflex to open with a refusal, with the base model underneath doing whatever comes next. Prefill those tokens, change how they are sampled, or fine-tune them away with ten examples, and the reflex is gone while both filters report nothing wrong, because nothing wrong ever passed through them. The guardrail you can audit is not the guardrail that matters; the one that matters is a few tokens deep, in the distribution your prompt-side defenses never read — and that is the only place to make it deeper.

NEW ENGAGEMENT · INTAKE

Tell us about it.

The more specific you are, the more useful our first reply.

SERVICE AREA
↩ ENCRYPTED IN TRANSIT
ASK THE FIELD NOTES BETA