SecEmb: Sparsity-Aware Secure Federated Learning of On-Device Recommender System with Large Embedding

Peihua Mai, Youlong Ding, Ziyan Lyu, Minxin Du, Yan Pang · DOI

Presented at ICML 2025, SecEmb introduces a novel protocol designed to reconcile the privacy requirements of federated recommendation systems with the resource constraints of mobile devices. By leveraging the inherent sparsity of user-item interactions, SecEmb achieves significant reductions in communication and computation costs without sacrificing model accuracy.

Introduction

Federated Recommender Systems (FedRec) enable mobile applications to train recommendation models locally, ensuring that sensitive user interaction data remains on-device. However, modern recommendation architectures rely heavily on embedding tables—massive matrices where each item (e.g., a product, movie, or song) is represented by a high-dimensional vector. This architecture introduces two primary challenges:

  1. The Payload Bottleneck: Embedding tables are often too large to be transmitted to mobile devices. Downloading the full model and uploading dense gradient updates consumes prohibitive amounts of bandwidth and battery.
  2. The Privacy-Efficiency Trade-off: While a user only interacts with a tiny fraction of items (sparsity), revealing which specific item updates a user is sending would immediately leak their private activity. Conventional secure aggregation methods that mask these indices typically require the client to process the entire model, nullifying the efficiency gains of sparsity.

The SecEmb Protocol

SecEmb addresses these challenges using Function Secret Sharing (FSS) within a two-server framework (e.g., a cloud provider and an independent privacy auditor). The protocol is divided into two primary phases:

1. Privacy-Preserving Embedding Retrieval

Instead of downloading the entire $m \times d$ embedding table, the client identifies the specific items they have interacted with. Using FSS, the client generates "point functions" for these items, which are split into secret shares and sent to the two non-colluding servers. The servers compute shares of the requested embeddings, which the client then recombines. This process ensures that neither server learns which specific item indices were requested.

2. Sparsity-Aware Update Aggregation

Following local training, the client must upload gradients only for the items they interacted with. SecEmb encodes these sparse updates into cryptographic keys using FSS. The servers aggregate these keys into a global gradient matrix. To prevent the servers from inferring activity levels based on the number of updates, SecEmb employs a standardization technique, padding or truncating updates to a fixed size ($m'$).

Technical Innovations

SecEmb introduces several optimizations to make FSS viable for on-device learning:

  • Row-Wise Encoding: Rather than generating a cryptographic key for every individual scalar in a vector, SecEmb generates a single key per row (item), drastically reducing key management overhead.
  • Path Sharing: The protocol optimizes computation by reusing the cryptographic "binary tree paths" generated during the retrieval phase for the subsequent update phase.
  • Lossless Computation: Unlike many efficiency-focused federated learning methods that use lossy compression (like quantization or SVD), SecEmb is mathematically lossless. It produces the exact same training results as a full-model transfer.

Experimental Evaluation

The researchers evaluated SecEmb across five benchmark datasets, including MovieLens (100K to 25M), Yelp, and Amazon. The results demonstrate that SecEmb effectively turns the "problem" of sparsity into a performance advantage:

  • Communication Efficiency: SecEmb reduced upload and download costs by 4x to 90x for Matrix Factorization and Factorization Machine models.
  • On-Device Performance: User-side computation time saw up to a 70x speedup compared to traditional secure FedRec protocols. On the Yelp dataset, share generation was reduced from nearly a minute to mere milliseconds.
  • Scalability: While traditional secure aggregation costs scale linearly with the total number of items ($m$), SecEmb’s communication costs scale logarithmically with $m$, making it suitable for massive, billion-item catalogs.

Conclusion

SecEmb demonstrates that high-performance, private recommendation is possible on-device by specifically optimizing for the sparse nature of user data. While the protocol currently relies on a two-server non-collusion assumption, its efficiency gains suggest a path forward for other large-scale sparse models, including the federated fine-tuning of Large Language Models (LLMs).

Summary updated

BibTeX
@inproceedings{mai2025secemb,
  author = {Peihua Mai and Youlong Ding and Ziyan Lyu and Minxin Du and Yan Pang},
  title = {{SecEmb: Sparsity-Aware Secure Federated Learning of On-Device Recommender System with Large Embedding}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=j7H4mbeOI1},
}
Figure