Skip to main content
. 2026 Feb 9;26(4):1120. doi: 10.3390/s26041120
Algorithm 1 Flow-Multi with Pareto Masking (mini-batch)
Require:
 πθ: Online policy model (initialized from pretrained weights)
  πref: Reference model
  Q: prompt batch
  K: group size (default 4)
  σt=at/(1−t): noise schedule
  μθ (Equation (3): drift; β: KL weight; LoRA rank r; reward weights w∈R4 (default wd=14))
Ensure: updated policy πθ (LoRA-only updates)
  1: Initialize policy πθ (LoRA on Q/K/V/O); set reference πref←stopgrad(πθ)
  2: for epoch =1,… do
  3:       Sample a mini-batch of prompts {qi}i=1P from Q
  4:       for each prompt qi do
  5:             Sampling (SDE rollout): generate K images {xi,k}k=1K using (2)
  6:             Reward vector for each xi,k: R(xi,k)=(raesth,rpref,ralign,rcomp)
  7:             Group-wise Pareto non-dominated mask Mi,k∈{0,1}                 (Section 3.5)
  8:             Scalarization ri,kcomb=∑d=14w(d)ri,k(d)                          (Section 3.6)
  9:       end for
10:       Gather survivors S={(i,k):Mi,k=1∧valid(i,k)} across devices; if S=∅ then fallback to top-1 by rcomb
11:       Compute survivors-only stats μS, σS
12:       Advantage (masked) Ai,k=ri,kcomb−μSσS·Mi,k
13:       Compute likelihood ratios ρi,k=πθ(oi,k∣qi)πθold(oi,k∣qi)
14:       PPO-style objective with Pareto mask                   (Equation (9), Section 3.7)
15:       KL penalty to reference (stepwise or sequence):               (Equation (10), Section 3.7)
16:       Update θ←θ+η∇θJGRPO(θ)                          ▹ LoRA params only
17:       Logging: Pareto keep ratio ∑i,kMi,k/(P·K), each reward mean/var, A stats, KL, loss terms, learning curves
18:       Periodically refresh reference πref←stopgrad(πθ)
19: end for