arXiv:2609.05403cs.LGSep 2026

Manuscript Offprint

arXiv:2609.05403

RegionFed: Federated Learning for Personalized Query Understanding in Heterogeneous Retail Environments

Quoc H. Nguyen, Ali Lafzi, Abhijeet Phatak, Siddharth Pratap Singh, Rohit Upadhyay, Yogananda Domlur Seetharama, Chittaranjan Tripathy

Quoc H. Nguyen*

Walmart Global Tech

Sunnyvale

California, USA,

quoc.nguyen@walmart.com

Ali Lafzi

Walmart Global Tech

Sunnyvale

California, USA,

Abhijeet Phatak

Walmart Global Tech

Sunnyvale

California, USA,

Siddharth Pratap Singh

Walmart Global Tech

Sunnyvale

California, USA,

Rohit Upadhyay

Walmart Global Tech

Sunnyvale

California, USA,

Yogananda Domlur Seetharama

Walmart Global Tech

Sunnyvale

California, USA,

Chittaranjan Tripathy

Walmart Global Tech

Sunnyvale

California, USA,

Abstract

Retail search systems serve diverse geographic regions with distinct query patterns, vocabularies, and product preferences, creating significant data heterogeneity that challenges both privacy-preserving training and model personalization. Federated learning offers a natural solution for privacy, but standard FL methods produce global models that sacrifice regional performance, while existing personalized FL approaches operate at the parameter level and catastrophically collapse on modern transformers (below 10% accuracy on T5) due to tied embeddings and LayerNorm interactions. We introduce RegionFed, an architecture-robust federated learning framework that sidesteps this failure by operating entirely at the gradient level. RegionFed uses the ℓ2\ell_2 conflict between regional and global gradients as a unified signal that (i) diagnoses heterogeneity, (ii) routes each region to the cheapest sufficient personalization strategy, and (iii) adaptively controls personalization strength. Because it treats models as differentiable black boxes, RegionFed deploys on T5-Small, T5-3B, RoBERTa, and CNN with zero code changes, providing large gains on transformers (where parameter-level methods collapse) and consistent improvements on CNNs. Across three public datasets (Amazon ESCI, Amazon Reviews, LEAF-FEMNIST) and four architectures, RegionFed-Meta achieves 92.27%, closing the gap to the privacy-violating centralized upper bound (Centralized + Regional Weighting: 92.04%, Δ=0.23\Delta=0.23pp, within 1σ1\sigma) while providing (ϵ≈0.60\epsilon\approx0.60)-differential privacy and O(1/T)\mathcal{O}(1/\sqrt{T}) convergence.

*Use footnote for providing further information about author (webpage, alternative address)—not for acknowledging funding agencies.

1 Introduction

Large-scale retail platforms serve hundreds of millions of customers across diverse geographical regions, each with distinct shopping behaviors, vocabularies, and product preferences. A critical component of the user experience is the search system's ability to accurately interpret and contextualize queries. Yet this creates a fundamental tension: effective personalization requires understanding regional patterns, while privacy regulations (GDPR, CCPA) and data sovereignty concerns prohibit centralizing sensitive query data. Federated learning (FL) [McMahan et al., 2017] offers a natural paradigm for privacy-preserving distributed training, but deploying FL in heterogeneous retail environments introduces challenges that existing methods, including recent clustered [Ghosh et al., 2020, Sattler et al., 2021] and personalized approaches [T. Dinh et al., 2020, Tan et al., 2022], fail to fully address.

The core challenge is twofold. First, standard FL methods (FedAvg [McMahan et al., 2017], Fed-Prox [Li et al., 2020]) produce a single global model that ignores regional heterogeneity: when "thongs" means footwear in Australia but undergarments in the US, a global model inevitably compromises accuracy for some regions. Second, existing personalized FL methods operate at the parameter level through control variates or bi-level optimization; while these are architecture-agnostic in interface, they are sensitive to parameter landscape topology and become unstable on modern transformer architectures due to shared embeddings, attention coupling, and LayerNorm interactions. Parameter-level methods like SCAFFOLD [Karimireddy et al., 2020] and pFedMe [T. Dinh et al., 2020] achieved strong results on CNNs but struggle on high-dimensional transformer landscapes (detailed analysis in Appendix F). Recent methods including FedProto [Tan et al., 2022] and pFed-Hyper [Zhang et al., 2024] advance personalization but remain parameter-level, inheriting similar limitations. This limits the applicability of existing personalized FL to production systems that increasingly rely on transformer-based models.

This observation motivates our key insight: effective personalization should operate at the gradient level rather than the parameter level. By treating models as black-box function approximators and personalizing based on gradient conflicts, we can achieve architecture-robust personalization that works seamlessly across model families. We personalize at the region level rather than the individual user level because regions pool enough clients to yield stable gradient estimates, and users within the same region share systematic patterns (vocabulary, product mix, seasonal behavior) that per-client models with scarce data cannot capture.

We introduce RegionFed, a gradient-level federated learning framework for retail query understanding that operates seamlessly across model architectures. Unlike prior work [Arivazhagan et al., 2019] requiring fixed personalization strategies, RegionFed dynamically determines optimal personalization through gradient conflict analysis, automatically adjusting regional adaptation without compromising privacy. While gradient projection [Yu et al., 2020] and hierarchical aggregation [Ghosh et al., 2020] exist independently, RegionFed provides a principled combination: gradient conflict serves as both the heterogeneity diagnostic and the adaptive control signal within a hierarchical regional structure, enabling compute-aware routing and DP-compatible personalization in a unified framework. Our contributions are: (1) Gradient-conflict framework for architecture-robust personalization: rather than manipulating model parameters directly (which fails on transformers due to tied embedding and LayerNorm feedback loops), RegionFed uses ℓ2\ell_2 gradient conflict as the sole signal for adaptive personalization within a hierarchical regional structure. Gradient-level operations avoid instability because they determine how much of the standard gradient to apply per region, without injecting additive parameter corrections that propagate through shared weight matrices. This treats models as differentiable black boxes, enabling deployment across architectures (T5, RoBERTa, or future designs) without code modification. (2) Compute-aware strategy orchestration: the gradient-conflict signal serves as an automated triage system that routes each region to the cheapest sufficient strategy (Grad/Interp/Meta), deploying expensive meta-learning only when conflict warrants it. (3) DP-compatible conflict detection with concrete privacy guarantees: DP gradient clipping (C=1.0C=1.0) bounds the signal component, while the sigmoid centering via μr\mu_r (calibrated from round 1) absorbs the noise baseline, ensuring that relative conflict differences remain informative across rounds and regions. With σdp=4.0\sigma_{dp}=4.0, T=50T=50, and δ=10−5\delta=10^{-5}, RegionFed achieves ϵ≈0.60\epsilon \approx 0.60 while closing the gap to centralized accuracy. (4) Theoretical and empirical validation: O(1/T)\mathcal{O}(1/\sqrt{T}) convergence with explicit heterogeneity dependence (Theorem 5.1); 12–25pp improvement over FedAvg/FedProx on T5-Small; collapse (<10%) of all four parameter-level baselines tested across E∈{1,5,10,40}E\in\{1, 5, 10, 40\} on transformers, confirmed transformer-specific via LEAF-FEMNIST [Caldas et al., 2018] where SCAFFOLD achieves 79.52% on CNN; cross-architecture confirmation on RoBERTa-Base, T5-3B, and CNN; cross-domain validation on Amazon Reviews [Ni et al., 2019] (Table 1, Panel B); sustained advantage over 50 rounds. All results averaged over 5 seeds.

Related Work. FedAvg [McMahan et al., 2017] and FedProx [Li et al., 2020] produce single global models; clustered methods [Ghosh et al., 2020, Sattler et al., 2021, Marfoq et al., 2021] group clients by similarity but lack regional adaptation. Parameter-level methods (SCAFFOLD [Karimireddy et al., 2020], pFedMe [T. Dinh et al., 2020], Per-FedAvg [Fallah et al., 2020], APFL [Deng et al., 2020], Ditto [Li et al., 2021a], FedNova [Wang et al., 2020]) work on CNNs but cause transformer instability; FedBN [Li et al., 2021b] personalizes BatchNorm but not LayerNorm. Layer-splitting methods (FedBABU [Oh et al., 2022], FedRep [Collins et al., 2021]) avoid collapse but limit personalization. Transformer-specific methods (FedTP [Li et al., 2023], FedAdapter [Cai et al., 2023], FedLoRA [Yi et al., 2023]) require architecture-specific design. Multi-task gradient methods (PCGrad [Yu et al., 2020], CAGrad [Liu et al., 2021]) project away conflicts within a single model; RegionFed uses conflict magnitude as a routing signal across regional models. Concurrent work [Sun et al., 2024, Chen et al., 2025] explores layer-wise conflict and black-box FL; RegionFed differs by using holistic gradient conflict for hierarchical regional routing. See Appendix A for a full survey.