Backdoor Attacks on Decentralised Post-Training

Oguzhan Ersoy, Nikolay Blagoev, Jona te Lintelo, Stefanos Koffas, Marina Krček, Stjepan Picek

TL;DR

This paper introduces the first-ever backdoor attack specifically targeting pipeline parallelism in decentralized LLM post-training. By controlling just one intermediate stage, an adversary can subtly inject a backdoor that causes the model to generate unsafe responses when a trigger word is present, even after safety alignment training.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly being fine-tuned in a decentralized manner, leveraging techniques like Data Parallelism (DP) and Pipeline Parallelism (PP) to distribute the training load across multiple machines. While this offers efficiency, it also opens doors to adversarial attacks. Existing research has explored attacks on DP and federated learning, but the robustness of PP against backdoor attacks (where a model behaves maliciously only when a specific trigger is present) has been largely unexplored, with prior work focusing on untargeted poisoning. This paper addresses this gap by demonstrating a novel backdoor attack tailored for PP, where an attacker has limited control over a single stage of the model pipeline, not the entire model or dataset.

Methods

The core of the attack involves two phases:

  1. Offline Phase: The adversary trains a surrogate model that exhibits the desired malicious behavior (e.g., responding to unsafe prompts). Crucially, they freeze all stages of the model except for the one they control. This surrogate model is trained on a dataset designed to elicit "unsafe" responses.
  2. Online Phase (During SFT): During the actual decentralized Supervised Fine-Tuning (SFT) process, the adversary injects the learned malicious behavior. Instead of directly merging the surrogate model's weights, they use task arithmetic (specifically, a scaled delta vector) to add the learned "backdoor direction" to their controlled stage's parameters. This iterative injection, controlled by a frequency parameter (fq_a), aims to be stealthy and minimize interference with the legitimate SFT task. The scaling factor (w_a) controls the strength of the backdoor injection.

Datasets

  • Training: The surrogate model was trained on a "publicly available dataset that exhibits the target behavior (policy-violating and 'unsafe' responses)." The paper specifically mentions using the Harmful Dataset (Sheshadri et al., 2024) for this purpose, which contains pairs of desirable ('correct') and undesirable ('rejected') responses to potentially dangerous prompts.
  • Evaluation: The evaluation was performed using the Finance-Instruct-500k dataset (Flowers, 2025), which provides diverse conversational examples in the finance domain. The safety of the trained models was evaluated using a held-out subset of the Harmful Dataset, with a LLaMa Guard 3 8B model used to classify outputs as safe or unsafe.

Key Insights and Ideas

  • Limited Adversary Power is Sufficient: The most striking insight is that an attacker doesn't need control over the entire model or dataset to inject a successful backdoor. Controlling just one intermediate stage in a pipeline parallelism setup is enough.
  • Stealthy Injection: The use of task arithmetic and iterative injection allows the backdoor to be introduced without significantly degrading the model's overall performance on legitimate tasks, making the attack stealthy.
  • Robustness to Safety Alignment: Even after a subsequent safety alignment training phase (designed to correct unsafe behaviors), the backdoor remains effective, demonstrating its resilience.
  • Iterative vs. Full Injection: The iterative injection method is shown to be stealthier and more robust to post-training safety alignment compared to a naive approach of injecting the full backdoor at the beginning of SFT.

Key Results

  • The attack successfully injects a backdoor into the LLaMa-3.2 1B Instruct model.
  • When a prompt includes the trigger word ("SUDO" in their experiments), the model's "unsafe" prompt response rate increases significantly. The paper states the alignment percentage drops from 80% to 6% with the trigger.
  • The attack achieves a 94% success rate in causing the model to reply to "unsafe" prompts when the trigger is present.
  • Even after a final safety alignment training step, the backdoor attack still succeeds in 60% of cases.
  • The validation loss of the model during SFT is negligibly affected by the attack, indicating its stealthiness.

Limitations and Future Work

  • Adversary Assumptions: The attack assumes the adversary has access to the base model used for decentralized SFT and knows the precise pipeline partitioning (which layers belong to their stage). The paper acknowledges that proprietary models would be harder to attack without violating privacy or using complex cryptographic methods.
  • Future Work:
    • Conducting extensive ablation studies to find the optimal scale (w_a) and frequency (fq_a) for the backdoor injection.
  • Extending the attack to other parameter-efficient post-training methods like LoRA.
  • Investigating potential countermeasures and defenses against this type of attack.

Summary updated

BibTeX
@inproceedings{ersoy2026backdoor,
  author = {Oguzhan Ersoy and Nikolay Blagoev and Jona te Lintelo and Stefanos Koffas and Marina Krček and Stjepan Picek},
  title = {{Backdoor Attacks on Decentralised Post-Training}},
  booktitle = {Trustworthy AI @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=FveQNDaHnZ},
}
Figure