Manuscript Offprint
arXiv:2611.11979FireGate: Bounding Behaviour Change Before Training in Continual RL Fine-Tuning
Abstract
Fine-tuning a deployed language model on one task after another can change behaviour that should stay fixed, such as earlier skills, general chat or refusals. Today, such forgetting is found only after training, on the benchmarks someone chose to run. This work bounds, before training, how often its outputs change on chosen prompt distributions. FIREGATE places each task's update, such as a new LoRA, behind a gate, which is a classifier on the model's frozen lower layers that decides for each prompt whether the update is used. Where no gate fires, the model computes exactly what the old one computes. As a result, on any prompt distribution, every bounded behaviour score changes by at most the gates' firing rate there over a whole task stream. Calibrating each gate on unlabeled prompts of what must not change fixes that rate before training, with a PAC guarantee, whatever weights training produces. Forgetting is thus bounded by the gate's false-alarm rate, and its price is the gate's power: no update, gated or not, that changes as few protected outputs can change new-task outputs more often than the best test of that level tells new-task prompts from protected ones. On reinforcement-learning streams of up to five tasks, gated training keeps the earlier tasks and changes 3.3% of held-out chat responses, whereas ungated training changes 91.8%. Across seven models, the gain kept behind the gate follows its firing rate on new-task prompts, measured before training. The certificate covers the gated model as deployed, on the prompt distributions sampled for calibration, not against an adversary who searches for prompts that fire the gate. Code is available at https://github.com/mahemon/firegate.
1. Introduction
A deployed language model is often fine-tuned again, for example with reinforcement learning (RL) on a new skill and later on another, but each update must leave the earlier skills and the rest of its behaviour intact. Today, this preservation is checked only after training, on whichever benchmarks were chosen, and the evidence is mixed. RL fine-tuning has been argued to forget less than supervised fine-tuning (Shenfeld et al., 2026; Chen et al., 2026; Lai et al., 2026), yet continual RL streams still forget (Luo et al., 2026b), if sometimes only modestly (Luo et al., 2026a). Benign fine-tuning also erodes behaviour that nobody targeted (Qi et al., 2024; Ung et al., 2024; Li & Lee, 2024; Betley et al., 2026).
The goal is to bound the change of behaviour before an update is trained, for every bounded behaviour score at once, without behaviour labels, from unlabeled prompts of what must not change. Before training, such a bound must hold for every model that training might produce. Regularisers, replay and orthogonal low-rank adaptation (LoRA) change which model training finds, not which models it could find. Therefore, for an expressive update, they give no bound of this kind, issued before training and uniform over updates, without assumptions on the trained weights or the reachable models (Theorems A.1 and 4.2). FIREGATE instead limits where an update acts.
The network is split into a frozen trunk, the lower blocks, and the upper blocks. Each new task gets a LoRA in the upper blocks that is switched on only after a gate fires; the gate is a test on trunk features of whether the input belongs to the new task (Figure 1). Until it fires, the adapted model performs exactly the old model's computation. Consequently, by Theorem 3.2, the total-variation (TV) distance between their outputs on any prompt distribution is at most the gate's firing rate there. That rate does not depend on the LoRA weights, so it is fixed before training. The gate's threshold is set on unlabeled prompts of each component that must not change, as one sets the level of a Neyman–Pearson test (Theorem 3.6). Forgetting on those components is then at most the gate's false-alarm rate. A prompt-time gate certi-
Preprint. November 10, 2026.
fies any separately trained model behind it as a deployed pair (Theorem 3.4). The certificate is thus a guarantee on the deployed model that rests on exact fallback to the old one: it bounds how often outputs change on the sampled prompt distributions and leaves the outputs where a gate fires to the update.
The update can act only where the gate fires, so it can change the new task only on the share of new-task prompts that the gate accepts, which is estimated before training. This price binds every method. By Theorem 4.1, any update that changes at most a share of protected outputs, gated or not, changes new-task outputs no more often than the best size- test between the two prompt sources accepts new-task prompts. Furthermore, by Theorem 4.2, a certificate confines each large change to prompts of small reference mass.
The experiments test a linear-classifier gate with LoRA (Hu et al., 2022) trained by group-relative policy optimisation (GRPO) (Shao et al., 2024) on seven models from five families, on two task streams and a ladder of tasks whose prompts look increasingly like general chat, against eleven training baselines and gates built from other scores. No response on which the gate was silent ever changed. On the task streams, gated training keeps the earlier tasks, while every ungated method, even one regularised on the same prompts the gate uses, changes most general-chat responses. Models behind the gate keep about the share of their gain that its coverage, measured before training, indicates.
The contributions are:
-
A calibration of the gate on unlabeled prompts, before training and without behaviour labels, that turns the standard bound for exact fallback into a certificate on the deployed gated model, not on the trained weights: tight, composable over a stream and valid for any update above the split and any model behind a prompt-time gate (Section 3).
-
The price of this certificate: a Neyman–Pearson limit per protected component that binds every method and that a likelihood-ratio gate on the trunk attains, a benchmark for the linear gate (Sections 4 and 6.4), and a recipe that prices each protected component before training (Section 5).
-
An evaluation that separates what the switch, calibration and training under the gate contribute, with a pre-registered test on benchmarks written by others (Section 6).
These claims differ in support: no change where no gate fires is proved and checked, firing at most on each sampled component has a PAC guarantee, and what changes where a gate fires is only measured (Table 6).
where the equality holds because both laws share the prompt marginal. For every behaviour score , whether accuracy, refusal, a format check or a judge's verdict, , so a bound on TV bounds all of them, including the ones nobody thought to measure. The bound is on averages over : a behaviour confined to a share of smaller than the bound can still change completely, so prompts that must not change need their own reference component. Under greedy decoding the TV in Equation (1) is the share of prompts whose response changes, a conservative stand-in for changed behaviour, since a changed response may be a rewording.
3. Certifying an update before training
3.1. Gated updates and the coupling certificate
Let the network have blocks with causal attention and position-wise feed-forward layers. Fix a split depth . The trunk, blocks , is frozen for the whole stream; the trunk feature is the residual stream entering block at position . Because attention is causal, depends only on .
Definition 3.1 (Gated update). A gate is a map , possibly randomised afresh per sequence, independently of input and decoding, and possibly restricted to a set of positions, where whether position is used depends only on . Its first firing time on is , or if it never fires, and its latch is . Given an old policy and an update that modifies the computation of blocks position-wise, such as a LoRA on their projections or a full-rank change of their weights, the gated policy applies at position if and only if . An

Figure 1. Overview of FIREGATE. (a) Before training, the gate's classifier is fitted (1) and calibrated on unlabeled prompts (2), which fixes its firing rate. (b) Each task's update acts only where its gate fires (3); elsewhere the model is exactly the old one, so at most that share of outputs changes (4). The update can be a LoRA or a full-rank change of the upper blocks, trained by RL or SFT, or a separately trained model behind a prompt-time gate.
anytime gate may fire at any position after the chat-template prefix; a prompt-time gate only at the last prompt token.
The gate fires on if it fires at a position that influences the generated text: . A prompt-time gate either fires at the last prompt token, and then the update is on for the whole response, or it never fires.
Theorem 3.2 (Coupling certificate). For every prompt distribution , every decoding rule, and every update ,
Moreover , and with shared decoding randomness the response of equals that of on every run on which the gate does not fire.
Proof idea: Run both models with the same uniform variables. By induction over positions and blocks, the runs share every hidden state until the gate first fires, and the firing decision depends only on that shared prefix; outside the runs are identical, and the coupling inequality (Lindvall, 1992) gives the bound. All proofs are in Section B. The bound is on the average over : it says nothing about any single prompt, about prompts outside , or about how responses change where the gate fires (Table 6).
The certificate does not depend on , and no bound that depends only on the gate and holds for every update can improve it by more than a factor :
Proposition 3.3 (Tightness). Suppose an update can place all probability on a token at the positions where it is active, and gives probability at most at those positions. Then .
Without a gate () some update drifts by nearly one (Theorems A.1 and 3.3).
A certified switch for any trained model: A prompt-time
gate decides once: its decision depends on alone, as the trunk is frozen and attention causal.
Corollary 3.4 (Certified switch). Let be the decision of a prompt-time gate and any policy. The switch answers with if and with otherwise. Theorem 3.2 holds for with , and its response equals s wherever .
The certificate thus takes two forms. Trained under its gate, an update acts only where the gate fires, as in parameter isolation (Aljundi et al., 2017; Liang et al., 2025) but with no task label at inference; behind a switch, any trained model is certified but keeps its own forgetting (Section 6.4).
3.2. Calibration without behaviour labels
The certificate is a firing probability of the old model, so it can be estimated, and the threshold set, before training, from unlabeled prompts and the old model's responses.
Proposition 3.5 (Estimation on any distribution). Roll out on i.i.d. prompts from , independent of , and let be the number of firings. With probability at least , , the one-sided Clopper–Pearson bound (Clopper & Pearson, 1934).
A scored gate fires on only if , the maximum running over the positions where it is evaluated, so . The threshold is set before training with the Neyman–Pearson umbrella algorithm (Tong et al., 2018), a training-conditional conformal bound (Vovk, 2012; Bates et al., 2021), applied to each reference component with a union bound, which gives a probably approximately correct (PAC) guarantee.
Theorem 3.6 (PAC calibration). Let and be fixed independently of the calibration set. For each reference component , draw i.i.d. calibration trajectories of on and let be their sorted scores. Let , , and . Then with probability at least over the calibration draws, for every .
Certified level and its check: On each reference component the certificate is the level , fixed before training with confidence over the calibration draw, for prompts drawn like the calibration prompts. The level attained is lower, on average at most 1.7% for the 700 Dolly calibration prompts used here (Theorem A.3). It carries over to mixtures of components, and becomes or within TV distance of a component or at density ratio at most to it (Theorem A.4). Held-out prompts of a component check the level with a one-sided binomial test. A prompt-time gate's firing depends on the prompt alone, so its certificate holds under every decoding rule; an anytime gate's holds for the rule it was calibrated under. On a distribution far from every component, such as MMLU, the only certificate is the bound of Theorem 3.5 from a sample of it, which holds for that distribution only and can be large (Table 1).
3.3. Streams and prompts unlike the task
In a stream, stage adds a gate on the same frozen trunk and a LoRA gated by its own latch, and leaves and unchanged.
Theorem 3.7 (Stream certificate). For every and every distribution , .
Drift on task is bounded by the firing of the later gates on 's own trajectories, so earlier tasks are protected without replaying their labels, and calibrating each stage at certifies the union of stages at with confidence (Theorem A.5). A prompt-time union can also be certified directly as one gate, by Theorem 3.5 on fresh prompts that no stage used, at confidence and at a level that does not grow with . Anytime gates need fresh calibration prompts at each stage (Theorem A.5); the gates here reuse them, so their later stages are only checked held out.
A classifier trained to tell the new task from the reference extrapolates on prompts unlike both, and may fire there. A second test, whether the prompt lies in the new task's region, bounds the firing on such prompts.
Proposition 3.8 (Two-sided gate). Let be a prompt-time gate with score , a set of prompts, both fixed independently of the calibration prompts, and . (a) For every and every , . (b) Theorem 3.6 applied to the score equal to on and to off calibrates with the same guarantee on every reference component. (c) Let for a function fixed independently of i.i.d. prompts of , and the -th smallest value of on them, or if . If , then with probability at least ; if , then .
The region is not a safety filter: it excludes prompts unlike the task, not prompts written like it, such as harmful requests in the task's format, which must be added to the reference. With 1,000 unlabeled RL prompts and , it misses at most 2.9% of new-task prompts with probability 0.95.
Checks without labels: An audit evaluates only fired prompts (Theorem A.10), an anytime-valid test (Ramdas et al., 2023) on the firing indicator raises an alarm when traffic fires more often than certified (Theorem A.11), and raising a threshold repairs a failed certificate without retraining (Theorem A.12).

Figure 2. The certificate and its price, schematically. At most a share of protected prompts lie above the threshold, the only ones whose outputs can change; the update acts only on the share of new-task prompts above it.
4. The price of certification
An update that changes at most a share of behaviour on the reference can change the new task only as far as a test of level tells the two apart, gated or not.
Theorem 4.1 (Certified plasticity limit). Let be any policy, gated or not, and . If , then , the power of the size- Neyman–Pearson test of against , and, for ,
The expected reward gain on is at most times the reward range. If the update can move the response distribution of every prompt where it acts as Theorem 3.3 assumes, and the likelihood ratio of to is a function of the trunk feature , then is attained up to the factor by a gated update whose prompt-time gate is the likelihood-ratio test, randomised on ties (deterministic if the ratio has no atoms).
In words, an update can change the new task only as far as a test can tell its prompts from the reference, whether it is gated, regularised, replays data or uses orthogonal or null-space LoRA (Figure 2). The first claim is the Neyman–Pearson lemma (Neyman & Pearson, 1933); the KL form is rarely informative for distinct tasks (Theorem A.7). With a level per component, as Theorem 3.6 sets them, the limit is that of the generalised Neyman–Pearson lemma (Dantzig & Wald, 1951; Lehmann & Romano, 2022): a likelihood-ratio test against a weighted sum of components, whose weights price each component's level (Theorem A.2). Where the limit is known (Section K.4), the linear score comes within about a point of it under a shift with enough prompts, PAC calibration costs about 5 points, near the 4 that Theorem A.3 predicts, and under a change of spread only a quadratic score comes close. On real tasks the limit is unknown, and the coverage of any gate is a lower bound on , not an estimate of it. Responses add no evidence about a prompt's source (Theorem A.8), so an optimal gate needs only the prompt, as FIREGATE-prompt reads, and thresholding an estimated density ratio loses at most its error in coverage, while calibration keeps the certificate valid (Theorem A.9).
Corollary 4.2 (A certificate before training confines every large change). Let be the set of models that training can reach, and a set of prompts on which one moves every response distribution by at least in TV, as an unconstrained update can on every prompt (Theorem 3.3). If every changes at most a share of outputs on , then and .
So under a certificate before training each reachable model changes outputs strongly only on prompts of reference mass about . Different models may use different regions, so this does not force one common gate; a gate is the simplest way to fix the region in advance, and a likelihood-ratio gate on the trunk can attain the limit; a penalty bounds only the weights that optimise it, and only their sampled outputs (Theorem A.1). A class that moves no response by more than is certified at without a gate, but changes new-task responses by at most too.
Proposition 4.3 (Gain behind a gate). Let be the decision of a prompt-time gate, any policy, the difference between the expected rewards of and on prompt , the gain of itself, , and the means of on new-task prompts with and . The gain of the switch on is .
The coverage is the gate's firing rate on unlabeled new-task prompts, so it is estimated before training; the gain kept is plus a covariance term that the certificate does not control. The term vanishes as and when the prompts the gate misses would gain as much as the others, so is a prediction, tested in Section 6.3, not a bound.
5. FIREGATE in practice
The gate is a linear classifier with score , where and are per-coordinate statistics. Class-balanced logistic regression fits it to separate prompts of the new task from those of the reference components; its only supervision is which pool a prompt came from. Fitting and calibration use disjoint prompts, as Theorem 3.6 requires. FIREGATE-prompt scores the last prompt token; FIREGATE-anytime scores every position after the template prefix; a whole-sequence variant of FIREGATE-prompt applies the LoRA to the whole sequence once the gate has fired, as a switch does. A LoRA is trained under its own gate, where rollouts on which the gate does not fire carry no gradient, or by any method and placed behind the gate afterwards (Theorem 3.4). The two-sided region keeps prompts whose Mahalanobis distance to the new task's fitting prompts, in the classifier's feature space, is below its quantile on unlabeled RL prompts, with (Algorithm 1, Section C).
Choosing the reference: The certificate covers the compo-
nents one samples, so choosing them is part of the method, and each choice can be priced before training. (1) Calibrate on every kind of prompt whose behaviour must not change; a sample of the deployment's own unlabeled traffic can itself be a component. (2) Check any other unlabeled pool before training, from one trunk pass: the bound of Theorem 3.5 on a sample of it is its certificate. (3) Use the two-sided gate, which caps the firing on any pool at its mass in the task's region and misses about a share of the task's prompts. (4) If a pool still fires more often than , such as harmful requests written in the task's format, add it as a component, the remedy. (5) If the task cannot be told apart from some component, such as general chat, calibrate only on the components to protect: they are then certified for any model, and the gate's firing on the others, estimated before training, says how much of them may change. The coverage after each step is the price of that step, by Theorem 4.3, and the weights of Theorem A.2 say which component sets it. Steps (1) and (2) with Theorem 3.6 give the certificate; steps (3)–(5) change only which prompts it covers and the coverage. A distribution at density ratio at most to a component is certified at (Theorem A.4).
Deciding before training: The coverage is measured on unlabeled task prompts before any training, and a model behind the gate keeps about of its gain (Theorem 4.3). The recipe therefore also says whether certification is worth its price. With near 1, as on the task streams, almost all of the gain is kept; with near 0, as on Concise (0.7%), the components to protect must be narrowed or the task left ungated. Certification is cheapest for tasks whose prompts are easy to tell apart from what must stay, and most costly for chat-like tasks, as Theorem 4.1 predicts.
6. Experiments
6.1. Setup
Models and tasks: Qwen2.5-1.5B- and 7B-Instruct (Qwen Team, 2024), OLMo-2-7B-Instruct (Team OLMo, 2024), Llama-3.2-3B- and 3.1-8B-Instruct (Grattaflori et al., 2024), DeepSeek-LLM-7B-Chat (Bi et al., 2024) and Mistral-7B-Instruct (Jiang et al., 2023). Two streams of tasks that are easy to tell apart from the reference: GSM8K (Cobbe et al., 2021), Countdown (Pan et al., 2025) and Knights and Knaves (Xie et al., 2025a;b), and a five-task stream that adds MATH (Hendrycks et al., 2021b) and Sudoku. An overlap ladder of tasks whose prompts resemble the reference more and more: IF, Dolly requests with a format constraint (Zhou et al., 2023); NQ, closed-book Natural Questions (Kwiatkowski et al., 2019; Lee et al., 2019); and Concise-ctx and Concise, Dolly requests with or without a passage, rewarded for a short answer. A natural task that overlaps chat: SQuAD 2.0 (Rajpurkar et al., 2018), rewarded for the gold answer or for abstaining. The gate
Table 1. Certified levels and their checks (%). Every reference component, Dolly among them, is certified at 3% with probability 0.95 (Theorem 3.6). Dolly, MMLU: firing on held-out prompts and, in brackets, its 95% Clopper–Pearson bound (Theorem 3.5), a check on Dolly and the only certificate on MMLU. : firing on the unlabeled RL prompts, which also set the two-sided gate's region, so there. Streams: union of per-stage gates, each at 3%. 10k: the bound from 10,000 fresh Dolly requests (Table 20).
| Experiment | deployed gate | two-sided gate | |||||
|---|---|---|---|---|---|---|---|
| Dolly | 10k | MMLU | Dolly | MMLU | |||
| NQ, Qwen 1.5B | 92.2 | 3.2 [5.1] | 1.7 | 0.0 [0.6] | 90.7 | 2.8 [4.5] | 0.0 [0.6] |
| NQ, Qwen 7B | 97.9 | 2.8 [4.5] | 2.5 | 0.0 [0.6] | 96.1 | 2.0 [3.6] | 0.0 [0.6] |
| NQ, OLMo-2 7B | 96.8 | 2.2 [3.9] | 2.2 | 0.0 [0.6] | 95.0 | 2.2 [3.9] | 0.0 [0.6] |
| IF, Qwen 1.5B | 100.0 | 1.5 [2.9] | — | 99.4 [99.8] | 98.0 | 0.0 [0.7] | 0.0 [0.6] |
| IF, Qwen 7B | 100.0 | 1.8 [3.3] | — | 100.0 [100.0] | 98.0 | 0.0 [0.7] | 0.0 [0.6] |
| Concise-ctx, 1.5B | 3.8 | 1.8 [3.3] | — | 0.0 [0.6] | 3.7 | 1.5 [2.9] | 0.0 [0.6] |
| 3 tasks, Qwen 1.5B | 100.0 | 4.0 [6.0] | 3.3 | 8.6 [10.9] | 98.0 | 0.0 [0.7] | 0.0 [0.6] |
| 3 tasks, Qwen 7B | 100.0 | 3.0 [4.8] | 2.8 | 39.0 [42.7] | 98.0 | 0.0 [0.7] | 0.0 [0.6] |
| 5 tasks, Qwen 1.5B | 100.0 | 6.0 [8.3] | 4.5 | 50.0 [53.8] | 98.0 | 0.0 [0.7] | 0.0 [0.6] |
reads block 9 of 28 in Qwen2.5 (about 0.3 of the depth in every model); LoRA of rank 16 above it; GRPO for 150 steps per task, 16 prompts 8 samples; three seeds; fitting/calibration: Dolly 600/700, AdvBench 100/170, task-like 900/700 (Section D).
Methods: FIREGATE-prompt, its whole-sequence variant and FIREGATE-anytime at , against eleven baselines with the same LoRA and budget: Seq-GRPO, an ungated LoRA per task; +KL to the previous model (Shenfeld et al., 2026); +Ref-KL, the same penalty on the reference prompts the gate uses (Li & Hoiem, 2018); null-space LoRA (Liang & Li, 2024), EWC (Kirkpatrick et al., 2017) and A-GEM (Chaudhry et al., 2019) on the same prompts; LoRA scaling (Wortsman et al., 2022), O-LoRA (Wang et al., 2023), replay, safety replay (Pham et al., 2025), and an uncalibrated router. The deployed gate is FIREGATE-prompt's classifier at ; as Theorem 3.4 allows, every ungated run is also evaluated behind it. Two gates appear in the main text. The deployed gate, steps (1) and (2) of Section 5, gives the coverage, gain and switch results unless a result is marked otherwise (Table 7). The chosen gate of each experiment is what the full recipe selects: two-sided, with the remedy or a protected set where steps (4) and (5) apply. It was fixed before the external tests of Section 6.6.
Reference pools and evaluation: Gates are calibrated with on unlabeled prompts of four kinds: Dolly-15k requests (Conover et al., 2023), AdvBench harmful requests (Zou et al., 2023), task-like prompts (ARC, CommonsenseQA, OpenBookQA, BoolQ, Alpaca, MBPP) and stored prompts of earlier tasks. The share of changed responses is measured on held-out Dolly and AdvBench prompts and on XSTest (Röttger et al., 2024) and MMLU (Hendrycks et al., 2021a), which are never calibrated on. Section D gives every setting; Table 8 marks what was fixed before its evidence.
6.2. The certificate holds as stated
Exactness: No response on which the gate was silent ever changed, under greedy decoding or under sampling (Table 9): the implementation realises Theorem 3.2 exactly.
The calibrated level: Held-out prompts are consistent with the level of 3% (Table 1), which 400 cannot confirm: the single-task deployed gates fire on at most 3.2% of held-out Dolly prompts (bounds up to 5.1%) and on no held-out harmful request. On 10,000 fresh Dolly requests they fire on 1.5–2.2% (bounds at most 2.5%, Table 20), as Theorem A.3 predicts, and the stream unions' bounds of 2.8–4.5% certify each union far below (Theorem 3.5).
6.3. Certified updates kept about the share of the gain
Ungated updates change most reference responses: Seq-GRPO changes over 90% of Dolly responses on every task, none of which it was trained on, and the regularisers change most of them too, including those built from the gate's own reference prompts (Table 10); on NQ it also lowers refusal, though its data concern no refusals (Table 14; Qi et al., 2024). On NQ and SQuAD 2.0, every ungated setting (26 on NQ) changes at least 51% of Dolly responses, even at LoRA scale 0.02 or KL weight 100, since a penalty limits sampled outputs and a small change still flips greedy ones (Theorem A.1); gates that certify Dolly change 0.5–3.5% (Figure 3 and Table 27). A changed response may be a re-wording, but the drift is real: response lengths alone bound Seq-GRPO's TV distance on NQ far above the certified level (Table 9). Average scores can stay flat while responses change: on the three-task stream Seq-GRPO moves AdvBench refusal and MMLU accuracy by at most a point but lowers XSTest over-refusal by 15.5 points (Table 10). The certificate bounds every such score at once, including those nobody measured.
The gain kept follows the coverage: Table 2 places Seq-GRPO behind the deployed gate of seven models. On IF the gate fires on nearly every new-task prompt and the switch keeps all of the gain; on NQ, where the tasks overlap, it keeps within one point of on every model. On TriviaQA, a task first used after every setting was fixed, all seven predictions written before its data were downloaded hold (Section K.8): behind the gate Seq-GRPO keeps 23.1 of its 24.6-point gain, against 22.3 predicted before training, and changes 3.5% of Dolly responses instead of 95.8%. Given the trained model's gain , the deployed IF gates have , where the prediction is exact by construction; where it is off by 0.5 points on average (Figure 4), and by 0.3–0.4 on NQ as the threshold sweeps from 0.1 to 0.9, though by up to 4.1 on IF once the sweep lowers its (Section D.3): the trunk features barely predict which prompts will gain, so on NQ a gate fitted to miss those prompts keeps as much as a random one, and only an oracle that knows each prompt's

+KL +Ref-KL null-space LoRA +EWC LoRA scale Seq-GRPO, A-GEM
Figure 3. NQ, Qwen2.5-1.5B: gain against Dolly responses changed, mean of three seeds. Each curve sweeps one knob: the level for the gates and Seq-GRPO behind FIREGATE-prompt's gate, the coefficient, energy share, weight or scale for the ungated methods. The router uses its logit-0 rule; the oracle knows each prompt's task (Table 14).
Table 2. The switch on seven models from five families (three seeds, ). , Chg.: Seq-GRPO's gain (points) and changed Dolly responses (%); : firing on unlabeled RL prompts, before training; Kept: the gain behind the deployed prompt-time gate; CP: 95% Clopper-Pearson bound of its held-out Dolly firing (%); Non-fired: changed non-fired responses of the FIREGATE-prompt runs; †two of three runs.
| Model | Task | ungated | behind the gate | Non-fired | |||||
|---|---|---|---|---|---|---|---|---|---|
| Chg. | Kept | Chg. | CP | ||||||
| Qwen2.5-1.5B | IF | +38.7 | 93.3 | 100.0 | +38.7 | +38.7 | 1.5 | 2.9 | 0/4,797 |
| Qwen2.5-1.5B | NQ | +5.2 | 94.2 | 92.2 | +4.8 | +4.7 | 3.2 | 5.1 | 0/9,363 |
| Qwen2.5-7B | IF | +12.9 | 94.6 | 100.0 | +12.9 | +12.9 | 0.8 | 3.3 | 0/3,531 |
| Qwen2.5-7B | NQ | +3.8 | 94.6 | 97.9 | +3.7 | +3.8 | 2.8 | 4.5 | 0/9,310 |
| OLMo-2-7B | NQ | +5.9 | 91.2 | 96.8 | +5.7 | +5.7 | 2.2 | 3.9 | 0/9,303 |
| Llama-3.2-3B | IF | +14.3 | 94.1 | 100.0 | +14.3 | +14.3 | 1.7 | 3.3 | 0/3,783 |
| Llama-3.2-3B | NQ | +10.8 | 96.7 | 89.0 | +9.6 | +9.2 | 2.5 | 4.2 | 0/9,447 |
| Llama-3.1-8B | IF | +11.4 | 95.5 | 100.0 | +11.4 | +11.4 | 1.8 | 3.3 | 0/3,957 |
| Llama-3.1-8B | NQ | +7.1 | 99.9 | 95.5 | +6.7 | +6.8 | 2.5 | 4.2 | 0/9,342 |
| DeepSeek-LLM-7B | IF | +35.3 | 99.5 | 99.9 | +35.2 | +35.3 | 2.3 | 3.9 | 0/3,429 |
| DeepSeek-LLM-7B | NQ | +10.7 | 97.3 | 84.5 | +9.1 | +8.7 | 1.3 | 2.6 | 0/9,519 |
| Mistral-7B | IF | +34.8 | 98.5 | 100.0 | +34.8 | +34.8 | 1.0 | 2.3 | 0/4,008 |
| Mistral-7B | NQ | +9.5 | 98.8 | 93.0 | +8.8 | +7.9 | 2.3 | 3.9 | 0/6,270 |
gain does worse (Table 11); on SQuAD 2.0 it keeps 18.5 points against 20.8, as missed prompts gained about 40 points against 22 (Theorem 4.3). The streams, full-rank GRPO and SFT behave alike (Tables 3 and 19).
6.4. Calibration, the switch and gated training
Calibration sets the level: Five gates built from the same features and prompts, as a router or an expert gate (Aljundi et al., 2017) would build them, fire on up to 31% of Dolly prompts on NQ at their own thresholds, which are set to separate the pools, not to keep the reference quiet; PAC-calibrated, they fire on at most 3.2% and still keep most of the gain (Table 12). The score then sets only the coverage: four score classes calibrated together, each at , all keep protected harmful requests at most 1.6% (Table 18). A Gaussian ratio covers 95.3% of NQ, 85.4% of SQuAD 2.0 and 56.7% of Concise-ctx (protect + passages), the linear
Table 3. Five-task stream, Qwen2.5-1.5B, three seeds. Avg, BWT: mean accuracy over the five tasks after the stream (base 29.9%) and backward transfer; Dolly: held-out responses changed (%), re-wordings included (refusal, over-refusal and MMLU changes on a stream: Table 10); GB, time: peak memory and batched generation time against the base model, gated LoRAs unmerged, one or all five firing (Section D.6). Each stage is certified at 3%, so the union at 15% with probability at least 0.75 (Theorem A.5); certified directly as one gate on 10,000 fresh Dolly requests (Theorem 3.5), its Dolly firing is at most 4.5% with probability 0.95 (Table 20). One gate: the union of the five two-sided gates, set once to fire on at most 3% of the shared calibration prompts (Theorem A.6); on 400 fresh Dolly prompts it fires on none, which certifies its Dolly firing at 0.7% with probability 0.95 (Theorem 3.5). -: not measured.
| Deployment | Avg | BWT | Dolly | GB | Time |
|---|---|---|---|---|---|
| Seq-GRPO, ungated | 46.5 1.7 | -3.5 0.7 | 91.8 | 8.1 | 1.00 |
| behind the gate | 46.5 1.7 | -3.5 0.7 | 4.8 | 10.9 | 1.18 |
| behind one gate | 46.3 1.8 | - | 0.0 | - | - |
| FIREGATE-prompt, gated training | 49.6 2.9 | +0.0 0.0 | 3.3 | 12.5 | 1.25-2.59 |
classifier 90.2, 81.4 and 11.0%, and the best score bounds from below; on 13 model-task pairs it covers at most 7.0 points more (Table 16), neither shown to reach the limit. Scores that see one pool cover little, the one-class score no NQ prompt (Figure 5), a language model told the task 2.9% (Table 17): a score needs both pools.
Training under the gate and the switch: On single tasks neither gains consistently more (Tables 4 and 14); the switch certifies a model trained by any method at the cost of a second model in memory (33.9 against 19.7 GB at 7B). Gated training stores the same LoRAs as the ungated baselines; matched in memory and routing, its comparison is the router, which uses the same features and LoRAs without calibration: it changes no chat on the 3-task stream, but on NQ it fires on 6.8% of Dolly prompts, a rate set by no level before training (Tables 10 and 14). On a stream, gated training keeps the earlier tasks, because their LoRAs and gates are


predicted gain behind the gate, (points)
--- y = x ● NQ ◇ IF ( ) ▲ Concise-ctx ■ Concise
Figure 4. Gain kept behind the prompt-time gate against (Theorem 4.3; measured before training, the trained model's gain), every ungated method at three levels, mean over seeds; right: the box on the left. On IF ; on the 78 other points the mean error is 0.3 points (0.5 where ), the largest 3.4.
frozen and fire only on their own prompts, while the switch inherits the trained model's forgetting (Table 3); the higher average comes mostly from seeds in which Seq-GRPO loses Countdown or K&K, and the time grows with the number of unmerged LoRAs whose gates fire. One gate set for the whole stream at 3%, instead of 3% per stage, is certified on fresh Dolly prompts at 0.7% (Theorem 3.5) and keeps 46.3 of 46.5 points. On this evidence, three streams of three or five tasks on Qwen2.5 at 1.5B and 7B, the switch suits one task and gated training suits streams; longer streams are untested.
6.5. Protecting chosen behaviours
Certified gain falls as the new prompts look more like the reference (Theorem 4.1): behind the deployed gate, Seq-GRPO keeps all of its IF gain but little of its Concise gain. When chat is what a task should change, the gate is calibrated only on what must stay, step (5) of Section 5 (Table 4).
SQuAD 2.0: Seq-GRPO's refusal rate barely moves, yet it changes most of its responses to held-out harmful requests and half of its MMLU answers, and refuses far less often when a harmful request comes with a passage. The protect gate covers the task but also fires on almost all harmful requests followed by a passage, which are not drawn like the protected ones; with such requests added as a component, step (4), it fires on at most 1.6% of them and on no held-out harmful, MMLU or XSTest prompt, and Seq-GRPO behind it keeps almost all of its gain. Ref-KL and safety replay hold the rates they target, not the responses.
Tasks whose prompts are chat requests: On Concise and Concise-ctx, built to conflict with refusal, protecting harmful requests with a passage leaves the linear classifier 23 and 11% coverage, as the prompts resemble them. With the region check of step (3) the level must hold only inside the task's region, so the threshold falls: the gate keeps
56.8 of Concise-ctx's 65.2 points, firing on at most 1.2% of harmful requests in any form, but on up to 10.4% on Concise, whose region holds plain chat requests (Tables 18, 22 and 24).
6.6. Prompts outside the reference
Pools unlike the task: MMLU is never a component, and the deployed IF gate fires on almost every MMLU prompt, whose answer-format instruction resembles IF prompts; the IF and stream gates also fire on many harmful requests in jailbreak templates and on real WildChat first turns (Zhao et al., 2024; Section D.5). The two-sided gate fires on no MMLU or jailbreak prompt and on almost no WildChat prompt in any experiment, while keeping most of its coverage (Table 13). On all 13 model-task pairs of Table 2, the gate of steps (3) and (4) fires on no MMLU or jailbreak prompt and loses at most 3 points of the gain (Table 26).
Prompts written like the task: As Theorem 3.8 allows, harmful requests in IF's answer format pass the region until the remedy adds them; with it the gate fires on none of twelve task-like forms on IF and the stream (Section I), and the gate chosen for each task on at most 2.4% of eight forms written before any gate saw them (Table 23); the task-like component, region and remedy followed failures (Table 8).
Benchmarks written by others: With every setting frozen and predictions written beforehand, the gates chosen for the eight experiments other than Concise fire on no HarmBench or StrongREJECT request (Mazeika et al., 2024; Souly et al., 2024) and on at most 1% of HarmBench's contextual ones. On Concise, whose prompts are chat requests like the harmful ones, they fire on up to 9.0%, above the predicted levels (Table 5). On ten more sets written by others (MultiJail, oasst1, system prompts), all four predictions hold: outside Concise the chosen gates fire on at most 1.6% of any set (Table 29), and Seq-GRPO behind them newly answers at
Table 4. Protecting chosen behaviours on SQuAD 2.0, a task that overlaps general chat (Qwen2.5-1.5B, ). Deployed: calibrated on every component; protect: on harmful and task-like prompts only; + passages: harmful requests followed by a passage added. : coverage of RL prompts; changes in points; responses changed (%); harmful + passage: firing and refusal change on 250 such held-out requests, as given / as a question (seed 0; else three seeds). Concise, Concise-ctx: Tables 22 and 24.
| Method | Change | Responses changed (%) | Harmful + passage | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Gain↑ | Refusal | MMLU | AdvBench | MMLU | Dolly | Gate fires (%) | Refusal | ||
| SQuAD 2.0: passage and question, rewarded for the gold answer or for abstaining | |||||||||
| Seq-GRPO | - | +24.4 | -0.3 | -2.9 | 77.1 | 49.3 | 99.3 | - | -36.8 / -74.8 |
| behind the deployed gate | 85.4 | +18.5 | +0.0 | +0.0 | 0.0 | 0.0 | 1.0 | 0.4 / 0.4 | -0.4 / +0.0 |
| behind protect | 100.0 | +24.4 | +0.0 | -0.2 | 0.8 | 0.5 | 46.3 | 98.4 / 100.0 | -36.8 / -74.8 |
| behind protect + passages | 99.8 | +24.3 | +0.0 | +0.0 | 0.0 | 0.0 | 16.3 | 0.8 / 1.6 | -0.8 / -1.2 |
| Ref-KL, protected | - | +19.9 | +0.0 | +1.1 | 8.8 | 23.9 | 89.8 | - | - |
| Safety replay | - | +27.4 | +0.0 | -1.6 | 52.5 | 35.0 | 98.1 | - | -13.6 / -61.2 |
| FIREGATE-prompt, deployed gate | - | +15.9 | +0.0 | +0.0 | 0.0 | 0.0 | 1.0 | - | +0.0 / +0.0 |
| FIREGATE-prompt, protect | - | +33.3 | +0.0 | -0.1 | 0.5 | 0.2 | 44.8 | - | -28.0 / -80.0 |
Table 5. Every setting frozen (Section K.1): firing (%) of the chosen gate on HarmBench (HB, ), its contextual requests (ctx., 100) and StrongREJECT (SR, 288), a sampled check (95% bounds 1.5, 3.0, 1.0% where it fires on none). Base: the base model's HB refusal (%), failures included; changes: points, seed 0. Con., Ctx: Concise(-ctx); O, L: OLMo-2, Llama-3.2.
| Con. | Ctx | SQuAD | NQ | IF | IF 7B | 3 tasks | NQ | O | NQ L | |
|---|---|---|---|---|---|---|---|---|---|---|
| HB / SR fires↓ | 0/4.2 | 0/0 | 0/0 | 0/0 | 0/0 | 0/0 | 0/0 | 0/0 | 0/0 | |
| ctx. fires↓ | 9.0 | 1.0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| HB refusal, base | 93 | 93 | 93 | 93 | 93 | 86 | 93 | 96 | 88 | |
| HB refusal, ungated | -79 | -51 | -2 | -41 | -4 | +3 | -12 | -2 | -25 | |
| HB refusal, gated | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 |
most 0.17% of harmful prompts (5.95% on Concise; Table 30). These sets test the recipe of Section 5 as it would be used on a new deployment, with no choice made after seeing them. The task-like component, the region, the remedy and the passage component were each added after a failure before the recipe was frozen (Table 8); after it, the predictions held on every external set for every experiment except Concise. On Concise, sampling harmful requests in more forms, a component added after this failure with its predictions written in advance, cuts this to 0.22%, and firing on unseen harmful sets to at most 0.5%, at half the coverage (Section K.7).
7. Related work
Forgetting in continual post-training: Continual-learning methods regularise parameters (Kirkpatrick et al., 2017), distil the old model (Li & Hoiem, 2018), replay data (Rolnick et al., 2019) or isolate parameters, for language models often as orthogonal or null-space LoRA (Wang et al., 2023; Liang & Li, 2024; Liang et al., 2025). Under RL fine-tuning, forgetting has been tied to the KL divergence from the old policy (Shenfeld et al., 2026), to on-policy data (Chen et al., 2026; Lai et al., 2026) and to the circuits that training changes (Rojas Nunez et al., 2026), and continual RL streams still forget (Wolczyk et al., 2024; Luo et al.,
2026b;a). Benign fine-tuning also erodes alignment and refusals (Qi et al., 2024; Li & Lee, 2024; Ung et al., 2024), and safety-preserving methods keep the update in a safe region of the weights or choose its data (Lyu et al., 2024; Yang et al., 2026; Zhang et al., 2025; Pham et al., 2025; Sun et al., 2026). These methods reduce the change measured after training; they bound no change on distributions that were not evaluated.
Certificates for model updates: Stability of the training algorithm certifies unlearning (Ullah et al., 2021); evaluations certify after the fact that an update does not regress (Balachandran, 2026; Mondal et al., 2026), auditing tests detect a behavioural shift once it has happened (Richter et al., 2025), and Friedman & Meir (2026) bound the forgetting of trained weights. The certificate here is issued before training, from unlabeled prompts, for the model as deployed. Its proof is a coupling argument (Lindvall, 1992), and its calibration follows the Neyman–Pearson umbrella algorithm and training-conditional conformal risk control (Tong et al., 2018; Vovk, 2012; Bates et al., 2021).
Routing and gating: Expert gates (Aljundi et al., 2017), gated LoRA (Liang et al., 2025; Hoy & Celik, 2025), gated representation fine-tuning (Zeng et al., 2025), safety routing in mixture-of-experts models (Kim et al., 2025), model editors (Mitchell et al., 2022) and LLM routers (Ong et al., 2025) send inputs to specialised computation, with gates learned and judged on measured behaviour. By Theorem 4.2, a certified expressive update acts like such a gate. The contribution here is the connection of localisation with a per-component Neyman–Pearson threshold with a finite-sample guarantee (Rigollet & Tong, 2011; Tong et al., 2018), which bounds the drift of any model behind it before training, and the limit that no update with the same budget beats the best such test. Section E discusses each line of work in more detail.
8. Limitations
The certificate holds on the prompt distributions that were sampled: someone must choose the reference components, and here several were added after failures before the recipe was frozen (Table 8); after that, it was tested only on sets and a task fixed before any gate saw them (Sections K.1, K.5 and K.8), which cannot rule out forms nobody sampled. It bounds how often behaviour changes, not how well the fired prompts are answered, so harm can concentrate where the gate fires (Section K.6), and it gives no protection against an adversary who searches for prompts that fire the gate. The proof needs a frozen trunk with causal attention and an update above the split. Serving costs a second model behind the switch or unmerged LoRAs under gated training, and coverage is low on tasks whose prompts resemble general chat, as Theorem 4.1 predicts.
9. Conclusion
Fine-tuning a deployed language model on one task after another can change behaviour that should stay fixed, and such forgetting is usually found only after training, on the benchmarks someone chose to run. This work bounds it before training. FIREGATE places each task's update behind a calibrated gate: where no gate fires the model is exactly the old one, so every bounded behaviour score changes by at most the firing rate, for any weights training produces and over a whole task stream. Because the gate is calibrated on unlabeled prompts before training, forgetting becomes a false alarm whose rate is fixed in advance. The price is the gate's power: no update with the same budget can change the new task more often than the best test between new-task and protected prompts allows. On reinforcement-learning streams, gated training kept the earlier tasks and left almost all general-chat responses unchanged, and models behind the gate kept about the share of their gain that the gate's coverage, measured before training, predicted. Across seven models from five families, no response on which a gate was silent ever changed, and gates frozen in advance fired on no HarmBench or StrongREJECT request outside the two tasks built to conflict with refusals. The bound is therefore not an observation about one training run: it is fixed before training, from unlabeled prompts, and on the sampled prompt distributions no weights that training produces can break it.
References
Aakanksha, Ahmadian, A., Ermis, B., et al. The multilingual alignment prism: Aligning global and local preferences to reduce harm. In EMNLP, 2024.
Aljundi, R., Chakravarty, P., and Tuytelears, T. Expert gate: Lifelong learning with a network of experts. In CVPR,
Alssum, L., Itani, H., Hammoud, H. A. A. K., et al. Unforgotten safety: Preserving safety alignment of large language models with continual learning. arXiv preprint arXiv:2512.10150, 2025.
Arditi, A., Obeso, O., Syed, A., et al. Refusal in language models is mediated by a single direction. In NeurIPS, 2024.
Austin, J., Odena, A., Nye, M., et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
Balachandran, V. B. Pay only for disagreement: Certified no-regression verdicts for model updates with matching label-complexity bounds. arXiv preprint arXiv:2609.17560, 2026.
Bates, S., Angelopoulos, A. N., Lei, L., et al. Distribution-free, risk-controlling prediction sets. Journal of the ACM, 68(6), 2021.
Betley, J., Warncke, N., Sztyer-Betley, A., et al. Training large language models on narrow tasks can lead to broad misalignment. Nature, 649:584–589, 2026.
Bi, X., Chen, D., et al. DeepSeek LLM: Scaling open-source language models with longtermism. arXiv preprint arXiv:2401.02954, 2024.
Biderman, D., Portes, J., Gonzalez Ortiz, J. J., et al. LoRA learns less and forgets less. Transactions on Machine Learning Research, 2024.
Cao, W. Fight fire with fire: Defending against malicious RL fine-tuning via reward neutralization. arXiv preprint arXiv:2505.04578, 2025.
Chaudhry, A., Ranzato, M., Rohrbach, M., and Elhoseiny, M. Efficient lifelong learning with A-GEM. In ICLR, 2019.
Chen, H., Razin, N., Narasimhan, K., and Chen, D. Retaining by doing: The role of on-policy data in mitigating forgetting. In ICML, 2026.
Chen, P.-Y., Shen, H., Das, P., and Chen, T. Fundamental safety-capability trade-offs in fine-tuning large language models. arXiv preprint arXiv:2503.20807, 2025.
Clark, C., Lee, K., Chang, M.-W., et al. BoolQ: Exploring the surprising difficulty of natural yes/no questions. In NAACL, 2019.
Clark, P., Cowhey, I., Etzioni, O., et al. Think you have solved question answering? Try ARC, the AI2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
Clopper, C. J. and Pearson, E. S. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26(4):404–413, 1934.
Cobbe, K., Kosaraju, V., Bavarian, M., et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
Conover, M., Hayes, M., Mathur, A., et al. Free Dolly:
Introducing the world's first truly open instruction-tuned LLM. Databricks blog, 2023.
Dantzig, G. B. and Wald, A. On the fundamental lemma of Neyman and Pearson. The Annals of Mathematical Statistics, 22(1), 1951.
Deng, Y., Zhang, W., Pan, S. J., and Bing, L. Multilingual jailbreak challenges in large language models. In ICLR, 2024.
Donsker, M. D. and Varadhan, S. R. S. Asymptotic evaluation of certain Markov process expectations for large time. IV. Communications on Pure and Applied Mathematics, 36(2):183–212, 1983.
Feng, W., Wang, L., Lv, P., et al. Token buncher: Shielding LLMs from harmful reinforcement learning fine-tuning. arXiv preprint arXiv:2508.20697, 2025.
Friedman, L. and Meir, R. Data-dependent and oracle bounds on forgetting in continual learning. In CoLLAs, 2026.
Grattafiori, A., Dubey, A., et al. The Llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
Hahm, D., Min, T., Jin, W., and Lee, K. Unintended misalignment from agentic fine-tuning: Risks and mitigation. In AAAI, 2026.
Halko, N., Martinsson, P.-G., and Tropp, J. A. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review, 53(2):217–288, 2011.
Hendrycks, D., Burns, C., Basart, S., et al. Measuring massive multitask language understanding. In ICLR, 2021a.
Hendrycks, D., Burns, C., Kadavath, S., et al. Measuring mathematical problem solving with the MATH dataset. In NeurIPS Datasets and Benchmarks, 2021b.
Hoy, W. and Celik, N. STABLE: Gated continual learning for large language models. arXiv preprint arXiv:2510.16089, 2025.
Hu, E. J., Shen, Y., Wallis, P., et al. LoRA: Low-rank adaptation of large language models. In ICLR, 2022.
Huang, T., Hu, S., Ilhan, F., et al. Harmful fine-tuning attacks and defenses for large language models: A survey. arXiv preprint arXiv:2409.18169, 2024.
Ibrahim, L., Hafner, F. S., and Rocher, L. Training language models to be warm can reduce accuracy and increase sycophancy. Nature, 652:1159–1165, 2026.
Jiang, A. Q., Sablayrolles, A., Mensch, A., Bamford, C., Chaplot, D. S., de las Casas, D., Bressand, F., Lengyel, G., Lample, G., Saulnier, L., et al. Mistral 7B. arXiv preprint arXiv:2310.06825, 2023.
Joshi, M., Choi, E., Weld, D. S., and Zettlemoyer, L. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1601–1611, 2017.
Kim, J., Song, M., Shin, S., and Son, S. Defending MoE LLMs against harmful fine-tuning via safety routing alignment. arXiv preprint arXiv:2509.22745, 2025.
Kirkpatrick, J., Pascanu, R., Rabinowitz, N., et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13): 3521–3526, 2017.
Köpf, A., Kilcher, Y., von Rütte, D., et al. OpenAssistant conversations – democratizing large language model alignment. In NeurIPS Datasets and Benchmarks, 2023.
Kwiatkowski, T., Palomaki, J., Redfield, O., et al. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452–466, 2019.
Lai, S., Zhao, H., Feng, R., et al. Reinforcement fine-tuning naturally mitigates forgetting in continual post-training. In ICML, 2026. arXiv:2507.05386.
Lee, K., Chang, M.-W., and Toutanova, K. Latent retrieval for weakly supervised open domain question answering. In ACL, 2019.
Lehmann, E. L. and Romano, J. P. Testing Statistical Hypotheses. Springer, fourth edition, 2022.
Li, C.-A. and Lee, H.-Y. Examining forgetting in continual pre-training of aligned large language models. arXiv preprint arXiv:2401.03129, 2024.
Li, Z. and Hoiem, D. Learning without forgetting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(12):2935–2947, 2018.
Liang, Y.-S. and Li, W.-J. InfLoRA: Interference-free low-rank adaptation for continual learning. In CVPR, 2024.
Liang, Y.-S., Chen, J.-R., and Li, W.-J. Gated integration of low-rank adaptation for continual learning of large language models. In NeurIPS, 2025.
Lindvall, T. Lectures on the Coupling Method. Wiley, 1992.
Luo, L., Zhang, G., Xu, H., et al. Continual reasoning gym: Diagnosing and harnessing shared reasoning in continual RLVR. arXiv preprint arXiv:2608.18574, 2026a.
Luo, M.-L., Wang, Z.-X., Zhou, Z.-H., et al. RL forgets! Towards continual policy optimization. arXiv preprint arXiv:2607.04364, 2026b.
Lyu, K., Zhao, H., Gu, X., et al. Keeping LLMs aligned after fine-tuning: The crucial role of prompt templates. In NeurIPS, 2024.
Martens, J. and Grosse, R. Optimizing neural networks with Kronecker-factored approximate curvature. In ICML, 2015.
Mazeika, M., Phan, L., Yin, X., et al. HarmBench: A standardized evaluation framework for automated red teaming and robust refusal. In ICML, 2024.
Mihaylov, T., Clark, P., Khot, T., and Sabharwal, A. Can a suit of armor conduct electricity? A new dataset for open book question answering. In EMNLP, 2018.
Mitchell, E., Lin, C., Bosselut, A., et al. Memory-based model editing at scale. In ICML, 2022.
Mondal, J. J., Banik, M., Apurba, M. S. A., and Al Mahmud, M. M. When can old evaluations certify a new model? Label-efficient release decisions under evaluator drift. arXiv preprint arXiv:2609.32267, 2026.
Neyman, J. and Pearson, E. S. On the problem of the most efficient tests of statistical hypotheses. Philosophical Transactions of the Royal Society A, 231:289–337, 1933.
Ong, I. et al. RouteLLM: Learning to route LLMs from preference data. In ICLR, 2025.
Pan, J., Zhang, J., Wang, X., et al. TinyZero. https://github.com/Jiayi-Pan/TinyZero, 2025.
Pham, A., Thalanki, M., Sun, M., et al. Preventing catastrophic forgetting: Behavior-aware sampling for safer language model fine-tuning. arXiv preprint arXiv:2510.21885, 2025.
Qi, X., Zeng, Y., Xie, T., et al. Fine-tuning aligned language models compromises safety, even when users do not intend to! In ICLR, 2024.
Qwen Team. Qwen2.5 technical report. arXiv preprint arXiv:2412.15115, 2024.
Rajpurkar, P., Jia, R., and Liang, P. Know what you don't know: Unanswerable questions for SQuAD. In ACL (Short Papers), 2018.
Ramdas, A., Grünwald, P., Vovk, V., and Shafer, G. Game-theoretic statistics and safe anytime-valid inference. Statistical Science, 38(4):576–601, 2023.
Richter, L., He, X., Minervini, P., and Kusner, M. J. An auditing test to detect behavioral shift in language models. In ICLR, 2025.
Rigollet, P. and Tong, X. Neyman-Pearson classification, convexity and stochastic constraints. Journal of Machine Learning Research, 12(86):2831–2855, 2011.
Ritter, H., Botev, A., and Barber, D. Online structured Laplace approximations for overcoming catastrophic forgetting. In NeurIPS, 2018.
Rojas Nunez, J., Sawant, V., Allen, N., et al. Mechanistic origins of catastrophic forgetting: Why RL preserves circuits better than SFT? arXiv preprint arXiv:2605.28860, 2026.
Rolnick, D., Ahuja, A., Schwarz, J., et al. Experience replay for continual learning. In NeurIPS, 2019.
Röttger, P., Kirk, H. R., Vidgen, B., et al. XSTest: A test suite for identifying exaggerated safety behaviours in large language models. In NAACL, 2024.
Sabbaghi, M., Pappas, G., Javanmard, A., and Hassani, H. Robust policy optimization to prevent catastrophic forgetting. arXiv preprint arXiv:2602.08813, 2026.
Scialom, T., Chakrabarty, T., and Muresan, S. Fine-tuned language models are continual learners. In EMNLP, 2022.
Shao, Z., Wang, P., Zhu, Q., et al. DeepSeekMath: Pushing
the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.
Shenfeld, I., Pari, J., and Agrawal, P. RL's razor: Why online reinforcement learning forgets less. In ICLR, 2026.
Souly, A., Lu, Q., Bowen, D., et al. A StrongREJECT for empty jailbreaks. In NeurIPS Datasets and Benchmarks, 2024.
Springer, M., Lee, C. P., Metevier, B., et al. The geometry of alignment collapse: When fine-tuning breaks safety. arXiv preprint arXiv:2602.15799, 2026.
Sun, G., Zhang, S., Wang, L., et al. Safety alignment as continual learning: Mitigating the alignment tax via orthogonal gradient projection. arXiv preprint arXiv:2602.07892, 2026.
Talmor, A., Herzig, J., Lourie, N., and Berant, J. CommonsenseQA: A question answering challenge targeting commonsense knowledge. In NAACL, 2019.
Taori, R., Gulrajani, I., Zhang, T., et al. Stanford Alpaca: An instruction-following LLaMA model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
Team OLMo. 2 OLMo 2 furious. arXiv preprint arXiv:2501.00656, 2024.
Tong, X., Feng, Y., and Li, J. J. Neyman-Pearson classification algorithms and NP receiver operating characteristics. Science Advances, 4(2), 2018.
Ullah, E., Mai, T., Rao, A., et al. Machine unlearning via algorithmic stability. In COLT, 2021.
Ung, M., Sun, A., Bell, S. J., et al. Chained tuning leads to biased forgetting. arXiv preprint arXiv:2412.16469, 2024.
Ville, J. Étude critique de la notion de collectif. Gauthier-Villars, 1939.
Vovk, V. Conditional validity of inductive conformal predictors. In ACML, 2012.
Wang, S., Zhu, X., Wang, H., et al. Emergent misalignment can be induced by sycophancy and reversed via alignment gating. arXiv preprint arXiv:2606.09068, 2026.
Wang, X., Chen, T., Ge, Q., et al. Orthogonal subspace learning for language model continual learning. In Findings of EMNLP 2023, 2023.
Wang, Y., Li, H., Han, X., et al. Do-not-answer: Evaluating safeguards in LLMs. In Findings of EACL, 2024.
Wolczyk, M., Cupial, B., Ostaszewski, M., et al. Fine-tuning reinforcement learning models is secretly a forgetting mitigation problem. In ICML, 2024.
Wortsman, M., Ilharco, G., Kim, J. W., et al. Robust fine-tuning of zero-shot models. In CVPR, 2022.
Xie, C., Huang, Y., Zhang, C., et al. On memorization of large language models in logical reasoning. In Proceedings of IJCNLP-AACL, 2025a.
Xie, T., Gao, Z., Ren, Q., et al. Logic-RL: Unleashing LLM reasoning with rule-based reinforcement learning. arXiv preprint arXiv:2502.14768, 2025b.
Yang, S., Zhang, Q., Liu, Y., et al. AsFT: Anchoring safety during LLM fine-tuning within narrow safety basin. In AAAI, 2026.
Yu, Q. et al. DAPO: An open-source LLM reinforcement learning system at scale. In NeurIPS, 2025.
Zeng, S., He, P., Guo, K., et al. Towards context-robust LLMs: A gated representation fine-tuning approach. In ACL, 2025.
Zhan, Q., Fang, R., Bindu, R., et al. Removing RLHF protections in GPT-4 via fine-tuning. In NAACL (Short Papers), 2024.
Zhang, B., Yang, Y., Ren, Z., et al. A guardrail for safety preservation: When safety-sensitive subspace meets harmful-resistant null-space. arXiv preprint arXiv:2510.14301, 2025.
Zhao, W., Ren, X., Hessel, J., et al. WildChat: 1M ChatGPT interaction logs in the wild. In ICLR, 2024.
Zhou, J., Lu, T., Mishra, S., et al. Instruction-following evaluation for large language models. arXiv preprint arXiv:2311.07911, 2023.
Zhou, Z., Peng, A., Li, Q., et al. Efficient online reinforcement learning fine-tuning need not retain offline data. In ICLR, 2025.
Zou, A., Wang, Z., Carlini, N., et al. Universal and transferable adversarial attacks on aligned language models. arXiv preprint arXiv:2307.15043, 2023.
A. Further theory: streams, the limit, the attained level, nearby distributions, audit and repair
Table 6. Status of each claim: proved, estimated before training, or observed.
| Statement | Status | Conditions and evidence |
|---|---|---|
| Drift at most the firing rate (Theorem 3.2) | proved | frozen trunk, causal attention; checked exactly |
| Any model behind a prompt-time gate (Theorem 3.4) | proved | the deployed pair, not its forgetting |
| Firing at most per component (Theorem 3.6) | proved | i.i.d. prompts, score fixed before them; components only |
| Firing outside the region (Theorem 3.8) | proved | at most its mass; nothing about prompts inside |
| The Neyman–Pearson limit (Theorem 4.1) | proved | any policy; attained if the ratio reads the trunk |
| Large changes confined (Theorem 4.2) | proved | each reachable model's region; not one common region |
| Coverage | estimated | unlabeled RL prompts; a lower bound on |
| Gain kept (Theorem 4.3) | identity; fit observed | exact if missed prompts gain alike; error 0.5 points |
| stages at (Theorem A.5) | proved | confidence ; anytime: fresh prompts, one rule |
| Firing elsewhere; gains and changes | observed | held-out bounds; three seeds unless marked |
Remark A.1 (No gate, no certificate before training). An ungated update is the case , and Theorem 3.3 then gives drift at least on every distribution for some update. A drift bound for an ungated method whose updates can do this must therefore depend on the weights that training produced or on constraints placed on them; without such constraints it can be computed only after training, and only on the distributions one evaluates (Theorem 4.2). Regularisers change which update training finds, not this. A penalty does bound the weights that optimise it: if scores at least as well as on , with and either KL divergence between and , then is at most the gain, hence at most 1, and by Pinsker's and Jensen's inequalities the drift on under sampling is at most . That bound needs training to reach such weights, holds only on and only for the sampling rule the KL is taken under, and says nothing about greedy outputs, whose argmax a small KL can flip: on NQ, Ref-KL at with four samples per reference prompt changes 73% of greedy Dolly responses (Table 14).
The limit per component: Theorem 3.6 sets a level for each component, and the limit of Theorem 4.1 is then a linear program with one constraint per component.
Proposition A.2 (Limit per component). Let be the reference components, and the densities of and with respect to , , and as in Theorem 4.1. If for every , then
the supremum over tests with values in . For a minimiser , every optimal test equals off the set where the two sides are equal. Raising the level of component to raises the limit by at most ; in particular, dropping a component with leaves the limit unchanged. If and every are functions of and the update is as in Theorem 4.1, a gated update whose prompt-time gate is such a test attains up to the factor .
With one component this is the Neyman–Pearson lemma, and with a common level the limit is at most that of the mixture in Theorem 4.1, often well below it: in the three-component scenario of Section K.4 it is 34.9% against 43.2%, and only the component nearest the new task has a non-negligible weight.
The level attained: Theorem 3.6 guarantees the level with probability ; its exact law gives the price of that guarantee.
Proposition A.3 (Level attained by calibration). In Theorem 3.6, suppose and the score of 's trajectories on has a continuous distribution. Then , and the right side has the Beta distribution, with mean ; it exceeds with probability .
For the 700 Dolly calibration prompts used here, three components, and , : the bound on the attained level has mean 1.7% and 5–95% quantiles of 1.0 and 2.6%, and the coverage lost to this slack is part of the price of certifying before training (Section K.4 checks the law).
Nearby distributions: The firing probability is linear in the prompt distribution, so a level carries over.
Proposition A.4 (The level on nearby distributions). Let , so that for every . for weights summing to one. If , then . If , then . For the two-sided gate of Theorem 3.8 with region and , .
With Theorem 3.2, each right side bounds the drift on of every model behind the gate.
Certificates over a stream: Each stage is calibrated against the model that precedes it, not against the base model; the certificates still add up.
Corollary A.5 (Sequential calibration composes). If for , then .
Calibrating stages with failure probability each gives the composed target with probability at least . To certify the union at with confidence by calibration alone, calibrate each stage at with failure probability ; with components each needs at least calibration prompts, about 950 for , , , and 2,130 for , which prompt-time gates may share across stages. A prompt-time union can instead be checked once, as one gate, on prompts no stage used (Theorem 3.5), with a bound that does not grow with (Table 20). For FIREGATE-anytime, Theorem 3.6 covers stage only if its calibration prompts are not used by earlier stages, because depends on the earlier thresholds; prompt-time gates may reuse them, since their scores and firing depend on the prompt alone. The held-out bound of Theorem 3.5 is unaffected.
With prompt-time gates the stream certificate no longer involves the models at all.
Proposition A.6 (Prompt-time streams). Let be prompt-time gates on the frozen trunk with decisions . (a) For gated updates, for every and every , . (b) For any policy , the switch that answers with when any of fires has drift at most from .
Both right sides are probabilities of an event in the prompt alone, so they are estimated from unlabeled prompts of by Theorem 3.5 without generating any response. This allows one budget for a stream. Instead of calibrating every stage at (Theorem A.5), stage 's threshold can be set so that the union of the first gates fires on at most a share of each reference component's calibration prompts, which leaves the whole stream at on the calibration prompts. The stages share calibration prompts, so Theorem 3.6 does not cover the union as such; its certificate comes instead from Theorem 3.5 on fresh prompts, at confidence for each component checked.
Remark A.7 (When the KL form is informative). The right side of Equation (2) is below one only if , about 2.8 nats at . They are often further apart: by data processing, the changed shares in the experiments give lower bounds of 3.0 nats on NQ and 4.2–20.2 on IF, and Donsker–Varadhan estimates (Donsker & Varadhan, 1983) with the gate score as test function are far larger. The exact Neyman–Pearson form is therefore tested instead (Section K.4).
Prompt-only tests: A gate may read the response as well as the prompt; this adds no evidence about the prompt's source.
Proposition A.8 (Responses carry no evidence). Let . For every policy , the laws and have densities and with respect to , functions of the prompt alone. Consequently every test on prompt-response pairs of size at most under has power at most under , and a Neyman–Pearson test between the joint laws reads only the prompt.
Estimated gates: A gate built from an estimate of the density ratio loses coverage in proportion to the estimate's error.
Proposition A.9 (Plasticity lost by an estimated gate). Let with densities any estimate of their ratio, and a possibly randomised threshold test on with . Then , which equals with when . A threshold test on a strictly increasing transformation of , such as a classifier's logit, is a threshold test on , so the bound holds for it and may use the best with the same order.
Audit, monitoring and repair:
Proposition A.10 (Exact decomposition and audit). With shared decoding randomness, for every score , . With i.i.d. prompts, is unbiased, evaluates only on fired prompts, and has variance at most .
The certificate is silent about the change of behaviour on fired prompts; Theorem A.10 shows that these are the only prompts to check, and that an audit there costs a share of a full evaluation.
Proposition A.11 (Anytime-valid monitoring). Let record whether the gate fired on the -th deployment prompt and with , , . (a) If for all , then . (b) Let . If the are i.i.d. Bernoulli with , then for every with and , , where ; for , , the KL divergence between Bernoulli laws.
Proposition A.12 (Monotone repair). Raising a gate's threshold from to keeps the update and never increases for any , so every certificate issued at remains valid. If with chosen as in Theorem 3.6, with and in place of , from fresh i.i.d. trajectories of on a distribution , then with probability at least , and all earlier guarantees hold simultaneously with probability at least . In a stream with anytime gates, raising the threshold of stage keeps every certificate relative to , , valid by Theorem 3.7; per-stage certificates of later stages must be estimated again.
Monitoring and repair need prompts, not labels, and no retraining. Together they turn a valid but vacuous certificate, such as the MMLU certificate of a gate calibrated without task-like reference prompts, into a detected event with a repair whose cost in plasticity is measured on the new task.
B. Proofs
The statements below are also checked numerically by scripts/verify_theory.py on small synthetic problems: exact enumeration of every response of random autoregressive models for Theorems A.5, 3.2, 3.3 and 3.7, linear programs for Theorems A.8, A.9 and 4.1, and Monte Carlo for Theorems A.10 to A.12, 3.5 and 3.6. The statements about prompt-time gates (Theorems A.6, 3.4, 3.8 and 4.3) have short direct proofs.
Throughout, positions are , and a block's output at position is a function of the previous block's outputs at positions (causal attention followed by position-wise maps). The update acts position-wise.
Lemma B.1 (Locality). Let . Then for every block and every position , the hidden state of at on equals that of . Consequently .
Proof. Blocks have the same weights in both models, so their states agree at all positions. For the proof is by induction on . The state at is computed from the states at , , which agree by the induction hypothesis, and the update is inactive at every position because for . The next-token distribution at is a function of the last block's state at .
Proof of Theorem 3.2. Draw and i.i.d. uniform, independent of . Generate with and with , both from , using for the -th response token. Each has law of its model. Let .
On the runs coincide: Suppose the first response tokens agree and has an -th response token. The common prefix has length , and on the gate does not fire at any position , so . Because depends only on the prefix up to , the same holds along . By Theorem B.1 both models have the same next-token distribution after , and the shared gives the same token. The stopping rule depends only on the tokens, so both runs stop together.
The firing event is the same in both runs: On , let . The runs agree on all tokens up to position , so and the gate fires at on ; since does not stop at and the stopping rule reads only these tokens, neither does , so . Conversely a firing on before any firing on is impossible because the runs agree until the first firing. Hence pathwise.
Bound: , so by the coupling inequality , and for , . A prompt-time gate is the special case in which is evaluated only at position . The argument holds unchanged, conditionally, for a gate that also reads a random variable independent of and of the .
Proof of Theorem 3.3. Use the coupling above. On , the first generated token at a position where the update is active is the token produced at position . Let . Under , has probability . Under , is decided by , the runs agree up to , and gives probability at most , so . Hence .
Proof of Theorem 3.7. Let , each gate on its own positions. Before every latch with is zero, so are inactive; the latches with are computed from the same trunk features of the same prefix in both models, so act identically. Theorem B.1 therefore holds with in the role of and in that of , and the proof of Theorem 3.2 applies. The event is the union of the firing events of ; the second inequality is the union bound.
Proof of Theorem A.5. For let . The events are disjoint with union . On the complement of no gate fires, so by the coupling in the proof of Theorem 3.7 the coupled trajectories of and coincide and . Theorem 3.7 bounds the drift by .
Proof of Theorem 3.4. The trunk is frozen and attention is causal, so and hence depend on alone. Both laws have prompt marginal , so by Equation (1) . Every response has at least one token, so the last prompt token influences the generated text and , which gives . With shared decoding randomness the switch runs itself on prompts with , so the two responses coincide there.
Proof of Theorem A.6. (a) By Theorem 3.7, . For a prompt-time gate (proof of Theorem 3.4), an event in the prompt alone, whose probability under is its probability under whatever is. (b) is the decision of a prompt-time gate on the same trunk features; apply Theorem 3.4.
Proof of Theorem 3.8. (a) and pointwise. (b) The score equal to on and to off is a fixed function, independent of the calibration prompts, and . The proof of Theorem 3.6 does not use continuity, so it applies unchanged to , whose distribution has an atom at . (c) is the firing event of a gate with score whose threshold is the -th smallest of i.i.d. scores, so the first claim is Theorem 3.6 with one component, level and failure probability , applied on ; its proof uses only through . For the second, let for a fresh . Since is fixed independently of the prompts, are exchangeable, and with ties broken at random the rank of among them is uniform on . only if that rank exceeds , which has probability . Hence .
Proof of Theorem 4.3. The switch answers with if and with otherwise, so its expected reward on exceeds 's by . Taking expectations over , its gain is . Since , which is ; it is zero exactly when missed prompts gain as much on average as the others, and the cost is then .
Proof of Theorem 3.5. Firing is a Bernoulli event per i.i.d. trajectory of , so and the Clopper–Pearson upper limit has coverage at least .
Proof of Theorem 3.6. Fix and let , which bounds and is non-increasing and right-continuous. Let ; then and, since for , (if there is nothing to prove). For , implies , so at least calibration scores are below . Each is below independently with probability , because the calibration trajectories are i.i.d. and independent of and , so by the choice of the event has probability at most . A union bound over components and monotonicity () finish the proof. No continuity is needed: the gate fires only on scores strictly above the threshold.
Proof of Theorem 4.1. By Equation (1), the drift on is . The map is a randomised test with size , so its power is at most by the Neyman–Pearson lemma. For the KL form, let be any test with , a Neyman–Pearson test in particular. The channel maps , to , with , ; by data processing , where is the KL divergence between Bernoulli laws, and for . A reward gains at most . For achievability, let be the ratio of the densities with respect to , and let a prompt-time gate fire with probability , , using a random variable independent of and of the decoding uniforms; it is a gate because is a function of . With an update that puts all mass on a token of -probability at most , , with the adapted model switched on at , so , and Theorem 3.3 for the gate that always fires gives , so with .
Proof of Theorem 4.2. Let move every response distribution on by at least . By Equation (1), its drift on is , and it is at most by assumption, so . The indicator of is then a test of size at most , so its power is at most by the Neyman–Pearson lemma. For a prompt-time gate, the update of Theorem 3.3 moves every prompt on which the gate fires, so these prompts form such a set ; for an ungated update, is every prompt.
Proof of Theorem A.2. The first inequality holds because is a feasible test, as in the proof of Theorem 4.1. For any feasible and , , so the supremum is at most the infimum. The problem maximises a linear functional over tests, a convex set that is compact in the weak-* topology of , subject to finitely many linear constraints, and the constant test satisfies them strictly; Lagrangian duality under this Slater condition gives equality, a maximising test and a minimising . This is the generalised Neyman–Pearson lemma (Dantzig & Wald, 1951; Lehmann & Romano, 2022). An optimal test attains equality in the display with , so it maximises over tests and equals 1 where the integrand's factor is positive and 0 where it is negative. For levels , the bound with gives ; dropping component is the level , and the limit cannot fall when a constraint is removed. Attainment follows as in the proof of Theorem 4.1, with an optimal test that is a function of (the conditional expectation of any optimal test given is one) in place of .
Proof of Theorem A.3. Firing requires , which gives the inequality. Let be the continuous distribution function of on . Then are i.i.d. uniform, has the distribution, and has the distribution (Vovk, 2012). It exceeds exactly when at least of the are below , an event of probability by the choice of .
Proof of Theorem A.4. because the trajectory law is followed by 's kernel, and does not depend on . (a) is linearity. (b) holds because , so . (c) . (d) is (a) with from Theorem 3.8(a).
Proof of Theorem A.8. Both laws share the kernel : with , , and likewise for , so both densities with respect to are functions of the prompt alone, and so is the likelihood ratio of the joint laws. A test induces the prompt-level test with the same size and power under and ; the Neyman–Pearson lemma applied to gives the claim.
Proof of Theorem A.9. With , let be a size- Neyman–Pearson test and . Both have size , so , and . For every , maximises over , so . Subtracting, and using the equal sizes to remove the constant
Algorithm 1 FIREGATE: stage of a continual stream
Input: ; task prompts and reward ; unlabeled reference components (generic chat, harmful requests, task-like prompts, stored prompts of tasks ); split depth ; mode (anytime or prompt-time); optionally a region level .
Roll out greedily on fitting prompts from and each .
Fit : logistic regression on normalised trunk features, label 1 for , 0 for (all positions after the template prefix; prompt-time: the last prompt token).
(two-sided) Fit the region of ; set outside it.
Roll out on calibration prompts of each and record .
Set by Theorem 3.6; the certificate on every and the coverage of are now fixed.
Add LoRA to blocks and train it with GRPO on , either gated by the latch of or ungated, by any method, then placed behind the prompt-time gate (Theorem 3.4).
Output: and its certificates.
, since ; when the right side is . A strictly increasing transformation of leaves unchanged.
Proof of Theorem A.10. Outside the coupled responses coincide (Theorem 3.2), which gives the identity. The summands are i.i.d. with mean equal to the left side, and .
Proof of Theorem A.11. (a) Each product is non-negative since , and under the hypothesis a supermartingale: . So is the mixture, which starts at one; Ville's inequality (Ville, 1939) gives the claim. (b) , so is at most the first time the -th log-product, a random walk with drift and increments at most , crosses ; Wald's identity bounds the expected crossing time by the threshold plus one increment, divided by the drift. With , and , so .
Proof of Theorem A.12. depends only on the old model's trajectories and is non-increasing in ; Theorem 3.2 holds for every update. The second claim is Theorem 3.6 with one component, and a union bound. The scores for repair must come from 's trajectories (the deployed model with its new updates off), because after a firing the deployed trajectory leaves 's.
C. Implementation details
Classifier and fitting details: The classifier of Section 5 is fitted on up to 48 positions per fitting trajectory (anytime) or on the last prompt token (prompt-time), with computed on the fitting features. The fixed chat-template prefix is identical for every prompt, so the likelihood ratio there is exactly one; the gate skips it.
Prompt-time and anytime gates: FIREGATE-prompt scores the last prompt token; FIREGATE-anytime scores every position after the template prefix and fires at the first whose score exceeds the threshold. Its trajectory score is a maximum over hundreds of positions, whose heavier upper tail on the reference puts the threshold higher at the same , while the response adds no evidence about the prompt's source (Theorem A.8); the prompt-time gate therefore fires more often on the new task (Table 14), and the anytime gate can switch the LoRA on inside a long prompt.
Region check of the two-sided gate: The two-sided gate of Theorem 3.8 uses as the Mahalanobis distance, in the classifier's standardised feature space, to the mean of the new task's fitting prompts, with the covariance shrunk toward a multiple of the identity (weight 0.1), and the empirical quantile of on the task's unlabeled RL prompts, which are disjoint from the fitting prompts, . With this quantile is at least the 980th smallest distance, so by part (c) of Theorem 3.8 the region misses at most 2.9% of new-task prompts with probability 0.95, and at most on average. The threshold is then calibrated on the conjunction. The level and the shrinkage were set once (Section D.1); with shrinkage 1 instead, the worst template's jailbreak firing reaches 100% (mean 6.9% over ten experiments), so the region depends on this setting, while between 0.01 and 0.1 and 50 or more RL prompts change little.
Exact gating and coupling: A forward pre-hook on block reads , computes in float32 for every gate and updates the latches (prompt-time gates only at the last prompt token), and the LoRA output is merged as where , so masked positions return the base value bit for bit. Gates are calibrated on greedy trajectories recorded with the gate attached but inactive, the code path used at deployment. The sampler draws one uniform per prompt and step from a fixed seed and selects the token by inverse transform, so two models decoded with the same seed realise the coupling of Theorem 3.2 exactly and the identity of non-fired responses can be checked under sampling too (Section D.2). The uniforms depend only on the prompt index and the seed; the bfloat16 logits depend slightly on batch composition, so a final model and its base model are always decoded in the same batches.
Training: GRPO (Shao et al., 2024) samples responses per prompt from the current gated policy, normalises rewards within the group, , and minimises the advantage-weighted negative log-likelihood averaged over all response tokens of the batch (Yu et al., 2025); AdamW with a 10-step linear warm-up, then a constant learning rate; LoRAs of earlier tasks are frozen.
Adapted layers: The LoRA adapts the attention and MLP projections (query, key, value, output, gate, up and down) of blocks only. Embeddings, the final normalisation and the output head, which some models tie to the embeddings, are never adapted, so the trunk's input and features are those of the old model.
Fitting and calibration sets: New task: 600 training prompts, disjoint from the RL prompts on which and the region's are set. Generic: 600 Dolly prompts (fit), 700 (calibration), 400 (held-out). Harmful: 100 AdvBench prompts (fit), 170 (calibration), 250 (held-out). Each earlier task: 300 stored training prompts (fit) and 300 (calibration), disjoint from those used for RL. Task-like prompts: 900 (fit) and 700 (calibration). Logistic regression: class-balanced, penalty , L-BFGS. Evaluation pools: 500 prompts per task, 500 MMLU, 450 XSTest, 400 Dolly and 250 AdvBench, the same prompts at every stage. Every pool is split at random. Theorem 3.6 assumes i.i.d. draws; for Dolly-15k the split is close to that, while AdvBench has 520 requests in all, so its certificate concerns that finite pool, split without replacement, and its 250 held-out requests check the level directly.
Baselines: +KL uses the estimator per token on the current task's samples. +Ref-KL samples one response of (temperature 1) for up to 1,024 of the gate's fitting and calibration prompts and adds on these sequences, per token. Null-space LoRA estimates the principal input subspace of every adapted projection on 512 reference sequences of (all components, earlier tasks included) with a randomised eigendecomposition (Halko et al., 2011), keeps the smallest rank (at most 256) that holds the chosen share of the input energy, and replaces the LoRA's down-projection by . LoRA scaling multiplies every Seq-GRPO LoRA's update by at evaluation; O-LoRA adds over earlier LoRAs ; the router is trained and evaluated under its own prompt-time gate with threshold zero. EWC penalises each projection's weight change with a Kronecker-factored diagonal Fisher of the previous model's own samples (: mean squared gradient at the projection's output, : mean squared input; Martens & Grosse, 2015; Ritter et al., 2018), so the penalty needs only products, from up to 256 of the samples that Ref-KL draws (at most 23 skipped for memory). A-GEM projects the RL gradient onto the half-space that does not increase the sampled reference KL to first order, before AdamW, so its guarantee is approximate under Adam's preconditioning.
Runs and hardware: One run per method, seed and configuration, on one GPU model throughout (NVIDIA H200 or A100); multi-GPU runs split rollouts and evaluation across GPUs with results that do not depend on the GPU count.
Code, data and licences: All models and datasets are public and are used for research under the licences on their model and dataset cards. Code and configurations will be released with the paper.
D. Full experimental setup and results
This section gives the complete setup and every result that Section 6 summarises, in six parts: the validity of the certificates, the changes of ungated training, the share of the gain kept, the overlap ladder, distributions outside the reference, and seeds, scale, other families and other trainers.
D.1. Setup
Models: Qwen2.5-1.5B- and 7B-Instruct (28 blocks, ), OLMo-2-1124-7B-Instruct (32 blocks, , the same 28% of the depth), Llama-3.2-3B-Instruct (28, 9), DeepSeek-LLM-7B-Chat (30, 10), Llama-3.1-8B-Instruct (32, 10; Meta's weights from the unsloth re-upload) and Mistral-7B-Instruct-v0.3 (32, 10). Qwen2.5-7B runs NQ, IF and the three-task stream, OLMo-2 NQ, and the other families IF and NQ with Seq-GRPO and FIREGATE-prompt. The split-depth study moves to 5 and 15 on Qwen2.5-1.5B.
Tasks: The three-task stream is GSM8K (Cobbe et al., 2021), then Countdown with 3–4 numbers (Pan et al., 2025), then Knights and Knaves puzzles with 2–4 people (Xie et al., 2025a;b). The five-task stream continues with MATH problems of levels 1–4 with a numeric answer (Hendrycks et al., 2021b), asked with GSM8K's instruction so that their gate must stay silent on stored GSM8K prompts, and with Sudoku puzzles in Countdown's answer format. The overlap ladder trains one stage on a new task whose prompts resemble the reference to a different degree: requests from held-out Dolly rows with one verifiable format constraint appended (IF, after Zhou et al., 2023; separable by the constraint text), closed-book Natural Questions asked as plain questions, like Dolly's open-QA requests (NQ; Kwiatkowski et al., 2019; Lee et al., 2019), Dolly requests that come with a context passage (closed QA, information extraction, summarisation) rewarded for a short answer (Concise-ctx; about a third of the reference looks like this, so the prompts are separable only in part), and plain held-out Dolly requests rewarded for a short answer (Concise; the new prompts come from the reference distribution itself, so any gain is drift on the reference).
Training: All methods share the LoRA placement (rank 16, scaling factor 32, all projections of blocks ), 150 GRPO steps per task with 16 prompts 8 samples at temperature 1, at most 512 new tokens, AdamW with learning rate and gradient clipping at 1. Each configuration is run with three seeds unless stated; the seed sets the LoRA initialisation and the rollout randomness, while prompts, data splits and evaluation pools are fixed (the first gate of a stream is therefore the same for every seed).
Methods: FIREGATE-prompt (prompt-time gate, LoRA trained under its gate), its whole-sequence variant (Section 5) and FIREGATE-anytime (anytime gate), at and, on the overlap tasks, also at 0.10 and 0.30. Baselines, all with the same LoRA placement and budget and implemented as in Section C: Seq-GRPO, a new ungated LoRA per task with earlier ones frozen, so it differs from FIREGATE-prompt only by the gate; +KL to the previous model, the divergence that predicts forgetting in Shenfeld et al. (2026),
; +Ref-KL on the same unlabeled reference prompts the gate uses, an LwF-style distillation (Li & Hoiem, 2018), , and with four samples per reference prompt and 64 reference sequences per step at ; null-space LoRA at 80%, 95% or 99% of the reference energy, estimated once or on the current model every 25 steps; +EWC, , which to second order approximates the per-token KL that Ref-KL samples; +A-GEM; LoRA scaling by at evaluation (Wortsman et al., 2022); O-LoRA and +Replay (a quarter of each batch from earlier tasks, with labels) on the stream; and a router with the classifier's natural threshold (logit > 0), trained under its own gate, which isolates what calibration contributes. The coefficient sweeps run on the 1.5B overlap tasks (some IF and Concise sweep points with one seed), EWC and A-GEM on NQ at 1.5B, O-LoRA, replay and A-GEM (one seed) on the 1.5B stream; the larger models and the five-task stream compare fewer methods (Tables 2 and 3).
Table 7 lists every gate and both ways of deploying an update, with the results that use each.
Table 7. The gates and deployment forms of the experiments. Every gate is calibrated with Theorem 3.6, so each certifies its firing on every calibrated component; the steps change only which prompts it covers and its coverage . Results use the deployed gate unless marked otherwise.
| Name | What it is | Where it is used |
|---|---|---|
| How the update is deployed | ||
| Gated training | a LoRA trained under its own gate; rollouts on which the gate stays silent carry no gradient | FIREGATE-prompt and FIREGATE-anytime rows; Non-fired in Table 2 |
| Switch | any trained model answers where a prompt-time gate fires, the old model elsewhere (Theorem 3.4) | "behind the gate" rows; Table 2, Figure 4 |
| Where the gate reads | ||
| Prompt-time | FIREGATE-prompt: reads the last prompt token and decides once per prompt | every switch; most gated runs |
| Anytime | FIREGATE-anytime: reads every position after the template prefix | Table 10 |
| Whole sequence | the prompt-time gate, with the LoRA applied to the whole sequence once it fires | Table 10 |
| Which prompts it covers (steps of Section 5) | ||
| Deployed, steps (1)–(2) | the classifier, thresholded at on each reference component | coverage, gain and switch results |
| Two-sided, step (3) | fires only inside the task's region, which misses a share of its prompts | chosen gate for NQ and TriviaQA |
| + remedy, step (4) | harmful requests in the task's format added as a component | chosen gate for IF and the streams |
| Protect, step (5) | calibrated only on the components to protect | Tables 4 and 24 |
| Protect + passages | adds harmful requests that follow a passage | chosen gate for Concise, Concise-ctx and SQuAD 2.0 |
| Wide harmful component | harmful requests from more sources and languages | Concise (Section K.7) |
| One gate for a stream | the union of the stages' gates, calibrated once (Theorem A.6) | Table 3 |
Certified switches: Every finished run of an ungated method is also evaluated behind the prompt-time gate of its experiment (Theorem 3.4): a prompt on which the gate fires gets the trained model's response, every other prompt the base model's. Under greedy decoding both responses are stored, so this evaluation is exact and needs no new generation; the trained and base responses come from the same run and GPU model. The gates are the deployed gate of FIREGATE-prompt and the variants of Section 5 (two-sided, one budget for a stream, the remedy, which adds AdvBench requests rewritten in each task's format to the reference, and protect), refitted or recalibrated at each level from trunk features stored in one pass of the base model, so their firing rates differ from those recorded during the trained runs by up to about two points.
Reference distributions and certificates: The four kinds of calibration prompts are those of Section 6.1; the task-like prompts come from ARC, CommonsenseQA, OpenBookQA, BoolQ, Alpaca and MBPP (Clark et al., 2018; Talmor et al., 2019; Mihaylov et al., 2018; Clark et al., 2019; Taori et al., 2023; Austin et al., 2021), in formats unlike MMLU's. is split across components.
Metrics: Task accuracy after each stage, average accuracy and backward transfer (BWT); refusal on AdvBench; over-refusal on safe XSTest prompts; MMLU accuracy; for every pool, the share of responses that differ from the base model's; and on Dolly the share that adopt a trained answer format (format leakage). Every metric is a bounded function of the response, so Theorem 3.2 covers all of them. A changed response can be a harmless rewording, so the share of changed responses bounds the drift from above; response lengths bound it from below (Table 9), and refusal, over-refusal and MMLU accuracy show what changed. Tables report mean standard deviation over seeds; a held-out bound is the largest over seeds.
Order of the design choices: The first version fixed the split at about 30% of the depth, a linear classifier on trunk features, , , the Dolly and AdvBench components with their split sizes and the Dolly, AdvBench, XSTest and MMLU evaluation pools, and none of these changed later; a later split-depth study left the split where it was. The task-like component was added in the second version, after first-version gates had fired on MMLU prompts, so MMLU is never calibrated on but did inform that choice. The two-sided region was designed after the MMLU firing of the stream gates and of the IF gate at ; its level and covariance shrinkage 0.1 were set then, before any variation of them, so MMLU is not an independent test of the region, while the jailbreak templates were added later and never used to set it. The remedy was designed after the deployed gates were seen to fire on harmful requests written in a task's format; it is fitted and calibrated on the fitting and calibration splits of those requests and evaluated on their held-out split, so it is tested on that format, not on new ones. The predictions of the gain behind the switch, of the protect setting and of the new experiments were written into the run plans before the runs, and the twelve stress forms of harmful requests and the fresh Dolly prompts were fixed before any gate was evaluated on them. The analyses of Section K were planned with their settings and predictions before they ran; three predictions of Section K.1 were added after its jobs had started and before any of their outputs was read, and are reported as such. Table 8 lists every choice with the evidence it can be judged on.
Table 8. Each design choice and the evidence it is judged on. Before: fixed before any gate was evaluated on that evidence, so it is a prospective test; after a failure: chosen after the named failure was seen, so that evidence does not test it independently.
| Choice | Fixed | Evidence |
|---|---|---|
| Split depth, linear classifier, , , Dolly and AdvBench components and their sizes; Dolly, AdvBench, XSTest and MMLU pools | first version; never changed | every later result (before) |
| Task-like component | second version, after a failure: first-version gates fired on MMLU | MMLU informed it; never calibrated on |
| Two-sided region, , shrinkage 0.1 | after a failure: MMLU firing of the stream gates and of IF at | not MMLU; the jailbreak templates, added later (before) |
| Remedy: harmful requests in the task's format | after a failure: deployed gates fired on such requests | their held-out split of the same format only |
| Passage component (protect + passages) | after a failure: the protect gate fired on harmful requests with a passage | held-out requests of the same form (Table 4) |
| Twelve stress forms; 10,000 fresh Dolly requests | before any gate was evaluated on them | Section I, Table 20 (before) |
| Eight second-round forms | before any gate saw them | Table 23 (before) |
| Score classes and their settings | before any result; the class with the largest coverage chosen after, each at | Table 18 (before) |
| HarmBench, StrongREJECT | every gate and setting frozen; three predictions added after the jobs started, before any output was read | Section K.1 (before) |
| MultiJail, oasst1, system prompts | gates frozen; predictions written before the download | Section K.5 (before) |
| Language-model score | its question per task fixed before any score | Table 17 (before) |
| Wide harmful component (Concise) | after a failure: the Concise gate fired on Multi-Jail; predictions written before any download or fit | its sources' test thirds; Do-Not-Answer and Aya red-teaming (before); XSTest, whose failure was known (Section K.7) |
| TriviaQA, settings copied from NQ | seven predictions written before the download; gate firing recorded before training | Table 32 (before) |
Reproducibility across GPUs: Greedy bfloat16 decoding is reproducible on one GPU model but not across models, so every run is compared with the base model evaluated on its own GPU model (Section C); tables mark runs on A100 GPUs.
D.2. A stream of distinguishable tasks
Validity and size of the certificates: Among 19853 prompt-stage pairs on which no new gate of FIREGATE-anytime fired, 0 responses differed from the previous stage's, and among 18714 such pairs of FIREGATE-prompt, 0: an exact check of Theorem 3.2, as the two runs share every hidden state until a gate fires. For FIREGATE-prompt, the held-out bounds on the firing (Table 10) are 5.7% on Dolly and 1.2% on AdvBench, and on the two pools never used in calibration 0.7% on XSTest and 10.5% on MMLU; for FIREGATE-anytime they are 2.9%, 1.2%, 0.7% and 15.7%. MMLU is the exception because it is not calibrated on and its answer-format instruction resembles the stream prompts. Earlier tasks are protected without replaying their labels: on average over seeds, the later gates of FIREGATE-anytime fire on 3.1% of stored GSM8K trajectories of and on 0.1% of the stored Countdown trajectories of , and those of FIREGATE-prompt on none and on 0.8% (Theorem 3.7), while Seq-GRPO changes 99.0% and 96.3% of those responses. Recalibrating on resampled calibration sets, the firing rate exceeds in at most 0.2% of resamples, against the allowed of 1.0–1.7% (Theorem 3.6). Under sampling at temperature 0.7 with shared randomness, 0 of 18543 non-fired responses of the two gate variants differ from the base model's (three seeds), as Theorem 3.2 requires for any decoding rule.
Certificates under other decoding rules: Theorem 3.2 holds for every decoding rule, but an anytime gate's firing depends on the rule, so its certificate must be calibrated under the deployed one; a prompt-time gate's does not. Table 9 decodes the reference pools again at temperatures 0.3 and 1 and with top- 0.9, the final and the base model sharing one seed and the same batches. No non-fired response changes (0 of 13,947), each gated run changes no more responses than its gate fires on, and refusal and MMLU accuracy stay within a point. Ungated Seq-GRPO changes most responses under every rule; its share of changed responses is only an upper bound on the TV distance, but on NQ the response lengths alone bound it below by 38.5–51.7% (95%).
Changes made by ungated continual RL: Table 10 gives every method on the stream: each ungated method changes most Dolly responses whatever it regularises, and the gated variants almost none at the same average accuracy, as only fired prompts can change. Seq-GRPO also lowers over-refusal on safe XSTest prompts by 15.5 points on average, with large variation across seeds; null-space LoRA changes the fewest Dolly responses of the ungated methods, and Seq-GRPO's LoRAs scaled by 0.5 at evaluation still change 84.8% of them.
Certification costs no accuracy on this stream: FIREGATE-prompt reaches 58.8% average accuracy and FIREGATE-anytime 59.1%, against 57.2% for Seq-GRPO; the gates separate each new task from the reference with AUROC 1.000, and the gated variants have BWT +0.0 0.1 and +0.1 0.1, while Seq-GRPO's ranges widely (). The router fires on none of the reference prompts here, while on NQ the same rule fires on 6.8% of Dolly prompts. Apart from Ref-KL, which learns little Countdown, the averages lie within about one standard deviation of each other, so the stream shows that certification costs no accuracy, not that it adds any; gating removes forgetting within the stream because each stage's LoRA is off on the other stages' prompts. It has one cost there: before a task is trained, an earlier stage's gate can fire on its prompts, which belong to no reference component until their own stage. After the GSM8K stage, FIREGATE-prompt lowers Countdown accuracy from 6.8% to 3.8%, and its whole-sequence variant lowers Countdown to 0.2% and K&K
Table 9. Drift under other decoding rules (Qwen2.5-1.5B, seed 0; the final and the base model share one decoding seed and are decoded in the same batches). Fire: firing on held-out Dolly prompts under that rule and its 95% Clopper–Pearson bound, which bounds the TV distance on Dolly under that rule (Theorem 3.2); a prompt-time gate’s firing is the same under every rule, an anytime gate’s is not. Chg.: share of changed responses, an estimate of an upper bound on the TV distance (coupling inequality). : change of refusal (AdvBench) and accuracy (MMLU), points. TV : largest 95% lower confidence bound on the TV distance over the four pools (Dolly, AdvBench, XSTest, MMLU), from the Kolmogorov–Smirnov distance of response lengths; for ungated runs it, not Chg., is the evidence of drift. Non-fired: changed responses on prompts where no gate fired, over the four pools (Theorem 3.2: 0).
| Run | Decoding | Dolly (%) | AdvBench | MMLU | TV | Non-fired | |||
|---|---|---|---|---|---|---|---|---|---|
| Fire (CP) | Chg. | Chg. | Chg. | ||||||
| Stream, FIREGATE-prompt | 3.8 (5.7) | 2.5 | 0.0 | +0.0 | 3.0 | -0.4 | 0.0 | 0 | |
| Stream, FIREGATE-prompt | 3.8 (5.7) | 3.0 | 0.0 | +0.0 | 2.4 | +0.2 | 0.0 | 0 | |
| Stream, FIREGATE-prompt | 0.9 | 3.8 (5.7) | 2.5 | 0.0 | +0.0 | 2.6 | -0.8 | 0.0 | 0 |
| Stream, FIREGATE-anytime | 1.2 (2.6) | 0.8 | 0.0 | +0.0 | 6.0 | +0.8 | 0.0 | 0 | |
| Stream, FIREGATE-anytime | 2.0 (3.6) | 1.5 | 0.0 | +0.0 | 6.8 | +0.4 | 0.0 | 0 | |
| Stream, FIREGATE-anytime | 0.9 | 0.8 (1.9) | 0.5 | 0.0 | +0.0 | 6.2 | +0.6 | 0.0 | 0 |
| Stream, Seq-GRPO | – | 88.2 | 9.6 | -0.8 | 27.6 | +1.8 | 0.0 | – | |
| Stream, Seq-GRPO | – | 95.8 | 49.6 | -0.4 | 35.0 | -0.2 | 3.8 | – | |
| Stream, Seq-GRPO | 0.9 | – | 93.8 | 32.0 | +0.0 | 33.2 | +0.8 | 3.8 | – |
| NQ, FIREGATE-prompt | 3.5 (5.4) | 3.5 | 0.0 | +0.0 | 0.0 | +0.0 | 0.0 | 0 | |
| NQ, FIREGATE-prompt | 3.5 (5.4) | 3.5 | 0.0 | +0.0 | 0.0 | +0.0 | 0.0 | 0 | |
| NQ, FIREGATE-prompt | 0.9 | 3.5 (5.4) | 3.5 | 0.0 | +0.0 | 0.0 | +0.0 | 0.0 | 0 |
| NQ, Seq-GRPO | – | 92.8 | 74.8 | -6.4 | 38.4 | -0.2 | 51.7 | – | |
| NQ, Seq-GRPO | – | 97.5 | 92.4 | -8.8 | 45.0 | +1.2 | 38.5 | – | |
| NQ, Seq-GRPO | 0.9 | – | 96.8 | 88.4 | -7.2 | 47.0 | -0.4 | 51.7 | – |
Table 10. After the stream GSM8K → Countdown → K&K (Qwen2.5-1.5B-Instruct, greedy decoding). Accuracy (%) on each task, average and backward transfer (BWT); changes relative to the base model in AdvBench refusal, XSTest over-refusal on safe prompts and MMLU accuracy (points); share of Dolly responses that differ from the base model’s (Chg.) or use a trained answer format (Leak). Each stage’s gate is certified before training at the PAC level 3% on every reference component (Theorem 3.6). The last two columns are held-out bounds, the largest 95% Clopper–Pearson bound on the firing over held-out prompts of the reference pools Dolly and AdvBench (ref.), which checks that level, and of XSTest and MMLU, which are never used in calibration (off-ref.) and have no other certificate; MMLU sets it; ungated methods have no gate (none), and the router has held-out bounds but no level chosen before training (uncal.). Mean standard deviation over of 3 seeds, with the same data and evaluation prompts; each bound is the largest over seeds. : run on A100 GPUs in at least one seed, the others on H200, each compared with the base model on its own GPU model. *One seed; its per-task accuracy, over-refusal and leak were not computed. Arrows: higher () or lower () is better; for changes relative to the base model, zero is best.
| Method | Stream tasks | vs. base (pts) | Dolly (%) | Held-out bound (%) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GSM8K | Countdown | K&K | Avg | BWT | Refusal | Over-ref. | MMLU | Chg | Leak | ref. | off-ref. | ||
| Base model (A100) | – | 74.40.0 | 6.80.0 | 13.20.0 | 31.50.0 | – | 0.0 | 0.0 | 0.0 | 0.0 | 0.00.0 | 0.0 | 0.0 |
| Base model (H200) | – | 73.2 | 7.8 | 13.4 | 31.5 | – | 0.0 | 0.0 | 0.0 | 0.0 | 0.2 | 0.0 | 0.0 |
| Seq-GRPO | 3 | 74.74.1 | 61.47.8 | 35.35.4 | 57.24.9 | -4.55.2 | -0.50.5 | -15.515.4 | +1.01.4 | 93.43.8 | 1.52.4 | none | |
| + KL | 3 | 77.52.0 | 58.34.1 | 31.92.1 | 55.91.9 | +5.38.8 | -0.10.2 | -17.22.1 | +0.71.0 | 90.80.4 | 0.10.1 | none | |
| + Replay | 3 | 75.50.6 | 63.21.3 | 35.92.2 | 58.20.1 | +1.21.7 | +0.00.0 | -14.30.9 | +0.90.3 | 90.24.2 | 1.31.9 | none | |
| + Ref-KL | 3 | 75.51.7 | 36.28.5 | 30.52.7 | 47.43.0 | -10.25.6 | -0.50.2 | -10.412.2 | -0.50.4 | 94.40.4 | 0.00.0 | none | |
| + O-LoRA | 3 | 76.00.9 | 64.36.0 | 39.21.1 | 59.82.4 | -1.80.6 | -0.50.2 | -12.83.3 | +1.60.3 | 90.92.1 | 2.52.2 | none | |
| + Null-space | 3 | 76.51.6 | 63.36.1 | 36.01.4 | 58.62.3 | -0.20.5 | -0.10.2 | -6.31.6 | +0.60.4 | 74.21.5 | 1.20.3 | none | |
| + A-GEM | 1 | – | – | – | 58.4 | -0.7 | -0.4 | – | +0.6 | 94.2 | – | none | |
| LoRA 0.5 | 3 | 77.70.8 | 60.32.7 | 26.72.1 | 54.91.4 | +0.11.7 | -0.10.2 | -9.29.8 | +0.60.7 | 84.83.8 | 0.70.9 | none | |
| Router (uncal.) | 3 | 77.50.5 | 59.712.0 | 33.92.2 | 57.14.6 | +0.00.0 | +0.00.0 | +0.00.0 | +0.00.0 | 0.00.0 | 0.00.0 | uncal. | |
| FIREGATE-prompt (ours) | 3 | 78.11.1 | 65.54.9 | 32.91.6 | 58.81.6 | +0.00.1 | +0.00.0 | +0.00.0 | +0.40.5 | 2.60.1 | 0.50.0 | 5.7 | 10.5 |
| whole sequence | 3 | 78.32.0 | 58.211.7 | 37.13.6 | 57.83.2 | +0.00.1 | +0.00.0 | +0.00.0 | +0.00.2 | 2.20.4 | 0.70.1 | 5.7 | 10.5 |
| FIREGATE-anytime (ours) | 3 | 78.01.6 | 65.03.6 | 34.32.9 | 59.10.9 | +0.10.1 | +0.00.0 | +0.00.0 | +0.30.4 | 1.00.5 | 0.30.1 | 2.9 | 15.7 |
from 13.2% to 6.0%.
D.3. Trained models behind the switch
The share of the gain kept: Figure 4 and Table 2 put Seq-GRPO of every experiment behind the gate at (Section 6.3). On Concise the gate covers 0.7% of the new prompts and the switch keeps +1.0 of +73.6 points, as Theorem 4.1 demands when new and reference prompts cannot be told apart; on Concise-ctx it covers 3.8% and keeps +2.6 of +65.2 points. Over the 52 cases of Figure 4 with the error of is 0.48 points on average (largest 3.4) against a mean gain of 5.3 points. Sweeping the threshold so that runs from 0.1 to 0.9, the error is 0.3 points on NQ (largest 0.7), 0.4 at 7B and 0.3 on OLMo-2; on IF and Concise-ctx the measured gain exceeds the prediction by up to 4.1 and 3.3 points at intermediate , the covariance term of Theorem 4.3.
The covariance term: Per task, the prediction error behind the deployed gate is computed with a 95% paired-bootstrap interval over prompts and seeds. Over the 92 combinations of task and ungated method in the Qwen2.5 and OLMo-2 experiments the interval of the error contains zero in 91, and the error is at most 0.5 points. A gate could in principle miss exactly the prompts with the most to gain; Table 11 puts Seq-GRPO behind gates that fire on as many held-out prompts as the deployed one. On NQ at 1.5B, where the deployed gate fires on of held-out prompts, the deployed gate keeps +4.7 points, as random gates of that size do (+4.7, 95% range +4.0 to +5.4). An oracle that knows each prompt's gain could move this to -1.9 or +7.7, but the trunk features do not carry that knowledge: a ridge regression on them, cross-fitted to predict each prompt's gain, has on NQ for all three models, and the gate it defines keeps +4.9, +3.7 and +5.5 points, inside the random range in each case. Where the features do predict some of the gain (Concise and Concise-ctx, of 0.31 and 0.20), the gate covers 1–3% of the prompts, so such a gate can lose about one point at most. The prediction is a statement about gates built from these features, checked on held-out prompts, not a bound for every gate.
Table 11. The range over which the covariance term moves the gain kept behind a gate. Seq-GRPO's gain (points) behind gates that fire on as many held-out prompts as the deployed gate. Worst / best: oracle on each prompt's gain, which needs labels; solved: fires first on prompts the base model already solves; features: a ridge regression on the trunk features, cross-fitted, that predicts each prompt's gain ( in brackets) and fires on the lowest predictions; random: mean and 95% range of 1000 random gates ( in expectation). : firing on held-out new-task prompts. Tasks with .
| Experiment | Task | Deployed | Worst | Best | Solved | Features () | Random | ||
|---|---|---|---|---|---|---|---|---|---|
| Concise, Q-1.5B | Concise | 1.4 | +73.6 | +1.0 | +0.0 | +1.4 | +0.0 | +0.6 (0.31) | +1.0 [+0.6, +1.4] |
| Concise-ctx, Q-1.5B | Concise-ctx | 3.2 | +65.2 | +2.6 | +0.0 | +3.2 | +0.0 | +1.0 (0.20) | +2.1 [+1.4, +2.8] |
| NQ, OLMo-2-1124-7B | NQ | 95.8 | +5.9 | +5.7 | +1.7 | +8.5 | +5.8 | +5.5 (0.00) | +5.7 [+5.1, +6.1] |
| NQ, Q-1.5B | NQ | 90.6 | +5.2 | +4.7 | -1.9 | +7.7 | +4.9 | +4.9 (-0.00) | +4.7 [+4.0, +5.4] |
| NQ, Q-7B | NQ | 96.4 | +3.8 | +3.8 | +0.9 | +6.1 | +3.4 | +3.7 (-0.01) | +3.7 [+3.3, +4.0] |
D.4. The overlap ladder
The overlap ladder: On the streams the gates separate new-task from reference prompts almost perfectly, so certification is free and Theorem 4.1 is never tested. The overlap ladder tests it.
Matched routers show that calibration, not gating, sets the certified level: Table 12 builds five gates from the same unlabeled prompts and trunk features, so that they differ from the gate only in the score and the threshold: the logistic classifier, a Gaussian model with shared covariance (LDA), an Expert-Gate-style pair of PCA autoencoders (Aljundi et al., 2017), 15 nearest neighbours, and a one-class region of the new task. At their own thresholds, as a router or an expert gate would use them, they fire on 6.2–30.8% of Dolly prompts. PAC-calibrated at , every one fires on at most 3.2% (95% bounds at most 5.1%) and Seq-GRPO behind it keeps 3.2–4.7 of its 5.2 points. The density-ratio gates keep the most coverage at that level (92.2% for the logistic classifier and 95.4% for LDA at , against 58.1–82.8% for the others; Table 18 uses ), consistent with Theorem A.9. An oracle gate that knows which prompts are NQ questions would keep Seq-GRPO's +5.2 points with no drift; it needs the task identity of every prompt.
D.5. Certificates outside the reference
Distributions unlike both the task and the reference: Table 13 lists the firing of each gate variant on held-out pools, all computed before training; by Theorem 3.4 it bounds the drift of any model behind the gate. The deployed IF gate fires on 99.4% of MMLU prompts, on 73.5% of Dolly requests behind a system prompt and on 83.2% of AdvBench requests behind one; the stream gates fire on 8.6%, 39.0% and 50.0% of MMLU prompts at 1.5B, 7B and on the five-task stream. These pools are far from both the task and the reference, where a classifier trained only to tell the two apart extrapolates. The region check caps the firing at the mass a pool puts in the task's region (Theorem 3.8), and these pools put almost none there, so the two-sided gate fires on none of them in any experiment and on 0.0–2.8% of Dolly. Its threshold is set on the RL prompts, so its coverage there (90.7–98.0%, Concise(-ctx) aside) is in-sample; on held-out task prompts it is 89.0–98.6%, against 90.6–100% for the deployed gate. Behind it, Seq-GRPO keeps +38.2 of +38.7 points on IF with no MMLU response changed, against 88.5% changed behind the deployed gate. On 500 WildChat first turns (Zhao et al., 2024), never fitted or calibrated on, the deployed IF and stream gates fire on 11.8–30.8% and the two-sided gate on at most 1.2%. Without the task-like component the classifier fires on 33.6–100% of MMLU prompts in eight of eleven experiments, with it on at most 2.0% outside IF and the streams. Where a gate fires on a pool it does not certify, the change there depends on training: at on IF, FIREGATE-prompt lowers MMLU accuracy by 8.6 points ( over seeds).
Table 12. Gates built from the same unlabeled prompts and trunk features (NQ, top, and Concise-ctx, bottom; Qwen2.5-1.5B-Instruct), at their own threshold (natural; as a router uses them) and PAC-calibrated. Power: firing on unlabeled RL prompts; Dolly, MMLU, AdvB.: on held-out pools (%); CP: 95% bound on Dolly; Seq: Seq-GRPO behind the gate, new-task gain (points) and Dolly responses changed (%). Only the calibrated rows carry a certificate.
| Gate | AUROC | Threshold | Power↑ | Dolly↓ | CP↓ | MMLU | AdvB. | Gain | Chg. |
|---|---|---|---|---|---|---|---|---|---|
| NQ | |||||||||
| linear classifier (logistic) | 0.989 | natural | 96.9 | 6.2 | 8.6 | 0.0 | 0.0 | +5.1 | 6.2 |
| 92.2 | 3.2 | 5.1 | 0.0 | 0.0 | +4.7 | 3.2 | |||
| 98.3 | 9.5 | 12.3 | 0.0 | 0.0 | +5.1 | 9.5 | |||
| Gaussian (LDA) | 0.993 | natural | 98.7 | 7.8 | 10.3 | 0.2 | 0.0 | +5.3 | 7.8 |
| 95.4 | 3.2 | 5.1 | 0.0 | 0.0 | +4.7 | 3.2 | |||
| 99.5 | 10.5 | 13.4 | 0.8 | 0.0 | +5.3 | 10.5 | |||
| PCA autoencoders, Expert-Gate style | 0.980 | natural | 100.0 | 23.2 | 27.0 | 0.0 | 0.0 | +5.2 | 23.2 |
| 82.8 | 3.0 | 4.8 | 0.0 | 0.0 | +4.5 | 3.0 | |||
| 97.0 | 10.5 | 13.4 | 0.0 | 0.0 | +5.2 | 10.5 | |||
| 15 nearest neighbours | 0.975 | natural | 99.7 | 20.2 | 23.8 | 0.0 | 0.0 | +5.2 | 20.2 |
| 68.8 | 1.0 | 2.3 | 0.0 | 0.0 | +4.1 | 1.0 | |||
| 96.4 | 11.2 | 14.2 | 0.0 | 0.0 | +5.4 | 11.2 | |||
| one-class (new-task region) | 0.942 | natural | 98.0 | 30.8 | 34.8 | 0.0 | 0.0 | +5.2 | 30.8 |
| 58.1 | 2.5 | 4.2 | 0.0 | 0.0 | +3.2 | 2.5 | |||
| 82.1 | 7.8 | 10.3 | 0.0 | 0.0 | +4.2 | 7.8 | |||
| Concise-ctx: Dolly requests with a context passage | |||||||||
| linear classifier (logistic) | 0.839 | natural | 81.0 | 28.2 | 32.2 | 7.2 | 0.0 | +53.8 | 26.8 |
| 3.8 | 1.8 | 3.3 | 0.0 | 0.0 | +2.6 | 1.8 | |||
| 24.1 | 7.5 | 10.0 | 0.0 | 0.0 | +17.7 | 7.3 | |||
| Gaussian (LDA) | 0.838 | natural | 98.5 | 33.0 | 37.1 | 0.0 | 0.0 | +64.0 | 31.5 |
| 3.5 | 2.0 | 3.6 | 0.0 | 0.0 | +3.1 | 2.0 | |||
| 24.4 | 8.5 | 11.2 | 0.0 | 0.0 | +14.8 | 8.0 | |||
| PCA autoencoders, Expert-Gate style | 0.826 | natural | 99.6 | 33.2 | 37.3 | 0.0 | 0.0 | +65.0 | 31.8 |
| 3.5 | 1.5 | 2.9 | 0.0 | 0.0 | +1.4 | 1.5 | |||
| 25.8 | 9.0 | 11.7 | 0.0 | 0.0 | +14.2 | 8.8 | |||
| 15 nearest neighbours | 0.832 | natural | 99.9 | 33.5 | 37.6 | 0.2 | 0.0 | +65.2 | 32.0 |
| 1.8 | 0.0 | 0.7 | 0.0 | 0.0 | +0.4 | 0.0 | |||
| 10.6 | 3.8 | 5.7 | 0.0 | 0.0 | +6.2 | 3.6 | |||
| one-class (new-task region) | 0.827 | natural | 98.0 | 32.5 | 36.6 | 0.0 | 0.0 | +62.6 | 31.0 |
| 8.4 | 3.0 | 4.8 | 0.0 | 0.0 | +5.8 | 2.9 | |||
| 23.9 | 8.2 | 10.9 | 0.0 | 0.0 | +14.9 | 7.9 | |||
Harmful requests wrapped in three common jailbreak templates (refusal suppression with a prefix injection, role play, a fictional frame) are never used in calibration either. The deployed IF gate fires on 34.0% of them at 1.5B and on 49.7% at 7B, and the stream gates on 13.2–57.5%: the templates carry instructions about the form of the answer, as IF and stream prompts do. The two-sided gate fires on none of them in any experiment (Table 13).
Harmful requests in a task's format: AdvBench requests rewritten in a trained task's answer format look like task prompts, so the deployed gates fire on all of them, and behind them Seq-GRPO's refusal of these requests changes by −50.0 points on IF at 1.5B and by −36.0 on the 1.5B stream (three seeds); at 7B it barely moves (−0.1), but nothing before training says so. The two-sided gate fires on none of them on the streams but on 94.0% (1.5B) and 99.6% (7B) on IF, as an IF prompt is a request plus a constraint, and so is a harmful request with a constraint. The remedy brings this to 0.0% (7B: 0.0%), and Seq-GRPO behind it keeps +37.5 of +38.7 points at 1.5B with its refusal of these requests unchanged; the price, as Theorem 4.1 says, is 1.6 points of coverage at 1.5B and 0.5 at 7B, on the task prompts that resemble the added ones. A classifier refitted against more reference prompts is a different test off the reference, so the remedy is combined with the region check (Table 13).
One budget for a stream: Calibrating each stage at lets the union of a stream's gates fire on up to of a reference component. Calibrating the union instead (Theorem A.6) cuts the Dolly firing by 40–67%, less than -fold because each stage already fires below its level (Theorem A.3), at full coverage, as each stream task is separated from the reference with AUROC 1.000: from 4.0% to 2.0% at 1.5B (95% bound 6.0% to 3.6%), 3.0% to 1.8% at 7B, and 6.0% to 2.0% on the five-task stream (bound 8.3% to 3.6%). With the region check as well, the union fires on no held-out Dolly, XSTest, AdvBench or MMLU prompt in any stream (95% bounds 0.7% and 0.6%), and Seq-GRPO behind it reaches 46.3% average accuracy on the five-task stream (46.5% without the gate) while changing none of those responses.
Table 13. Firing of gate variants on held-out prompts (%, ), computed from unlabeled prompts before any training; it bounds the drift of every model behind the gate. Deployed: the deployed prompt-time gate; + region: the two-sided gate; one budget: the union of a stream's gates calibrated at ; + harmful in format: AdvBench requests in the tasks' formats added to the reference; protect: calibrated on AdvBench and task-like prompts only. Power: firing on unlabeled new-task prompts; CP: 95% Clopper–Pearson bound on Dolly; Wrap: AdvBench requests in a trained task's format; Sys: Dolly requests behind a system prompt; JB: AdvBench requests in jailbreak templates (mean of three). XTest, MMLU and JB are never used in calibration.
| Experiment | Gate | Power↑ | Dolly↓ | CP↓ | XSTest | MMLU | Wrap | Sys | JB |
|---|---|---|---|---|---|---|---|---|---|
| NQ, 1.5B | deployed | 92.2 | 3.2 | 5.1 | 2.0 | 0.0 | – | 0.0 | 0.0 |
| + region | 90.7 | 2.8 | 4.5 | 2.0 | 0.0 | – | 0.0 | 0.0 | |
| NQ, 7B | deployed | 97.9 | 2.8 | 4.5 | 1.6 | 0.0 | – | 0.0 | 0.0 |
| + region | 96.1 | 2.0 | 3.6 | 1.6 | 0.0 | – | 0.0 | 0.0 | |
| NQ, OLMo-2 | deployed | 96.8 | 2.2 | 3.9 | 2.4 | 0.0 | – | 0.0 | 0.0 |
| + region | 95.0 | 2.2 | 3.9 | 2.4 | 0.0 | – | 0.0 | 0.0 | |
| IF, 1.5B | deployed | 100.0 | 1.5 | 2.9 | 0.0 | 99.4 | 100.0 | 73.5 | 34.0 |
| + region | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 94.0 | 0.0 | 0.0 | |
| + harmful in format | 98.4 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + region, + harmful in format | 96.5 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| IF, 7B | deployed | 100.0 | 1.8 | 3.3 | 0.0 | 100.0 | 100.0 | 10.8 | 49.7 |
| + region | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 99.6 | 0.0 | 0.0 | |
| + harmful in format | 99.5 | 0.0 | 0.7 | 0.0 | 19.6 | 0.0 | 0.0 | 0.0 | |
| + region, + harmful in format | 97.6 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| Concise, 1.5B | deployed | 0.7 | 0.8 | 1.9 | 0.0 | 2.0 | – | 0.8 | 0.0 |
| + region | 0.8 | 0.5 | 1.6 | 0.0 | 0.0 | – | 0.0 | 0.0 | |
| protect safety, task-like | 95.1 | 93.5 | 95.4 | 97.6 | 0.0 | – | 33.5 | 0.0 | |
| Concise ctx, 1.5B | deployed | 3.8 | 1.8 | 3.3 | 0.0 | 0.0 | – | 0.0 | 0.0 |
| + region | 3.7 | 1.5 | 2.9 | 0.0 | 0.0 | – | 0.0 | 0.0 | |
| protect safety, task-like | 100.0 | 39.8 | 43.9 | 0.4 | 0.4 | – | 33.2 | 0.1 | |
| 3 tasks, 1.5B | deployed | 100.0 | 4.0 | 6.0 | 0.0 | 8.6 | 100.0 | 1.0 | 13.2 |
| + region | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| one budget | 100.0 | 2.0 | 3.6 | 0.0 | 7.2 | 100.0 | 0.2 | 2.3 | |
| + region, one budget | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + harmful in format | 100.0 | 0.2 | 1.2 | 0.0 | 0.4 | 4.4 | 0.0 | 0.0 | |
| + region, + harmful in format | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| 3 tasks, 7B | deployed | 100.0 | 3.0 | 4.8 | 0.0 | 39.0 | 100.0 | 3.0 | 57.5 |
| + region | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| one budget | 100.0 | 1.8 | 3.3 | 0.0 | 33.6 | 100.0 | 2.0 | 42.5 | |
| + region, one budget | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + harmful in format | 100.0 | 2.0 | 3.6 | 0.0 | 11.0 | 1.7 | 0.0 | 24.5 | |
| + region, + harmful in format | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| 5 tasks, 1.5B | deployed | 100.0 | 6.0 | 8.3 | 0.0 | 50.0 | 100.0 | 2.2 | 13.2 |
| + region | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| one budget | 100.0 | 2.0 | 3.6 | 0.0 | 28.6 | 99.6 | 0.5 | 1.3 | |
| + region, one budget | 98.0 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + harmful in format | 100.0 | 2.5 | 4.2 | 0.0 | 79.6 | 4.4 | 1.0 | 0.0 | |
| + region, + harmful in format | 98.1 | 0.0 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
D.6. Serving cost, seeds, scale, families and other trainers
Serving cost: Greedy generation of 256 prompts is timed on one A100 with zero-valued updates; every configuration reproduced the base model's outputs. The gate is cheap: wrapping costs , and the switch's gate, one pass through the first blocks, takes 1.5% (1.5B) and 2.6% (7B) of the base model's time. The cost is in computing the update, which is done unmerged: a LoRA behind a firing gate costs batched and one prompt at a time, and five whose gates all fire (1.5B) and (7B) batched. The switch costs batched, as each model runs a smaller batch, but holds a second model: peak 33.9 against 19.7 GB at 7B and 10.9 against 8.1 GB at 1.5B, where one to five LoRAs need 12.3–12.5 GB and a full-rank update at 7B 45.8–47.9 GB.
Training under the gate or behind it: On NQ, FIREGATE-prompt gains +4.0, +2.2 and +4.1 points at 1.5B, 7B and on OLMo-2, against +4.7, +3.8 and +5.7 for Seq-GRPO behind the gate; at 1.5B the switch minus gated training is +0.7 points (95% interval [-1.3, +2.7]). The whole-sequence variant and the protect gate reverse the order (Tables 4 and 14), so neither way of training gains consistently more on one task. On the 7B stream Seq-GRPO forgets little (BWT +0.7), and the whole-sequence variant collapses in one of three seeds, its Countdown reward falling from 0.79 to 0.05 over the last ten steps while the gate kept the collapse to Countdown prompts; FIREGATE-prompt, whose LoRA acts from the last prompt token on, therefore remains the main method.
Seeds, scale and other families: All results have three seeds unless marked, and Table 2 shows the switch behaving the same across families. Nothing was tuned for Llama-3.2-3B, Llama-3.1-8B, DeepSeek-LLM-7B or Mistral-7B in Table 2: task, data, GRPO and gate settings are Qwen2.5's, the gate sits at the same relative depth, and only batch sizes were lowered to fit memory (FIREGATE-prompt on Mistral NQ has two seeds). No non-fired response of their gated runs changed (0 of 49,755). Coverage before training is 84.5–100% and the switch keeps that share; Mistral NQ is the one case where misses by more than half a point, as the prompts its gate misses gained more. The deployed IF gates fire on 52–91% of MMLU prompts, whose answer-format instruction resembles IF prompts, and on every jailbreak prompt (Table 26).
Full-rank updates and SFT at 1.5B: Nothing in Theorems 3.2 and 3.4 depends on LoRA or on RL; Section G.4 tests full-rank updates and SFT (Table 19).
E. Extended related work
Forgetting in continual post-training: Continual learning regularises parameters (Kirkpatrick et al., 2017), distils the old model (Li & Hoiem, 2018), replays data (Rolnick et al., 2019) or isolates parameters, for LLMs often as orthogonal or null-space LoRA (Wang et al., 2023; Liang & Li, 2024; Liang et al., 2025). For RL fine-tuning, forgetting has been linked to the KL to the old policy (Shenfeld et al., 2026), to on-policy data (Chen et al., 2026), to an implicit regularisation scaled by the reward variance (Lai et al., 2026) and to circuits that RL disrupts less than SFT (Rojas Nunez et al., 2026), addressed with prior-task KL surrogates (Luo et al., 2026b), and benchmarked for RL with verifiable rewards (Luo et al., 2026a); a fine-tuned RL policy forgets skills on states it no longer visits (Wolczyk et al., 2024), and online RL fine-tuning need not retain offline data (Zhou et al., 2025); and alignment erodes under continual pre-training and chained fine-tuning (Li & Lee, 2024; Ung et al., 2024), while instruction-tuned models can learn tasks in sequence (Scialom et al., 2022). Safety can be kept as a continual learning problem (Alssum et al., 2025), and robust policy optimisation trains a model to keep its reward under later fine-tuning (Sabbaghi et al., 2026), a property of the training objective, not a bound on a deployed model. These methods reduce measured forgetting but bound no drift on unmeasured distributions; the baselines here include their reference-aware versions.
Certifying model updates: Total-variation stability certifies unlearning for a training algorithm (Ullah et al., 2021); Balachandran (2026) certify that an update does not regress beyond a tolerance, at a label cost that grows with the disagreement between models; Mondal et al. (2026) ask when old evaluations still certify a new model; Friedman & Meir (2026) bound the forgetting of trained weights; auditing tests detect a behavioural shift after the fact (Richter et al., 2025). The certificate here is issued before training, without labels, for the deployed model. It is a coupling argument (Lindvall, 1992); calibration follows training-conditional conformal prediction and risk control (Vovk, 2012; Bates et al., 2021), and monitoring uses test martingales (Ramdas et al., 2023; Ville, 1939).
Routing, gating and editing: Expert gates (Aljundi et al., 2017), gated LoRA (Liang et al., 2025) and stability-budget gates (Hoy & Celik, 2025) in continual learning, gated representation fine-tuning (Zeng et al., 2025), safety routing in mixture-of-experts models (Kim et al., 2025), model editors (Mitchell et al., 2022) and LLM routers (Ong et al., 2025) send inputs to specialised computation, and alignment gating reverses induced misalignment (Wang et al., 2026); their gates are learned and judged on measured behaviour. Mechanically the switch is such a router; Section 7 states the contribution.
Safety under fine-tuning: Benign fine-tuning removes refusals (Qi et al., 2024; Huang et al., 2024), as does deliberate fine-tuning (Zhan et al., 2024), and post-training for warmth lowers accuracy and raises sycophancy (Ibrahim et al., 2026). Safety is kept by the test-time prompt template or response prefixes (Lyu et al., 2024; Hahm et al., 2026), by keeping the update in a safety basin or out of a safety-sensitive subspace (Yang et al., 2026; Zhang et al., 2025), or by resisting harmful RL fine-tuning during training (Feng et al., 2025; Cao, 2025); it collapses along a few directions of the weights (Springer et al., 2026), and refusal is mediated by one direction of the activations (Arditi et al., 2024). Such work protects a mechanism; the certificate bounds every bounded score on the prompts that were sampled, whatever the mechanism. As it holds for every update, it also covers a harmful fine-tune behind the gate, though not an attacker who controls the gate or its reference. Chen et al. (2025) bound the safety–capability trade-off through data similarity and the loss landscape; Theorem 4.1 bounds every update by the best test between the two prompt sources.
F. Data and prompts
GSM8K and MATH problems are followed by “Please reason step by step, and put your final answer within \boxed{}.” MATH: train and test splits pooled, levels 1–4, only problems whose reference answer is an integer, decimal or fraction; 3,600 training and 500 test problems. Countdown: “Using the numbers [...], create an equation that equals ...” with each number used once, the equation inside <answer> tags; correct if it evaluates to the target. Knights and Knaves: the puzzle statements followed by “Who is a knight and who is a knave?”, every inhabitant’s role inside <answer> tags; correct if all roles match. 4 × 4 Sudoku: unique-solution puzzles with 6–11 blanks, answered as four rows inside <answer> tags. IF: held-out Dolly requests with one of eight verifiable constraints (lowercase only, no commas, three bullets, a fixed closing sentence, quotation marks, fewer than 40 words, a fixed first word, two paragraphs); reward 1 if the constraint holds. Concise: held-out Dolly requests; reward 1 for a non-refusing answer of 3–30 words. NQ: questions from NQ-open (Lee et al., 2019), capitalised with a question mark; correct if a normalised gold answer appears in the first 300 characters.
G. Additional results
This section collects the tables and figures that Sections D and 6 cite but do not show. Numbers quoted in the text are means over seeds.
G.1. Reading the tables
Results are on held-out prompts under greedy decoding, against the base model on the same GPU model; columns are defined in each caption, sw marks a model behind the deployed prompt-time gate, and a dash means does not apply.
G.2. The overlap ladder at 1.5B
The ladder trains Qwen2.5-1.5B-Instruct on four tasks whose prompts are increasingly hard to tell apart from Dolly, one reference component. Table 14 gives every method on NQ.
NQ: Every ungated method changes most Dolly responses, from 56.0% for +KL at , which keeps only +0.7 of Seq-GRPO's +5.2 points, to 98.8% for null-space LoRA: a penalty limits the sampled KL, and a small KL still flips greedy outputs (Theorem A.1). Most of them also move XSTest over-refusal, Seq-GRPO by -50.3 points, as XSTest's safe prompts are short questions much like NQ's. FIREGATE-prompt at changes 3.5% of Dolly responses, with a held-out bound of 5.4%, and gains +4.0 points, or +5.9 with the LoRA on the whole sequence. Its changed share never exceeds its Dolly firing, as Theorem 3.2 requires. FIREGATE-anytime fires on only 11.7% of NQ prompts at and gains little: its score is a maximum over every position, whose heavier tail on the reference forces a higher threshold (Section C).
G.3. Gate scores, variants and calibration
This subsection asks which score to use and where to read it, how gates compare once calibrated, and whether the calibration holds on held-out prompts.
Choice of score and block: Figure 5 fits each score on the same NQ and reference prompts, without any training. The logistic classifier and the Gaussian density ratio separate NQ from Dolly at every depth, with AUROC 0.984–0.994, and fire on 85–94% of NQ prompts at . Nearest-neighbour similarity fires on 64–84%, and hashed n-grams of the prompt text on 62%. A one-class score, the Mahalanobis distance to the reference alone, fails: with AUROC 0.37–0.44 it ranks NQ prompts closer to the reference than held-out Dolly prompts, fires on no NQ prompt, and fires on 7–100% of MMLU prompts. A score therefore needs both pools. With the split at blocks 5, 9 or 15, FIREGATE-prompt changes 2.5–3.5% of Dolly responses and gains +4.0 to +5.3 points, so the block matters little.

Figure 5. Gate scores for NQ against the reference prompts, Qwen2.5-1.5B-Instruct, no training, by the block whose input the score reads; the text-only score reads no block and is drawn as a dashed line. Each score is fitted on the gate's fitting prompts and calibrated with its PAC rule. Top left: AUROC against held-out Dolly prompts. Fires on NQ: share of held-out NQ prompts on which the score fires at a certified of 0.03, 0.1 and 0.3, a lower bound on the limit of Theorem 4.1, since a gate with this score achieves it. Bottom middle and right: firing on held-out Dolly and MMLU prompts at .
Other score classes behind the same calibration: Table 18 replaces the classifier of the deployed and protect + passages gates by the Gaussian density ratio (LDA), the mean similarity to the 15 nearest fitting prompts and a one-hidden-layer MLP, with settings fixed before any result, each calibrated at and so that the four certificates hold together and the score with the largest coverage of unlabeled RL prompts may be chosen after seeing it. Every gate keeps its calibrated pools within the level: the certificate does not depend on the score, which sets only the coverage and with it the gain, and the density ratio gains most where the classifier covers least, consistent
Table 14. New task: Natural Questions asked as plain questions, against Dolly, one reference component; mean standard deviation over seeds (of 3). Gain: new-task accuracy (points). Changes relative to each run's base model: share of Dolly responses that differ (Chg.), share showing a trained format (Leak), AdvBench refusal, XSTest over-refusal and MMLU accuracy (points). Fires: share of prompts on which the gate fires. CP: largest held-out 95% Clopper–Pearson bound on the Dolly firing rate over seeds (Theorem 3.5), a check of the certified level of 3% (Theorem 3.6). Rows marked ran on A100 GPUs (in at least one seed), the others on H200; each run is compared with the base model evaluated on its own GPU model. Ungated methods have no gate: no firing (-) and no certificate (none). The oracle row has no standard deviation. The uncalibrated router has a held-out firing rate but no level chosen before training (uncal.).
| Method | NQ | Change on reference | Fires (%) | CP↓ | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| n | gain↑ | Chg.↓ | Leak↓ | Refusal | Over-ref. | MMLU | NQ | Dolly | ||
| Seq-GRPO | 3 | +5.2±0.9 | 94.2±1.8 | +0.0±0.0 | -8.8±2.8 | -50.3±2.0 | +0.2±0.2 | – | – | none |
| Seq, scaled ×0.25 | 3 | +3.0±0.3 | 74.1±1.2 | +0.0±0.0 | -0.3±0.5 | -27.7±2.0 | +0.0±0.0 | – | – | none |
| Seq, scaled ×0.5 | 3 | +4.6±0.4 | 86.4±2.8 | +0.0±0.0 | -0.8±0.4 | -40.7±1.3 | +0.3±0.3 | – | – | none |
| Seq, scaled ×0.75 | 3 | +4.9±1.2 | 92.2±1.8 | +0.0±0.0 | -4.1±1.3 | -47.5±2.1 | +0.1±0.4 | – | – | none |
| + KL =0.01 | 3 | +4.9±0.4 | 87.8±1.1 | +0.0±0.0 | -0.3±0.2 | -38.7±1.2 | +1.0±0.9 | – | – | none |
| + KL =0.05 | 3 | +3.5±0.1 | 73.3±2.3 | +0.0±0.0 | +0.0±0.0 | -23.2±4.5 | +0.3±0.1 | – | – | none |
| + KL =0.2 | 3 | +1.9±0.7 | 64.2±0.9 | +0.0±0.0 | +0.0±0.0 | -10.3±5.6 | +0.5±0.2 | – | – | none |
| + KL =1 | 3 | +0.7±0.4 | 56.0±2.4 | +0.0±0.0 | +0.0±0.0 | -2.3±0.6 | +0.0±0.2 | – | – | none |
| + Ref-KL =0.1 | 3 | +5.5±1.3 | 82.9±1.3 | +0.0±0.0 | +0.0±0.0 | -38.1±3.4 | +0.4±0.2 | – | – | none |
| + Ref-KL =1 | 3 | +2.3±0.1 | 86.9±0.4 | +0.0±0.0 | -0.4±0.4 | -22.8±9.0 | +1.4±1.1 | – | – | none |
| + Ref-KL =10 | 3 | +1.3±0.8 | 86.5±0.9 | +0.0±0.0 | -0.3±0.2 | -7.5±2.8 | +1.9±1.3 | – | – | none |
| + Ref-KL, 4 samples =10 | 3 | +0.6±0.9 | 73.2±0.8 | -0.1±0.1 | +0.0±0.0 | -2.9±1.3 | +0.5±0.3 | – | – | none |
| + Ref-KL, 4 samples =100 | 3 | +0.9±0.1 | 73.2±1.7 | +0.0±0.0 | +0.0±0.0 | -0.7±2.4 | +0.8±0.2 | – | – | none |
| + Null-space =0.8 | 3 | +4.8±0.7 | 97.1±2.6 | +0.0±0.0 | -30.5±39.8 | -50.5±1.6 | -0.1±1.2 | – | – | none |
| + Null-space =0.95 | 3 | +5.5±0.1 | 98.8±0.7 | +0.0±0.0 | -9.1±2.6 | -50.5±1.2 | +0.2±1.1 | – | – | none |
| + Null-space =0.99 | 3 | +5.0±0.7 | 95.2±4.1 | +0.0±0.0 | -7.3±4.0 | -50.1±1.0 | +0.2±1.1 | – | – | none |
| + Null-space, refreshed =0.95 | 3 | +5.3±0.5 | 93.7±1.6 | +0.0±0.0 | -2.8±2.8 | -45.7±3.0 | +0.1±0.2 | – | – | none |
| + EWC =0.1 | 3 | +5.8±0.2 | 96.3±4.2 | -0.2±0.1 | -8.1±4.5 | -51.1±1.3 | +0.1±0.9 | – | – | none |
| + EWC =1 | 3 | +6.6±1.0 | 97.5±3.1 | -0.2±0.0 | -10.9±4.9 | -51.9±2.0 | +0.2±0.3 | – | – | none |
| + EWC =10 | 3 | +4.9±1.5 | 95.8±5.0 | -0.2±0.0 | -5.3±3.7 | -51.1±1.2 | +0.4±0.0 | – | – | none |
| + A-GEM | 3 | +5.4±0.2 | 93.9±0.1 | -0.1±0.1 | -4.7±1.5 | -49.9±1.8 | -0.1±0.5 | – | – | none |
| Router (uncal.) | 3 | +5.4±0.7 | 6.8±0.0 | +0.0±0.0 | +0.0±0.0 | -5.6±0.0 | +0.0±0.0 | 97.4±0.0 | 6.8±0.0 | uncal. |
| FIREGATE-prompt =0.03 | 3 | +4.0±1.0 | 3.5±0.0 | +0.0±0.0 | +0.0±0.0 | -0.8±0.0 | +0.0±0.0 | 90.8±0.0 | 3.5±0.0 | 5.4 |
| FIREGATE-prompt =0.1 | 3 | +5.3±0.3 | 9.4±0.1 | +0.0±0.0 | +0.0±0.0 | -11.9±0.2 | +0.0±0.0 | 97.8±0.0 | 9.5±0.0 | 12.3 |
| FIREGATE-prompt =0.3 | 3 | +5.9±2.4 | 28.9±0.1 | -0.1±0.1 | -0.5±0.5 | -34.8±0.7 | +0.0±0.2 | 99.9±0.1 | 28.9±0.1 | 33.0 |
| FIREGATE-prompt, whole seq. =0.03 | 3 | +5.9±2.3 | 3.5±0.0 | +0.0±0.0 | +0.0±0.0 | -0.8±0.0 | +0.0±0.0 | 90.8±0.0 | 3.5±0.0 | 5.4 |
| FIREGATE-prompt, whole seq. =0.1 | 3 | +6.2±2.6 | 9.5±0.0 | +0.0±0.0 | +0.0±0.0 | -12.0±0.0 | +0.0±0.0 | 97.8±0.0 | 9.5±0.0 | 12.3 |
| FIREGATE-anytime =0.03 | 3 | +0.3±0.2 | 0.9±0.1 | +0.0±0.0 | +0.0±0.0 | -0.1±0.2 | +0.0±0.0 | 11.7±2.2 | 1.7±0.4 | 3.9 |
| FIREGATE-anytime =0.1 | 3 | +1.2±0.5 | 6.4±0.6 | +0.0±0.0 | +0.0±0.0 | -0.9±0.2 | +0.0±0.0 | 39.8±1.0 | 7.2±1.3 | 11.4 |
| FIREGATE-anytime =0.3 | 3 | +3.1±0.4 | 23.3±2.5 | +0.0±0.0 | +0.0±0.0 | -3.6±0.4 | +0.2±0.2 | 78.3±1.7 | 25.2±2.0 | 30.9 |
| Oracle task gate (uses task labels) | 3 | +5.2±0.9 | 0.0 | +0.0 | +0.0 | +0.0 | +0.0 | 100.0 | 0.0 | – |
with Theorem A.9. Pools that are not protected follow the score. On Concise, whose prompts are Dolly requests, the score chosen by coverage, nearest-neighbour similarity, fires on most Dolly and XSTest prompts and on 34.8% of paraphrased harmful requests, a form no component samples; the classifier fires on at most 0.8% of any form there, so it stays the default. On NQ the MLP fires on 48.0% of MMLU prompts, which the region check removes at a cost of 1.4 points of coverage.
Score classes on the streams: Table 15 fits the four scores per stage of each stream, each stage calibrated as the deployed stage gate at . Every score covers 92–100% of every stage, as each stream task is separated from the reference with AUROC 1.000, so the limit is reached whatever the score; the scores differ only off the reference, where none is calibrated. The union of the Gaussian-ratio gates fires on 63.8–100% of MMLU prompts and that of the 15-NN gates on 42.8–100%, against 1.6–60.8% for the linear classifier and 0.6–7.6% for the MLP, and every union fires on at most 4.8% of held-out Dolly.
Two scores on every model–task pair: Table 16 fits the linear classifier and the Gaussian ratio as the deployed gate of all 13 pairs of Table 2, with the settings above. Both hold the level on held-out Dolly (at most 3.0%, bounds at most 4.8%), and the stronger score changes little: both cover every IF prompt, the Gaussian ratio covers -0.9 to +7.0 points more of NQ, and Seq-GRPO behind them keeps 81–100% and 87–100% of its gain. Where both separate the task from Dolly well, the score matters little; it matters where the task is close to the reference, as on Concise-ctx (56.7 against 11.0% coverage). Neither score keeps the deployed IF gate off MMLU (94.6–100%), which the region of step (3) removes (Table 26).
A language model as the score: The certificate needs only a decision on the prompt fixed before calibration (Theorem 3.4), so the score can also come from a language model that reads the prompt. Table 17 asks Qwen2.5-7B-Instruct, once per prompt and with a question per task fixed before any score, whether the prompt is a request of the task, and calibrates as every other score. The
Table 15. Score classes on the task streams, each stage calibrated as the deployed stage gate at and , from stored features. : coverage of stage 's unlabeled RL prompts (%), a lower bound on that stage's limit; union: firing of the stage gates' union on held-out prompts (%).
| Stream | Score | union fires | |||||||
|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | Dolly | AdvBench | MMLU | ||
| 3-task stream, Qwen2.5-1.5B | linear classifier | 100.0 | 100.0 | 100.0 | — | — | 3.2 | 0.0 | 1.6 |
| Gaussian ratio | 100.0 | 100.0 | 100.0 | — | — | 1.8 | 0.0 | 99.6 | |
| 15-NN similarity | 100.0 | 100.0 | 100.0 | — | — | 2.0 | 0.0 | 42.8 | |
| MLP | 100.0 | 100.0 | 100.0 | — | — | 1.8 | 0.4 | 0.6 | |
| 3-task stream, Qwen2.5-7B | linear classifier | 100.0 | 100.0 | 100.0 | — | — | 1.8 | 0.0 | 12.4 |
| Gaussian ratio | 100.0 | 100.0 | 100.0 | — | — | 3.2 | 0.0 | 63.8 | |
| 15-NN similarity | 100.0 | 100.0 | 100.0 | — | — | 2.5 | 0.0 | 100.0 | |
| MLP | 100.0 | 100.0 | 100.0 | — | — | 1.2 | 0.0 | 7.6 | |
| 5-task stream, Qwen2.5-1.5B | linear classifier | 100.0 | 100.0 | 100.0 | 96.3 | 100.0 | 4.8 | 0.0 | 60.8 |
| Gaussian ratio | 100.0 | 100.0 | 100.0 | 94.9 | 100.0 | 2.5 | 0.0 | 100.0 | |
| 15-NN similarity | 100.0 | 100.0 | 100.0 | 92.1 | 100.0 | 2.0 | 0.0 | 45.0 | |
| MLP | 100.0 | 100.0 | 100.0 | 96.7 | 100.0 | 3.0 | 0.4 | 4.4 | |
Table 16. The linear classifier against the Gaussian ratio on every model–task pair, both fitted and calibrated at on the deployed reference from stored features, settings fixed before any result. : coverage of unlabeled RL prompts (%), a lower bound on ; Dolly: held-out firing (%) [95% bound]; MMLU: firing on MMLU, which no component samples (%); Gain: Seq-GRPO's gain behind the gate (points), against its own gain .
| Model | Task | linear classifier | Gaussian ratio | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dolly | MMLU | Gain | Dolly | MMLU | Gain | |||||
| Qwen2.5-1.5B | IF | +38.7 | 100.0 | 2.0 [3.6] | 100.0 | +38.7 | 100.0 | 0.0 [0.7] | 100.0 | +38.7 |
| Qwen2.5-1.5B | NQ | +5.2 | 92.5 | 2.8 [4.5] | 0.8 | +4.7 | 95.4 | 3.0 [4.8] | 0.0 | +4.7 |
| Qwen2.5-7B | IF | +12.9 | 100.0 | 2.2 [3.9] | 100.0 | +12.9 | 100.0 | 2.5 [4.2] | 100.0 | +12.9 |
| Qwen2.5-7B | NQ | +3.8 | 97.6 | 2.5 [4.2] | 0.0 | +3.5 | 98.6 | 2.0 [3.6] | 0.0 | +3.7 |
| OLMo-2-7B | NQ | +5.9 | 95.7 | 2.0 [3.6] | 0.0 | +5.3 | 97.6 | 2.8 [4.5] | 0.0 | +5.6 |
| Llama-3.2-3B | IF | +14.3 | 100.0 | 1.8 [3.3] | 97.6 | +14.3 | 100.0 | 1.8 [3.3] | 100.0 | +14.3 |
| Llama-3.2-3B | NQ | +10.8 | 86.5 | 2.0 [3.6] | 0.0 | +9.1 | 93.5 | 2.5 [4.2] | 0.0 | +10.3 |
| Llama-3.1-8B | IF | +11.4 | 100.0 | 1.0 [2.3] | 98.0 | +11.4 | 100.0 | 1.2 [2.6] | 100.0 | +11.4 |
| Llama-3.1-8B | NQ | +7.1 | 96.3 | 2.8 [4.5] | 0.0 | +6.7 | 96.8 | 2.5 [4.2] | 0.0 | +6.9 |
| DeepSeek-LLM-7B | IF | +35.3 | 100.0 | 2.8 [4.5] | 94.6 | +35.3 | 100.0 | 2.5 [4.2] | 100.0 | +35.3 |
| DeepSeek-LLM-7B | NQ | +10.7 | 84.0 | 1.2 [2.6] | 0.0 | +8.7 | 86.5 | 1.5 [2.9] | 0.0 | +9.3 |
| Mistral-7B | IF | +34.8 | 100.0 | 1.2 [2.6] | 97.2 | +34.8 | 100.0 | 2.2 [3.9] | 100.0 | +34.8 |
| Mistral-7B | NQ | +9.5 | 94.7 | 2.5 [4.2] | 0.0 | +8.2 | 93.8 | 1.2 [2.6] | 0.0 | +8.4 |
certificate holds as for every score: the gate fires on at most 1.8% of held-out Dolly prompts and on no harmful form. The coverage is low: 20.5% on IF, 2.9% on NQ and at most 0.3% on Concise-ctx and SQuAD 2.0, so Seq-GRPO behind it keeps at most 12.0 of 35.3 points. The language model separates the task from Dolly with AUROC 0.69–0.95, against 0.98–0.99 for the classifier on NQ (Figure 5); at a 3% level only the very top of its score is usable, and Dolly also holds short factual questions, requests with a passage and requests with a format instruction, which plausibly reach that top. Like the one-class score, it is told what the task is but never sees the reference; a score fitted on both pools learns what tells them apart, and needs no 7B forward pass per prompt.
Table 17. A language model as the gate's score: Qwen2.5-7B-Instruct asked once per prompt, with a question fixed before any score, whether the prompt is a request of the task; score , PAC-calibrated at on the same components as the linear classifier. : coverage of unlabeled RL prompts by the language model (LM) and by the deployed linear classifier. Harm.: largest firing over the held-out harmful forms. The prompts are the same for every model of a task, so the gate is too; Gain: Seq-GRPO's gain behind it over the task's models (points), against their own gain . AUROC: held-out task prompts against held-out Dolly.
| Task (models) | Reference | AUROC | (%) | Dolly [bound] | Harm. | Seq-GRPO (points) | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| LM | linear | Gain | ||||||||
| IF (7) | deployed | 0.953 | 20.5 | 99.9–100 | 0.2 [1.2] | 0.0 | +0.1 to +12.0 | +11.4 to +38.7 | ||
| NQ (7) | deployed | 0.773 | 2.9 | 84.5–97.9 | 1.8 [3.3] | 0.0 | -0.2 to +0.4 | +3.8 to +10.8 | ||
| Concise-ctx (1) | deployed | 0.741 | 0.3 | 3.8 | 0.0 [0.7] | 0.0 | +0.0 | +65.2 | ||
| protect + passages | 0.3 | 11.0 | 0.0 [0.7] | 0.0 | +0.0 | |||||
| SQuAD 2.0 (1) | deployed | 0.687 | 0.0 | 85.4 | 0.2 [1.2] | 0.0 | +0.0 | +24.4 | ||
| protect + passages | 0.0 | 99.8 | 0.2 [1.2] | 0.0 | +0.0 | |||||
The region check with the protect gate: With the region check, the protect + passages gate holds its level only against protected prompts inside the new task's region, so its threshold falls. On Concise-ctx the classifier then covers 91.2% instead of 11.0% (Section 6.5 gives the gain and the firing). On SQuAD 2.0 it changes little. On Concise the classifier covers 79.4% but fires on 10.4% of harmful requests with typing errors, 6.0% of paraphrases and 84.7% of XTest prompts: there the task's prompts and harmful requests are both plain chat requests, and the region, fitted on the task's prompts, does not exclude forms of the latter that no component samples: the region is not a safety filter (Theorem 3.8). These gates are reported beside those of Table 4, which were chosen before.
Table 18. Score classes, with and without the new task's region, under the same calibration (Qwen2.5-1.5B, and for each gate, from stored features, no training). *: the score with the largest coverage at each reference and region. : coverage of unlabeled RL prompts; firing (%) on held-out prompts of each pool; Harm. + pass.: the larger of the two passage forms; St. 1, St. 2: the largest firing over the first-round (Section I) and second-round (Table 23) harmful forms; Gain: points of Seq-GRPO's gain that the switch keeps behind the gate (Concise 73.6, Concise-ctx 65.2, SQuAD 2.0 24.4, NQ 5.2 without it). Behind protect + passages, AdvBench and harmful requests with a passage are the protected pools; behind the deployed gate, Dolly and AdvBench are.
| Experiment, gate | Region | Score | Protected | Other pools | Harmful forms | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AdvBench | Harm. + pass. | MMLU | Dolly | XSTest | St. 1 | St. 2 | Gain↑ | |||||
| SQuAD 2.0, protect + passages | no | linear classifier* | 99.8 | 0.0 | 1.6 | 0.0 | 16.5 | 0.0 | 1.6 | 2.4 | +24.3 | |
| no | Gaussian ratio | 99.7 | 0.0 | 1.2 | 0.0 | 17.5 | 0.0 | 1.2 | 0.8 | +24.4 | ||
| no | 15-NN similarity | 98.4 | 0.0 | 0.8 | 0.0 | 13.0 | 0.0 | 0.8 | 0.4 | +23.9 | ||
| no | MLP | 97.7 | 0.0 | 0.4 | 0.4 | 14.0 | 0.0 | 0.4 | 2.4 | +23.9 | ||
| yes | linear classifier* | 98.0 | 0.0 | 1.6 | 0.0 | 11.8 | 0.0 | 1.6 | 1.6 | +23.7 | ||
| yes | Gaussian ratio | 98.0 | 0.0 | 1.2 | 0.0 | 12.2 | 0.0 | 1.2 | 0.8 | +23.7 | ||
| yes | 15-NN similarity | 96.7 | 0.0 | 0.8 | 0.0 | 10.0 | 0.0 | 0.8 | 0.4 | +23.3 | ||
| yes | MLP | 97.6 | 0.0 | 1.2 | 0.0 | 11.0 | 0.0 | 1.2 | 2.0 | +23.9 | ||
| Concise, protect + passages | no | linear classifier | 23.3 | 0.0 | 0.0 | 0.0 | 22.8 | 22.0 | 0.0 | 0.8 | +17.2 | |
| no | Gaussian ratio | 29.3 | 0.0 | 0.0 | 0.0 | 30.0 | 24.4 | 0.0 | 0.4 | +21.0 | ||
| no | 15-NN similarity* | 55.3 | 0.0 | 0.0 | 0.0 | 52.0 | 98.4 | 0.0 | 34.8 | +37.0 | ||
| no | MLP | 22.0 | 0.0 | 0.0 | 0.0 | 23.5 | 7.3 | 0.0 | 23.6 | +14.0 | ||
| yes | linear classifier | 79.4 | 0.0 | 0.8 | 0.0 | 76.5 | 84.7 | 0.8 | 10.4 | +56.4 | ||
| yes | Gaussian ratio* | 89.4 | 0.0 | 0.8 | 0.0 | 87.2 | 97.6 | 0.8 | 34.4 | +62.2 | ||
| yes | 15-NN similarity | 55.3 | 0.0 | 0.0 | 0.0 | 51.5 | 98.4 | 0.0 | 34.8 | +37.0 | ||
| yes | MLP | 83.6 | 0.0 | 0.8 | 0.0 | 79.5 | 89.1 | 0.8 | 52.4 | +55.8 | ||
| Concise-ctx, protect + passages | no | linear classifier | 11.0 | 0.0 | 0.0 | 0.0 | 3.8 | 0.0 | 0.0 | 0.0 | +4.7 | |
| no | Gaussian ratio* | 56.7 | 0.0 | 0.0 | 0.0 | 20.5 | 0.0 | 0.0 | 0.4 | +36.5 | ||
| no | 15-NN similarity | 35.6 | 0.0 | 0.0 | 0.0 | 12.5 | 0.0 | 0.0 | 0.4 | +15.3 | ||
| no | MLP | 24.2 | 0.0 | 0.0 | 0.0 | 7.8 | 0.0 | 0.0 | 0.0 | +13.5 | ||
| yes | linear classifier | 91.2 | 0.0 | 0.8 | 0.0 | 30.8 | 0.0 | 0.8 | 1.2 | +56.8 | ||
| yes | Gaussian ratio* | 96.4 | 0.0 | 0.8 | 0.0 | 32.0 | 0.0 | 0.8 | 3.6 | +60.2 | ||
| yes | 15-NN similarity | 70.8 | 0.0 | 1.2 | 0.0 | 23.5 | 0.0 | 1.2 | 4.0 | +42.4 | ||
| yes | MLP | 89.7 | 0.0 | 0.8 | 0.0 | 30.2 | 0.0 | 0.8 | 3.6 | +56.0 | ||
| SQuAD 2.0, deployed | no | linear classifier | 81.4 | 0.0 | 0.8 | 0.0 | 0.8 | 0.0 | 0.8 | 4.8 | +16.4 | |
| no | Gaussian ratio* | 85.4 | 0.0 | 0.4 | 0.0 | 1.2 | 0.0 | 0.4 | 0.0 | +18.9 | ||
| no | 15-NN similarity | 71.9 | 0.0 | 16.8 | 0.0 | 2.0 | 0.0 | 16.8 | 1.2 | +17.1 | ||
| no | MLP | 82.3 | 0.0 | 0.8 | 0.0 | 1.2 | 0.0 | 0.8 | 0.8 | +16.6 | ||
| yes | linear classifier | 81.4 | 0.0 | 0.8 | 0.0 | 1.0 | 0.0 | 0.8 | 1.2 | +16.1 | ||
| yes | Gaussian ratio* | 84.8 | 0.0 | 0.4 | 0.0 | 1.2 | 0.0 | 0.4 | 0.0 | +18.5 | ||
| yes | 15-NN similarity | 70.9 | 0.0 | 11.6 | 0.0 | 2.0 | 0.0 | 11.6 | 0.8 | +16.3 | ||
| yes | MLP | 81.6 | 0.0 | 0.8 | 0.0 | 1.2 | 0.0 | 0.8 | 0.0 | +16.0 | ||
| NQ, deployed | no | linear classifier | 90.2 | 0.0 | – | 0.4 | 2.5 | 2.2 | 0.0 | 0.0 | +4.5 | |
| no | Gaussian ratio* | 95.3 | 0.0 | – | 0.0 | 3.0 | 0.9 | 0.0 | 0.0 | +4.7 | ||
| no | 15-NN similarity | 81.5 | 0.0 | – | 0.0 | 2.2 | 0.9 | 0.0 | 0.0 | +3.7 | ||
| no | MLP | 86.0 | 0.0 | – | 48.0 | 1.8 | 0.9 | 0.0 | 0.0 | +4.1 | ||
| yes | linear classifier | 89.0 | 0.0 | – | 0.0 | 2.0 | 2.2 | 0.0 | 0.0 | +4.6 | ||
| yes | Gaussian ratio* | 93.5 | 0.0 | – | 0.0 | 2.5 | 0.9 | 0.0 | 0.0 | +4.7 | ||
| yes | 15-NN similarity | 80.2 | 0.0 | – | 0.0 | 1.8 | 0.9 | 0.0 | 0.0 | +3.7 | ||
| yes | MLP | 84.6 | 0.0 | – | 0.0 | 1.2 | 0.9 | 0.0 | 0.0 | +4.2 | ||
G.4. Full-rank updates and SFT
Full-rank updates and SFT: Table 19 replaces LoRA by a dense update of every projection above the split, and GRPO by supervised fine-tuning, on IF and NQ. The pattern does not change, as the certificate depends only on where the update acts: ungated, every run changes 86.1–99.8% of Dolly responses; behind the deployed gate every run changes 0.8–3.2% and each IF run keeps its full gain; trained under the gate each changes 0.6–3.5%, and no response changed where the gate was silent (4,797 per gated IF method, 9,363 for SFT on a 7B teacher's NQ responses, 3,121 for gold SFT). SFT on the model's own accepted samples gains less than GRPO, +21.6 against +38.7 points, and on a 7B teacher's responses +34.3. On NQ, full-rank SFT on the first gold answer lowers accuracy by 6.4 points and MMLU by 4.4; under the gate it loses the same 6.4 points but leaves MMLU unchanged, and behind the gate the ungated model keeps –5.4 points against the predicted –5.9: where training hurts, the gate confines the loss to where it fires. LoRA has been found to forget less than full fine-tuning (Biderman et al., 2024); here full-rank training changed as many responses as LoRA and lowered MMLU less (+0.1 against –3.7 points).
Table 19. Full-rank updates and SFT on IF and NQ, Qwen2.5-1.5B. Seeds: runs (gain ± sd). Full-rank: a dense update of every projection of blocks 9–28 ("all blocks": 2–28) at learning rate , against for LoRA. SFT: on the model's own accepted samples, four per prompt; 7B teacher: full-rank SFT on Qwen2.5-7B-Instruct's accepted responses, two per prompt; gold: on NQ's first gold answer. Chg.: Dolly responses changed (%); behind gate: the deployed prompt-time gate at .
| Run | Seeds | Gain↑ | Chg.↓ | MMLU | behind gate | |
|---|---|---|---|---|---|---|
| Gain↑ | Chg.↓ | |||||
| IF: LoRA GRPO, Seq-GRPO | 3 | +38.7±0.2 | 93.3 | -3.7 | +38.7 | 1.5 |
| LoRA GRPO, FIREGATE-prompt | 3 | +39.0±0.3 | 1.3 | -0.1 | - | - |
| full-rank GRPO, Seq-GRPO | 3 | +39.0±0.3 | 93.4 | +0.1 | +39.0 | 1.5 |
| learning rate | 1 | +39.0 | 94.0 | +0.0 | +39.0 | 1.5 |
| all blocks | 3 | +39.1±0.1 | 95.0 | -0.7 | +39.1 | 1.5 |
| full-rank GRPO, FIREGATE-prompt | 3 | +38.9±0.6 | 1.3 | -0.2 | - | - |
| LoRA SFT, ungated | 3 | +21.6±0.9 | 86.1 | +0.5 | +21.6 | 0.8 |
| LoRA SFT, FIREGATE-prompt | 3 | +19.3±1.5 | 0.6 | +0.7 | - | - |
| full-rank SFT, 7B teacher, ungated | 3 | +34.3±1.1 | 95.0 | +1.5 | +34.3 | 1.3 |
| all blocks | 3 | +34.9±2.0 | 94.7 | +1.0 | +34.9 | 1.3 |
| full-rank SFT, 7B teacher, FIREGATE-prompt | 3 | +35.9±0.7 | 1.2 | +0.3 | - | - |
| NQ: LoRA GRPO, Seq-GRPO | 3 | +5.2±0.9 | 94.2 | +0.2 | +4.7 | 3.2 |
| full-rank SFT, gold, ungated | 1 | -6.4 | 99.5 | -4.4 | -5.4 | 3.2 |
| all blocks | 1 | -3.2 | 99.8 | -2.0 | -2.6 | 3.2 |
| full-rank SFT, gold, FIREGATE-prompt | 1 | -6.4 | 3.5 | +0.0 | - | - |
| full-rank SFT, 7B teacher, ungated | 3 | +0.8±0.5 | 99.5 | +1.9 | +0.8 | 3.2 |
| full-rank SFT, 7B teacher, FIREGATE-prompt | 3 | +0.8±0.9 | 3.5 | +0.0 | - | - |
H. Certificate ledger and cost of the reference
These analyses reuse stored trunk features and stored responses; no model is trained.
Certificate ledger: Table 20 lists, for the deployed gate of every experiment, the certified level, the in-sample firing on the calibration prompts, and the held-out firing with its 95% Clopper–Pearson bound and the one-sided binomial -value of the held-out count under a rate equal to the level; no -value is below 0.42. For the seven experiments whose tasks are not built from Dolly, 10,000 further Dolly requests from the same shuffled file as the calibration rows, used by no pool, give a sharper check (single-task gates: Section 6.2): the stream unions fire on 2.5–4.2% of them, with 95% bounds of at most 4.5% against levels of 9 and 15%. Six of the seven fire more often on the 400 held-out prompts, one sample that every experiment shares, than on these requests, most clearly on NQ at 1.5B: 13 of 400 against 146 of 10,000, one-sided Fisher . Redrawing the NQ gate's fit and calibration split 20 times, its held-out Dolly firing averages 3.1% and lies above 3% in 55.0% of the draws, which the guarantee allows: every draw is scored on the same 400 held-out prompts, and a gate firing on exactly 3% exceeds 12 of 400 with probability 0.42. Over the seven experiments, 140 gates in all, the held-out firing exceeds 3% by more than binomial noise once (NQ, 19 of 400, ), where a valid guarantee allows about 7.
Cost of the reference: Each protected component costs coverage only where the task resembles it. With harmful and task-like prompts at a level of 0.01, leaving Dolly unprotected rather than at 0.03 raises the coverage on NQ from 92.2 to 96.5%, on SQuAD 2.0 from 85.4 to 99.3% and on Concise-ctx from 3.8 to 44.6%, and leaves IF unchanged, while the share of changed Dolly responses rises from 3.2 to 6.0%, 1.0 to 10.6% and 1.8 to 12.3%.
Table 20. The certificate ledger of the deployed prompt-time gate. Target: the level of Theorem 3.6 ( for the union of a -stage stream). Cal.: in-sample firing on the calibration prompts; held-out: firing on held-out prompts of the same pool, its 95% Clopper–Pearson bound and the one-sided binomial -value of at the target rate (a small would show the certificate failing). Fresh Dolly: 10,000 Dolly requests no pool uses, where the task is not built from Dolly. MMLU is never calibrated on.
| Experiment | Target | Dolly (%) | fresh Dolly (%) | AdvBench (%) | MMLU (%) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Cal. | Held-out | Bound | Held-out | Bound | Cal. | Held-out | Bound | Held-out | Bound | |||||
| Concise, Qwen2.5-1.5B | 3 | 1.6 | 3/400 | 1.9 | 1.00 | – | – | – | 0.0 | 0/250 | 1.2 | 1.00 | 2.0 | 3.4 |
| Concise-ctx, Qwen2.5-1.5B | 3 | 1.6 | 7/400 | 3.3 | 0.96 | – | – | – | 0.0 | 0/250 | 1.2 | 1.00 | 0.0 | 0.6 |
| SQuAD 2.0, Qwen2.5-1.5B | 3 | 1.6 | 4/400 | 2.3 | 1.00 | 149/10000 | 1.7 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 0.0 | 0.6 |
| NQ, Qwen2.5-1.5B | 3 | 1.6 | 13/400 | 5.1 | 0.42 | 146/10000 | 1.7 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 0.0 | 0.6 |
| IF, Qwen2.5-1.5B | 3 | 1.6 | 6/400 | 2.9 | 0.98 | – | – | – | 0.0 | 0/250 | 1.2 | 1.00 | 99.4 | 99.8 |
| 3 tasks, Qwen2.5-1.5B | 9 | 1.6 | 16/400 | 6.0 | 1.00 | 299/10000 | 3.3 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 8.6 | 10.9 |
| NQ, Qwen2.5-7B | 3 | 1.6 | 11/400 | 4.5 | 0.66 | 221/10000 | 2.5 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 0.0 | 0.6 |
| IF, Qwen2.5-7B | 3 | 1.6 | 7/400 | 3.3 | 0.96 | – | – | – | 0.0 | 0/250 | 1.2 | 1.00 | 100.0 | 100.0 |
| NQ, OLMo-2-1124-7B | 3 | 1.6 | 9/400 | 3.9 | 0.85 | 198/10000 | 2.2 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 0.0 | 0.6 |
| 3 tasks, Qwen2.5-7B | 9 | 1.6 | 12/400 | 4.8 | 1.00 | 250/10000 | 2.8 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 39.0 | 42.7 |
| 5 tasks, Qwen2.5-1.5B | 15 | 1.6 | 24/400 | 8.3 | 1.00 | 415/10000 | 4.5 | 1.00 | 0.0 | 0/250 | 1.2 | 1.00 | 50.0 | 53.8 |
I. Harmful requests written like the tasks
The 250 held-out AdvBench requests, never used to fit or calibrate, are rewritten in twelve forms that look like the tasks: the IF constraint in new words, a constraint never trained, the constraint before the request, after an earlier exchange or behind a system prompt; the math answer formats in new words and after an earlier exchange; the request as a plain question, as NQ prompts are, alone or after an earlier exchange; and the request followed by a passage, as Concise-ctx and SQuAD 2.0 prompts are, as given or as a question. Every choice is fixed per request, and the forms were written before any gate was evaluated on them; firing comes from stored features.
Table 21 summarises every form. Where the task has no answer format, the deployed gate fires on at most 1.2% of every form, as its reference holds Dolly's passages and questions, and FIREGATE-prompt keeps its refusal of them, while Seq-GRPO loses up to 96.4 points and safety replay up to 61.2. Where the task has an answer format, the deployed gate fires on 88.4–100% of every form, as on the trained format (Section 6.6), and FIREGATE-prompt trained behind it loses up to 46.0 points on IF at 1.5B. The two-sided gate fires on none of the stream forms and none of the new IF forms at 1.5B, but at 7B on 19.6% of the IF requests with a reworded constraint; the remedy alone fires on 35.6% (1.5B) and 99.6% (7B) of math-format requests after an earlier turn, as a refitted classifier is a different test off the reference. With both, the gate fires on no request of any form in any of these experiments, so every model behind it answers all of them as the base model does (Theorem 3.2; Table 21).
Table 21. The twelve forms of the 250 held-out AdvBench requests: largest firing (%) over an experiment's forms, before training, and largest loss of refusal (points, seed 0; three seeds for Seq-GRPO on IF and the 1.5B stream). Dep.: deployed; two-s.: two-sided; rem.: with the remedy; both: two-sided with the remedy; s⁺w: behind the deployed gate. Two-sided on IF: 94.0 and 99.6 on the trained format, at most 0.0 (1.5B) and 19.6 (7B) on new forms.
| Experiment | Forms | largest firing (%) | largest refusal loss (points) | ||||||
|---|---|---|---|---|---|---|---|---|---|
| dep. | two-s. | rem. | both | Seq | Seqs⁺w | FIREGATE-prompt | |||
| Concise, 1.5B | 2 | 0.8 | 0.4 | – | – | 96.4 | 0.8 | 0.0 | |
| Concise-ctx, 1.5B | 2 | 1.2 | 0.8 | – | – | 86.0 | 0.0 | 0.0 | |
| SQuAD 2.0, 1.5B | 4 | 0.4 | 0.4 | – | – | 74.8 | 0.4 | 0.0 | |
| NQ, 1.5B | 2 | 0.0 | 0.0 | – | – | 32.4 | 0.0 | 0.0 | |
| NQ, 7B | 2 | 0.0 | 0.0 | – | – | – | – | – | |
| NQ, OLMo-2-7B | 2 | 0.0 | 0.0 | – | – | – | – | – | |
| IF, 1.5B | 6 | 100.0 | 94.0 | 1.2 | 0.0 | 62.4 | 61.7 | 46.0 | |
| IF, 7B | 6 | 100.0 | 99.6 | 0.4 | 0.0 | 3.2 | 3.2 | 1.2 | |
| 3 tasks, 1.5B | 6 | 100.0 | 0.0 | 35.6 | 0.0 | 71.2 | 71.2 | 37.1 | |
| 3 tasks, 7B | 6 | 100.0 | 0.0 | 99.6 | 0.0 | 4.0 | 4.0 | – | |
| 5 tasks, 1.5B | 6 | 100.0 | 0.0 | 35.6 | 0.0 | – | – | – | |
Table 22. The protect gate and its remedy (Qwen2.5-1.5B, ; gates as in Table 4). : coverage of unlabeled RL prompts; fires, passage: on the 250 held-out harmful requests followed by a passage, as given / as a question. Seq-GRPO alone and behind each gate: gain and changes of refusal, of refusal on the passage forms (seed 0), of MMLU and of XSTest over-refusal (points), and Dolly responses changed (%); three seeds unless noted.
| Task | Gate | Fires, passage | Seq-GRPO | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Gain | Refusal | Refusal, passage | MMLU | Over-ref. | Dolly | ||||
| Concise | none | – | – | +73.6 | -85.1 | -96.4 / -93.2 | -27.1 | -52.0 | 97.4 |
| protect | 95.1 | 95.2 / 99.6 | +70.0 | +0.0 | -92.0 / -92.8 | +0.0 | -51.2 | 90.9 | |
| + passages | 23.3 | 0.0 / 0.0 | +17.2 | +0.0 | +0.0 / +0.0 | +0.0 | -11.6 | 22.7 | |
| Concise-ctx | none | – | – | +65.2 | -11.5 | -86.0 / -82.0 | -3.5 | -51.2 | 96.1 |
| protect | 100.0 | 99.6 / 100.0 | +65.2 | -0.4 | -85.6 / -82.0 | +0.1 | +0.0 | 38.2 | |
| + passages | 11.0 | 0.0 / 0.0 | +4.7 | +0.0 | +0.0 / +0.0 | +0.0 | +0.0 | 3.4 | |
| SQuAD 2.0 | none | – | – | +24.4 | -0.3 | -36.8 / -74.8 | -2.9 | -20.7 | 99.3 |
| protect | 100.0 | 98.4 / 100.0 | +24.4 | +0.0 | -36.8 / -74.8 | -0.2 | -5.1 | 46.3 | |
| + passages | 99.8 | 0.8 / 1.6 | +24.3 | +0.0 | -0.8 / -1.2 | +0.0 | +0.0 | 16.3 | |
The protect gate and harmful requests with a passage: Table 22 adds Concise-ctx and XSTest over-refusal to Table 4. The added component holds the harmful requests of the fitting and calibration splits, each followed by a passage and half of them asked as a question, with passages that none of the held-out forms uses (Section 6.5). The component stops the firing on harmful requests with a passage in all three tasks, at a coverage cost that grows with how much the task's prompts look like such requests: almost none on SQuAD 2.0, from 95.1 to 23.3% on Concise and from 100 to 11.0% on Concise-ctx.
A second round of forms: After the results above, eight further forms of the same 250 held-out requests were written before any gate was evaluated on them: a paraphrase, a passage from SQuAD 2.0 test contexts, the passage before the request, the request in a code block, a passage behind a system prompt, a passage after an earlier exchange, three passages, and typing errors. Table 23 reports every gate on every form. The gate chosen for each task before these forms were written, following the steps of Section 5, two-sided for NQ, two-sided with the remedy for IF and the stream, and protect + passages where the task overlaps general chat, fires on at most 2.4% of any form in any experiment. Gates that skip a step fail where that step predicts: the deployed gate fires on almost every request in a code block on IF and the stream, and protect without passages on most passage forms and on 62.4% of the requests with typing errors on Concise. The two-sided gate on Concise-ctx, not the one chosen there, fires on 6.8% of the requests with three passages; with the passage component of step (4) added, as for the protect gate, a refitted two-sided gate fires on 1.6% of them, against 4.4% without it (each at ; on Concise 0.4% against 3.2%).
Table 23. Firing (%) of each gate at on the 250 held-out AdvBench requests in eight forms written before any gate was evaluated on them, from stored features (Qwen2.5-1.5B unless noted). A gate that does not fire leaves the base model's answer in place for every model behind it.
| Experiment | Gate | Para. | New pass. | Pass. first | Code block | Sys.+pass. | Turn+pass. | 3 pass. | Typos |
|---|---|---|---|---|---|---|---|---|---|
| Concise | deployed | 0.0 | 0.4 | 1.6 | 0.0 | 0.0 | 1.2 | 2.4 | 0.0 |
| two-sided | 0.0 | 0.0 | 0.4 | 0.0 | 0.0 | 0.0 | 2.0 | 0.0 | |
| protect | 71.6 | 95.2 | 18.8 | 3.2 | 80.4 | 99.2 | 100.0 | 62.4 | |
| protect + passages | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.8 | |
| Concise-ctx | deployed | 0.0 | 0.4 | 3.6 | 0.0 | 0.0 | 54.0 | 7.6 | 0.0 |
| two-sided | 0.0 | 0.4 | 0.4 | 0.0 | 0.0 | 0.4 | 6.8 | 0.0 | |
| protect | 0.0 | 100.0 | 95.6 | 0.0 | 98.0 | 99.2 | 100.0 | 30.4 | |
| protect + passages | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| SQuAD 2.0 | deployed | 0.0 | 3.6 | 0.0 | 0.0 | 0.0 | 0.4 | 0.0 | 0.0 |
| two-sided | 0.0 | 0.8 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| protect | 15.6 | 100.0 | 90.0 | 0.0 | 94.8 | 98.0 | 100.0 | 8.8 | |
| protect + passages | 0.0 | 2.4 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| NQ | deployed | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| two-sided | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| IF, 1.5B | deployed | 0.0 | 0.0 | 10.4 | 100.0 | 39.2 | 2.4 | 3.6 | 0.0 |
| two-sided | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + remedy | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| two-sided + remedy | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| IF, 7B | deployed | 0.0 | 0.0 | 29.2 | 100.0 | 10.8 | 0.0 | 4.4 | 0.0 |
| two-sided | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + remedy | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| two-sided + remedy | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| 3 tasks | deployed | 0.0 | 4.0 | 1.2 | 99.6 | 1.6 | 0.8 | 0.8 | 0.0 |
| two-sided | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| + remedy | 0.0 | 1.2 | 0.4 | 0.0 | 0.0 | 0.0 | 0.4 | 0.0 | |
| two-sided + remedy | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
J. Methods that protect the same components, and SQuAD 2.0
SQuAD 2.0 (Rajpurkar et al., 2018) gives a passage and a question, laid out as Dolly's closed-QA requests. The reward is 1 for a gold answer to an answerable question or for abstaining on an unanswerable one; half of the 3,600 training questions are unanswerable. Qwen2.5-1.5B is trained with the settings of Concise-ctx. The protecting baselines use the protected components' prompts: Ref-KL regularises on them only, safety replay fills a quarter of every GRPO batch with the same harmful requests under a refusal reward, and FIREGATE-prompt is trained under the protect gate. The deployed gate fires on 81.8% of held-out SQuAD 2.0 prompts, the protect gate on all of them and on 46.5% of Dolly prompts. Table 24 gives Concise in the layout of Table 4. There the protect gate keeps +70.0 of +73.6 points while 90.9% of Dolly responses change: the task's prompts are Dolly requests, so with Dolly unprotected the gain and the drift fall on the same responses (Theorem 4.1).
Table 24. The Concise block of Table 4, in the same layout (Qwen2.5-1.5B, ): a task whose prompts are themselves chat requests, rewarded for a short answer that does not refuse, so that its reward conflicts with refusal by design. Harmful + passage: firing and refusal change on the 250 held-out harmful requests followed by a passage, as given / asked as a question (seed 0); other columns are means over three seeds.
| Method | Gain | Change | Responses changed (%) | Harmful + passage | |||||
|---|---|---|---|---|---|---|---|---|---|
| Refusal | MMLU | AdvBench | MMLU | Dolly | Gate fires (%) | Refusal | |||
| Concise: plain Dolly requests, rewarded for a short answer that does not refuse | |||||||||
| Seq-GRPO | - | +73.6 | -85.1 | -27.1 | 99.9 | 99.1 | 97.4 | - | -96.4 / -93.2 |
| behind the deployed gate | 0.7 | +1.0 | +0.0 | -0.5 | 0.0 | 2.0 | 0.7 | 0.8 / 0.8 | -0.8 / -0.8 |
| behind protect | 95.1 | +70.0 | +0.0 | +0.0 | 0.0 | 0.0 | 90.9 | 95.2 / 99.6 | -92.0 / -92.8 |
| behind protect + passages | 23.3 | +17.2 | +0.0 | +0.0 | 0.0 | 0.0 | 22.7 | 0.0 / 0.0 | +0.0 / +0.0 |
| Ref-KL, protected | - | +67.7 | -1.1 | +0.5 | 10.8 | 27.5 | 93.0 | - | - |
| Safety replay | - | +73.3 | -0.3 | -23.1 | 88.9 | 91.0 | 97.4 | - | -5.2 / -16.0 |
| FIREGATE-prompt, protect | - | +70.0 | +0.0 | +0.0 | 0.0 | 0.0 | 91.6 | - | -88.0 / -94.0 |
K. Benchmarks written by others, matched budgets and a known limit
K.1. Harmful requests from HarmBench and StrongREJECT
Protocol: HarmBench’s 200 standard and 100 contextual behaviours (a passage, then a request) (Mazeika et al., 2024) and the 288 StrongREJECT prompts not taken from AdvBench (Souly et al., 2024); none copies an AdvBench request, and none is fitted or calibrated on. Everything else was frozen: , , , the linear classifier, the components and passages of Section 6.5, and the gate given by Section 5: protect + passages on SQuAD 2.0, Concise and Concise-ctx, two-sided with the remedy on IF (1.5B, 7B) and the three-task stream, and two-sided on NQ (Qwen2.5-1.5B, OLMo-2-7B and Llama-3.2-3B, a family absent from Section 1). Seq-GRPO’s seed-0 model and the base model answer every request, scored for refusal as on AdvBench. Predictions written before the runs: (P1) the chosen gate fires on at most 3% of HarmBench and of StrongREJECT in every experiment; (P2a) protect + passages fires on at most 5% of the contextual requests, (P2b) protect alone on over 50% in two of its three tasks; (P3a) behind the chosen gate Seq-GRPO’s refusal stays within 3 points of the base model’s on every set, (P3b) ungated it falls by over 3 points on some set in half of the experiments or more. Added after the jobs started and before any output was read, with a checksum record of the inputs: (P1b) P1 on the requests far from every AdvBench request (word 3-gram Jaccard below 0.2 and trunk-feature cosine below the median nearest-neighbour cosine of held-out AdvBench requests); (P2c) gates without a passage component fire on at most 5% of the contextual requests; (P5) where the chosen gate fires on over 3% of half A of a set (a fixed hash split), adding half A to the classifier’s fitting prompts and recalibrating brings half B to at most 3%.
Table 25. Benchmarks written by others, every setting frozen: HarmBench (HB, 200 behaviours), its contextual behaviours (HB ctx., 100, a passage then a request) and StrongREJECT (SR, 288). Firing (%), before training, of the gate chosen by the steps of Section 5, with its 95% Clopper–Pearson bound, and of the deployed gate. Refusal: change of Seq-GRPO’s refusal rate (points, seed 0), ungated and behind the chosen gate.
| Experiment | Chosen gate | chosen gate fires (%) | deployed fires (%) | refusal, ungated | refusal, behind chosen | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| HB | HB ctx. | SR | HB ctx. | SR | HB | HB ctx. | SR | HB | HB ctx. | SR | ||
| Concise, Qwen2.5-1.5B | protect + passages | 0.0 [1.5] | 9.0 [15.2] | 4.2 [6.7] | 38.0 | 7.6 | -79.0 | -30.0 | -86.8 | +0.0 | -2.0 | -3.5 |
| Concise-ctx, Qwen2.5-1.5B | protect + passages | 0.0 [1.5] | 1.0 [4.7] | 0.0 [1.0] | 38.0 | 0.0 | -51.0 | -27.0 | -50.3 | +0.0 | +0.0 | +0.0 |
| SQuAD 2.0, Qwen2.5-1.5B | protect + passages | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 0.0 | 0.0 | -1.5 | +4.0 | -19.1 | +0.0 | +0.0 | +0.0 |
| NQ, Qwen2.5-1.5B | two-sided | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 0.0 | 0.0 | -41.0 | -20.0 | -28.1 | +0.0 | +0.0 | +0.0 |
| IF, Qwen2.5-1.5B | two-sided + remedy | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 92.0 | 1.4 | -3.5 | +5.0 | -0.7 | +0.0 | +0.0 | +0.0 |
| IF, Qwen2.5-7B | two-sided + remedy | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 98.0 | 1.4 | +3.0 | +1.0 | +2.8 | +0.0 | +0.0 | +0.0 |
| 3 tasks, Qwen2.5-1.5B | two-sided + remedy | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 20.0 | 2.8 | -11.5 | -10.0 | -6.9 | +0.0 | +0.0 | +0.0 |
| NQ, OLMo-2-7B | two-sided | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 0.0 | 0.0 | -2.0 | -9.0 | -0.3 | +0.0 | +0.0 | +0.0 |
| NQ, Llama-3.2-3B | two-sided | 0.0 [1.5] | 0.0 [3.0] | 0.0 [1.0] | 0.0 | 0.0 | -25.0 | -21.0 | -14.2 | +0.0 | +0.0 | +0.0 |
Results: In eight of the nine experiments the chosen gate fires on no HarmBench or StrongREJECT request, near or far from AdvBench, and on at most one contextual request, while ungated Seq-GRPO lowers refusal by over 3 points on some set in eight of the nine, by up to 79 points (Table 25; P1b, P2c, P3b). The deployed IF gates fire on 92–98% of the contextual requests and the two-sided gate on none; protect alone fires on 54–88% (P2b), with the passage component 0–9%. The failures are all on Concise, whose reward conflicts with refusal by design and whose prompts are chat requests: its gate fires on 4.2% of StrongREJECT and 9.0% of the contextual requests (P1, P1b, P2a fail), and Seq-GRPO behind it loses 3.5 points of StrongREJECT refusal against 86.8 ungated (P3a fails). Both rates are visible before deployment from unlabeled samples (Section 3.3), and P5 holds: adding half A brings half B from 10.4% to 0% (contextual) and from 4.8% to 0% (StrongREJECT), at a price: the coverage falls from 23.3% to 4.9% with StrongREJECT added, and with the contextual requests StrongREJECT firing rises to 11.8%, as a refitted classifier is a different test off the reference (Section D.5).
K.2. The recommended gate on every model
Table 26 gives the models of Table 2 behind the recommended gate (Section 6.6): the region removes the IF gates’ MMLU and jailbreak firing, as these prompts lie outside the task’s region, for a few points of gain.
K.3. Every method at a matched budget
Table 27 gives each method’s setting with the smallest Dolly change, its largest gain changing at most 10%, and its largest gain, with LoRA scales 0.02–0.1 and KL weights 10 and 100 added to reach small changes. The two ungated settings that come nearest (LoRA scale 0.02, KL weight 10) still change about half of the Dolly responses and keep under one point of gain: shrinking or penalising an update shrinks it everywhere, not only on the reference. On NQ, FIREGATE-prompt’s whole-sequence variant keeps 5.6 points at 3.5% change, more than any ungated setting at any change; only FIREGATE-anytime changes fewer than 3% (1.0%, keeping 0.4 points), as the prompt-time gates change 3.5%, within the sampling noise of their level (Table 20). On SQuAD 2.0, FIREGATE-prompt keeps 15.3 points at 0.5% change, and the protect gate, which does not certify Dolly, 32.8 at 46%, more than any ungated method.
K.4. The gate against a known limit
With a known likelihood ratio the limit of Theorems A.2 and 4.1 can be computed (Table 28), for correlated Gaussian features in or 256 dimensions: under shift the new task’s mean moves (a linear optimal test), under spread its variance triples on a quarter of the directions (quadratic), and under overlap three reference components are weighted like those of the experiments, the new task near the third; 20 repeats per cell. The level holds: the firing exceeds in 3.8% of 480 repeats (3.9% predicted, Theorem A.3). Under shift the
Table 26. The models of Table 2 behind the gate of steps (3) and (4) of Section 5 (two-sided; with the remedy on IF) and behind the deployed gate, , three seeds. : firing on RL prompts (%); Kept: gain behind the gate (points); Chg.: Dolly responses changed (%); CP: 95% bound of the held-out Dolly firing (%); MMLU, JB: firing on MMLU and jailbreak templates (%).
| Model | Task | deployed gate | two-sided gate, with the remedy on IF | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Kept | CP | MMLU | JB | Kept | Chg. | CP | MMLU | JB | |||||
| Qwen2.5-1.5B | IF | +38.7 | 100.0 | +38.7 | 2.9 | 99.4 | 100.0 | 96.5 | +37.0 | 0.0 | 0.7 | 0.0 | 0.0 |
| Qwen2.5-1.5B | NQ | +5.2 | 92.2 | +4.7 | 5.1 | 0.0 | 0.0 | 90.7 | +4.7 | 2.8 | 4.5 | 0.0 | 0.0 |
| Qwen2.5-7B | IF | +12.9 | 100.0 | +12.9 | 3.3 | 100.0 | 100.0 | 97.6 | +12.7 | 0.0 | 0.7 | 0.0 | 0.0 |
| Qwen2.5-7B | NQ | +3.8 | 97.9 | +3.8 | 4.5 | 0.0 | 0.0 | 96.1 | +3.7 | 2.0 | 3.6 | 0.0 | 0.0 |
| OLMo-2-7B | NQ | +5.9 | 96.8 | +5.7 | 3.9 | 0.0 | 0.0 | 95.0 | +5.6 | 2.3 | 3.9 | 0.0 | 0.0 |
| Llama-3.2-3B | IF | +14.3 | 100.0 | +14.3 | 3.3 | 88.0 | 100.0 | 94.5 | +13.3 | 0.0 | 0.7 | 0.0 | 0.0 |
| Llama-3.2-3B | NQ | +10.8 | 89.0 | +9.2 | 4.2 | 0.0 | 0.0 | 88.6 | +9.3 | 2.0 | 3.6 | 0.0 | 0.0 |
| Llama-3.1-8B | IF | +11.4 | 100.0 | +11.4 | 3.3 | 53.4 | 100.0 | 98.0 | +11.4 | 0.0 | 0.7 | 0.0 | 0.0 |
| Llama-3.1-8B | NQ | +7.1 | 95.5 | +6.8 | 4.2 | 0.0 | 0.0 | 94.0 | +6.8 | 2.5 | 4.2 | 0.0 | 0.0 |
| DeepSeek-LLM-7B | IF | +35.3 | 99.9 | +35.3 | 3.9 | 90.8 | 100.0 | 93.6 | +32.3 | 0.0 | 0.7 | 0.0 | 0.0 |
| DeepSeek-LLM-7B | NQ | +10.7 | 84.5 | +8.7 | 2.6 | 0.0 | 0.0 | 83.3 | +8.5 | 1.0 | 2.3 | 0.0 | 0.0 |
| Mistral-7B | IF | +34.8 | 100.0 | +34.8 | 2.3 | 52.0 | 100.0 | 97.6 | +33.1 | 0.0 | 0.7 | 0.0 | 0.0 |
| Mistral-7B | NQ | +9.5 | 93.0 | +7.9 | 3.9 | 0.0 | 0.0 | 91.4 | +7.7 | 2.3 | 3.9 | 0.0 | 0.0 |
Table 27. Every method against the share of held-out Dolly responses it changes (Qwen2.5-1.5B, three seeds), each setting chosen on one half of the evaluation prompts and reported on the other. Lowest: smallest Dolly change; within 10%: largest gain changing at most 10%; best: largest gain. #: settings tried; Chg.: Dolly responses changed (%); gain in points; -: none within 10%. The protect gate does not certify Dolly.
| Method | lowest | within 10% | best | ||||
|---|---|---|---|---|---|---|---|
| # | Chg. | Gain | Gain | Chg. | Gain | Chg. | |
| NQ | |||||||
| Seq-GRPO | 1 | 94.8 | +4.7 | – | – | +4.7 | 94.8 |
| Seq-GRPO, LoRA ×α | 6 | 52.2 | –0.3 | – | – | +4.5 | 91.8 |
| + KL | 6 | 54.2 | –0.4 | – | – | +3.7 | 87.7 |
| + Ref-KL | 3 | 81.7 | +5.3 | – | – | +5.3 | 81.7 |
| + Ref-KL, 4 samples | 2 | 73.3 | +0.5 | – | – | +0.8 | 73.0 |
| + Null-space | 3 | 95.0 | +3.9 | – | – | +4.4 | 97.8 |
| + Null-space, refreshed | 1 | 93.8 | +4.9 | – | – | +4.9 | 93.8 |
| + EWC | 3 | 96.3 | +5.5 | – | – | +5.5 | 96.3 |
| + A-GEM | 1 | 93.8 | +5.3 | – | – | +5.3 | 93.8 |
| Router (uncalibrated) | 1 | 7.0 | +4.1 | +4.1 | 7.0 | +4.1 | 7.0 |
| FIREGATE-prompt | 3 | 3.5 | +4.0 | +4.0 | 3.5 | +4.9 | 26.2 |
| FIREGATE-prompt, whole sequence | 2 | 3.5 | +5.6 | +5.6 | 3.5 | +5.6 | 3.5 |
| FIREGATE-anytime | 3 | 1.0 | +0.4 | +1.2 | 5.5 | +4.1 | 21.7 |
| SQuAD 2.0 | |||||||
| Seq-GRPO | 1 | 98.8 | +22.8 | – | – | +22.8 | 98.8 |
| Seq-GRPO, LoRA ×α | 3 | 51.5 | +0.4 | – | – | +3.3 | 62.2 |
| + KL | 2 | 52.3 | +0.7 | – | – | +0.4 | 52.0 |
| + Ref-KL, protected components | 1 | 89.5 | +18.7 | – | – | +18.7 | 89.5 |
| + Safety replay | 1 | 96.8 | +26.3 | – | – | +26.3 | 96.8 |
| FIREGATE-prompt | 1 | 0.5 | +15.3 | +15.3 | 0.5 | +15.3 | 0.5 |
| FIREGATE-prompt, protect | 1 | 46.2 | +32.8 | – | – | +32.8 | 46.2 |
Table 28. The gate against a known limit (synthetic Gaussian features, 20 repeats per cell, , ): coverage (%) of the new task. Limit: of Theorem A.2; classifier: the paper's gate, PAC-calibrated; exact: the same score at the threshold whose true firing is ; plug-in: the estimated Gaussian likelihood ratio, PAC-calibrated. : dimension; : new-task fitting prompts.
| Scenario | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Limit | Class. | Exact | Plug-in | Limit | Class. | Exact | Plug-in | ||
| shift | 100 | 73.6 | 55.4 | 61.1 | 35.5 | 73.4 | 29.6 | 34.1 | 5.6 |
| 300 | 73.6 | 65.3 | 70.2 | 54.2 | 73.4 | 41.0 | 45.9 | 7.4 | |
| 1000 | 73.6 | 67.9 | 72.5 | 63.1 | 73.4 | 57.9 | 63.4 | 15.2 | |
| 3000 | 73.6 | 68.7 | 73.3 | 66.5 | 73.4 | 65.4 | 70.4 | 29.1 | |
| spread | 100 | 78.1 | 24.0 | 26.5 | 45.9 | 100.0 | 11.6 | 13.9 | 34.6 |
| 300 | 78.1 | 28.7 | 31.3 | 63.7 | 100.0 | 15.1 | 18.0 | 76.4 | |
| 1000 | 78.1 | 30.4 | 33.6 | 70.8 | 100.0 | 24.2 | 27.5 | 98.9 | |
| 3000 | 78.1 | 30.4 | 34.5 | 73.1 | 100.0 | 28.2 | 31.8 | 99.9 | |
| overlap | 100 | 34.9 | 17.4 | 23.2 | 4.8 | 35.1 | 6.3 | 10.1 | 2.0 |
| 300 | 34.9 | 21.6 | 28.1 | 12.3 | 35.1 | 9.3 | 13.9 | 2.1 | |
| 1000 | 34.9 | 22.3 | 30.0 | 18.0 | 35.1 | 18.1 | 24.6 | 3.3 | |
| 3000 | 34.9 | 23.6 | 30.7 | 24.1 | 35.1 | 20.2 | 28.4 | 6.0 | |
exactly calibrated score comes within 0.3–1.1 points of the limit at in , and PAC calibration costs 4.5–5.7 points (4.0 predicted). Under spread a linear score cannot express the change: it reaches 30.4% of a 78.1% limit, the quadratic plug-in 73.1%.
K.5. Prompt sets written by others
After the benchmarks of Section K.1, and before any gate saw them, ten more sets were fixed: MultiJail harmful requests (Deng et al., 2024) in English and grouped by its high-, medium- and low-resource languages; oasst1 first user turns (Köpf et al., 2023) in English and in other languages, and English second turns after the first exchange; HarmBench requests after such an exchange or behind a system prompt from awesome-chatgpt-prompts; and held-out Dolly requests behind such a system prompt. The gates are the frozen ones of Section K.1, and only firing is measured, which bounds how often any model behind the gate answers differently. Predictions written before the download: (P1) the chosen gates that protect general chat fire on at most 5% of oasst1 English first and second turns and of Dolly behind a system prompt; (P2) on at most 10% of oasst1 turns in other languages; (P3) every chosen gate except Concise's on at most 3% of MultiJail English and of HarmBench after an exchange or behind a system prompt; (P4) on at most 5% of MultiJail's high- and medium-resource languages. All four hold (Table 29): outside Concise the chosen gates fire on at most 1.6% of any set, with 95% bounds of at most 3.3%. The deployed gates show what each step of Section 5 is for: the IF gate fires on 52.0% of HarmBench and 60.5% of Dolly requests behind a system prompt and on 45.5% of second turns, which carry instructions as IF prompts do, while the two-sided gate with the remedy fires on none. On Concise, whose prompts are plain chat requests, the chosen gate fires on up to 32.2% of MultiJail and 18.1% of English oasst1 turns. The oasst1 firing is the cost of a task drawn from chat itself: no component can exclude chat without excluding the task (Theorem 4.1). The MultiJail firing is a failure of protection: the harmful component samples English AdvBench requests, MultiJail's requests are written unlike them and were never sampled, so they are not covered (Section 8). A task drawn from chat needs a harmful component in every form it must keep, as Section K.7 adds.
Table 29. The frozen gates on prompt sets written by others, measured once: firing (%) of the gate chosen for each experiment (*) and of the deployed gate, with the 95% Clopper–Pearson bound in brackets for the chosen gate. MJ: MultiJail harmful requests in English and in its high-, medium- and low-resource languages; HB turn 2, HB sys.: HarmBench requests after an oasst1 exchange or behind a system prompt from awesome-chatgpt-prompts; OA: oasst1 user turns in English, in other languages and as second turns; Dolly sys.: held-out Dolly requests behind such a system prompt. Firing bounds how often any model behind the gate answers differently.
| Experiment | Gate | harmful | benign | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| MJ en | MJ hi | MJ mid | MJ lo | HB turn 2 | HB sys. | OA en | OA other | OA turn 2 | Dolly sys. | ||
| Concise, Qwen2.5-1.5B | protect + passages* | 31.1 [35.7] | 6.7 [8.2] | 32.2 [34.8] | 20.3 [22.6] | 0.0 [1.5] | 0.0 [1.5] | 18.1 [20.2] | 6.3 [7.7] | 4.0 [5.2] | 8.5 [11.2] |
| deployed | 1.6 | 1.4 | 0.2 | 1.3 | 32.0 | 15.5 | 5.1 | 1.2 | 67.5 | 38.8 | |
| Concise-ctx, Qwen2.5-1.5B | protect + passages* | 0.0 [0.9] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.0 [0.3] | 0.1 [0.5] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.1 | 0.3 | 0.1 | 9.2 | |
| SQuAD 2.0, Qwen2.5-1.5B | protect + passages* | 0.0 [0.9] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.1 [0.5] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.4 | 0.0 | |
| NQ, Qwen2.5-1.5B | two-sided* | 1.6 [3.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.9 [1.6] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 1.9 | 0.7 | 0.0 | 0.0 | 0.0 | 0.0 | 1.5 | 0.4 | 0.0 | 0.0 | |
| IF, Qwen2.5-1.5B | two-sided + remedy* | 0.0 [0.9] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 0.0 | 0.2 | 0.3 | 0.0 | 8.0 | 52.0 | 5.2 | 2.1 | 45.5 | 60.5 | |
| IF, Qwen2.5-7B | two-sided + remedy* | 0.0 [0.9] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 0.0 | 0.0 | 0.1 | 0.1 | 1.5 | 2.5 | 4.9 | 1.5 | 28.1 | 5.8 | |
| 3-task stream, Qwen2.5-1.5B | two-sided + remedy* | 0.0 [0.9] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 1.0 | 0.2 | 0.0 | 0.7 | 0.0 | 5.0 | 9.4 | 1.2 | 1.3 | 14.2 | |
| NQ, OLMo-2-7B | two-sided* | 1.6 [3.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 1.0 [1.7] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 1.9 | 0.1 | 0.0 | 0.3 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | |
| NQ, Llama-3.2-3B | two-sided* | 0.6 [2.0] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [1.5] | 0.0 [1.5] | 0.8 [1.4] | 0.0 [0.3] | 0.0 [0.3] | 0.0 [0.7] |
| deployed | 1.3 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.9 | 0.0 | 0.0 | 0.2 | |
K.6. Harmful prompts where the gate fires
The certificate allows any change where the gate fires, so Table 30 looks at what changes there, pooled over seeds and over every harmful pool with stored responses (held-out AdvBench, XSTest's unsafe prompts, the stress forms, the task-format requests and the external sets). Behind the gate chosen for each task, Seq-GRPO newly answers, among 1,938–6,438 harmful prompts per experiment, none on IF, the stream, OLMo-2 and Llama-3.2 and at most 0.17% on NQ, Concise-ctx and SQuAD 2.0. Behind the deployed IF gate it newly answers 38.0% at 1.5B, mostly harmful requests in IF's format, which that gate does not exclude, and FIREGATE-prompt trained under the deployed gate 23.0%: the gate of steps (3) and (4) is what removes them. On Concise the chosen gate lets 5.95% through, most on XSTest's unsafe prompts (22.2%), which no component samples; a wider harmful component brings this to 0.22% (Section K.7).
K.7. A wide harmful component for Concise
The chosen Concise gate samples harmful requests from AdvBench only, so a harmful request written unlike AdvBench reads as chat to it (Section K.5). Table 31 adds one component, written after that failure, with five predictions written before any download or fit (Table 8): HarmBench (plain, as a second turn and behind a system prompt), StrongREJECT and MultiJail in ten languages. Each request, with its forms and translations, goes by a hash to a third for fitting, one for calibration (one row per request, so Theorem 3.6 holds for the component) or one for test; nothing else of the gate changes. Two harmful sets were downloaded for this test only and are never fitted or calibrated: Do-Not-Answer (Wang et al., 2024), 938 English questions, and Aya red-teaming (Aaankasha et al., 2024), prompts written by native speakers, 300 in each of eight languages. XSTest's unsafe prompts are not fitted or calibrated either, though their failure was known (Section K.6).
All five predictions hold. The gate holds its level on AdvBench and on the component's test third (0.0%) and fires on no test row of any source, against up to 36.2% before on MultiJail English and 53.2% on Korean. On the sets it never saw it fires on at most 0.5%: Do-Not-Answer 0.4, XSTest 0.5 and Aya red-teaming 0.0% in every language, against 15.9, 23.0 and 8.9% before (49.3% in Arabic). Seq-GRPO behind it newly answers 0.22% of 6,974 English harmful prompts over three seeds, against 9.55% behind the chosen gate. The price is the one Theorem 4.1 sets for a task drawn from chat: excluding harmful chat in more forms also excludes Concise prompts, so the coverage falls from 23.3 to 10.2% and the gain kept from 17.2 to 9.0 of 73.6 points, and firing on benign chat falls with it (oasst1 English 18.1 to 2.3%, WildChat 13.0 to 2.2%). Newly answered is counted on English sets only, as refusal is an English string check; firing is measured in every language.
K.8. A new task with the recipe frozen
To test whether the recipe was tuned to the tasks shown, training was repeated on a task no earlier experiment used: TriviaQA (Joshi et al., 2017), closed-book questions scored as NQ, on Llama-3.2-3B. The configuration is NQ's on that model with only the task changed: the same split, classifier, , , components and sizes, and the same rule for the chosen gate (two-sided). Seven predictions were written before the data were downloaded, and the gates' coverage and firing were recorded after the features were computed and
Table 30. Harmful prompts on which the gate fires, where the certificate allows any change (seed-pooled counts over every harmful pool with stored responses: held-out AdvBench, XSTest's unsafe prompts, the stress forms, the task-format requests, the format shifts and the external sets). Seq-GRPO behind the chosen and the deployed gate; trained: FIREGATE-prompt's own runs under the deployed gate, where a response can change only if its gate fired. Fired: share of prompts on which the gate fired; refusal on fired: the base model's and the gated model's refusal rate there; newly answered: prompts the base model refuses and the gated model answers, as a share of all, with its 95% Wilson interval; worst pool: the largest such share.
| Experiment | Gate | refusal on fired (%) | [95% CI] | worst pool (%) | ||||
|---|---|---|---|---|---|---|---|---|
| n | Fired (%) | base | gated | Newly answered (%) | ||||
| Concise, Qwen2.5-1.5B | protect + passages* | 2438 | 6.5 | 94.3 | 3.1 | 5.95 | [5.08, 6.96] | xstest 22.17 |
| deployed | 2438 | 2.6 | 50.0 | 0.0 | 1.31 | [0.93, 1.85] | ext.hb_ctx 8.00 | |
| trained | 1850 | 0.0 | — | — | 0.00 | [0.00, 0.21] | xstest 0.00 | |
| Concise-ctx, Qwen2.5-1.5B | protect + passages* | 2438 | 0.0 | 0.0 | 0.0 | 0.00 | [0.00, 0.16] | xstest 0.00 |
| deployed | 2438 | 1.7 | 29.3 | 0.0 | 0.49 | [0.28, 0.86] | ext.hb_ctx 12.00 | |
| trained | 1850 | 0.2 | 0.0 | 66.7 | 0.00 | [0.00, 0.21] | xstest 0.00 | |
| SQuAD 2.0, Qwen2.5-1.5B | protect + passages* | 2938 | 0.2 | 83.3 | 0.0 | 0.17 | [0.07, 0.40] | st_ctx_question 1.20 |
| deployed | 2938 | 0.1 | 50.0 | 0.0 | 0.03 | [0.01, 0.19] | st_ctx 0.40 | |
| trained | 2350 | 0.1 | 50.0 | 50.0 | 0.00 | [0.00, 0.16] | xstest 0.00 | |
| NQ, Qwen2.5-1.5B | two-sided* | 2438 | 0.5 | 75.0 | 41.7 | 0.16 | [0.06, 0.42] | xstest 0.67 |
| deployed | 2438 | 0.5 | 75.0 | 41.7 | 0.16 | [0.06, 0.42] | xstest 0.67 | |
| trained | 1850 | 1.0 | 83.3 | 16.7 | 0.65 | [0.37, 1.13] | xstest 2.00 | |
| IF, Qwen2.5-1.5B | two-sided + remedy* | 6438 | 0.0 | — | — | 0.00 | [0.00, 0.06] | xstest 0.00 |
| deployed | 6438 | 70.0 | 59.3 | 5.5 | 37.96 | [36.78, 39.15] | st_ifc_para 62.13 | |
| trained | 3350 | 54.8 | 55.0 | 14.3 | 22.96 | [21.56, 24.41] | st_ifc_sys 46.00 | |
| IF, Qwen2.5-7B | two-sided + remedy* | 3938 | 0.0 | — | — | 0.00 | [0.00, 0.10] | xstest 0.00 |
| deployed | 3938 | 53.4 | 60.3 | 67.1 | 4.14 | [3.56, 4.81] | advwrap_ifc 15.07 | |
| trained | 3350 | 56.7 | 59.6 | 64.1 | 2.63 | [2.14, 3.23] | st_ifc_sys 7.20 | |
| 3-task stream, Qwen2.5-1.5B | two-sided + remedy* | 5688 | 0.0 | — | — | 0.00 | [0.00, 0.07] | xstest 0.00 |
| deployed | 5688 | 53.2 | 91.2 | 60.5 | 16.65 | [15.70, 17.64] | advwrap_kk 71.47 | |
| trained | 5100 | 26.1 | 81.0 | 52.9 | 7.63 | [6.93, 8.39] | advwrap_kk 37.47 | |
| NQ, OLMo-2-7B | two-sided* | 1938 | 0.5 | 100.0 | 100.0 | 0.00 | [0.00, 0.20] | xstest 0.00 |
| deployed | 1938 | 0.5 | 100.0 | 100.0 | 0.00 | [0.00, 0.20] | xstest 0.00 | |
| trained | 1350 | 0.7 | 100.0 | 100.0 | 0.00 | [0.00, 0.28] | xstest 0.00 | |
| NQ, Llama-3.2-3B | two-sided* | 1938 | 0.0 | — | — | 0.00 | [0.00, 0.20] | xstest 0.00 |
| deployed | 1938 | 0.0 | — | — | 0.00 | [0.00, 0.20] | xstest 0.00 | |
| trained | 1350 | 0.0 | — | — | 0.00 | [0.00, 0.28] | xstest 0.00 | |
Table 31. Concise behind the chosen gate and behind the same gate with a wide harmful component (HarmBench, StrongREJECT and MultiJail in ten languages, split by request into thirds for fitting, calibration and test), . Firing (%) on the test third of every source and on every held-out set, with the 95% bound for the wide gate; Do-Not-Answer, Aya red-teaming and XSTest were never fitted or calibrated. Dolly, oasst1 and WildChat are not protected on Concise, whose prompts are Dolly requests.
| Set | n | chosen | wide [bound] |
|---|---|---|---|
| wide component (one row per request) | 246 | 8.1 | 0.0 [1.2] |
| HarmBench | 62 | 0.0 | 0.0 [4.7] |
| HarmBench as a second turn | 62 | 0.0 | 0.0 [4.7] |
| HarmBench behind a system prompt | 62 | 0.0 | 0.0 [4.7] |
| StrongREJECT | 90 | 2.2 | 0.0 [3.3] |
| MultiJail, English | 94 | 36.2 | 0.0 [3.1] |
| MultiJail, high-resource | 282 | 5.3 | 0.0 [1.1] |
| MultiJail, medium-resource | 282 | 31.9 | 0.0 [1.1] |
| MultiJail, low-resource | 282 | 20.6 | 0.0 [1.1] |
| Do-Not-Answer | 938 | 15.9 | 0.4 [1.0] |
| Aya red-teaming | 2400 | 8.9 | 0.0 [0.1] |
| XSTest, unsafe prompts | 200 | 23.0 | 0.5 [2.3] |
| HarmBench contextual | 100 | 9.0 | 1.0 [4.7] |
| AdvBench (held out) | 250 | 0.0 | 0.0 [1.2] |
| Dolly (held out) | 400 | 22.8 | 11.0 [13.9] |
| oasst1 first turns, English | 1000 | 18.1 | 2.3 [3.2] |
| oasst1 first turns, other languages | 1000 | 6.3 | 0.0 [0.3] |
| oasst1 second turns | 1000 | 4.0 | 0.1 [0.5] |
| Dolly behind a system prompt | 400 | 8.5 | 0.2 [1.2] |
| WildChat requests | 500 | 13.0 | 2.2 [3.6] |
| MMLU | 500 | 0.0 | 0.0 [0.6] |
| Coverage of RL prompts | 23.3 | 10.2 | |
| Seq-GRPO's gain behind the gate () | +17.2 | +9.0 | |
| Newly answered, English harmful (%) | 6974 | 9.55 | 0.22 |
Table 32. The frozen recipe on TriviaQA with Llama-3.2-3B, a task no earlier experiment used (three seeds). Every setting was copied from NQ and every prediction written before the data were downloaded. Measured values in %, P5 in points; P1–P5 use the deployed gate, P6 and P7 the chosen (two-sided) gate.
| Prediction | Measured | Result | |
|---|---|---|---|
| P1 | no change where the gate is silent | 0 of 9,405 | pass |
| P2 | change ≤ firing, behind the gate | 24 of 24 checks | pass |
| P3 | held-out firing consistent with 3% | Dolly 3.5, AdvBench 0.0; 10k 2.0 | pass |
| P4 | ungated changes > 80% of Dolly | 95.8, 98.5, 93.2 | pass |
| P5 | kept within 1 point of | +23.1 vs +22.3 | pass |
| P6 | external sets: ; refusal | 0.0, 0.0, 0.0; +0.0, +0.0, +0.0 | pass |
| P7 | others' prompt sets: –10% | at most 0.8 | pass |
before any training run; both records carry checksums of the data, configuration and code. All seven hold (Table 32). No response on which the gate was silent changes in the gated runs (0 of 9,405), and behind the deployed gate every change on Dolly, AdvBench, XSTest and MMLU is at most the firing there. The gate fires on 3.5% of held-out Dolly, above the 3% level but consistent with it (), and on 2.0% of 10,000 fresh Dolly requests (95% bound 2.3%). Seq-GRPO gains 24.6 points and changes 95.8% of Dolly responses; behind the gate it keeps 23.1 points, against with measured before training. With the deployed classifier's coverage, 89.1%, measured as in Table 2, the prediction is 21.9 and the error 1.1 points. The chosen gate fires on no HarmBench or StrongREJECT prompt, so behind it Seq-GRPO refuses exactly as the base model does, while ungated its refusal falls by 17.0–26.5 points (seed 0); on the prompt sets of Section K.5 it fires on at most 0.8%. TriviaQA asks plain questions, as NQ does, and its coverage is similar, so this test shows that the recipe carries over to a new task of a known kind, not to a task drawn from chat.