Federated Reinforcement Learning with Environment Heterogeneity

Hao Jin, Yang Peng, Wenhao Yang, Shusen Wang, Zhihua Zhang

Abstract: We study Federated Reinforcement Learning (FedRL) problem in which $n$ agents collaboratively learn a single policy without sharing the trajectories they collected during agent-environment interaction. In this paper, we stress the constraint of environment heterogeneity, which means $n$ environments corresponding to these $n$ agents have different state-transitions. To obtain a value function or a policy function which optimizes the overall performance in all environments, we propose two algorithms, we propose two federated RL algorithms, QAvg and PAvg. We theoretically prove that these algorithms converge to suboptimal solutions, while such suboptimality depends on how heterogeneous these $n$ environments are. Moreover, we propose a heuristic that achieves personalization by embedding the $n$ environments into $n$ vectors. The personalization heuristic not only improves the training but also allows for better generalization to new environments.

Introduction

Standard Reinforcement Learning (RL) typically assumes an agent interacts with a single, static environment. However, real-world deployments often involve fleets of agents—such as autonomous delivery robots or drones—operating in slightly different physical conditions. Federated Reinforcement Learning (FedRL) offers a framework for these agents to learn collectively without sharing raw trajectory data, preserving privacy and reducing communication overhead.

A critical challenge in FedRL is Environment Heterogeneity, where the state-transition dynamics ($P$) differ across agents. This paper addresses two primary objectives in this setting: learning a robust global policy that performs well across all environments and developing a personalization mechanism for rapid local adaptation.

Methodology

The authors propose two foundational algorithms for heterogeneous FedRL:

  • QAvg (Federated Q-Learning): Agents perform local updates to their Q-networks before periodically synchronizing with a central server that averages the model weights.
  • PAvg (Federated Policy Gradient): Agents update local policy functions, which are then aggregated and averaged by the server.

To analyze convergence, the study introduces the Imaginary Environment ($M_I$), representing the average of all local transition dynamics. Theoretical results show that QAvg and PAvg converge toward the optimal policy of this imaginary average environment, with a suboptimality gap determined by the degree of heterogeneity.

Personalization via Environment Embeddings

To move beyond a generic global policy, the authors introduce a personalization heuristic. In this architecture, each environment is assigned a unique ID that passes through an embedding layer to produce a low-dimensional vector. This vector is concatenated with the state observation to inform the policy.

Architecture of the personalization heuristic showing shared parameters and private embedding layers.

During federated averaging, agents share all network layers except for the embedding layer. This allows the shared backbone to learn general physical principles while the private embeddings capture local environmental quirks.

Experimental Results

The proposed methods were evaluated on tabular tasks (Random MDPs, WindyCliffs) and continuous control benchmarks (MuJoCo HalfCheetah and Hopper). In the MuJoCo tasks, heterogeneity was introduced by varying physical parameters like leg lengths and body sizes.

Performance and Generalization

Experimental results demonstrate that the federated approach significantly outperforms independent learning. As shown in the performance curves for HalfCheetah and Hopper, the federated DDPGAvg algorithm achieves higher objective values and faster convergence compared to standard DDPG.

Comparison of DDPGAvg and standard DDPG performance on HalfCheetah and Hopper environments.

Key findings include:

  • The Heterogeneity Gap: The suboptimality of the global policy is proportional to the diversity of the environments (quantified as $\kappa$).
  • Communication Efficiency: There is an optimal frequency for local updates ($E$); communicating too rarely leads to model drift, while communicating too often increases overhead.
  • Few-Shot Adaptation: The embedding heuristic enables impressive generalization. When introduced to a new environment, an agent only needs to update its small embedding layer to adapt, rather than retraining the entire policy.

Conclusion

This work provides a theoretical and empirical foundation for FedRL in heterogeneous environments. By leveraging environment embeddings, the proposed framework balances global knowledge sharing with local specialization. Future research may explore model-based FedRL to directly learn transition dynamics and further refine the theoretical understanding of personalization heuristics.

Summary updated

BibTeX
@inproceedings{jin2022federated,
  author = {Hao Jin and Yang Peng and Wenhao Yang and Shusen Wang and Zhihua Zhang},
  title = {{Federated Reinforcement Learning with Environment Heterogeneity}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=Ld0gJ5D_7g},
}
Figure