Knowledge Base Regulation Tracker Standards & Frameworks OSS Directory AI Incident Database Research Paper Library Case Studies Society Articles News Jobs About Charter Sign inBecome a Member

CrypTen

Privacy-preserving computation

Framework for privacy-preserving machine learning built on PyTorch that implements secure multi-party computation behind a tensor API familiar to PyTorch users. Named in the taxonomy; the repository was archived by Meta in 2024 and is no longer maintained.

mpcpytorchsecure computation

Overview of CrypTen

CrypTen is a framework designed for privacy-preserving machine learning, built on top of PyTorch. It enables researchers and developers to train machine learning models using encrypted data, ensuring that sensitive information remains protected throughout the process. The framework implements secure multi-party computation (MPC) protocols, which allow multiple parties to jointly compute a function over their inputs while keeping those inputs private. CrypTen abstracts these MPC operations behind a tensor API that is familiar to PyTorch users, facilitating adoption for those already experienced with the PyTorch ecosystem.

Developed by Meta AI Research, CrypTen was initially released in 2019 under the MIT license, which is permissive and allows for broad use in both academic and commercial settings. The project was archived by Meta in 2024, indicating that it is no longer actively maintained, though its documentation and existing codebase remain accessible for reference and educational purposes.

The framework is implemented in Python and is compatible with Linux-based systems, as Windows support is not provided. Users are advised to install CrypTen in a dedicated conda environment to avoid conflicts with other dependencies.

How It Works

CrypTen operates by integrating secure multi-party computation (MPC) techniques into the PyTorch workflow. In the context of machine learning, this means that raw data—such as training samples or model weights—can remain encrypted while still enabling the computation of gradients, predictions, or other model operations.

The framework achieves this by providing a tensor API that mirrors PyTorch’s design. Users can write machine learning models using familiar PyTorch syntax, but with the added guarantee that sensitive data remains encrypted during computation.

The framework is designed to handle both training and inference tasks, with examples demonstrating its use in scenarios such as encrypted training of support vector machines (SVMs), convolutional neural networks (CNNs), and contextual bandits models.

Use Cases

  • Encrypted Training of Machine Learning Models: CrypTen provides examples demonstrating how to train models on encrypted data. For instance, the mpc_linear_svm example trains a linear SVM classifier using randomly generated encrypted data.
  • Privacy-Preserving Deep Learning: The mpc_cifar example trains an adaptation of the LeNet architecture on the CIFAR dataset using encrypted inputs. This showcases how CrypTen can be applied to more complex deep learning tasks while maintaining data privacy. Similarly, the tfe_benchmarks example trains three different network architectures on the MNIST dataset in cleartext but encrypts the trained model and data for secure inference.
  • This is particularly useful in deployment scenarios where model weights or input data must remain confidential, such as in federated learning or privacy-sensitive applications.
  • Contextual Bandits and Reinforcement Learning: The bandits example trains a contextual bandits model on encrypted data, illustrating CrypTen’s applicability in reinforcement learning and decision-making systems where privacy is a concern.
  • Multi-Party Collaboration: CrypTen supports distributed training across multiple machines or cloud instances. The aws_launcher script, for example, enables users to launch examples with encrypted data on multiple AWS instances, facilitating collaborative model training without exposing raw data to any single party.

Key Features and Capabilities

  • PyTorch-Compatible API: CrypTen’s tensor API is designed to be intuitive for PyTorch users, allowing them to transition to privacy-preserving machine learning with minimal adjustments to their existing code. This compatibility reduces the learning curve and encourages adoption among researchers and practitioners familiar with PyTorch.
  • Support for Secure Multi-Party Computation (MPC): The framework implements MPC protocols to enable collaborative computation on encrypted data. This ensures that sensitive information remains private while still allowing for accurate model training and inference. The exact cryptographic protocols used are not detailed in the documentation, but the framework’s design emphasizes privacy preservation.
  • Examples for Diverse Machine Learning Tasks: CrypTen includes a variety of examples covering different machine learning paradigms, such as supervised learning (SVM, CNNs), reinforcement learning (contextual bandits), and benchmarking (MNIST, CIFAR). These examples serve as practical demonstrations of how to apply CrypTen to real-world problems while maintaining data privacy.
  • Multi-Process and Distributed Training: CrypTen supports multi-process execution on a single machine, where each peer (or process) contributes to the computation without accessing raw data. Additionally, the framework provides tools for distributed training across cloud instances, such as AWS, enabling scalable privacy-preserving collaborations.
  • Pre-Trained Models for Benchmarking: For examples that involve training in cleartext (e.g., for benchmarking purposes), CrypTen provides pre-trained models in the model subdirectory of each example.
  • Command-Line Options for Customization: Users can configure CrypTen examples using command-line options, such as enabling multi-process mode (--multiprocess).

Technical Considerations

  • Windows users are not supported, which may limit its adoption in environments where Windows is the primary operating system. Users are recommended to install CrypTen in a dedicated conda environment to avoid dependency conflicts.
  • Archival Status: As of 2024, CrypTen is no longer actively maintained by Meta. While the framework remains accessible for educational and research purposes, users should be aware that there will be no updates or bug fixes moving forward.
  • Documentation and Community Support: The primary source of information for CrypTen is its official documentation, which includes installation instructions, API references, and example walkthroughs.

Sources

Contribute

Spot an error, or know a record we should add? Members can propose additions and submit corrections.