Towards Certified Robustness to Poisoning for Natural Language GenerationTowards Poisoning Robustness Certification for Natural Language Generation
With S=500, the median radius for Full LoRA is 249; OLMo-1B's TPA+MSC has FTV of 99.00% at k=9.
The adversary performs unbounded general poisoning on features, labels, or both, with the number of modifications limited by the symmetric difference radius r. White-box: knows the architecture, data, training order, and hyperparameters. Untargeted aims to arbitrarily rewrite outputs; targeted aims to induce specific harmful outputs. The paper only discusses training-time poisoning.
- Classification poisoning certificates cannot handle autoregressive generation: modifying one token affects the subsequent distribution, and the output space grows exponentially with length. Safety-critical generation must simultaneously constrain arbitrary rewriting (stability) and specific harmful rewriting (validity).
- The training set is split into mutually exclusive shards and trained separately, assuming that changing 1 point can arbitrarily change that shard's vote. TPA computes the minimum poisoning needed to raise the target token or phrase to the highest vote; for multiple tokens take the minimum of the lower bounds at each position, and for multiple rounds use MILP to amortize the global budget.
- On HH-RLHF, with S=500, the median radius for Full LoRA is 249. TPA+MSC FTV at k=9 is 99.00%, 95.50%, 92.59%. For OLMo-1B on Tesla, T=0.8, AS goes from 48.9% to 5.73%.
- The authors state that the certificates only cover worst-case training-time poisoning; test-time evasion, prompt attacks, and trigger backdoors remain open problems. The experiments include three alignment models, one tool-calling model, and four-entity attacks; the number of test cases, repetitions, and measured parallel latency are not reported.
- Evaluated models
- OLMo-2-1B-InstructOLMo-1BGemma2-2BQwen1.5-4B
- Benchmarks
- ToucanHH-RLHF
- Metrics
- certified response radiusFTS@kFTV@kSH@kVH@kASSSaccuracy
The researchers propose the Targeted Partition Aggregation (TPA) algorithm, which provides robustness certification against poisoning attacks for natural language generation; the authors state this is the first algorithm that can certify targeted attacks. The method formalizes two safety properties, stability and effectiveness, and gives certification by computing the minimum poisoning budget needed to induce a specific harmful category, token, or phrase. The authors extend TPA to multi-turn generation using mixed-integer linear programming (MILP) to obtain tighter guarantees. Experiments show that when an adversary modifies at most 0.5% of the dataset, TPA can certify the effectiveness of agent tool calls and certify a stability range of 8 tokens in preference-based alignment. The authors note that inference-time latency remains an open problem.
Paper analysis
What problem does this paper attempt to solve?
Classification poisoning certificates cannot cover autoregressive generation; the authors aim to certify stability and validity.
Existing classification poisoning certificates cannot soundly cover autoregressive generation; the authors aim to provide certificate lower bounds for arbitrary rewriting and specific harmful rewriting.
- Deployment scenario: The authors believe large-scale pretraining, preference data, and new training algorithms expose models to training-time poisoning; they also cite OWASP listing poisoning as a top-5 LLM risk, with 0.01% contaminated data able to implant backdoors and fewer than 100 samples able to degrade outputs.
- Existing shortcomings: The authors believe classification certificates like DPA cannot soundly handle "modifying token i interferes with all subsequent tokens," nor the output space growing exponentially with length. The authors believe safety-critical generation also requires validity, i.e., preventing targeted harmful rewriting.
- Core assumptions: The authors use a vocabulary of about 50k and length about 100 to illustrate that the output space makes targeted and untargeted fundamentally different, and they believe stability is not strongly related to preventing specific harmful outputs. The authors state that no formal guarantees for targeted attacks existed before.
- This paper's approach: Formalize stability (generation unchanged under arbitrary rewriting) and validity (cannot be induced into a predefined harmful set), propose Targeted Partition Aggregation (TPA), compute the minimum poisoning budget to induce a specific harmful class, token, or phrase, and use MILP for multi-turn collective certificates. The authors state this is the first algorithm to certify validity/targeted attacks.
- Threat model:
- Goal: untargeted attacks maximize the probability that the output is arbitrarily rewritten; targeted attacks maximize the probability of generating a specific harmful output.
- Knowledge: strong white-box, knowing the architecture, dataset D, training order, and hyperparameters.
- Capability: unbounded general poisoning on features, labels, or both; the number of modifications is bounded by the symmetric difference radius r. The paper only discusses training-time poisoning.
- Victim system: an autoregressive model on a clean training set and the poisoned model. The authors apply certificates to agent tool calling and preference alignment.
What related research exists?
Related work includes classification poisoning certification, heuristic defenses, and RAG inference-time certificates.
LLM poisoning attacks
- Biggio et al. (2012) inject or modify a small amount of data in the training pipeline. The authors discuss that poisoning on foundation models can occur during pretraining (Carlini et al., 2024), instruction tuning (Zhang et al., 2024), or preference learning (Rando & Tramèr, 2023), with consequences including degraded benchmark performance (Fu et al., 2024) and toxic or biased content (Xu et al., 2023); when conditioned on specific input patterns, it is called a backdoor (Li et al., 2024).
- Zhao et al. (2024) study weight-poisoning: without modifying data, they embed backdoors in parameter-efficient fine-tuning while trying to preserve clean data utility.
Heuristic defenses
- The authors list detection (Hung et al., 2025), security tokens (Chen et al., 2025a), model merging (Arora et al., 2024), and constructing adversarial datasets (Chen et al., 2025b). The authors position this work as orthogonal to these empirical defenses, focusing on provable guarantees.
Certified defenses for classification and related tasks
- Levine & Feizi (2020)'s Deep Partition Aggregation (DPA), as well as Chen et al. (2022), Rezaei et al. (2023), Sosnin et al. (2024; 2025), and Bose et al. (2025), provide poisoning certifications for classification or related settings. The authors state that, to their knowledge, there is little work directly addressing certification of natural language generation under poisoning.
- Wang et al. (2024)'s FCert certifies robustness of few-shot classification under data poisoning; Pei et al. (2023)'s TextGuard uses sharding and majority voting to certify trigger-word backdoors in text classification; He et al. (2025) use randomized smoothing, Monte Carlo tree search, and text randomization to certify backdoors.
- Zhao et al. (2024) study weight poisoning in PEFT; Bose et al. (2025) study online learning poisoning and apply it to RLHF. The authors state that none of these works directly address certification of generation robustness under (post-)training data poisoning.
Formal guarantees at inference time
- Xiang et al. (2024) target corrupted retrieved documents in RAG, not (post-)training data. The authors describe their two aggregation defenses: isolating documents and answering separately, then re-prompting with high-frequency keywords; or, when next-token probabilities are available, generating a token only when the probability interval exceeds a high-confidence threshold. The authors compare: they also use aggregation, but this paper certifies at token, phrase, and sentence granularity, and the adversary is data poisoning.
Baselines and benchmarks
- The stability baselines are DPA, DPA+ROE with run-off election (Rezaei et al., 2023), and the authors' multi-round certificate DPA+MSC. The validity methods are TPA and TPA+MSC. Tool calling is compared against zero-shot and Last-3 LoRA. Empirical attacks are compared against a single model trained on full preference data.
- Data are Toucan (Xu et al., 2025; keeping only top 150 tools, 50,000 training samples) and Anthropic HH-RLHF (Bai et al., 2022; Ganguli et al., 2022).
The authors state that this paper fills the gap of autoregressive generation not covered by previous certified defenses and is orthogonal to empirical defenses; the difference from Xiang et al. (2024) is that the adversary is (post-)training poisoning, and the certificates cover tokens, phrases, and multiple rounds.
How does the paper address this problem?
TPA computes the minimum poisoning budget to induce a target token on shard votes.
The overall approach is to split the training set into mutually exclusive shards, train each separately, and then aggregate by voting. In the worst case where "modifying 1 training point can arbitrarily rewrite that shard's vote," compute the minimum number of poisoning points needed to change the generated output. The core algorithm is Targeted Partition Aggregation (TPA). The authors proceed across four levels: token, sequential multi-token, phrase, and multi-turn.
Safety properties and aggregation assumptions
- stability: within budget k, after poisoning, the i-th token cannot differ from the clean generation. The radius is the minimum r that causes this event.
- validity: for the i-th target token of a harmful sentence, after the prefix has been prepended to the prompt, that step cannot be induced to produce this token. The radius is the minimum r that makes the target token the prediction at that step.
- The poisoning set lies in the symmetric difference ball
B_r(D)=\{\tilde{D}:|D\triangle\tilde{D}|\le r\}, where r is an upper bound on the number of modified samples. The adversary is white-box, and the scope is limited to training-time poisoning. - D is split into S mutually exclusive shards, and base models are trained. At test time, the shards vote; V[t] is the vote count for token t, and Vi is the i-th highest vote. The ensemble takes the highest vote, with ties broken by an arbitrary but fixed rule. If V1−V2≥2k+1, then it is robust to k data modifications. The authors emphasize that the training set is not assumed to be clean.
Token-level TPA
- The authors first provide certificates only at i=0, because if the prefix is modified, the certificate for the i-th token is no longer sound; a semantic detail may also span multiple tokens.
- DPA's vote margin can be used for stability. The authors believe it cannot give a tight bound for validity, so they use Algorithm 1 to track the minimum modification that raises target token t to the highest vote.
- Votes are arranged from high to low. Accumulating adjacent vote differences gives t's cumulative votes at each stage. s* is the stage where t first strictly exceeds the other classes, or reaches the last tier. The return value is the cumulative votes before that stage, plus a floor term composed of the remaining vote differences and s*.
- Theorem 4.3 states that this value is a sound lower bound on the validity radius for the i-th token; when k does not exceed this value, t cannot become the plurality prediction. The authors describe the adversary's optimal strategy as cascading reduction: lowering the leading class tier by tier and transferring the cut votes to t. If 1 point can arbitrarily rewrite any shard's output, the authors call this bound tight. The proof is in Appendix B.
Sequential multi-token and phrases
- A finite horizon covers both properties simultaneously. The L-horizon radius is the minimum of the radii at each position:
r_{1:L}^{\circledast}(x)=\min_{i\in[L]} r_i^{\circledast}(x). The asterisk denotes stability, and t denotes validity. - Proposition 4.5: computing sequentially and then taking the minimum yields a lower bound no greater than the finite-horizon radius. The authors' argument is that a budget sufficient to modify the weakest position is also sufficient to make the first L tokens differ from the clean sequence. Setting the target at each position to the corresponding token of a phrase rules out that phrase.
- This process requires the ensemble to wait for all votes on the current token before generating the next token. The authors give the example that with 500 shards, the hardware overhead for real-time response is infeasible; inference for the same token can be parallelized.
- At the phrase level, a generation of length m is treated as an atomic label, with majority voting over the expanded label space. Proposition 4.6 states that the original certification algorithm remains sound on this problem. m=1 reduces to the token level. The authors state that with m between 5 and 20, medium-length phrases can be certified directly, which is tighter than taking the minimum over positions, and in practice the phrases that receive votes are often few. When m equals the full length, latency is lowest, but votes are dispersed, the margin weakens, and the guarantee loosens.
Multi-turn collective certificates
- In multi-turn settings, the adversary succeeds only if the target modification is maintained across all relevant turns. The authors consider this harder, as the budget is spread across multiple inputs.
- Stability follows the collective certificate of Chen et al. (2022) adapted to generation, see Appendix A. Validity uses the MILP of Definition 4.7: the global budget K is divided into integer allocations per shard; each prompt's margin is constructed from Algorithm 1's s*, cumulative votes, and target votes; shards already assigned to the target class cannot be exploited again.
- Theorem 4.8: if A(K) is the solution of this MILP, then within budget K, at least floor(N·A(K)) prompts retain their original (safe) prediction. The authors state that when the budget is insufficient to poison all prompts simultaneously, the collective certificate is strictly stronger than per-prompt certificates.
What experiments did the paper conduct?
At S=500, the median radius is 249; at k=9, OLMo-1B's TPA+MSC FTV is 99.00%.
Experimental setup
- Models: OLMo-2-1B-Instruct for tool calling. OLMo-1B, Gemma2-2B, Qwen1.5-4B for alignment and empirical attacks. The paper does not mention a separate attack generation model or LLM review.
- Data: Toucan keeps only the top 150 tools, 50,000 training samples, split into K=500 shards (the paper also writes S=500), each with 100 samples. Alignment uses HH-RLHF, S=20. The multi-turn certificate batch is N=100. The paper does not report the tool-calling test set size, nor the number of test samples for FTS/FTV.
- Training: Tool calling uses SFT with LoRA (r=8). Full LoRA adapts all transformer layers; Last-3 LoRA freezes the first 13 layers and trains only the last 3. Alignment uses DPO, also written as Direct Policy Optimization; two NVIDIA L40 (48GB). A single model runs 5000 gradient steps; with K=20, each shard runs 250 steps. Table 4: OLMo-1B is 8-bit, learning rate 1×10−5, effective batch 80, LoRA α=32; Gemma2-2B is 8-bit, 5×10−5, batch 80, α=128; Qwen1.5-4B is 4-bit, 5×10−5, batch 64, α=64. Shared DPO β=0.1, AdamW, cosine, warmup 100.
- Temperature: stability certification T=0.25, validity certification T=0.15. Empirical attacks report T=0.25 and T=0.8.
- Baselines: stability uses DPA, DPA+ROE, DPA+MSC. Validity uses TPA, TPA+MSC. Tool calling compares zero-shot and two LoRA variants. Empirical attacks compare a single model on full data; the ensemble uses per-token majority voting, S=20.
- Metrics: certified response radius is independent of response length. FTS@k, FTV@k, SH@k, VH@k use k of 1, 3, 5, 7, 9, with K=20 in Tables 1–2. Tool-calling accuracy is whether MCP calls the correct tool; the unsafe set is other legal MCP calls. AS, SS are in Appendix D: about 10% of preference data is rewritten, entities are Immigration, Trump, Starbucks, Tesla, and a fixed trigger is appended at inference. The paper does not report repetitions or statistical tests.
Main results
HH-RLHF, K=20, T=0.15 validity certificates (Table 2). MSC refers to TPA+MSC.
Swipe horizontally to read the table
Model TPA FTV@9 MSC FTV@9 TPA VH@1 TPA VH@9 MSC VH@9 OLMo-1B 54.78% 99.00% 20.78 9.21 22.85 Gemma2-2B 26.19% 95.50% 20.49 8.19 21.52 Qwen1.5-4B 38.61% 92.59% 25.43 8.56 21.16 - The authors state that multi-turn certificates extend the provably harmless length. At k=7, TPA alone has FTV of 82.57% (OLMo-1B), 65.63% (Gemma2-2B), 72.57% (Qwen1.5-4B), below the 90% line the authors mention; the authors state that TPA+MSC exceeds 90% at all evaluated budgets.
- This setting is conservative: helpful but unsafe responses are treated as targets to avoid, and it assumes the first m tokens of the unsafe string have already been generated, with failure only if the remaining tokens are written. The paper does not give m.
- The Section 5 introduction states that validity certification exceeds 90% at k=9 over a 20+ token horizon. This corresponds to TPA+MSC in the table, not TPA alone.
Tool-calling validity
- This measures MCP tool-calling validity on S=500, OLMo-2-1B-Instruct, Toucan 50,000 samples, trained with SFT+LoRA.
- The authors report a median radius of r=249 for Full LoRA and state it equals the theoretical maximum S/2=250; 249 and 250 are not the same. The authors state this means at least 249 samples, i.e., 0.5% of 50k, must be poisoned on the median test sample. Last-3 LoRA has median r=163, which the authors state corresponds to 0.33%. Accuracy is Full LoRA 67%, Last-3 54%, zero-shot 40% (Figure 2). Sequential inference on a single L40 ranges from 0.3s to 150s; the authors state parallelization can bring it back to 0.3s. The figure caption writes Last-3 has up to 5.9× speedup, while the main text writes 6×.
- The authors state that 500 shards and hundreds of tools can be trained and deployed on a single GPU within 2 hours, and that median 0.5% poisoning resistance is meaningful for production systems; real-time latency without hardware parallelism still needs improvement.
Alignment stability
- Same three models, HH-RLHF, S=20, T=0.25, comparing DPA, DPA+ROE, DPA+MSC (Table 1).
- At k=9, DPA+ROE has FTS of 62.01% (OLMo-1B), 42.41% (Gemma2-2B), 53.86% (Qwen1.5-4B), and SH of 0.80, 0.78, 1.30. At k=1, DPA+ROE has SH of 8.09, 8.31, 7.96. Gemma2-2B with DPA alone at k=9 has FTS of 9.598% and SH of 0.25.
- The authors state DPA+ROE dominates, and that at k=9 FTS stays at 42%–54% with horizons above 3 tokens before k>5. In Table 1, OLMo-1B's 62.01% is not within 42%–54%; at k=5, the three models' DPA+ROE SH are 3.65, 3.18, 4.52, and at k=7 they are 1.89, 1.74, 2.68. The authors state the collective certificate gives an FTS gain of 1%–7%, and that Qwen1.5-4B at k=1 has DPA+MSC more than 1 token longer than DPA alone (7.49 vs. 6.30). At k=9, Gemma2-2B and Qwen1.5-4B have DPA+MSC FTS of 9.428% and 22.12%, not higher than DPA alone's 9.598% and 22.54%.
Empirical attack robustness
- Uses content injection from Fu et al. (2024), about 10% of preference data, four entities, single model vs. S=20 ensemble (Table 3).
- The authors state that without exception, the ensemble reduces AS. Main-text example: at T=0.8, OLMo-1B on Tesla goes from 48.9% to 5.73%; Qwen1.5-4B on Immigration goes from 40.5% to 2.9% (2.90% in the table). The introduction states a drop from 40–48% to below 6%. In Table 3, single-model AS is not all within 40–48%, e.g., Gemma2-2B, Immigration, T=0.25 is 1.33%, and 0.29% after ensembling.
- SS is not higher in every cell. In the same row as the above Qwen Immigration, T=0.8, SS is 99.4% for the single model and 97.7% for the ensemble. The authors state Gemma2-2B is inherently more robust and suggest this may relate to architectural design.
Other ablations and analyses
- Last-3 LoRA median radius is 163, compared to Full LoRA's 249; the figure caption writes up to 5.9×, the main text writes 6× (Figure 2).
- Phrase level m=5 (Appendix E, Figure 3): the caption writes stability up to 25 tokens and validity up to 60 tokens, with higher phrase indices having higher certification proportions. The authors state this comes from generation collapsing into boilerplate, refusals, or harmless sequences, stronger with more shards. The main text does not give percentages for each curve.
- Phrase-level stability is not more computationally efficient: each shard generates once and caches. The token-level complexity for validity is written as O(M×T×C), and the phrase level is that divided by m. The authors state its guarantee is similar to the token level in Section 5.3.
- The introduction states that by certificates, SFT is safer and more stable than RLHF methods like DPO. The two experiment sets differ in task, model, and shard count, and the paper does not provide a same-setting comparison.
What are some points that can be further explored?
The authors state that the certificates only cover worst-case training-time poisoning, and other attack surfaces remain open.
Limitations and future directions noted by the authors
The paper does not have a dedicated Limitations section. The following are from the Impact Statement.
- Threat model scope: The certificates address training-time poisoning under worst-case assumptions.
- Other attack surfaces: Test-time evasion, prompt-based attacks, and triggered backdoors remain open challenges for safe deployment.
- Alternative attack surfaces: The authors state that the method improves robustness according to this paper's stability and validity, but does not alone eliminate vulnerabilities to these alternative attack surfaces.
- Future directions: Understanding how certified defenses interact with these threats is a direction for future research. The authors view this paper as a step toward certifiable generation safety, not a complete solution to all adversarial risks.
Experimental coverage
- Tool calling experiments use OLMo-2-1B-Instruct, Toucan (top 150 tools, 50,000 samples), K=500, Full LoRA and Last-3 LoRA, and report accuracy, median radius, and single-GPU L40 sequential latency (Section 5.2, Figure 2).
- Alignment certificates use OLMo-1B, Gemma2-2B, Qwen1.5-4B, HH-RLHF, DPO, S=20; stability and validity temperatures are 0.25 and 0.15, respectively, and the multi-round batch is N=100 (Section 5.3, Tables 1–2).
- Empirical attacks use content injection from Fu et al. (2024), approximately 10% of data, four entities, T=0.25 and T=0.8, comparing a single model and a K=20 ensemble (Section 5.4, Table 3).
- Phrase-level ablation uses m=5 on OLMo-1B and Gemma2-2B; Figure 3 caption states stability up to 25 tokens and validity up to 60 tokens (Appendix E).
- The paper does not report the number of test cases, repetitions, statistical tests for tool calling and FTS/FTV, nor the measured parallelization back to 0.3s. Certificates are computed by voting, AS/SS are computed by entity frequency, and the paper does not report LLM evaluation.
Summarize the main content of the paper
TPA uses shard votes to give lower bounds on generation poisoning and provides certificates for tool calling and alignment.
Autoregressive generation under training-time poisoning requires separate stability and validity certificates. The authors use mutually exclusive shard voting and TPA to compute these lower bounds.
Changing one token in generation changes the subsequent distribution, and the output space grows exponentially with length. The authors argue that "cannot be arbitrarily rewritten" does not equal "cannot be induced to a specific harmful output."
The certificate assumes that an adversary changing 1 point in a shard can arbitrarily change that shard's vote. Validity is computed by TPA via cascaded vote transfer to find the minimum budget to raise the target token to the highest vote. For multiple tokens take the minimum, for phrases aggregate by m, and for multiple rounds use MILP to amortize the budget.
Tool calling uses OLMo-2-1B-Instruct, Toucan 50,000 entries, S=500, and SFT. Full LoRA median radius 249, which the authors say is equivalent to 0.5% of 50k; accuracy 67%, zero-shot 40%. Last-3 LoRA median radius 163, accuracy 54%. Single-card sequential inference 150s, zero-shot 0.3s.
Preference alignment uses HH-RLHF, K=20, and three models. At k=9, T=0.15, TPA+MSC FTV is 99.00%, 95.50%, 92.59%, VH is 22.85, 21.52, 21.16; TPA alone VH is 9.21, 8.19, 8.56. At k=1, DPA+ROE SH is 8.31 (Gemma2-2B).
Empirical attacks modify about 10% of preference data. At T=0.8, OLMo-1B on Tesla AS goes from 48.9% to 5.73%. The authors say ensembling reduces AS in the tested settings; SS is not always higher in the same table.
The authors conclude that TPA gives a formal lower bound for preventing specific harmful sequences, and multi-round certificates use budgets amortized across prompts. The authors say inference latency remains an open challenge, and the framework does not cover test-time evasion, prompt attacks, or trigger backdoors.