NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

FLsim: A Modular and Library-Agnostic Simulation Framework for Federated Learning

Arnab Mukherjee, Raju Halder, Joydeep ChandraarXiv 2025 · DOI

TL;DR

This paper introduces FLsim, a novel, modular, and library-agnostic simulation framework for Federated Learning (FL). FLsim aims to simplify the research and benchmarking of new FL techniques by offering a flexible and reproducible environment that supports diverse data distributions, network topologies, and ML libraries.

What Problem Does This Paper Address?

Federated Learning (FL) has rapidly evolved since its inception, with numerous algorithms and methodologies emerging to tackle various challenges. However, a significant hurdle for researchers is the difficulty in efficiently developing, testing, and benchmarking new FL techniques against existing state-of-the-art solutions. This is due to the complexity of setting up diverse experimental environments, managing different data distributions (like non-IID data common in real-world scenarios), and integrating various machine learning libraries. Existing simulation platforms often lack flexibility, are tied to specific ML frameworks, or don't adequately support advanced FL paradigms like decentralized topologies or blockchain integration. FLsim aims to bridge this gap by providing a unified, adaptable, and reproducible simulation framework.

Methods

FLsim is designed with modularity and flexibility at its core. Its key features include:

  • Library Agnosticism: Users can employ their preferred ML libraries (PyTorch, TensorFlow, Scikit-Learn) without framework-specific limitations.
  • Customizable Data Distributions: Supports both independent and identically distributed (IID) and non-IID data distributions, crucial for realistic FL scenarios.
  • Diverse Network Topologies: Accommodates various network structures, from simple client-server to hierarchical and decentralized peer-to-peer setups.
  • Modular FL Workflow: Users define their FL experiments through configuration files, specifying datasets, local learning algorithms, aggregation strategies, and consensus mechanisms.
  • Reproducibility: Employs techniques like node seed synchronization and deterministic execution settings to ensure consistent experimental outcomes across different hardware.
  • Pluggable Blockchain Integration: Offers support for simulating blockchain-based FL, enhancing security, traceability, and verifiability.
  • Consensus Mechanisms: Supports multi-worker aggregation with customizable consensus algorithms for selecting global models.

The framework is built around six core components: Job Orchestrator, Logic Controller, Dataset Distributor, Client/Worker Nodes, Key-Value Store, and Performance Logger.

Datasets

The paper evaluates FLsim using standard datasets commonly used in FL research:

  • CIFAR-10: Used for evaluating FL frameworks, ML library agnosticism, and multi-worker aggregation scenarios.
  • MNIST: Utilized for large-scale experiments to assess scalability.

The paper does not introduce new datasets but focuses on how FLsim can handle diverse data distributions (e.g., using Dirichlet Distribution for non-IID scenarios) on these existing benchmarks.

Key Insights and Ideas

  • True Library Agnosticism is Achievable: FLsim demonstrates that a comprehensive FL simulation framework can indeed be built to support multiple popular ML libraries without significant compromise.
  • Modularity is Key to Flexibility: By breaking down the FL workflow into configurable components, FLsim allows researchers to easily swap out and customize different aspects of their experiments, from data distribution to aggregation strategies.
  • Reproducibility in Distributed Settings is Challenging but Solvable: The paper highlights the difficulties in reproducing results across different hardware and proposes specific synchronization and configuration techniques to mitigate these issues.
  • Blockchain Integration is a Practical Extension: FLsim's ability to seamlessly integrate blockchain functionalities opens doors for exploring more secure and transparent FL applications.

Key Results

  • Broad Framework Support: FLsim successfully simulated seven diverse state-of-the-art FL frameworks, including FedAvg, SCAFFOLD, and Fedstellar, demonstrating its versatility.
  • ML Library Performance: Experiments showed comparable performance across PyTorch, TensorFlow, and Scikit-Learn for basic FL tasks, with PyTorch generally achieving higher accuracy and lower communication bandwidth.
  • Multi-Worker Consensus Effectiveness: The framework demonstrated that with a majority of honest workers, consensus mechanisms can effectively nullify the impact of malicious workers on global model poisoning.
  • Topology Performance: While accuracy was similar across client-server, hierarchical, and decentralized topologies, hierarchical and decentralized approaches showed higher CPU and memory usage, with decentralized topologies demanding the most network bandwidth.
  • Reproducibility: Experiments confirmed that FLsim can achieve highly reproducible results across different hardware configurations (CPUs and GPUs) when deterministic settings are applied.
  • Scalability: FLsim demonstrated scalability up to 1000 clients on MNIST, showing consistent global model accuracy while network bandwidth and training time increased with the number of clients.

Limitations and Future Work

  • Efficiency and Memory Management: The authors acknowledge ongoing efforts to further optimize the efficiency and memory management of the framework.
  • Job Scheduling: Enhancements to job scheduling mechanisms are planned to expedite FL experiment execution.
  • Expanding Repository: The team is working on expanding the repository with more demo experiments and templates for existing FL proposals.

The paper concludes by emphasizing FLsim's potential to significantly advance FL research by offering unprecedented flexibility and functionality for researchers and practitioners.

Summary updated

BibTeX
@misc{mukherjee2025flsim,
  author = {Arnab Mukherjee and Raju Halder and Joydeep Chandra},
  title = {{FLsim: A Modular and Library-Agnostic Simulation Framework for Federated Learning}},
  year = {2025},
  eprint = {2507.11430},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.11430},
}

Loading related content...

Figure