This repository contains the code for the paper "Low-Cost Privacy-Aware Decentralized Learning," available here: https://arxiv.org/abs/2403.11795.
Some code fragments have been omitted due to their dependence on our original computing grid and enoslib scripts. These omitted parts handle deployment and saving simulation results, built on top of our decentralizepy fork.
- Simulations are conducted using the
decentralizepysubmodule. - Privacy attacks are implemented in the
attack/folder. - Code for reorganizing
decentralizepysimulation data and launching experiments is omitted due to its reliance on our computing architecture (Grid5000). The full code is available here. - Singularity images are used for running simulations and running attacks. The Makefile builds these containers.
- Additional simulation code is available in
misc_simulations/, including code for Figures 13 and 14, which can be run independently as long as the required environment is installed.
A brief overview of how to use our code:
- Simulate ZIP-DL using our fork of the
decentralizepylibrary. Attackers save models for later attacks. Users must generate a configuration file, distribute it across machines, and correctly setip.json. - After the simulation, group results into a single folder if multiple machines were used.
- Run attacks using the
attacker_containerand theattacksfolder. - Format, visualize, and store results using
attacks/pets_plots.ipynb.
Run make to build the Singularity images containing all necessary libraries.
For development or local execution, create a virtual environment. We tested with Python 3.10—Python 3.11 may cause conflicts with sklearn.
python3.10 -m venv venv-zip-dl
source venv-*/bin/activateThen, install dependencies:
pip install --editable decentralizepy
pip install -r requirements.txtThis pipeline produces the results in our paper in four steps:
- Simulating decentralized learning
- Reorganizing simulation results
- Running attacks
- Visualizing results
Each step is detailed below with relevant code references.
Simulations run using decentralizepy. Our fork includes:
ZIP-DL(zerosum) andMuffliatoasSharingobjects.- Modified scripts to save models at specified intervals for downstream attacks.
To run a simulation, generate a configuration file with the desired parameters and deploy it accordingly.
Simulation results should be structured as follows for attacks:
experiment_name/
config.ini
g5k_config.json
machine1/
...
machinek/
Key details:
machine*folders are generated bydecentralizepyand should be consolidated into one directory.config.inicontains thedecentralizepyconfiguration used for the simulation.g5k_config.jsonstores additional simulation parameters not included inconfig.ini, such as the number of nodes.
Attacks use the attacker_container.sif container, which wraps perform_attacks.py. To use it:
- Bind the folder containing experiment data to
/experiments_to_attackin the container. - Provide necessary arguments for
perform_attacks.py.
The attacks/ structure includes:
perform_attacks.py— runs attacks on the given dataset.classifier_attacker.py— implements the attack logic.
Results are analyzed in the attacks folder, mainly using notebooks. Supporting scripts include:
plot_loaders.pyplot_results.pyplot_utils.py
Generated plots and stored CSV data were used to create the paper’s figures.
This project is licensed under the MIT License. See the LICENSE file for more details.
Paper title: Low-Cost Privacy-Preserving Decentralized Learning
Artifacts HotCRP ID: 9
Requested Badge: Available
This artifact contains the code for the simulations presented in the paper Low-Cost Privacy-Preserving Decentralized Learning. Specifically, it includes:
- Code to run simulations corresponding to our algorithm.
- Code to perform the attacks used in our paper.
- Scripts to gather and aggregate results for generating the data used in our paper.
Key code fragments include:
- Implementation of Algorithm 1.
- Implementation of the classifier attack.
- Implementation of the Loss attack.
- Current version of our paper:
paper57-2025-3-source.pdf
This artifact does not pose any security or privacy risks. We use public datasets and conduct privacy attacks on models generated within our experiments.
Below, we describe how to access the artifact and all necessary data and software components, along with setup instructions and verification steps.
This artifact contains most of the source code required for the paper. The full source code, including experiment configuration generation and deployment scripts, is available here. However, this repository is self-sufficient in terms of source code, with only experiment configuration and deployment scripts missing.
For detailed repository organization, refer to the sections above that describe the purpose of each folder and code fragment.