Decentralized Word2Vec Using Gossip Learning

Abdul Aziz Alkathiri, Lodovico Giaretta, Sarunas Girdzijauskas, Magnus SahlgrenNoDaLiDa 2021

Abstract

Advanced NLP models require huge amounts of data from various domains to produce high-quality representations. It is useful then for a few large public and private organizations to join their corpora during training. However, factors such as legislation and user emphasis on data privacy may prevent centralized orchestration and data sharing among these organizations. Therefore, for this specific scenario, we investigate how gossip learning, a massively-parallel, data-private, decentralized protocol, compares to a shared-dataset solution. We find that the application of Word2Vec in a gossip learning framework is viable. Without any tuning, the results are comparable to a traditional centralized setting, with a loss of quality as low as 4.3%. Furthermore, the results are up to 54.8% better than independent local training.

1. Introduction

Training state-of-the-art Natural Language Processing (NLP) models typically requires massive, diverse datasets. While multiple organizations (like hospitals or government agencies) might want to pool their data to build better models, they are often blocked by strict privacy laws (like GDPR), data collection agreements, or a simple lack of trust in a central "gatekeeper." Standard solutions like Federated Learning solve the data-sharing problem by keeping data local, but they still rely on a central server to aggregate gradients, creating a single point of failure and a potential bottleneck. This paper investigates whether Gossip Learning—a fully decentralized, asynchronous protocol—can produce high-quality word embeddings without any central orchestration.

2. Methodology

The researchers implemented Word2Vec on top of a Gossip Learning framework. In this setup, each node starts with a local model. At regular intervals, a node selects a random peer and sends its current model. When a node receives a model, it merges the weights (averaging them) with its own and trains the resulting model on a single batch of its local data. Unlike Federated Learning, there is no global "round"; nodes operate at their own pace, performing "random walks" of models across the network.

The study used a 16GB Wikipedia articles dump, filtered into five categories (science, politics, business, humanities, and history) to simulate organizational silos. Models were evaluated using $w2v_{sim}$, which measures how closely the generated embeddings match a reference model trained on the Google News dataset.

3. Results

The decentralized protocol proved remarkably robust to data heterogeneity. The gossip-trained models were up to 54.8% better than independent local training, proving that decentralized collaboration effectively overcomes the "specificity" of local data. Even when data was imbalanced or topic-wise, the protocol remained stable.

Centralized Word2Vec training baseline.

As shown in Figure 1, the centralized baseline achieves a high similarity score, stabilizing around 64.5. In comparison, the decentralized approach (Figure 2) shows all nodes converging toward a consensus model that performs nearly as well, reaching scores above 60.

Convergence of 10 nodes in a decentralized gossip learning environment.

The best decentralized configuration achieved a $w2v_{sim}$ score of 61.84, compared to the centralized baseline of 64.479. This represents a performance gap of only 4.3%. Surprisingly, reducing the model exchange frequency by 50x didn't just maintain quality—it slightly improved it in some configurations, suggesting significant margins for optimization.

4. Conclusion and Future Work

Gossip Learning is a viable alternative for training Word2Vec embeddings when data privacy or lack of central infrastructure prevents traditional methods. While the current study assumes ideal network conditions and does not address security concerns like poisoning attacks, the results show that decentralized collaboration can achieve near-parity with centralized training. Future work should explore scaling this approach to more complex architectures like Transformers and testing robustness in real-world peer-to-peer networks with latency and packet loss.

Summary updated

BibTeX
@inproceedings{alkathiri2021decentralized,
  author = {Abdul Aziz Alkathiri and Lodovico Giaretta and Sarunas Girdzijauskas and Magnus Sahlgren},
  title = {{Decentralized Word2Vec Using Gossip Learning}},
  booktitle = {NoDaLiDa},
  year = {2021},
  url = {https://openreview.net/forum?id=fW8w0Md92V},
}
Figure