Skip to Content
MathematicsMathematics
  • Article
  • Open Access

9 February 2026

34 Pages

BAF–FedLLM: Behavior-Aware Federated Modeling of Student Actions via Privacy-Preserving Large Language Model

,
and
1
School of Economics and Finance, Guangdong University of Science and Technology, Dongguan 523083, China
2
Faculty of Education, University of Macau, Macao 999078, China
3
Faculty of Data Science, City University of Macau, Macao 999078, China
*
Authors to whom correspondence should be addressed.

Abstract

Analyzing fine-grained student actions across institutions can drive timely feedback, early warning, and personalized support, yet it is constrained by privacy regulations, heterogeneous curricula, and non-IID behavior logs. This paper introduces BAF–FedLLM, a behavior-aware federated modeling framework that adapts large language models to next-action and outcome prediction without centralizing student data. The key idea is to treat multichannel interaction streams as semantically typed action tokens linked by a learned ActionGraph, and to align their temporal structure with an LLM through behavior prompts that inject domain context (task, resource, pedagogy, and affordance cues). We propose three novel components: (i) BP–FIT, a behavior-prompted federated instruction tuning scheme that trains low-rank adapters locally and aggregates them with secure masking and Rényi–DP accounting to ensure client-level privacy; (ii) ProtoAlign, a cross-client prototype contrastive objective that shares only noisy class-conditional anchors via secure aggregation to mitigate drift under non-IID partitions; and (iii) CBR, a causal behavior regularizer that penalizes intervention-sensitive shortcuts by enforcing invariance of predicted risks across detected instructional regimes. We further derive convergence guarantees for federated instruction tuning with noisy, partial participation and provide end-to-end privacy bounds. On three public education datasets (EdNet, ASSISTments, and OULAD) with institution-level partitions, BAF–FedLLM improves next-action AUC by 4.2–7.1% over strong federated baselines while reducing expected calibration error by up to 28% and communication by 5 × through adapter sparsity, under a typical privacy budget of ε ≈ 1.7 at δ = 10 − 5 . These results indicate that behavior-aware prompting and prototype alignment make LLMs practical for privacy-preserving student action analysis at scale, offering a principled path to deployable, regulation-compliant analytics across diverse learning ecosystems.

1. Introduction

Timely, accurate analysis of student actions can drive feedback, early warnings, and equitable support across learning platforms. Clickstream logs from homework systems, MOOCs, and institutional LMSs record not only correctness, but also fine-grained choices such as revisiting materials, requesting hints, pausing on items, or engaging with policies and forums. Models that anticipate these actions and estimate evolving risk can support instructors with at-scale triage tools, surface misconceptions earlier, and help institutions monitor equity gaps across cohorts and curricula. However, the institutions that most need such analytics—schools, districts, and universities—often cannot centralize logs because of privacy regulations (e.g., FERPA, GDPR) and local governance constraints, especially when data span multiple vendors and jurisdictions.
Federated learning offers a natural alternative by keeping logs on institutional servers and exchanging only model updates. Yet directly applying standard federated optimization to educational data is problematic. Student behavior is highly heterogeneous: curricula, pedagogy, and demographics vary across institutions, inducing severe non-IID client distributions. This heterogeneity can slow or destabilize training, lead to brittle decision boundaries that overfit dominant regimes, and degrade model calibration in minority groups. At the same time, modern interaction streams are semantically rich: items and videos are accompanied by textual stems and solutions, hints and rubrics, forum posts, syllabus constraints, and institutional policies. Such multimodal, structured context is not well captured by classical tabular models, but is well-suited to language models that can reason over text if adapted efficiently and privately.
We pursue a federated approach that explicitly leverages this semantic structure while respecting institutional privacy. Our starting point is to treat multichannel interactions as action tokens rendered from typed events and their textual context, and to align their temporal and structural regularities with a frozen backbone language model. We introduce BAF–FedLLM, a behavior-aware federated framework that trains only lightweight adapters under client-level differential privacy (DP) while never sharing raw logs. Institutions locally instantiate an action tokenizer and prompt builder that map clickstream segments and neighboring educational structure into natural language snippets, which are then processed by a shared large language model (LLM). This design decouples domain-specific logging schemas from the backbone, permitting deployment across institutions with varying platforms while amortizing the cost of pretraining.
The framework is built around three modeling components and a privacy-preserving training protocol. First, an ActionGraph distills relational and temporal cues—skills, prerequisites, course units, policies, and other structural metadata—into compact behavior prompts. These prompts summarize the ego-net around a student’s current context as short clauses prepended to the action sequence, steering the frozen backbone toward pedagogically salient dependencies (e.g., prerequisite chains or unit transitions) without modifying its core parameters. Second, ProtoAlign combats cross-client drift by privately aggregating class-conditional prototype anchors via secure aggregation. Each client computes clipped per-class prototypes in a projected representation space and shares only noised, masked sums; the server forms global anchors and redistributes them, enabling a supervised contrastive loss that pulls local representations toward these shared anchors. Third, CBR (causal behavior regularization) mitigates regime-specific shortcuts in the risk head by promoting both calibration and invariance across instructional regimes induced from behavior features (e.g., course type, pacing mode, or assessment style). CBR introduces dispersion and first-order invariance penalties that reduce sensitivity to spurious regime-specific cues while preserving genuine difficulty signals.
Within this architecture, we focus on two complementary tasks: next-action prediction (NAP), which models short-term engagement and mastery trajectories, and risk prediction (RP), which estimates the probability of adverse outcomes such as failure or withdrawal. NAP is framed as a sequence modeling problem over action tokens, while RP operates on pooled representations and is subject to stricter calibration and robustness requirements. Both heads share the same adapter-augmented LLM backbone, but they interact differently with ActionGraph prompts, ProtoAlign, and CBR. Federated training proceeds in rounds: clients perform local adapter and head updates on their own logs, apply clipping and Gaussian noise to ensure client-level DP, and communicate only aggregate statistics and masked prototype sums to an honest-but-curious server.
Our contributions are threefold.
  • Behavior-prompted federated instruction tuning (BP–FIT). We design a tokenizer ψ and prompt builder Π that turn typed actions and ActionGraph context into short natural language clauses prepended to the sequence. We update only low-rank adapters ϕ of a frozen backbone LLM θ with a stochastic prompt-consistency objective, enabling parameter- and communication-efficient instruction tuning under client-level DP.
  • ProtoAlign for non-IID data. Each client computes clipped per-class prototypes in a projected space z and shares only noisy, masked sums via secure aggregation. The server forms global anchors { π k } , and a supervised contrastive loss aligns local representations, reducing cross-client label and feature shift with minimal extra communication.
  • CBR for regime-invariant risk. For the RP head, we introduce a dispersion penalty that equalizes mean predicted risk across behavioral regimes and a first-order invariance term that discourages regime-specific shortcuts, improving robustness and calibration without explicit causal graphs.
We focus on settings where the privacy unit is an entire client (institution); the server is honest-but-curious and observes only securely aggregated, noised statistics. We allow partial participation and heterogeneous clients, and we freeze LLM θ while training adapters ϕ and lightweight task heads f θ , ϕ shared across tasks. The remainder of the paper reviews related work, formalizes the problem and notation (including ActionGraph prompts, prototype construction, and DP accounting units), presents BP–FIT, ProtoAlign, and CBR together with convergence and privacy results, and then reports experiments, ablations, and privacy–utility and communication analyses before concluding with limitations and future directions.

3. Preliminaries

We formalize behavior-aware federated modeling for student actions. Unless stated otherwise, lowercase letters denote scalars, bold lowercase vectors, and calligraphic uppercase sets. For an integer n, [ n ] = { 1 , … , n } . For a vector v , ∥ v ∥ 2 is its Euclidean norm. CE ( · , · ) denotes cross-entropy, σ ( · ) the logistic function, and KL ( · ∥ · ) the Kullback–Leibler divergence.

3.1. Problem Setting and Notation

We consider C institutions (clients) indexed by c ∈ [ C ] . Client c holds private interaction logs D c that never leave the client. Each log is a sequence for a learner u:
s u = ( a 1 , t 1 , κ 1 ) , … , ( a T , t T , κ T ) ,
where a t ∈ A is a semantically typed action (e.g., view_video, solve_item, hint), t t a timestamp, and κ t contextual metadata (course, resource, device, instructor policy). Let ψ : A × K → Σ * be a tokenizer that renders an action and its salient context as a short textual action token over vocabulary Σ . For a prefix s u , 1 : t , we write x u , 1 : t = ψ ( s u , 1 : t ) .
We study two prediction tasks used throughout:
Next - Action Prediction   ( NAP ) : y u , t act = a t + 1 ∈ A pred , Risk Prediction   ( RP ) : y u , t risk ∈ { 0 , 1 } for a horizon H ( e . g . , dropout within H ) .
A model f θ , ϕ maps a prompted token prefix to a distribution over targets. We decompose f into a frozen backbone LLM with parameters θ and trainable adapters ϕ . The same notation will be used in Section 4.

3.2. Student Action Tokens and the ActionGraph

To inject structural cues beyond raw text, we maintain a typed ActionGraph
G = ( V , E , τ ) , V = A ∪ R ∪ O ,
where nodes include actions A , resources R (items, pages, videos), and organizational entities O (course, unit, instructor). Each edge e = ( v → v ′ , ℓ ) ∈ E is typed by ℓ ∈ { precedes ,   requires ,   same _ skill ,   same _ unit ,   prereq ,   cohort } with a time-decay τ ( e ) ∈ R ≥ 0 . For a prefix s u , 1 : t , we form a small ego-net G u , t around recently visited nodes and summarize it as compact behavior descriptors (counts, decays, typed degrees). The behavior prompt builder Π ( s u , 1 : t ,   G u , t ) renders these descriptors as natural language clauses prepended to the tokenized prefix:
b u , t = Π ( s u , 1 : t , G u , t ) ∈ Σ * , x ˜ u , 1 : t = [ b u , t ; x u , 1 : t ] .
This construction will be used by BP–FIT in Section 4.
We note that our CBR regularizer penalizes regime-specific risk dispersion and first-order sensitivity, encouraging h u , t to encode behaviorally stable cues rather than spurious instructional shortcuts. Unlike personalized meta-learning approaches [8], we retain a single global adapted model, simplifying deployment in cross-institution analytics. Compared with prototype-based federated methods such as FedProto and supervised prototype alignment, ProtoAlign uses privatized class anchors computed in a projected LLM representation space, and aggregates only clipped, noised sufficient statistics under secure aggregation. This design allows us to derive an explicit alignment gain term in the convergence bound (Section 5), rather than treating prototypes as a heuristic regularizer. Likewise, CBR differs from invariant risk minimization and environment-invariant prediction in that (i) it operates on automatically induced instructional regimes derived from behavior graphs instead of externally labeled environments, and (ii) it regularizes the risk head through a dispersion and first-order invariance penalty that is compatible with client-level differential privacy, without sharing environment labels or per-regime statistics across institutions.

3.3. Backbone LLM and Adapter Parameterization

Let LLM θ produce hidden states h u , t ∈ R d at the final token of x ˜ u , 1 : t . We train lightweight low-rank adapters (e.g., LoRA-style) at selected attention/MLP layers: for a weight matrix W ∈ R m × n , we add Δ W = A B with A ∈ R m × r , B ∈ R r × n , r ≪ min { m , n } . All trainable parameters across layers are collected in ϕ . Two task heads share the representation
p ϕ act ( · | x ˜ u , 1 : t ) = softmax W act h u , t , p ϕ risk ( 1 | x ˜ u , 1 : t ) = σ w ⊤ h u , t + b .
We will refer to any intermediate representation used for alignment as z u , t = P h u , t for a fixed projection P.

3.4. Federated Protocol and Privacy Model

Training proceeds in rounds r ∈ [ R ] with a subset S r ⊆ [ C ] of participating clients. Each selected client initializes ϕ ( r , 0 ) ← ϕ ( r ) , performs τ local steps to obtain ϕ c ( r , τ ) , and returns an update Δ ϕ c ( r ) = ϕ c ( r , τ ) − ϕ ( r ) . We use weighted aggregation with w c = | D c | / ∑ i ∈ S r | D i | .
Local objectives. For client c with index set Ω c   =   { ( u , t ) }
L c NAP ( ϕ ) = 1 | Ω c | ∑ ( u , t ) ∈ Ω c CE p ϕ act ( · | x ˜ u , 1 : t ) , y u , t act ,
L c RP ( ϕ ) = 1 | Ω c | ∑ ( u , t ) ∈ Ω c CE p ϕ risk ( · | x ˜ u , 1 : t ) , y u , t risk .
Section 4 augments these with prototype alignment and causal regularization.
Threat model. The server is honest-but-curious: it orchestrates training but should not learn individual updates. Clients may be heterogeneous and partially participating. We assume a reliable secure aggregation primitive that reveals only aggregated statistics to the server.
Differential privacy at client level. Before secure aggregation, each update is clipped and noised:
Δ ¯ ϕ c ( r ) = clip Δ ϕ c ( r ) , S + N 0 , σ 2 S 2 I .
Let q be the expected participation rate per round and let A RDP ( q , σ , R ) denote a Rényi–DP accountant that composes sampling and Gaussian noise across R rounds to yield an ( ε , δ ) bound for any target δ ∈ ( 0 , 1 ) . We report ε minimized over Renyi order α ≥ 1 . The effective privacy unit is one client (institution). All results in Section 5 will specify ( ε , δ ) , S, σ , q, and R.

3.5. Prototype Anchors and Invariance Cues

Heterogeneity induces client-specific drifts in representation space. For each class k ∈ A pred , we define a local prototype on client c:
μ c , k = 1 | B c , k | ∑ ( u , t ) ∈ B c , k z u , t , B c , k = { ( u , t ) ∈ Ω c : y u , t act = k } .
Clients share only masked prototypes through secure aggregation (masking/noise details in Section 4), yielding global anchors π k used for ProtoAlign.
Student behavior is also moderated by instructional regimes s ∈ S (e.g., assessment-heavy vs. mastery-based). We extract coarse regime indicators from G u , t and metadata into a discrete variable s u , t . The causal regularizer in Section 4 enforces stability of risks with respect to s by penalizing dispersion of conditional risks across regimes. For reference, define per-regime empirical risks on client c:
R ^ c ( s ) = 1 | Ω c ( s ) | ∑ ( u , t ) ∈ Ω c ( s ) CE p ϕ risk ( · | x ˜ u , 1 : t ) , y u , t risk , Ω c ( s ) = { ( u , t ) ∈ Ω c : s u , t = s } .

3.6. Tasks, Metrics, and Heterogeneity Index

We evaluate NAP with top-1 accuracy, macro-F1, and ROC–AUC. RP is evaluated with ROC–AUC, AUPRC, and calibration. Given M probability bins { B m } m = 1 M , the expected calibration error is
ECE = ∑ m = 1 M | B m | N | acc ( B m ) − conf ( B m ) | .
To quantify non-IIDness across clients, we report a label skew index based on total variation of next-action marginals:
TV – Skew = 2 C ( C − 1 ) ∑ 1 ≤ i < j ≤ C 1 2 ∑ k ∈ A pred | p i ( k ) − p j ( k ) | ,
where p c ( k ) is the empirical frequency of class k on client c. We additionally state the Dirichlet concentration α part used to synthesize heterogeneous partitions when needed in Section 5.
Summary of symbols. C (clients), D c (local data), s u (sequence), ψ (action tokenizer), G ,   G u , t (ActionGraph and ego-net), Π (behavior prompt), θ (frozen LLM), ϕ (adapters), h u , t / z u , t (hidden/representation), μ c , k / π k (local/global prototypes), S ,   σ ,   q ,   R (DP/participation parameters), s (instructional regime), and evaluation metrics as above. These notations are used consistently in Section 4 and Section 5.

4. Methodology

We present BAF–FedLLM, a three-part framework built on the preliminaries of Section 3: BP–FIT for behavior-prompted federated instruction tuning of adapters, ProtoAlign for cross-client prototype alignment under secure aggregation, and CBR for causal behavior regularization that enforces regime-invariant risk. We then provide a unified training algorithm, convergence and privacy guarantees, and a communication analysis. Throughout, the backbone LLM θ is frozen and we optimize only the adapter parameters ϕ and task heads. Algorithm 1 and Figure 1 show a general pipeline of our proposal.
Algorithm 1 Training and deployment of the privacy-preserving federated LLM.
  1:
Input: Frozen LLM backbone θ , adapter parameters ϕ , privacy budget ( ε , δ ) , clip norm S, noise multiplier σ , number of rounds R
  2:
for each round r = 1 , … , R  do
  3:
   Server samples a subset of clients C r
  4:
   for each client c ∈ C r in parallel do
  5:
     Construct behavior graph and behavior prompts from local logs
  6:
     Form model input (system prompt + behavior prompt + query)
  7:
     Initialize local adapter parameters ϕ c ← ϕ
  8:
     for local steps t = 1 , … , τ  do
  9:
        Compute task loss on local mini-batch
10:
        Take gradient step on ϕ c (backbone θ is frozen)
11:
     end for
12:
     Clip update: Δ ϕ c ← clip ( ϕ c − ϕ , S )
13:
     Add noise: Δ ϕ ˜ c ← Δ ϕ c + N ( 0 , σ 2 S 2 I )
14:
     Send Δ ϕ ˜ c to server (via secure aggregation)
15:
   end for
16:
   Server aggregates: ϕ ← ϕ + 1 | C r | ∑ c ∈ C r Δ ϕ ˜ c
17:
end for
18:
Output: Global privacy-preserving model ( θ , ϕ ) deployed to institutions
Figure 1. High-level overview of the proposed privacy-preserving federated LLM framework. Clients construct behavior prompts from local interaction logs, adapt frozen LLM backbones via parameter-efficient adapters under client-level differential privacy, and share only clipped and noised aggregates with the server. The server updates the global adapters and redistributes the model without accessing raw texts or identifiers.

4.1. BP–FIT: Behavior-Prompted Federated Instruction Tuning

BP–FIT adapts a frozen backbone LLM θ to student interaction streams by prepending compact behavior prompts to the tokenized action prefix and training only low-rank adapters ϕ locally under clipping and noise. The design emphasizes three properties: (i) semantic grounding via ActionGraph-derived descriptors, (ii) robustness to missing or noisy metadata through stochastic prompting with self-distillation, and (iii) privacy/efficiency from parameter-efficient updates and client-level differential privacy.

4.1.1. Action-to-Text Tokenization and Behavior Prompt Construction

Given a learner prefix s u , 1 : t = ( a 1 , t 1 , κ 1 ) , … , ( a t , t t , κ t ) on client c, the tokenizer ψ renders a short textual action token sequence x u , 1 : t = ψ ( s u , 1 : t ) over vocabulary Σ (Section 3). To expose structural regularities from the ActionGraph G without leaking raw identifiers, a prompt builder Π maps ( s u , 1 : t , G u , t ) to a fixed-form clause string:
b u , t = skill = s ★ ; recent _ correct = ρ t ; same _ unit _ ratio = u t ; recency = d t ; policy = p t .
Here s ★ ∈ S skills is the modal skill in a sliding window; ρ t = 1 W ∑ j = 1 W I [ correct t − j + 1 ] ; u t = # { actions in current unit } W ; d t summarizes inter-event gaps via multi-scale decay d t = ∑ ℓ = 1 L α ℓ exp ( − λ ℓ Δ t t ) with ∑ ℓ α ℓ = 1 and Δ t t = t t − t t − 1 ; and p t ∈ { assessment ,   practice ,   mastery ,   mixed } is an instructional regime cue derived from O nodes linked to recent actions. To limit cardinality and prevent identifier leakage, continuous fields are discretized by a public quantizer R with bin set B , and high-cardinality categories (e.g., resource IDs) are mapped to stable hashed buckets h ( · ) with K h bins. The prompted sequence is
x ˜ u , 1 : t = [ b u , t ; x u , 1 : t ] ,
with a strict token budget for b u , t to preserve context for x u , 1 : t . The builder caches rolling statistics of G u , t (typed degrees, recency counts) to keep amortized cost O ( 1 ) per step.
In all experiments, the ActionGraph G contains nodes for actions, resources (items, videos, pages), and organizational entities (course, unit, instructor). We keep edge types { precedes ,   same _ skill ,   same _ unit ,   prereq ,   cohort } and apply an exponential time decay with λ ℓ ∈ { 10 − 2 , 10 − 3 , 10 − 4 } for short-, medium-, and long-range dependencies, respectively. Behavior descriptors such as recent correctness ρ t and same-unit ratio u t are computed over a sliding window of size W = 20 . Continuous quantities are discretized into 8 bins using a public quantile estimator fitted on a held-out validation subset, and high-cardinality identifiers (e.g., resource IDs) are mapped to K h = 512 hashed buckets to avoid leaking raw identifiers. The behavior prompt budget is fixed to B prompt tokens per dataset, and prompts are truncated from the least informative fields if they exceed this budget.

4.1.2. Stochastic Prompting and Self-Distilled Objective

Institutional logs vary in fidelity; some clients may lack policy tags or fine-grained skills. To make predictions stable under missing fields, BP–FIT applies prompt dropout. For each of the five fields, we sample a Bernoulli mask m ∈ { 0 , 1 } 5 with rate p drop and elide masked clauses, producing two paired views per example: an on view with mask m and an off view with the complementary mask m ¯ . Let h u , t denote the final hidden state of LLM θ on x ˜ u , 1 : t and P a fixed projection yielding z u , t = P h u , t . The action and risk heads share h u , t :
p ϕ act ( · | x ˜ u , 1 : t ) = softmax ( W act h u , t ) , p ϕ risk ( 1 | x ˜ u , 1 : t ) = σ ( w ⊤ h u , t + b ) .
Denoting predictions from the on and off views by p ϕ act , on / off and p ϕ risk , on / off , the local BP–FIT loss on client c combines task cross-entropy with a self-distillation term that enforces prompt invariance:
L c BP ( ϕ ) = L c NAP ( ϕ ) + λ risk L c RP ( ϕ ) + λ cons · 1 | Ω c | ∑ ( u , t ) ∈ Ω c KL p ϕ act , on ∥ p ϕ act , off + KL p ϕ risk , on ∥ p ϕ risk , off .
The KL terms encourage consistency when salient descriptors are absent, improving calibration and reducing shortcutting on spurious prompt fields. We linearly warm up λ cons over the first R warm rounds to avoid underfitting early in training.
BP–FIT trains only low-rank adapters injected at selected attention and MLP layers. For a backbone weight W ∈ R m × n , the trainable delta is Δ W = A B with A ∈ R m × r , B ∈ R r × n , r ≪ min { m , n } . The parameter set ϕ aggregates all adapter pairs and the two task heads. Unless otherwise stated, local optimization uses Adam with learning rate 5 × 10 − 4 , weight decay 10 − 2 , and mini-batch size 64, with T local = τ = 5 local steps per communication round. We apply gradient clipping ∥ ∇ ϕ ∥ 2   ≤   S with S = 1.0 and label smoothing of 0.1 on NAP to temper overconfidence. Only the clipped update Δ ϕ c is released; before secure aggregation, it is perturbed by Gaussian noise with multiplier σ , yielding client-level ( ε , δ ) guarantees after composition across rounds. In all reported configurations, we use σ = 1.2 for adapter updates and ( S π , σ π , σ n ) = ( 1.0 , 0.8 , 0.5 ) for prototype messages, resulting in ε ∈ [ 1.61 , 1.72 ] at δ = 10 − 5 . No tokens, prompts, counts, or ActionGraph features leave the client. Communication per round is O ( r ( m + n ) ) numbers for adapters plus a small overhead for prototypes, independent of raw sequence length.
By canonically rendering a few stable descriptors from G u , t and enforcing invariance to their omission, BP–FIT steers LLM θ toward pedagogically meaningful structure while remaining resilient to heterogeneous logging. The projected states z u , t produced here are subsequently consumed by ProtoAlign for cross-client alignment, and the regime indicators implicit in p t integrate with CBR to regularize risk across instructional regimes, ensuring methodological cohesion across the next subsections.

4.2. ProtoAlign: Cross-Client Prototype Alignment

Objective. ProtoAlign mitigates representation drift caused by non-IID client distributions by aligning projected states z u , t = P h u , t to global class anchors { π k } k ∈ A pred that are computed from privatized, securely aggregated local prototypes. Unlike methods that exchange gradients or example features, ProtoAlign communicates only clipped, noisy sufficient statistics. This preserves client-level privacy and adds a small, count-proportional overhead to adapter updates.

4.2.1. Private Prototype Messaging and Anchor Estimation

On client c, the per-class prototype is μ c , k = 1 n c , k ∑ ( u , t ) ∈ B c , k z u , t with n c , k = | B c , k | . To bound sensitivity, we clip it to radius S π , obtaining μ ^ c , k = μ c , k · min 1 , S π / ∥ μ c , k ∥ 2 . Clients send only masked sums through secure aggregation:
s c , k = n c , k μ ^ c , k + N ( 0 , σ π 2 S π 2 I ) , n ˜ c , k = n c , k + N ( 0 , σ n 2 ) .
The server receives s ˜ k = ∑ c ∈ S r s c , k and n ˜ k = ∑ c ∈ S r n ˜ c , k (but never per-client values) and forms a debiased, stabilized anchor estimate
π ^ k ( r ) = α k · s ˜ k max { 1 , n ˜ k } , α k = n ˜ k n ˜ k + ς n 2 ,
where ς n 2 ≈ | S r | σ n 2 is the aggregate count noise variance (known to the server from the number of participating clients), and α k ∈ ( 0 , 1 ] attenuates anchors estimated from few or noisy counts. To reduce high-variance fluctuations from σ π , anchors are exponentially averaged across rounds and ℓ 2 -normalized to match cosine similarity used downstream:
π k ← ( 1 − β ) π k + β π ^ k ( r ) ∥ π ^ k ( r ) ∥ 2 + ϵ , β ∈ ( 0 , 1 ] , ϵ > 0 .
Sensitivity and privacy. Clipping by S π ensures the per-client contribution to s ˜ k has ℓ 2 sensitivity at most S π ; the Gaussian mechanisms with multipliers ( σ π , σ n ) therefore compose (via subsampled RDP in Section 3) with the noised adapter updates to yield client-level ( ε , δ ) bounds. Because only sums are visible under secure aggregation, no per-client prototype or count is ever exposed.

4.2.2. Alignment Loss with Prior Correction and Hard Negatives

Given privatized anchors, each client aligns its representations via a supervised contrastive objective. For a labeled pair ( z u , t , k ) with k = y u , t act , define
L c PA ( ϕ ) = − 1 | Ω c | ∑ ( u , t ) ∈ Ω c log exp sim ( z u , t , π k ) / τ PA ∑ j ∈ A pred ω c , j exp sim ( z u , t , π j ) / τ PA ,
where sim ( z , π ) = z ⊤ π ∥ z ∥ 2 ∥ π ∥ 2 and τ PA > 0 . To counter label–prior mismatch across clients, we introduce prior correction weights
ω c , j = P ^ ( j ) p ^ c ( j ) + ϵ γ , p ^ c ( j ) = n c , j ∑ ℓ n c , ℓ , P ^ ( j ) ∝ ∑ c ∈ S r n ˜ c , j ,
with exponent γ ∈ [ 0 , 1 ] controlling the strength of reweighting. This emphasizes underrepresented classes on each client without revealing exact priors. For hard negatives, we optionally sharpen the denominator by upweighting anchors j whose similarity exceeds a margin κ , i.e., set ω c , j ← ω c , j ( 1 + λ hard I [ sim ( z , π j ) > κ ] ) , which accelerates separation under heavy class overlap.
The anchor-based contrast pulls representations toward class-level centroids that average away client-specific nuisance variability while pushing away other classes globally. This reduces the effective smoothness constant and the drift term in the federated convergence bound (Section 3), improving both optimization and calibration under non-IID partitions.

5. Theoretical Analysis

This section revises and expands the guarantees that underlie BAF–FedLLM. We first formalize assumptions and the unified objective that couples BP–FIT, ProtoAlign, and CBR. We then present non-asymptotic convergence bounds that make explicit the roles of DP noise, client drift, and alignment/invariance. Next, we provide client-level differential privacy accounting that composes noised adapter updates with privatized prototype messaging under secure aggregation. Finally, we analyze mixture shift generalization, calibration, and the effect of low-rank adapters on optimization bias.

5.1. Setup, Assumptions, and Unified Objective

Notation 1. 
There are C clients indexed by c ∈ [ C ] . Client c holds data D c and induces a loss F c ( ϕ ) = E ξ ∼ D c [ L c ( ϕ ; ξ ) ] , where L c combines BP–FIT, ProtoAlign, and CBR. The global objective is the mixture
F ( ϕ ) = ∑ c = 1 C p c F c ( ϕ ) , p c = | D c | ∑ j = 1 C | D j | .
Per round r, a subset S r participates with rate q. Each selected client takes τ local steps, returning a clipped and noised update Δ ¯ ϕ c ( r ) , and the server applies the weighted update. Prototypes are shared as noised sums through secure aggregation (Section 3).
Assumption 1. 
We adopt standard FL conditions:
  • F is L smooth: ∥ ∇ F ( ϕ ) − ∇ F ( ϕ ′ ) ∥ 2   ≤   L ∥ ϕ − ϕ ′ ∥ 2 .
  • Stochastic gradients have bounded variance: E ∥ ∇ L c ( ϕ ; ξ ) − ∇ F c ( ϕ ) ∥ 2 2 ≤ σ g 2 .
  • Client drift at a minimizer ϕ ★ is ζ 2 = ∑ c p c ∥ ∇ F c ( ϕ ★ ) − ∇ F ( ϕ ★ ) ∥ 2 2 .
  • Adapter updates are clipped at radius S and perturbed by Gaussian noise N ( 0 , σ 2 S 2 I ) prior to secure aggregation. Prototype messages are clipped at S π and noised with multipliers ( σ π , σ n ) .
Unified objective. For each client
L c ( ϕ ) = L c NAP ( ϕ ) + λ risk L c RP ( ϕ ) ︸ BP – FIT tasks + λ cons D KL prompt ( ϕ ) + λ PA L c PA ( ϕ ) + λ disp L c disp ( ϕ ) + λ inv L c inv ( ϕ ) ,
where D KL prompt is the BP–FIT consistency term, L PA is the anchor-based InfoNCE loss, and L disp , L inv are the CBR penalties (all defined in Section 3 and Section 4).
We also define two helpful margins that quantify the regularizing effect of ProtoAlign and CBR:
Δ align = E sim ( z , π y ) − max j ≠ y sim ( z , π j ) , Δ inv = ∑ s ∈ S ∇ ν R ^ c ( s ) ( ν w , b ) | ν = 1 2 2 .
Larger Δ align and smaller Δ inv both improve optimization, as formalized next.

5.2. Convergence with Non-IID Data, DP Noise, and Alignment/Invariance

Let T = q C R τ be the expected number of local steps across R rounds and keep step size η ≤ 1 / ( 2 L ) .
Theorem 1 
(Stationarity under alignment and invariance). Under the assumptions above
1 R ∑ r = 0 R − 1 E ∥ ∇ F ( ϕ ( r ) ) ∥ 2 2 ≤ 2 F ( ϕ ( 0 ) ) − F ★ η T ︸ optimization + 2 L η σ g 2 + σ 2 S 2 ︸ stochastic + DP noise + 2 L 2 η 2 τ 2 ζ 2 ︸ client drift − c PA λ PA Δ align ︸ alignment gain − c CBR λ disp + λ inv Γ ︸ invariance gain .
Here c PA , c CBR > 0 are constants depending on temperature τ PA and the smoothness of the logistic head, and Γ is a regime variance surrogate that decreases as Δ inv decreases.
Sketch. The proof adapts the standard descent lemma for noisy local SGD with partial participation, adding two strongly concave regularizers: (i) a cosine similarity neighborhood induced by L PA that increases the margin Δ align and tightens the smoothness constant observed by the optimizer; (ii) CBR terms that reduce cross-regime variance in the gradients of the risk head, effectively shrinking the drift seen by the global model. The negative terms in (1) quantify these gains.
Corollary 1 
(PL condition). If F satisfies the Polyak–Łojasiewicz (PL) inequality with parameter μ > 0 , then for η ≤ min { 1 / ( 2 L ) , μ / ( 4 L 2 τ 2 ) } ,
E F ( ϕ ( R ) ) − F ★ ≤ ( 1 − η μ ) T · F ( ϕ ( 0 ) ) − F ★ + η L μ σ g 2 + σ 2 S 2 + L η τ 2 μ ζ 2
− η μ c PA λ PA Δ align + c CBR ( λ disp + λ inv ) Γ .
Thus alignment and invariance accelerate convergence and reduce the error floor created by DP noise and client drift.
Remark 1 
(Low-rank approximation bias). Let Δ W ★ be the full-rank optimal weight delta for a backbone layer and let Π r denote the best rank r approximation operator. If adapters implement Δ W = Π r ( Δ W ★ ) , then the approximation residual contributes an additive bias B r ∝ ∥ Δ W ★ − Π r ( Δ W ★ ) ∥ F 2 to the optimization term. Empirically, modest ranks (e.g., r = 8 ) keep B r small relative to the alignment/invariance gains.

5.3. Client-Level Differential Privacy with Secure Prototype Messaging

We analyze the composite mechanism releasing (i) adapter updates and (ii) prototype messages each round.
Mechanism Mupd. Each participating client releases Δ ¯ ϕ c ( r ) = clip ( Δ ϕ c ( r ) , S ) + N ( 0 , σ 2 S 2 I ) via secure aggregation. With subsampling rate q and R rounds, its Rényi DP cost is A RDP ( q , σ , R ) .
Mechanism Mproto. For each class k, client c sends s c , k = n c , k μ ^ c , k + N ( 0 , σ π 2 S π 2 I ) and n ˜ c , k = n c , k + N ( 0 , σ n 2 ) through secure aggregation. Clipping at S π bounds sensitivity and yields Rényi costs A RDP ( q , σ π , R ) and A RDP ( q , σ n , R ) .
Theorem 2 
(Client–DP composition). For any target δ ∈ ( 0 , 1 ) , the combined mechanism ( M upd , M proto ) is ( ε , δ ) client–DP with
ε ≤ min α > 1 A RDP ( q , σ , R ) + A RDP ( q , σ π , R ) + A RDP ( q , σ n , R ) ⇒ ( ε , δ ) .
Secure aggregation ensures the server observes only sums across clients; per-client messages remain hidden even from an honest-but-curious server. The privacy unit is an entire institution.
Corollary 2 
(Typical budgets). With ( q , R ) = ( 0.1 , 150 ) and multipliers ( σ , σ π , σ n ) = ( 1.2 , 0.8 , 0.5 ) , the above yields ε in the range 1.6 – 1.8 for δ = 10 − 5 , consistent with Section 5.

5.4. Mixture Shift Generalization, Calibration, and Communication Complexity

Generalization across client mixtures. Let P be the training mixture over clients and Q an unseen evaluation mixture (e.g., different cohort proportions). Consider a linear action head on unit norm features with Lipschitz constant L act = ∥ W act ∥ 2 . Define class conditional prototype drift
δ k = ∥ E P [ z | y = k ] − E Q [ z | y = k ] ∥ 2 and Δ prior = ∥ p P − p Q ∥ 1 ,
where p P , p Q are label marginals. Then for cross-entropy loss ℓ
| E Q [ ℓ ] − E P [ ℓ ] | ︸ mixture shift gap ≤ L act ∑ k π k δ k + C Δ prior ,
for a universal constant C. ProtoAlign contracts δ k by aligning client-level features to common anchors, while BP–FIT reduces sensitivity to metadata gaps, jointly tightening this bound.
Calibration. Let logits for the risk head be z = w ⊤ h + b with Lipschitz constant L z in h . If CBR reduces the across-regime logit variance by a factor ρ < 1 , then for standard binning estimators, the expected calibration error satisfies
ECE with CBR ≤ ρ ECE without CBR + O 1 N ,
where N is the number of evaluation points. Empirically, we observe ρ ≈ 0.72 – 0.76 (Section 5), matching the 24– 28 % ECE reductions.
Communication complexity. Each round, a client transmits
p adpt · b ︸ adapter update + K d · b ︸ prototype sums + K · b ︸ noisy counts bits ,
with bitwidth b, class count K, and representation dimension d. Since p adpt ≪ | θ | and K is modest, adapter updates dominate; ProtoAlign adds a small fixed overhead. Low-rank adapters thus allow stronger DP noise at a similar bandwidth compared to full fine-tuning, without materially changing convergence (Remark above).

6. Experiments

We empirically validate BAF–FedLLM on three public education datasets with institution-level partitions and non-IID behavior: EdNet (clickstream-based K–12) (https://github.com/riiid/ednet, accessed on 9 October 2025), ASSISTments (K–12 tutoring) (https://sites.google.com/site/assistmentsdata/, accessed on 9 October 2025), and OULAD (open university) (https://analyse.kmi.open.ac.uk/open-dataset, accessed on 9 October 2025 or https://doi.org/10.1038/sdata.2017.171, accessed on 9 October 2025). We evaluate the two tasks defined in Section 3: next-action prediction (NAP) and risk prediction (RP). All numbers are averaged over five seeds; we report means and note significance via paired t-tests across clients ( p < 0.01 unless stated). The same notation as in Section 3 and Section 4 is used throughout.

6.1. Setup

Corpora and tasks. We evaluate BAF–FedLLM on three public learning platforms with heterogeneous behavior and governance constraints: EdNet (clickstream-based K–12), ASSISTments (tutoring), and OULAD (open university). Following Section 3, each interaction is rendered to an action token and augmented by a compact behavior prompt derived from the ActionGraph ego-net. The two prediction tasks are (i) next-action prediction (NAP) over a fixed action alphabet A pred and (ii) risk prediction (RP) for near-term disengagement. For K–12 (EdNet/ASSISTments), we label RP for a H = 28 day horizon; for OULAD, whose modules are longer, we use H = 42 days. Table 1 summarizes the corpora after standard cleaning (de-duplication, timestamp sanity checks, anonymization) and tokenization. We cap sequences at L max tokens via head–tail truncation and constrain prompts to a budget B prompt to preserve context length for actions.
Table 1. Corpora and tokenization. C clients are derived from institutional metadata; L max is the sequence cap; B prompt caps the behavior prompt. NAP uses K = | A pred | = 10 action types across all datasets. RP horizon H is 28 days (EdNet/ASSISTments) and 42 days (OULAD).
Federated partitioning and non-IIDness. Clients correspond to institution-level units (schools/classes in EdNet/ASSISTments; module presentations in OULAD). Where metadata is sparse, we synthesize heterogeneity by Dirichlet partitioning with concentration α part over next-action classes. We quantify label skew by the TV–skew index from Section 3; empirical values are reported in Table 2 and visualized in Figure 2. To probe sensitivity to heterogeneity, we also generate auxiliary splits at α part ∈ { 0.1 , 0.3 , 0.5 , 1.0 } and track the induced skew (Figure 3).
Table 2. Federated protocol and privacy configuration. Shared defaults across datasets unless noted: R = 150 , q = 0.1 , τ = 5 , rank r = 8 , learning rate η = 5 × 10 − 4 , EMA β = 0.5 , temperature τ PA = 0.2 . TV–skew estimated on training splits; ε at δ = 10 − 5 .
Figure 2. Measured non-IID label skew. Bars show TV–skew for each dataset (left to right: EdNet, ASSISTments, OULAD). No legend is shown by design; bar ordering conveys the dataset identity.
Figure 3. Heterogeneity calibration. Solid curve: empirical TV–skew observed on EdNet under synthetic partitions at α part ∈ { 0.1 , 0.2 , 0.3 , 0.5 , 1.0 } . Dashed curve: analytical expectation for Dirichlet sampling with the same class prior. No legend is shown; solid vs. dashed are described here.
Backbone, adapters, and privacy. The backbone LLM θ is frozen; we train LoRA-style adapters of rank r = 8 on selected attention/MLP layers with shared task heads. Training proceeds for R = 150 rounds with partial participation q = 0.1 and τ = 5 local steps. Client updates are clipped at S = 1.0 and noised with multiplier σ = 1.2 ; prototype messages use ( S π , σ π , σ n ) = ( 1.0 , 0.8 , 0.5 ) . Subsampled Rényi accountants yield client-level budgets ε ∈ [ 1.61 , 1.72 ] at δ = 10 − 5 ; details per dataset appear in Table 2. All evaluations use five seeds and report mean ± std over clients; calibration uses M = 15 equal-width bins.
Evaluation protocol. For NAP, we report top-1 accuracy, macro-F1, and ROC–AUC; for RP, we report ROC–AUC, AUPRC, and ECE with binning-corrected estimates. Paired t-tests across clients (per seed) assess significance at p < 0.01 . Unless noted, hyperparameters are fixed across datasets (Table 2); ablations vary one factor at a time. All results are computed per client and averaged to respect federated evaluation, with stratified confidence intervals across seeds. (Our empirical reliability analysis centers on accuracy, calibration, and robustness to client sampling and label skew; more fine-grained LLM-specific probes such as template sensitivity, sequence perturbations, and held-out institution generalization are left to future work (Section 7).)
Optimization and hyperparameters. For all datasets, we keep the federated protocol fixed: R = 150 rounds, participation rate q = 0.1 , and τ = 5 local steps with adapter rank r = 8 . Clients use Adam with learning rate 5 × 10 − 4 , weight decay 10 − 2 , and batch size 64. Prompt dropout is set to p drop = 0.15 , the alignment temperature to τ PA = 0.2 , and the invariance weight to λ inv = 0.1 , matching the configuration used in the ablations of Section 6.3. All default hyperparameters are summarized in Table 3. More details about our experimental settings are given in Appendix A.
Table 3. Main notation and default hyperparameters used in experiments.

6.2. Main Results

Overall performance. Table 4 and Figure 4 summarize next-action prediction (NAP). Across EdNet/ASSISTments/OULAD, BAF–FedLLM improves ROC–AUC over the strongest baseline by + 0.041 / + 0.039 / + 0.039 absolute (relative +5.0%/+4.9%/+5.2%). These gains translate to + 2.8 – 3.4 points in top-1 accuracy and + 3.0 – 3.8 points in macro-F1, reflecting better class balance and fewer false positives on rare actions. Pairwise client-level t-tests (five seeds) show significance at p < 0.01 on all datasets.
Table 4. NAP results (mean over five seeds; client-averaged). Bold indicates the best per dataset.
Figure 4. NAP ROC–AUC by dataset and method. Within each dataset group, the five bars (left to right) correspond to Local, FedAvg–Adapter, FedProx–Adapter, FedProto, and BAF–FedLLM. No legend is displayed by design; bar order conveys method identity.
Risk prediction and calibration. Table 5 and Figure 5 report risk prediction (RP). Relative to the best baseline ROC–AUC of 0.801/0.772/0.744, our method reaches 0.838/0.814/0.785. AUPRC improves by +0.051/+0.044/+0.046 absolute, and expected calibration error (ECE) drops by 28%/24%/24% (from 4.9/5.4/6.2 to 3.5/4.1/4.7). Improvements are consistent across clients (interquartile gains: AUC + 0.026 to + 0.051 ; ECE − 0.7 to − 1.9 points). These results are aligned with the design: BP–FIT stabilizes predictions under missing metadata, ProtoAlign reduces cross-client drift, and CBR suppresses regime-specific shortcuts, sharpening recall at low false positive rates and improving probability calibration.
Table 5. RP results (mean over five seeds; client-averaged). ECE is reported in percentage points with M = 15 bins. Bold indicates the best value per dataset. In the rest of our paper, the ↓ (or ↑) symbol indicates that lower (or higher) values are better.
Figure 5. RP precision–recall quality. Bars per dataset show AUPRC for the best baseline other than ours (left bar) and BAF–FedLLM (right bar). No legend is displayed; the caption states the bar semantics.
Effect sizes and robustness. On EdNet, per-client Cohen’s d for NAP AUC between BAF–FedLLM and the best baseline is 0.71 (medium–large). Under resampling of client participation ( q ∈ [ 0.05 , 0.2 ] ), average NAP AUC varies by ≤ 0.006 , indicating robustness to partial participation. Across seeds, standard deviations remain small (AUC ≤   0.006 , AUPRC ≤   0.008 , ECE ≤   0.3 ), consistent with reduced variance from prototype alignment and invariance regularization.
Our baseline suite focuses on local training, FedAvg/FedProx with adapters, and prototype-based FedProto because these methods are representative of global model federated learning under non-IID behavior and can be implemented with frozen LLM backbones and client-level DP using clipped/noised adapter updates. In contrast, drift correction via control variates (e.g., SCAFFOLD-style methods), adaptive server optimizers (FedOpt), and fully personalized FL often assume full-model updates, additional global control states, or client-specific heads, which complicate our privacy and communication budget and depart from the single deployable global model considered here. We view ProtoAlign and CBR as complementary to these optimizer- and personalization-level techniques, and we leave systematic comparison and integration with FedOpt/SCAFFOLD/personalized FL as important directions for future work.
Interpretation. NAP gains are largest in clients with high label skew and sparser prompts, consistent with ProtoAlign contracting inter-client prototype dispersion while BP–FIT enforces prompt invariance. RP benefits most on cohorts exhibiting assessment-heavy regimes; CBR dampens regime-specific overconfidence, lowering ECE without sacrificing discrimination. Together these effects yield better calibrated, more transferable predictors under client-level DP.

6.3. Ablations and Analyses

Module contributions. We ablate each component of BAF–FedLLM on all datasets by removing ProtoAlign (–PA), BP–FIT (–BP), or CBR (–CBR), and by removing both alignment and invariance (–PA, –CBR). As a sanity check, we also report a non-private variant (No DP, σ = 0 ) to quantify the privacy cost. Table 6 shows that ProtoAlign delivers the largest accuracy gain under label skew (AUC drops by 1.2 – 1.5 points when removed), BP–FIT adds robustness to missing metadata (AUC drops by 0.6 – 0.9 points), and CBR primarily improves calibration (ECE increases by 0.4 – 0.9 points with small AUC change). Removing DP noise yields marginal accuracy increases (≤0.4 points), indicating our ( ε , δ ) budgets preserve most of the utility.
Table 6. Module ablation across datasets (mean over five seeds; client-averaged). NAP reports ROC–AUC; RP reports ROC–AUC and ECE (percentage points). Rows: full model and ablations.
Sensitivity to prompting, alignment temperature, and invariance strength. We vary prompt dropout p drop , alignment temperature τ PA , and invariance weight λ inv on EdNet while keeping privacy fixed. Table 7 indicates a broad plateau around ( p drop , τ PA , λ inv ) ≈ ( 0.15 , 0.2 , 0.1 ) ; too little dropout (overreliance on prompts) or too high temperature (weak alignment) degrades AUC and increases ECE. Strong invariance ( λ inv = 0.3 ) slightly decreases AUC but further reduces ECE, consistent with the invariance–accuracy trade-off captured in our theory.
Table 7. Sensitivity on EdNet with fixed privacy ( ε , δ ) ≈ ( 1.72 × 10 − 5 ) . We vary prompt dropout p drop , alignment temperature τ PA , and invariance weight λ inv ; other hyperparameters follow Section 4. Uplink is per-round client MB (32 bit).
Visual ablations and heterogeneity analysis. Figure 6 visualizes the EdNet NAP AUC across variants; the largest drop occurs when removing alignment and invariance jointly, confirming their complementarity. Figure 7 shows NAP AUC as heterogeneity increases (lower α part ): our method (solid line) maintains a higher AUC than the strongest baseline (dashed line) with widening gaps as skew intensifies, reflecting ProtoAlign’s contraction of cross-client prototype drift and BP–FIT’s prompt invariance.
Figure 6. Ablation on EdNet (NAP AUC). Bars (left to right) show Full, –PA, –BP, –CBR, –PA&–CBR, and NoDP. No legend is shown by design; ordering conveys the variant.
Figure 7. Sensitivity to heterogeneity. Lines show NAP AUC on EdNet as label skew increases (smaller α part ). Solid line: BAF–FedLLM. Dashed line: strongest baseline other than ours. No legend is displayed; styles and ordering are explained here.
Alignment and invariance are complementary: removing both yields the largest degradation. Prompt dropout provides robustness to missing metadata, but excessive dropout or overly high alignment temperature weakens the signal. Under severe non-IIDness, BAF–FedLLM maintains significantly higher accuracy than baselines, confirming that private prototype anchors plus behavior-aware prompting reduce cross-client drift without sacrificing privacy.

6.4. Privacy–Utility and Systems Analysis

Privacy sweeps and calibration. We vary the noise multiplier σ to sweep client-level privacy and report the resulting ( ε , δ ) along with utility and calibration. Table 8 shows EdNet results at fixed ( R , q , τ , S ) = ( 150 , 0.1 , 5 , 1.0 ) ; larger σ yields smaller ε (stronger privacy) with graceful utility degradation. At our default σ = 1.2 ( ε ≈ 1.72 ), NAP AUC is within 0.004 of the non-private variant and RP ECE remains below 3.6 percentage points. Figure 8 extends this analysis across all datasets by plotting NAP AUC versus ε ; the curves saturate near ε ≈ 1.7 , indicating a robust operating point for deployment.
Table 8. Privacy–utility sweep on EdNet at fixed ( R , q , τ , S ) = ( 150 , 0.1 , 5 , 1.0 ) and δ = 10 − 5 . Larger σ ⇒ smaller ε (stronger privacy). Reported are client-averaged means over five seeds.
Figure 8. Privacy–utility trade-off (NAP AUC vs. ε ). Three lines correspond to datasets: circles = EdNet, squares = ASSISTments, triangles = OULAD. No legend is displayed; marker shapes identify datasets as stated here.
Communication and computation. Communication is dominated by adapter updates; ProtoAlign adds a small fixed overhead proportional to the number of action classes K and representation dimension d. Table 9 decomposes the per-round uplink for BAF–FedLLM using 32 bit floats and r = 8 (LoRA rank). The downlink is just the adapter parameters, identical across datasets. Figure 9 visualizes the uplink breakdown (stacked bars) and confirms that prototypes contribute less than 5 % of the total budget. On a mid-range CPU client, prompt building and prototype accumulation add < 8 % runtime over adapter training; cached ActionGraph statistics keep the amortized cost per interaction near constant.
Table 9. Per-round communication breakdown for BAF–FedLLM (uplink, 32 bit floats). Adapter deltas dominate; prototypes add a small overhead that varies slightly with client mix.
Figure 9. Communication breakdown for BAF–FedLLM. Stacked bars per dataset show (bottom→top) adapter deltas, prototype sums, and noisy counts. Numbers above bars indicate total uplink per round.
The privacy sweep confirms the theory: DP noise sets a mild error floor, but alignment and invariance lower it, producing a flat utility region around ε ≈ 1.7 . Communication is adapter-dominated; ProtoAlign’s messages are lightweight and insensitive to sequence length. Together these properties enable practical, regulation-compatible deployment with predictable bandwidth and strong accuracy–calibration trade-offs.

6.5. Results on Broader Non-IID FL Baselines

To better align the experimental section with the scope of related work, we extend the baseline discussion to explicitly cover three widely used families of non-IID FL approaches: (i) drift correction (e.g., SCAFFOLD-style control variates), (ii) stronger server optimizers (FedOpt; e.g., server momentum/adaptive updates), and (iii) personalization (regularized or clustered personalization). We emphasize that in our setting—frozen LLM backbones, adapter-only client updates, and client-level DP—baseline inclusion must preserve both (a) a comparable trainable parameter budget and (b) the same privacy/communication constraints; we therefore focus on variants that can be implemented with clipped/noised adapter updates and without full-model personalization. Beyond accuracy and calibration, we report LLM-specific reliability diagnostics that probe whether learned behaviors are stable under prompt- and sequence-level variation. Concretely, we quantify (1) prompt robustness via controlled prompt dropout and objective-weight sensitivity (Table 10 and Figure 10), and (2) representation reliability via an empirical alignment margin diagnostic that measures how strongly examples are pulled toward correct class prototypes (Table 11 and Figure 11). These diagnostics directly complement the main task metrics and expose failure modes not visible from average accuracy alone.
Table 10. Prompt robustness and objective-weight sensitivity on EdNet under fixed privacy (client-averaged; mean over five seeds). We vary prompt dropout p drop , alignment temperature τ , and invariance weight λ inv (other hyperparameters fixed).
Figure 10. Prompt sensitivity on EdNet. Left: NAP AUC vs. prompt dropout p drop at fixed τ = 0.2 , λ inv = 0.1 . Right: NAP AUC vs. temperature τ at fixed p drop = 0.15 , λ inv = 0.1 .
Table 11. Empirical alignment margin Δ align ^ (higher is better), averaged over held-out clients.
Figure 11. Alignment margin Δ align ^ across datasets (values match Table 11).
For completeness, Table 12 summarizes module ablations and a no-DP control, illustrating that (i) removing prototype alignment (PA) or behavior prompting (BP) consistently degrades discrimination, and (ii) removing calibration-by-regularization (CBR) materially increases ECE, with the largest calibration regressions under strong non-IIDness.
Table 12. Module ablation across datasets (client-averaged; mean over five seeds). NAP/RP report ROC–AUC; ECE is in percentage points (lower is better).

6.6. Results on Invariance Gains

To connect the theoretical alignment gains and invariance gains to measurable experimental signals, we instrument training to log (i) representation–prototype geometry and (ii) scenario-based prediction stability, under the same federated and privacy configuration used for all main results. Unless otherwise stated, all numbers in this subsection are obtained with T = 200 rounds, client sampling rate q = 0.1 , E = 1 local epoch capped at S max = 200 steps, LoRA on q_proj/v_proj in all layers with ( r , α , drop ) = ( 8 , 16 , 0.05 ) , AdamW with lr 2 × 10 − 4 , weight decay 0.01 , effective batch size 16 (micro-batch 4, grad-accum 4), max sequence length 512, and client-level DP on adapter updates with clipping C = 1.0 , noise multiplier σ = 0.8 , and δ = 10 − 5 . Concretely, each participating client u sends a clipped/noised adapter delta Δ ˜ u t = Δ u t · min 1 , C ∥ Δ u t ∥ 2 + N ( 0 , σ 2 C 2 I ) , and the server aggregates Δ ˜ u t with example-count weights. All diagnostics below are computed from the resulting (DP-trained) global checkpoints, and are logged every 10 rounds on the same held-out evaluation split as the main metrics (client-wise computation, then client aggregation).
Representations and prototypes. Let h ℓ ( x ) ∈ R d be the final-layer hidden states for the prompt tokens. We define the instance representation as mean pooling over prompt tokens followed by unit normalization:
z ( x ) = meanpool ( h ℓ ( x ) ) ∥ meanpool ( h ℓ ( x ) ) ∥ 2 .
with defaultsLet { p k } k = 1 K be server-maintained unit-normalized action prototypes. Each round, for each sampled client u, we compute local per-class prototype summaries on the client evaluation mini-batches, s u , k = ∑ x ∈ B u , k z ( x ) and n u , k = | B u , k | , where B u , k are examples with label/action k. The client transmits ( s u , k , n u , k ) only for diagnostics logging (not used by any baseline unless stated), and we apply client-level DP to these transmitted statistics using the same mechanism as above but with a separate clipping/noise pair ( C p , σ p ) : s ˜ u , k = s u , k · min 1 , C p ∥ s u , k ∥ 2 + N ( 0 , σ p 2 C p 2 I ) ,   n ˜ u , k = n u , k , with defaults C p = 1.0 and σ p = 0.8 (same as model update DP), and server aggregation s ¯ k = ∑ u ∈ U t s ˜ u , k , p k = s ¯ k ∥ s ¯ k ∥ 2 . This makes the prototype geometry diagnostics privacy-consistent with the rest of training (and avoids leaking raw embedding statistics). For an instance with label/action y, we define the prototype margin
Δ proto ( x ) = cos ( z ( x ) , p y ) − max k ≠ y cos ( z ( x ) , p k ) ,
and report (i) E [ Δ proto ] , (ii) Pr ( Δ proto > η ) with η = 0.05 , and (iii) the minimum prototype separation Δ ^ p = min i ≠ j ∥ p i − p j ∥ 2 as an observable proxy for class separability constants in the alignment terms. We construct M = 4 behavioral scenarios per instance that preserve label semantics: (a) template paraphrase (choose uniformly from a fixed set of six paraphrased instruction templates), (b) history truncation (drop the oldest 20% events), (c) event dropout (drop 10% non-terminal events uniformly at random with a fixed seed per run), and (d) distractor insertion (insert one neutral sentence sampled from a fixed list of 20 distractors). For RP, we compute scenario sensitivity using the predicted risk probability (computed from the constrained logits of risk_yes/risk_no): p ^ ( risk _ yes ∣ x ) = exp ( ℓ yes ) exp ( ℓ yes ) + exp ( ℓ no ) . We measure predictive stability via Var risk ( x ) = Var m = 1 . . M p ^ ( risk _ yes ∣ x ( m ) ) , and representational stability via Δ rep ( x ) = E m = 1 . . M 1 − cos ( z ( x ) , z ( x ( m ) ) ) . We report federated aggregates across clients (median and 90th percentile); in the tables, we show the median (superscript 50). Table 13 and Table 14 and Figure 12, Figure 13 and Figure 14 make these theory-linked quantities empirically visible.
Table 13. Alignment and invariance observables at round T = 200 under client-level DP. We report alignment proxies (higher is better) and invariance proxies (lower is better), aggregated by client average.
Table 14. Scenario-wise risk dispersion. Mean absolute change in p ^ ( risk _ yes ) relative to the base prompt (lower is better).
Figure 12. Alignment curve (EdNet). Mean prototype margin E [ Δ proto ] vs. communication rounds.
Figure 13. Invariance curve (EdNet). Median scenario risk variance Var risk 50 vs. rounds; removing invariance regularization increases scenario sensitivity.
Figure 14. Client-level correspondence (EdNet). Each point is a client. x-axis: increase in mean prototype margin from round 0 to 200. y-axis: improvement in worst-client NAP AUC relative to FedAvg–Adapter.

6.7. Targeted LLM Reliability Suite

We also conduct a targeted reliability suite that probes (i) prompt/template sensitivity and (ii) robustness to sequence/input perturbations, and (iii) held-out institution generalization when institution/course identifiers are available. Unless stated otherwise, we evaluate with the same federated protocol, adapter budget, and client-level DP configuration as in the main experiments. Metrics are computed per client and aggregated by client average; we report mean over five seeds.
For each task (NAP and RP), we construct N tpl = 6 semantically equivalent prompt templates by paraphrasing instructions, reordering non-semantic fields, and swapping verbalizers while keeping the candidate set and output schema fixed. We report the mean/standard deviation across templates and the worst-template score. Table 15 shows that BAF–FedLLM improves average performance while reducing template-induced variance and worst-template degradation.
Table 15. Template sensitivity (six templates). Mean ± Std and worst-template. We report ROC–AUC for NAP and RP and ECE (pp, lower is better).
We apply controlled perturbations to the input history and/or prompt: (a) event dropout (delete a ρ fraction of non-terminal events), (b) adjacent swap (swap neighboring events with probability ρ ), (c) tail truncation (remove the oldest ρ fraction of events), and (d) distractor insertion (insert a neutral sentence into the prompt with probability ρ ). We report robustness curves and the AUC drop at fixed perturbation levels. Table 16 and Figure 15 show consistently smaller degradation for BAF–FedLLM.
Table 16. Perturbation robustness. AUC drop Δ AUC = AUC(perturbed)−AUC(clean) at ρ ∈ { 0.2 , 0.3 } (closer to 0 is better).
Figure 15. Robustness curves on EdNet. NAP ROC–AUC under event dropout (left) and tail truncation (right) as a function of perturbation rate ρ .
When institution/course IDs are available, we perform leave-one-institution-out (LOIO) evaluation: train on all but one institution and test on the held-out one without adaptation (0%) and with limited-label adaptation using 1% and 5% of held-out training labels. Table 17 summarizes LOIO robustness and adaptation sample efficiency.
Table 17. Held-out institution generalization (LOIO). ROC–AUC on the held-out institution with no adaptation (0%) and limited-label adaptation (1%, 5%).

6.8. Discussions

6.8.1. Relation to Other Privacy-Preserving Models

Our framework instantiates client-level differential privacy by clipping and noising adapter and prototype updates, yielding end-to-end DP guarantees for institutional participants. This is complementary to centralized DP training, black-box aggregation schemes that expose only aggregate answers to queries, and specialized methods for large-scale, high-dimensional data. While a full empirical comparison with these families of approaches is beyond the scope of this work, we discuss their conceptual relationship to our model in Section 2, and we view a systematic experimental study that includes centralized DP baselines, aggregate answer mechanisms, and high-dimensional privacy methods as an important direction for future work.

6.8.2. Alignment and Invariance Diagnostics

To empirically instantiate the alignment and invariance terms appearing in Theorem 1 and Corollary 1, we additionally monitor two diagnostics on the trained models. First, for ProtoAlign, we estimate an empirical alignment margin
Δ ^ align = E sim ( z , π y ) − max j ≠ y sim ( z , π j ) ,
where expectations are taken over held-out client data. Second, for CBR, we compute the variance of regime-conditional risks Γ ^ = ∑ s ∈ S Var R b ( s ) using the induced instructional regimes described in Section 3.2.
Table 18 reports Δ ^ align for the main baselines and BAF–FedLLM. Across all three datasets, enabling ProtoAlign increases the alignment margin substantially: compared with adapterized FedAvg/FedProx and FedProto, BAF–FedLLM with ProtoAlign yields gains of roughly 0.04 – 0.06 in absolute margin (e.g., from 0.111 to 0.163 on EdNet and from 0.119 to 0.174 on ASSISTments). This indicates that examples are pulled closer to their correct class prototypes and pushed away from competing prototypes, consistent with the “alignment gain” term that tightens the convergence bound in our analysis.
Table 18. Empirical alignment margin Δ ^ align for different configurations (higher is better). Values are averaged over held-out clients.
Table 19 summarizes Γ ^ together with expected calibration error (ECE) and ROC–AUC for risk prediction. On all datasets, adding CBR reduces the regime-wise risk variance by about 35– 45 % (e.g., 0.039 → 0.022 on EdNet and 0.044 → 0.026 on ASSISTments) and improves calibration (ECE decreases from 4.6 % to 2.8 % on EdNet and from 5.1 % to 3.3 % on ASSISTments), while slightly increasing ROC–AUC. These patterns match the predicted negative “invariance gain” term and the calibration analysis in Section 5, providing a clearer quantitative link between the theoretical quantities and the empirical ablations in Table 18 and Table 19.
Table 19. Regime-wise invariance diagnostic Γ ^ and calibration for risk prediction. Lower Γ ^ and ECE indicate better invariance and calibration; higher ROC–AUC indicates better discriminative performance.

7. Conclusions

We presented BAF–FedLLM, a behavior-aware federated framework for student actions analysis that preserves privacy while leveraging a frozen backbone LLM θ . By rendering interactions as action tokens and injecting ActionGraph-derived behavior prompts, BP–FIT trains only low-rank adapters ϕ under client-level differential privacy; ProtoAlign combats non-IID drift via contrastive alignment to securely aggregated, noisy class anchors { π k } ; and CBR discourages regime-specific shortcuts through dispersion and first-order invariance penalties. We provided a unified training algorithm, a convergence bound that disentangles stochastic, DP and drift terms with an alignment gain, and end-to-end ( ε , δ ) accounting that composes privatized adapter updates and prototype messages under secure aggregation. On EdNet, ASSISTments, and OULAD, BAF–FedLLM delivered relative AUC gains of 4.2–7.1%, reduced calibration error by up to 28 % , and cut uplink by ≈5× compared to full fine-tuning, at typical client-level budgets ε ≈ 1.7 with δ = 10 − 5 .
These results indicate that structured behavior prompting, private prototype alignment, and causal regularization together make privacy-preserving LLMs practical for cross-institution analytics. At the same time, our study is limited by a baseline suite centered on adapterized FedAvg/FedProx and FedProto and by reliability probes focused on accuracy, calibration, and heterogeneity sweeps. Future work will broaden comparisons to drift correction, adaptive server optimizers, and personalization methods, and will directly test LLM-specific robustness (e.g., template sensitivity, sequence perturbations, and held-out institution generalization), alongside online ActionGraph induction, semi-synchronous participation, fairness auditing across cohorts, and private personalization atop the global adapted model.

Author Contributions

Conceptualization, W.J., Z.Y. and H.G.; methodology, W.J.; software, W.J.; validation, W.J., Z.Y. and H.G.; formal analysis, W.J., Z.Y. and H.G.; investigation, W.J.; resources, Z.Y. and H.G.; data curation, W.J.; writing—original draft preparation, W.J.; writing—review and editing, W.J., Z.Y. and H.G.; visualization, W.J.; supervision, Z.Y. and H.G.; project administration, Z.Y. and H.G.; funding acquisition, Z.Y. and H.G. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by MOE (Ministry of Education in China) Liberal arts and Social Sciences Foundation, titled “Research on the Impact and Response Strategies of Generative Artificial Intelligence on the Chinese Labor Market” (23YJC790049); and 2024 Guangdong Provincial Education Science Planning Project (Higher Education Special) “Research on the Application Status, Influencing Factors, and Intervention Strategies of Generative Artificial Intelligence Tools for College Students” (Project No. 2024GXJK580).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Reproducibility Details

This appendix specifies the implementation details required to reproduce our results, including (i) action prompt construction and ActionGraph configuration, (ii) local training hyperparameters and federated protocol, and (iii) client-level differential privacy settings and accounting. Unless stated otherwise, all results in the main paper use the configurations below, and all hyperparameters are identical across datasets unless explicitly noted.

Appendix A.1. Action Prompt Construction

Each training/evaluation instance is converted into a structured action prompt consisting of a system instruction, a compact student state summary, an action candidate set (NAP only), and an output schema. We use the following canonical template (line breaks shown for clarity):
  • [SYSTEM] You are an educational assistant. Follow the output schema
  • exactly.
  • [STATE] <course_id>, <student_id_hash>, <time_index>, <history_summary>
  • [ACTIONS] <a_1>: <desc_1> ... <a_K>: <desc_K>
  • [GOAL] Predict the next action and/or the risk label, given the state
  • and actions.
  • [OUTPUT] {‘‘action’’: <a_k>, ‘‘confidence’’: <0..1>, ‘‘rationale’’:
  • <short>}
The confidence field is computed as the model’s normalized probability of the predicted action token (top-1) under the constrained action vocabulary, i.e., the softmax over the logits restricted to the action tokens. During evaluation, rationale is ignored for scoring and used only for qualitative inspection. We use fixed mapping from action symbols a_k to natural language descriptions, shared across all clients and rounds. For NAP, the action set size is dataset-specific: EdNet ( K = 10 ), ASSISTments ( K = 7 ), and OULAD ( K = 6 ). For RP, the label space is binary {risk_yes, risk_no}, and the [ACTIONS] block is omitted.
We cap the formatted history summary to L = 128 tokens; if the raw history exceeds the cap, we deterministically keep the last h = 8 events verbatim and compress earlier events into action counts (e.g., quiz_attempt: 12, video_watch: 4). We additionally cap the number of distinct action count keys in the compressed block to 12 (keeping the most frequent keys) to avoid prompt bloat. If the full prompt exceeds the model context limit, we apply left-truncation that preserves [SYSTEM], [ACTIONS] (or label space), [OUTPUT], and the most recent events in [STATE]. The action description strings are fixed and do not change across rounds.

Appendix A.2. ActionGraph Configuration

ActionGraph is a directed multigraph G = ( V , E ) where nodes are action types and edges encode temporal co-occurrence in student trajectories. We construct G once using the global training split and broadcast only its serialized configuration to all clients (no per-client graphs are built). Nodes are the unique action types ( | V | = K ). We add a directed edge ( a i → a j ) if a j follows a i within a window of w = 3 steps in any trajectory, and we accumulate counts c i j . Edge weights are row-normalized transition probabilities
W i j = c i j ∑ j ′ c i j ′ ( row - stochastic ) .
We prune outgoing edges by keeping the top- m = 4 successors per node (ties broken by count) and drop edges with c i j < 5 . Self-loops are included only if observed. When serializing the graph, we store (i) the ordered node list, (ii) for each node, the list of outgoing neighbors and weights, and (iii) the pruning hyperparameters ( w , m , c min ) .
Given the most recent observed action a t , we append a compact neighborhood block to the prompt:
  • [GRAPH] Recent action: a_t
  • Likely next: (a_j, W_tj) for top-m outgoing edges
Weights are rounded to two decimals. If a t is unavailable (start of trajectory), the [GRAPH] block is omitted. If a t has fewer than m outgoing edges after pruning, we list all available edges.

Appendix A.3. Federated Protocol and Local Training Hyperparameters

We keep the backbone LLM frozen and train LoRA adapters on attention projection matrices (q_proj, v_proj) in all transformer layers. Default LoRA parameters are r = 8 , α = 16 , dropout 0.05 , and we do not train bias terms. We apply LoRA to all transformer layers. Unless noted, we use bfloat16 mixed precision with dynamic loss scaling disabled (native bf16). The output is produced via constrained decoding over action symbols (NAP) or over {risk_yes, risk_no} (RP). Constrained decoding is implemented by masking the logits of all tokens not in the allowed set at the decoding step; we use greedy decoding (temperature =   0 ) for scoring.
Federated training uses T = 200 communication rounds with uniform client sampling. Each round samples a fraction q = 0.1 of clients without replacement; if the sampled set is empty (rare for small client pools), we resample once. The server aggregates adapter deltas using weighted averaging by the number of local examples (FedAvg-style aggregation on adapter parameters only). We optionally apply server momentum μ for FedAvgM baselines; for our default method, μ = 0 unless explicitly enabled.
Each selected client performs E = 1 local epoch per round, capped at S max = 200 optimizer steps (whichever is smaller). We shuffle within-client data each epoch. The client loss is
L = L task + λ inv L inv + λ proto L proto + λ cbr L cbr ,
with default weights λ inv = 0.1 , λ proto = 0.2 , λ cbr = 0.05 , and alignment temperature τ = 0.2 . For prototype terms, we use cosine similarity with a margin m proto = 0.1 and normalize embeddings to unit norm. For invariance regularization, we use two stochastic views per sample (see below) and an InfoNCE temperature τ inv = 0.1 . For calibration regularization, we use label smoothing ϵ ls = 0.05 and a confidence penalty weight equal to λ cbr .
We use AdamW with learning rate 2 × 10 − 4 , ( β 1 , β 2 ) = ( 0.9 , 0.999 ) , weight decay 0.01 , and ϵ = 10 − 8 . We apply linear warmup for the first 5 % of local steps and cosine decay thereafter within each round (client–local schedule). We use gradient clipping (pre-DP) with max global norm g max = 1.0 . Unless stated otherwise, micro-batch size is 4 with gradient accumulation 4 (effective batch size 16). We set dropout in the backbone to its default value (as provided by the pretrained checkpoint) and keep it enabled during training.
We tokenize using the model’s default tokenizer. Maximum sequence length is 512 tokens after formatting; we left-truncate if necessary. We use teacher forcing for computing token log probabilities; for NAP, the action token is placed as the first field in the JSON output and is the only token used for computing the classification loss (auxiliary tokens in the JSON are ignored for the task loss). For RP, the risk_yes/risk_no token is treated analogously.
For stochastic views used by invariance regularization, we apply (independently per view): prompt dropout with probability p drop = 0.15 over optional descriptive fields (never dropping the action candidates), history event dropout with probability p evt = 0.10 over non-terminal events, and random truncation of the compressed-count block with probability p cnt = 0.25 (dropping up to four count keys). These augmentations are disabled at evaluation time.
We fix seeds for client sampling, template selection (when using multiple templates), shuffling, and augmentation sampling, and report mean and standard deviation over five seeds: {0,1,2,3,4}. Unless stated otherwise, validation is performed every 20 rounds, selecting the checkpoint with the best validation NAP AUC (tie-breaking by lower ECE).

Appendix A.4. Client-Level Differential Privacy Settings and Accounting

We apply client-level DP using a Gaussian mechanism on each participating client’s adapter update (delta). For client u at round t with update Δ u t , we compute
Δ ˜ u t = Δ u t · min 1 , C ∥ Δ u t ∥ 2 + N ( 0 , σ 2 C 2 I ) ,
where C is the client update clipping norm and σ is the noise multiplier; the server aggregates Δ ˜ u t over sampled clients. We clip the full adapter update vector (all LoRA parameters concatenated). Unless stated otherwise, we do not apply per-layer clipping, and we apply clipping/noise after local training but before transmission.
All DP results in the main paper use C = 1.0 , σ = 0.8 , q = 0.1 , T = 200 , and δ = 10 − 5 . We use the same ( C , σ ) across datasets unless explicitly noted. For transparency, we also log the empirical distribution of ∥ Δ u t ∥ 2 before clipping at each round and report the fraction of clients that are clipped.
We use Rényi DP accounting for the subsampled Gaussian mechanism with sampling rate q composed over T rounds and convert to ( ε , δ ) at δ = 10 − 5 . We report ε at the end of training (round T) and log intermediate values at rounds { 50 , 100 , 150 , 200 } . When reporting NoDP controls, we set σ = 0 and keep all other settings identical (including clipping for numerical stability), isolating the effect of privacy noise.

Appendix A.5. Baseline Parity, Hardware, and Release Checklist

All baselines that update adapters use the same adapter configuration, optimizer, batch size, round budget, augmentation settings, and DP mechanism; differences are restricted to the algorithmic component under comparison (e.g., FedProx proximal term, FedProto prototype aggregation). For baselines with additional hyperparameters, we tune them on the same validation protocol as our method; the tuned ranges are FedProx μ ∈ { 10 − 4 , 10 − 3 , 10 − 2 } , FedAvgM momentum ∈ { 0.3 , 0.6 , 0.9 } , Ditto regularization λ ∈ { 0.01 , 0.1 , 1.0 } , and FedProto prototype momentum ∈ { 0.0 , 0.5 , 0.9 } .
Experiments are run on 8 × A100 (80 GB) with mixed precision (bfloat16). We use PyTorch (2.x), Transformers (4.x), and a standard FL simulation stack; we log all hyperparameters, seeds, and DP accountant outputs. We checkpoint the global adapter state every 10 rounds and evaluate on a held-out validation set every 20 rounds.
Our release includes (i) prompt templates, (ii) the serialized ActionGraph configuration (ordered node list and pruned weighted adjacency), (iii) full hyperparameter YAML files per dataset and per method, (iv) a script that deterministically replays client sampling and augmentations given the seed, and (v) a minimal end-to-end reproduction script that runs a small-client smoke test and checks that metrics match within tolerance.

References

  1. McMahan, H.B.; Moore, E.; Ramage, D.; Hampson, S.; Aguera y Arcas, B. Communication-Efficient Learning of Deep Networks from Decentralized Data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), Fort Lauderdale, FL, USA, 20–22 April 2017. [Google Scholar]
  2. Kairouz, P.; McMahan, H.B.; Avent, B.; Bellet, A.; Bennis, M.; Bhagoji, A.N.; Bonawitz, K.; Charles, Z.; Cormode, G.; Cummings, R.; et al. Advances and Open Problems in Federated Learning. Found. Trends Mach. Learn. 2021, 14, 1–210. [Google Scholar] [CrossRef] [Scilit]
  3. Hsu, T.M.H.; Qi, H.; Brown, M. Measuring the Effects of Non-Identical Data Distribution for Federated Visual Classification. arXiv 2019, arXiv:1909.06335. [Google Scholar] [CrossRef] [Scilit]
  4. Li, T.; Sahu, A.K.; Zaheer, M.; Sanjabi, M.; Talwalkar, A.; Smith, V. Federated Optimization in Heterogeneous Networks. Proc. Mach. Learn. Syst. 2020, 2, 429–450. [Google Scholar]
  5. Karimireddy, S.P.; Kale, S.; Mohri, M.; Reddi, S.; Stich, S.; Suresh, A.T. SCAFFOLD: Stochastic Controlled Averaging for On-Device Federated Learning. In Proceedings of the 37th International Conference on Machine Learning (ICML), Virtual, 13–18 July 2020. [Google Scholar]
  6. Reddi, S.J.; Charles, Z.; Zaheer, M.; Garrett, Z.; Rush, K.; Konečný, J.; Kumar, S.; McMahan, H.B. Adaptive Federated Optimization. In Proceedings of the International Conference on Learning Representations (ICLR), Virtual Event, 3–7 May 2021. [Google Scholar]
  7. Mohri, M.; Sivek, G.; Suresh, A.T. Agnostic Federated Learning. In Proceedings of the 36th International Conference on Machine Learning (ICML), Long Beach, CA, USA, 9–15 June 2019. [Google Scholar]
  8. Fallah, A.; Mokhtari, A.; Ozdaglar, A. Personalized Federated Learning with Theoretical Guarantees: A Model-Agnostic Meta-Learning Approach. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Virtual, 6–12 December 2020. [Google Scholar]
  9. Bonawitz, K.; Ivanov, V.; Kreuter, B.; Marcedone, A.; McMahan, H.B.; Patel, S.; Ramage, D.; Segal, A.; Seth, K. Practical Secure Aggregation for Privacy-Preserving Machine Learning. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security (CCS), Dallas, TX, USA, 30 October–3 November 2017. [Google Scholar]
  10. Abadi, M.; Chu, A.; Goodfellow, I.; McMahan, H.B.; Mironov, I.; Talwar, K.; Zhang, L. Deep Learning with Differential Privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security (CCS), Hofburg Palace, Austria, 24–28 October 2016. [Google Scholar]
  11. Mironov, I. Rényi Differential Privacy. In Proceedings of the 2017 IEEE 30th Computer Security Foundations Symposium (CSF), Santa Barbara, CA, USA, 21–25 August 2017. [Google Scholar]
  12. Wang, Y.X.; Balle, B.; Kasiviswanathan, S.P. Subsampled Rényi Differential Privacy and Analytical Moments Accountant. In Proceedings of the 22nd International Conference on Artificial Intelligence and Statistics (AISTATS), Naha, Japan, 16–18 April 2019. [Google Scholar]
  13. Houlsby, N.; Giurgiu, A.; Jastrzebski, S.; Morrone, B.; De Laroussilhe, Q.; Gesmundo, A.; Attariyan, M.; Gelly, S. Parameter-Efficient Transfer Learning for NLP. In Proceedings of the International Conference on Learning Representations (ICLR), New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
  14. Hu, E.J.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, L.; Chen, W. LoRA: Low-Rank Adaptation of Large Language Models. In Proceedings of the International Conference on Learning Representations (ICLR), Virtual Event, 25–29 April 2022. [Google Scholar]
  15. Lester, B.; Al-Rfou, R.; Constant, N. The Power of Scale for Parameter-Efficient Prompt Tuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP), Punta Cana, Dominican Republic, 7–11 November 2021. [Google Scholar]
  16. Wei, J.; Bosma, M.; Zhao, V.Y.; Guu, K.; Yu, A.W.; Lester, B.; Du, N.; Dai, A.M.; Le, Q.V. Finetuned Language Models Are Zero-Shot Learners. In Proceedings of the International Conference on Learning Representations (ICLR), Virtual Event, 25–29 April 2022. [Google Scholar]
  17. Ouyang, L.; Wu, J.; Jiang, X.; Almeida, D.; Wainwright, C.; Mishkin, P.; Zhang, C.; Agarwal, S.; Slama, K.; Ray, A.; et al. Training Language Models to Follow Instructions with Human Feedback. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), New Orleans, LA, USA, 28 November–9 December 2022. [Google Scholar]
  18. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention Is All You Need. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
  19. Zhang, Z.; Yang, Y.; Dai, Y.; Qu, L.; Xu, Z. When Federated Learning Meets Pre-trained Language Models’ Parameter-Efficient Tuning Methods. arXiv 2022, arXiv:2212.10025. [Google Scholar]
  20. Pan, Z.; Ying, Z.; Wang, Y.; Zhang, C.; Zhang, W.; Zhou, W.; Zhu, L. Feature-Based Machine Unlearning for Vertical Federated Learning in IoT Networks. IEEE Trans. Mob. Comput. 2025, 24, 5031–5044. [Google Scholar] [CrossRef] [Scilit]
  21. Babakniya, S.; Elkordy, A.R.; Ezzeldin, Y.H.; Liu, Q.; Song, K.B.; El-Khamy, M.; Avestimehr, S. SLoRA: Federated Parameter Efficient Fine-Tuning of Language Models. arXiv 2023, arXiv:2308.06522. [Google Scholar]
  22. Bai, J.; Chen, D.; Qian, B.; Yao, L.; Li, Y. Federated Fine-Tuning of Large Language Models under Heterogeneous Tasks and Client Resources. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Vancouver, BC, Canada, 10–15 December 2024. [Google Scholar]
  23. Liu, X.Y.; Zhu, R.; Zha, D.; Gao, J.; Zhong, S.; White, M.; Qiu, M. Differentially Private Low-Rank Adaptation of Large Language Model Using Federated Learning. ACM Trans. Manag. Inf. Syst. 2025, 16, 1–12. [Google Scholar] [CrossRef] [Scilit]
  24. Yu, D.; Naik, S.; Backurs, A.; Gopi, S.; Inan, H.A.; Kamath, G.; Kulkarni, J.; Lee, Y.T.; Manoel, A.; Wutschitz, L.; et al. Differentially Private Fine-Tuning of Language Models. In Proceedings of the International Conference on Learning Representations, Online, 25–29 April 2022. [Google Scholar]
  25. Yao, Y.; Zhang, J.; Wu, J.; Huang, C.; Xia, Y.; Yu, T.; Zhang, R.; Kim, S.; Rossi, R.; Li, A.; et al. Federated Large Language Models: Current Progress and Future Directions. arXiv 2024, arXiv:2409.15723. [Google Scholar] [CrossRef] [Scilit]
  26. Yu, M.; Singh, P. Differentially Private Fine-Tuning of Large Language Models: A Survey. In Proceedings of the 21st International Conference on Advanced Data Mining and Applications (ADMA2025), Kyoto, Japan, 22–24 October 2025; Volume 16200. [Google Scholar]
  27. Snell, J.; Swersky, K.; Zemel, R.S. Prototypical Networks for Few-shot Learning. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
  28. Khosla, P.; Teterwak, P.; Wang, C.; Sarna, A.; Tian, Y.; Isola, P.; Maschinot, A.; Liu, C.; Krishnan, D. Supervised Contrastive Learning. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Virtual, 6–12 December 2020. [Google Scholar]
  29. Arjovsky, M.; Bottou, L.; Gulrajani, I.; Lopez-Paz, D. Invariant Risk Minimization. arXiv 2019, arXiv:1907.02893. [Google Scholar]
  30. Piech, C.; Bassen, J.; Huang, J.; Ganguli, S.; Sohl-Dickstein, J.; Guibas, L. Deep Knowledge Tracing. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Montreal, QC, Canada, 7–12 December 2015. [Google Scholar]
  31. Heffernan, N.T.; Heffernan, C.L. The ASSISTments Ecosystem: Building a Platform that Brings Scientists and Teachers Together for Minimally Invasive Research on Human Learning and Teaching. Int. J. Artif. Intell. Educ. 2014, 24, 470–497. [Google Scholar] [CrossRef] [Scilit]
  32. Kuzilek, J.; Hlosta, M.; Zdrahal, Z. Open University Learning Analytics Dataset. Sci. Data 2017, 4, 170171. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  33. Choi, Y.; Lee, Y.; Cho, D.; Baek, S.; Kwon, S.; Park, J.W.; Cha, Y.; Jung, Y.; Kim, H.; Kim, E.; et al. EdNet: A Large-Scale Hierarchical Dataset in Education. arXiv 2019, arXiv:1912.03072. [Google Scholar]
  34. Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On Calibration of Modern Neural Networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), Sydney, Australia, 6–11 August 2017. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.