RegionFed: Federated Learning for Personalized Query Understanding in Heterogeneous Retail Environments
Organizations: 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 \textit{architecture-robust} federated learning framework that sidesteps this failure by operating entirely at the gradient level. RegionFed uses the 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.23pp, within 1) while providing -differential privacy and convergence.
Figures & tables
| Category | Method | Overall (%) | Intent (%) | Spell (%) | NER (%) | RRS |
| Panel A: Amazon ESCI, T5-Small (primary benchmark, per-task breakdown) | ||||||
| Upper Bound | Centralized | 91.72 0.28 | 96.35 0.15 | 78.89 0.34 | 99.93 0.02 | – |
| (no privacy) | Cent. + Reg. Weighting | 92.04 0.25 | 96.72 0.18 | 79.84 0.31 | 99.55 0.08 | 91.54 |
| Standard FL | FedAvg | 80.18 0.31 | 78.79 0.44 | 75.94 0.38 | 85.81 0.27 | 80.04 |
| FedProx ( ) | 67.18 0.42 | 59.03 0.51 | 75.47 0.35 | 67.05 0.48 | 67.13 | |
| Reg-Aware FedAvg | 83.47 0.29 | 81.52 0.37 | 76.89 0.33 | 92.01 0.21 | 83.21 | |
| RRS by | ||||||
|---|---|---|---|---|---|---|
| Method | 1.0 (Low) | 0.3 (Med) | 0.1 (High) | Deg. | Reg. SD | RRS |
| FedAvg | 89.1 | 80.04 | 67.5 | 21.6 | 2.98 | 80.04 |
| FedProx | 89.5 | 67.13 | 69.2 | 20.3 | 3.40 | 67.13 |
| Reg-Aware FedAvg | 89.8 | 83.21 | 71.3 | 18.5 | 2.54 | 83.21 |
| Local FT | 90.2 | 79.53 | 78.3 | 11.9 | 3.21 | 79.53 |
| FedBABU | 89.8 | 84.12 | 72.4 | 17.4 | 2.18 | 84.12 |
| Region | Query | Task | Predicted | Best | Global | Gain |
|---|---|---|---|---|---|---|
| Electronics | apple tv | Intent | brand_lookup | 92.3% | 84.5% | +7.8% |
| Fashion | butter avlable | Spell | butter available | 91.3% | 83.6% | +7.7% |
| Home | tv cost | NER | PRODUCT O | 91.4% | 85.8% | +5.6% |
| Sports | need yoga mat | Intent | product_search | 91.9% | 84.1% | +7.8% |
| Beauty | supplements on sale | Intent | price_comparison | 93.4% | 87.2% | +6.2% |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Metric | Value |
|---|---|
| Total / Train / Test Samples | 20,000 / 16,000 / 4,000 |
| Regions / Clients per Region | 8 / 10 (80 total) |
| Vocabulary Size / Max Query Length | 5,000 words / 20 tokens |
| Intent Classes / Entity Types | 8 / 6 (5 + O tag) |
| Product Categories | 24 |
| Dirichlet / Regional Bias | 0.3 / 70% |
| ID | Region Type | Focus | Top Categories |
|---|---|---|---|
| 0 | Urban Tech | Tech | Electronics, Gaming |
| 1 | Young Demo. | Fashion | Fashion, Apparel |
| 2 | High-Income | Premium | Fashion, Electronics |
| 3 | Price-Conscious | Value | Grocery, Food |
| 4 | Active Lifestyle | Outdoor | Sports, Fitness |
| 5 | Business Prof. | Prof. | Apparel, Books |
| Strategy | Acc. | RRS | Cost | Best For |
|---|---|---|---|---|
| Meta | 92.3% | 91.6% | High | Max accuracy |
| Interp | 92.1% | 86.1% | Med | Perfect NER |
| Grad | 91.9% | 91.5% | Low | Edge devices |
| Dynamic | 91.9% | 90.2% | Var. | Automation |
| Strategy | Compute | Memory | Comm. Overhead | Best For |
|---|---|---|---|---|
| Grad | Same as FedAvg | Edge/mobile devices; latency-critical deployments | ||
| Interp | 3% | High local compute; smooth regional blending | ||
| Meta | 3% | Max accuracy (92.27%); RRS-critical applications | ||
| Dynamic | Variable | Variable | 5% | Automated strategy selection; heterogeneous fleets |
| Region | FedAvg | FedTP | Grad | Interp | Meta | Dyn. |
|---|---|---|---|---|---|---|
| Electronics | 82.1 | 92.0 | 91.9 | 84.6 | 92.3 | 91.9 |
| Fashion | 78.5 | 91.0 | 91.3 | 83.6 | 91.2 | 90.8 |
| Home | 81.3 | 91.8 | 91.2 | 85.8 | 91.4 | 91.1 |
| Grocery | 77.2 | 91.5 | 91.1 | 85.5 | 91.0 | 78.2 |
| Sports | 80.8 | 91.2 | 91.8 | 84.1 | 91.8 | 91.9 |
| Books | 82.4 | 90.5 | 90.4 | 85.4 | 90.3 | 90.3 |
| Region | Query | Task | Predicted | Grad | Meta | Interp | Dynamic | Gain |
|---|---|---|---|---|---|---|---|---|
| Electronics | apple tv | Intent | brand_lookup | 91.9 | 92.3 | 84.5 | 91.9 | +7.8 |
| Fashion | butter avlable | Spell | butter available | 91.3 | 91.2 | 83.6 | 90.8 | +7.7 |
| Home | tv cost | NER | PRODUCT O | 91.2 | 91.4 | 85.8 | 91.1 | +5.6 |
| Grocery | find laptop deals | Intent | brand_lookup | 91.1 | 91.0 | 85.5 | 78.2 | +5.6 |
| Sports | need yoga mat | Intent | product_search | 91.8 | 91.8 | 84.1 | 91.9 | +7.8 |
| Books | wrench discount | Intent | price_comparison | 90.4 | 90.3 | 85.4 | 90.3 | +5.0 |
| Round | Strategy | Accuracy | Diagnosis |
|---|---|---|---|
| 1 | grad | 91.1% | Correct selection |
| 2 | interp | 86.6% | Performance degraded |
| 3 | interp | 78.2% | Catastrophic drop |
| 4 | interp | 86.2% | Partial recovery |
| 5 | interp | 78.0% | Final collapse |
| Intent | Spell | NER | |||||||
| Method | Low | Med | High | Low | Med | High | Low | Med | High |
| FedAvg | 95.2 | 90.1 | 78.2 | 76.3 | 68.3 | 49.1 | 95.8 | 88.6 | 75.0 |
| FedProx | 95.3 | 90.7 | 80.1 | 76.9 | 69.2 | 51.3 | 96.1 | 89.5 | 76.2 |
| Reg-Aware FedAvg | 95.6 | 91.3 | 81.5 | 77.1 | 69.8 | 53.2 | 96.3 | 90.1 | 79.3 |
| Local FT | 96.1 | 93.2 | 85.7 | 77.8 | 72.1 | 62.4 | 96.8 | 94.1 | 86.8 |
| FedTP | 96.5 | 93.8 | 87.1 | 78.5 | 73.8 | 65.2 | 98.5 | 97.5 | 94.0 |
| Method | 4 Reg. | 8 Reg. | 16 Reg. | Deg. |
|---|---|---|---|---|
| FedAvg | 83.41 0.38 % | 80.18 0.31 % | 74.92 0.52 % | 8.49% |
| FedProx | 70.53 0.47 % | 67.18 0.42 % | 60.84 0.61 % | 9.69% |
| Reg-Aware FedAvg | 85.27 0.33 % | 83.47 0.29 % | 79.13 0.44 % | 6.14% |
| FedTP | 92.08 0.21 % | 91.54 0.22 % | 89.41 0.35 % | 2.67% |
| RF-Grad | 92.14 0.24 % | 91.92 0.25 % | 89.73 0.31 % | 2.41% |
| RF-Meta | 92.58 0.22 % | 92.27 0.31 % | 90.14 0.38 % | 2.44% |
| Region Assignment | Acc. | Description | |
|---|---|---|---|
| Semantic (default) | 92.3% | – | Category-coherent |
| Geographic proxy | 91.1% | –1.2% | By location, mixed categories |
| Random assignment | 88.1% | –4.2% | Uniform random |
| Adversarial | 86.7% | –5.6% | Maximally heterogeneous |
| FedAvg (no regions) | 80.2% | –12.1% | Baseline |
| Configuration | Acc. | |
|---|---|---|
| Baseline (Regional Only) | 88.5% | – |
| Reg-Aware FedAvg (no adaptive ) | 83.5% | – |
| + Hierarchical Personalization | 89.4% | +0.9% |
| + Golden Section | 88.9% | +0.5% |
| + Adaptive | 89.6% | +1.1% |
| + Hier. + | 89.8% | +1.4% |
| Overall Acc. | RRS | Reg. | |
|---|---|---|---|
| 0.5 | 91.1% | 90.8% | 1.21 |
| 0.75 | 91.8% | 91.3% | 1.05 |
| 1.0 | 92.3% | 91.6% | 0.97 |
| 1.5 | 91.9% | 91.2% | 1.08 |
| 2.0 | 91.0% | 90.5% | 1.34 |
| Setting | Overall Acc. | Range | |
|---|---|---|---|
| 91.5% | [0.68, 0.95] | –0.8% | |
| 91.9% | [0.61, 0.92] | –0.4% | |
| (calibrated) | 92.3% | [0.53, 0.88] | – |
| 92.0% | [0.51, 0.82] | –0.3% | |
| 91.6% | [0.50, 0.76] | –0.7% | |
| Fixed | 90.1% | [0.82, 0.97] | –2.2% |
| Range | Overall Acc. | |
|---|---|---|
| 89.1% | -3.2% | |
| 90.8% | -1.5% | |
| 92.3% | – | |
| 91.4% | -0.9% |
| Overall Acc. | RRS | Range | Effect | ||
|---|---|---|---|---|---|
| 0.1 | 0.60 | 89.14% | 88.52% | [0.50, 0.54] | Severe clipping bias |
| 0.5 | 0.60 | 91.48% | 90.87% | [0.51, 0.72] | Moderate clipping |
| 1.0 | 0.60 | 92.27% | 91.62% | [0.53, 0.88] | Balanced (default) |
| 5.0 | 0.60 | 91.82% | 91.15% | [0.50, 0.94] | High noise variance |
| 92.53% | 91.85% | [0.50, 0.96] | No DP (upper bound) |
| 1.0 | 2.0 | 4.0 | 8.0 | 16.0 | |
| (approx.) | 2.40 | 1.20 | 0.60 | 0.30 | 0.15 |
| FedAvg | 80.85 | 80.52 | 80.18 | 78.93 | 74.21 |
| RF-Meta | 92.54 | 92.41 | 92.27 | 91.48 | 88.15 |
| (RF-Meta FedAvg) | +11.69 | +11.89 | +12.09 | +12.55 | +13.94 |