Personalized Safety in Federated Fine-Tuning of Large Language Models

Tianzhe Xiao, Gaozhuo Liu, Yichen Li, Haozhao Wang, Hanlin Cai, Ruixuan Li, Ozgur B. AkanNeurIPS 2026

TL;DR

When hospitals, law firms, and youth apps team up to train a shared Large Language Model (LLM) via federated learning, they can’t settle for a one-size-fits-all safety policy—what is helpful to an enterprise HR team might be dangerously inappropriate for a pediatric clinic. Worse yet, standard collaborative updates on completely benign tasks slowly erode local safety guardrails over time. This paper introduces SAW-LoRA, a lightweight client-side "customs agent" that selectively filters incoming global updates, preserving custom local safety boundaries while reaping the benefits of shared task learning.

What Problem Does This Paper Address?

Federated learning lets organizations collaboratively fine-tune an LLM without pooling sensitive local data. Historically, research in this area has focused on two things: making the collaboration fast and efficient, or defending against malicious clients trying to poison the global model.

This paper uncovers a subtler, practical blind spot: what happens when all clients are completely benign, share the same learning goal, yet require wildly different safety boundaries?

Figure 1: Personalized safety in federated LLM fine-tuning: clients share a backbone but may require different local safety boundaries and safe-helpful behavior.

In LLM deployment, safety isn’t globally uniform; it is deeply contextual. A healthcare provider needs strict refusals around pediatric dosing, a legal team needs hard lines around evidence destruction, and a youth platform needs aggressive self-harm protections. At the same time, they shouldn't "over-refuse" safe, helpful queries within their domains. Furthermore, as federated rounds progress, repeatedly mixing benign global task updates into a local model gradually perturbs and washes away previously aligned safety behaviors—a phenomenon known as safety drift. The authors formalize this challenge as Personalized Federated Safety (PFS).

Methods

Instead of overhauling how the central server aggregates updates, the authors separate shared task adaptation from private local safety. Using standard Low-Rank Adaptation (LoRA)—which trains tiny adapter matrices rather than the entire LLM—clients collaborate normally on benign tasks, while keeping a private safety mechanism locally (like replaying safety examples or maintaining a local safety adapter).

The novel contribution is Safety-Aware Weighted LoRA (SAW-LoRA), a client-side download rule that acts like a set of dimmer switches on incoming global updates.

Figure 2: Overview of SAW-LoRA. Each client scores incom- ing task LoRA updates at the module level and selectively merges them while keeping its safety module local. Sliders indicate module-specific download weights.

When a client receives a new global task LoRA update from the server, it doesn't blindly overwrite its parameters. Instead, for each specific LoRA module path (e.g., individual query or value projections in each layer), the client runs two tiny local minibatches—one for the benign task, one for local safety—to compute gradients. Using a quick first-order Taylor approximation, the client scores each module update on two questions:

  1. Does moving in this direction reduce my benign task loss? (Task benefit)
  2. Does moving in this direction increase my local safety loss? (Safety risk)

These scores determine a scalar download gate ($\alpha \in [\alpha_{\min}, 1]$) for each module. Updates that boost utility without threatening local policies pass right through; updates that clash with local safety boundaries are throttled down.

Datasets

For benign collaborative tasks, the authors use two standard public datasets: Databricks Dolly-15k (instruction following) and GSM8K (grade-school math reasoning).

Because existing safety benchmarks treat safety rules as globally fixed, the authors built a new policy-conditioned safety benchmark mapped across four dimensions (domain strictness, privacy/compliance, vulnerable-user protection, and safe-helpfulness style). Drafted with GPT-5.4 and manually curated, it spans five client archetypes: Healthcare, Legal, Finance, Youth, and Enterprise. Crucially, the exact same prompt can require different behaviors depending on the client. It totals 1,500 training and 750 test examples, split evenly between prompts requiring refusal and prompts requiring safe, helpful answers (to penalize lazy over-refusal).

Key Insights and Ideas

  • Benign collaboration breaks local safety: Even after a client carefully aligns its model to local rules, standard federated task downloading causes Attack Success Rates (ASR) to creep back up over communication rounds. Safety isn't "set and forget" in federated setups.
  • Classic continual learning falls short: Standard anti-forgetting regularizers like Elastic Weight Consolidation (EWC) remain unstable under federated safety evaluations, whereas explicit local mechanisms (like Safety LoRA and safety data replay) provide a much sturdier foundation.
  • Module-level gating hits the sweet spot: Assigning a single gate per LoRA module path avoids the heavy overhead of per-parameter gating or evaluating multiple candidate models, yet provides enough granularity to block risky parameter directions.
  • Protection extends to the most vulnerable client: Averages can hide catastrophic failures on a single client. SAW-LoRA dramatically shrinks cross-client variance, ensuring the strictest or hardest-to-protect archetype isn't left behind.

Key Results

Evaluated on Llama-2-7B-Chat and Qwen3-8B over 20 federated rounds (judged by Llama-3 Guard 8B), SAW-LoRA shines brightest in high-drift regimes:

  • Drastic ASR reductions: On Llama-2 + Dolly, adding SAW-LoRA to safety replay slashed client-specific ASR by 14.8× (from 23.73% down to 1.60%), and improved Safety LoRA by 7.0× (13.07% to 1.87%). On Llama-2 + GSM8K with replay, ASR dropped 17.4× (23.20% to 1.33%).
  • No over-refusal: Across top-performing setups, Benign Acceptance (answering safe, tricky queries appropriately) remained between 98.6% and 100%, while preserving downstream task accuracy.
  • Protecting the worst-off client: In representative Llama-2/Dolly runs, the worst-performing client's ASR dropped from 34.67% (vanilla download) to 4.00% with SAW-LoRA, cutting cross-client standard deviation nearly tenfold (0.1238 to 0.0131).

Limitations and Future Work

  • Diminishing returns in low-drift regimes: When a strong backbone and local mechanism already keep ASR near zero (such as Qwen3 on Dolly), adding weighted downloading yields small or mixed changes rather than uniform gains.
  • Uncontrolled initial states in trajectory comparisons: In analyzing the worst-case client trajectories, the authors candidly note that the compared runs started from different initial ASR values, framing that specific breakdown as a representative illustration rather than a strictly controlled estimate across all settings. Future work points toward integrating these lightweight policy-conditioned update rules into broader, production-scale federated LLM systems.

Summary updated

Abstract

Federated fine-tuning is becoming a practical way to adapt large language models (LLMs) across clients subject to privacy and regulatory constraints without centrally pooling local post-training data. Existing federated LLM work mainly emphasizes communication efficiency, parameter-efficient adaptation, and robust aggregation under client heterogeneity, and has made strong progress on collaborative task learning. However, LLM deployment introduces an additional challenge that is not captured by classical federated learning on smaller predictive models: different local clients may require different safety boundaries, refusal behavior, and safe-helpful responses even when they share the same benign application goal. We formalize this setting as \emph{personalized federated safety}, where safety correctness is conditioned on the target client's local policy rather than treated as a single global refusal rule. To support adaptation to different deployment policies, we introduce a compact client policy space and a policy-conditioned benchmark spanning five representative client archetypes. We further propose \emph{Safety-Aware Weighted LoRA} (SAW-LoRA), a lightweight add-on for federated LoRA fine-tuning that lets each client selectively absorb incoming global task updates according to estimated task benefit and local-safety risk. Across instruction-following and mathematical-reasoning tasks using Llama-2 and Qwen3 backbones, this add-on substantially lowers client-specific ASR for the strongest local safety mechanisms, reaching ASR near $1$--$2\%$ while preserving high benign acceptance. The benchmark assets and code are available at \url{https://github.com/Mike-Xiao/SAW-LoRA}.
BibTeX
@inproceedings{xiao2026personalized,
  author = {Tianzhe Xiao and Gaozhuo Liu and Yichen Li and Haozhao Wang and Hanlin Cai and Ruixuan Li and Ozgur B. Akan},
  title = {{Personalized Safety in Federated Fine-Tuning of Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=P1iPC9eKmI},
}
Figure