CrypTen - Laurens van der Maaten

PyTorch · Intermediate ·📄 Research Papers Explained ·6y ago

Key Takeaways

The video discusses CrypTen, a platform for secure machine learning research, and its integration with PyTorch, highlighting secure computation techniques, homomorphic encryption, and trusted execution environments. It also covers the practical applications of CrypTen, including encrypted inference and training, and its potential for secure multi-party computation.

Full Transcript

hi everyone my name is Liana Madsen I'm a research scientist at Facebook AI research and I'm going to tell you a little bit more about secure multi-party competition following up on on Andrew stock secure multi-party computation is a truly exciting technique because it brings the potential to create all the values that machine learning can creates while maintaining the privacy of data and while making sure that the data cannot be compromised as Andrew just explains this may allow is to solve important problems using machine learning that we cannot solve today these techniques are part of a larger collection of secure computation techniques that also include homomorphic encryption and trusted execution environments there have been a lot of developments in these techniques over the past couple of years which led us to ask ourselves the question what would is secure and privacy-preserving Pytor to look like this is a difficult question what does it even mean for a software platform like pi towards to be secure or privacy-preserving could we have some kind of global flag that set torch that private is true and then magically all your fighters computations are performed in in a secure way we're not there yet but over the last several months a team of engineers and researchers at Facebook has worked very hard on delivering some first answers to this question in a project that we call Krypton I'm very excited to share some of our first results with you we're open sourcing Krypton today so that everybody can build on the work that our team has done so what is Krypton Krypton is a platform for researching machine learning using secure computation techniques it aims to enable machine learning researchers who are not cryptography experts to experiment with machine learning models using secure computing techniques and to get a realistic view of what is possible what is difficult how efficient these techniques are etc Krypton leverages and integrates with PI torch and closely follows the PI torch design principles and API we hope that this lowers the barrier to entry for machine learning researchers and the who were already familiar with pi torch in Krypton we've adopted the following three design principles Krypton is machine learning first we design it to expose complex cryptographic techniques such as secure NPC in an API that is very familiar to machine learning researchers that use PI torch because it's essentially the same API Krypton uses eager execution we closely followed by torches design philosophy with an imperative programming style this makes debugging and learning about the underlying techniques easier and Krypton is realistic each party in the multi-party computation runs in its own process and if you want on its own machine all communication is real and it's performed using a byte or distributed backends there are no shortcuts the core primitive in Krypton is the Krypton sir it is an object that looks just like a PI torque sensor but it's encrypted it's provably impossible for a single party to inspect the content of the tensor unless all parties unanimously agree that the tensor can be revealed publicly which is done in this example by calling the get plaintext function yet this is not stopping the crypt answer from performing computations for example we can add to crypt answers which will result in another correct answer that contains the encrypted result of the addition note that in this process none of the encrypted contents was ever revealed to any of the parties we can also add regular PI torched answers to crypt answers so you can mix and match encrypted and unencrypted data the sum of a crypt answer and a float answer is a crypt answer and again the encrypted content is never revealed to any of the parties under the hoods the crypt answer implements a lot of complex cryptographic machinery in particular it provides full implementations of arithmetic and XOR secret sharing and tools that convert between these two types of secret sharing together this allows Krypton to implement a large number of at operations I will get to that in a sec communication between the parties involved in secret sharing is real and efficient as its implemented via torts of distributors with the glue beckons the Crypt answer Repsol this cryptography in a tenser object that looks just like a regular byte or sensor which makes it easy for machine learn machine learning researchers to use without having to understand the complexities about Galois field stealing with reference or understanding when to synchronize after communications krypton supports a large number of operations we support all linear operations including convolutions we are assuming a curious but honest security model in which a trusted third party provides random beaver triples to facilitate the computation krypton implements various efficient ways of computing integer powers it can also compute square roots and non integer powers in the logger ripping domain it can do this because it implements operations such as logarithms Exponential's and reciprocals via efficient approximations Exponential's are performed using a limit approximation logarithms using householder iterations and reciprocals using Newton represents reps and iterations this allows Krypton to implement virtually every operation you may be using in pi torch as well including sigmoids soft maxes binary and multi-class logistic loss functions as well as their gradients we also support operations such as computing minimum and maximum values are Max's signs values and other operations that require us to compare to encrypted values this may sound easy but it's actually very difficult in an encrypted worlds because the bits that indicates which of the two values is larger than the other cannot become known by any of the parties we achieve this through an implantation that converts between arithmetic and XOR secret sharing as needed not only does Krypton support a very large collection of operations it also supports these for an arbitrary number of parties because Krypton's support for operations is almost the same as that of pi torch itself you can actually take complex by George models and these models and run them on encrypted inputs without much effort in this example we set up the image net data sets take a pre trained ResNet 18 from torch vision import that model into Krypton to encrypt it and run it it on the encrypted image net images if we open up the encrypted output of the model we find that the output is just what you would expect Krypton is not only support encrypted inference but also encrypt the training to make training easy to do Krypton includes an autocrat implementation that works just like you've come to expect from PI torch this example shows how it works the current version of Krypton still has a separate autocrat crypt answer which is sort of like the variable object that used to exist in early versions of of by torch in the next release of Krypton we will merge the two so that every crypt answer is autograph alright a little box apart from that the autocrat in Krypton works just as you would expect you call the backward function on a crypt sensor and it performs the back propagation gradients get stored in the grad field of the tensor just like in PI torch the only difference is that these gradients are encrypted - together with the encrypted models I showed you on the previous slides this provides you all the tools you need to train encrypted models on encrypted data to make it easy for everyone to get started with Krypton we provide a bunch of examples and tutorials these examples and tutorials include encrypted inference of rest nets and encrypted training of Linette models linear SVM's and contextual bandits they also go in-depth on some of the limitations that results from doing encrypted computation we want to emphasize that Krypton is not a production ready platform right now it provides realistic estimates of the amount of computation and communication that machine learning via secure NPC requires but it's still a proof-of-concept implementation our work on Krypton isn't only benefitting future users of Krypton but it's benefiting all of you as part of the Krypton project we've teamed teamed up with the core PI church team to prove the parts of my torch that are most importance when you're working with advanced cryptographic algorithms namely gala fields or as we call them in pi torch lands long tensors let's face it long tensors haven't received a lot of love so in part 1.3 we've added a lot of support for more long tensor operations yes you can now convolve two long tensors we've also made common long tensor operations a lot faster than they were before the current release of krypton focuses on secure multi-party computation Google will not stop there we already have a working prototype of a crypt answer that is backed by homomorphic encryption it's not ready for release yet but we hope to be able to share with you in the coming months over time we also plan to add a crypt sensor that is backed by a trusted execution environments via implementations based on platforms like Intel HDX to be clear we're not done yet you cannot yet take Krypton and train a bird model from scratch but we hope that Krypton is the start of a journey that at the end of the road will make secure and encrypted machine learning just as easy as by torch has made regular machine learning and we want to invite all of you to join us on this journey by giving us feedback by contributing to the Krypton codebase or by developing awesome new applications on top of Krypton we're excited to see what you come up with thank you [Music] okay last session of the day so we're gonna switch

Original Description

Practical applications of ML via cloud-based or machine-learning-as-a-service (MLaaS) platforms pose a range of security and privacy challenges. In particular, users of these platforms may not want or be able to share unencrypted data, which prevents them from taking full advantage of ML tools. CrypTen is a new community-based research platform for taking the field of privacy-preserving ML forward.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from PyTorch · PyTorch · 40 of 60

1 What is PyTorch?
What is PyTorch?
PyTorch
2 PyTorch Tutorial: A Quick Preview
PyTorch Tutorial: A Quick Preview
PyTorch
3 PyTorch Summer Hackathon 2019
PyTorch Summer Hackathon 2019
PyTorch
4 Tips and Tricks on Hacking with PyTorch: A Quick Tutorial by Brad Heintz
Tips and Tricks on Hacking with PyTorch: A Quick Tutorial by Brad Heintz
PyTorch
5 PyTorch 1.2 and PyTorch Hub: A Quick Introduction by Soumith Chintala and Ailing Zhang
PyTorch 1.2 and PyTorch Hub: A Quick Introduction by Soumith Chintala and Ailing Zhang
PyTorch
6 Torchtext 0.4 with Supervised Learning Datasets: A Quick Introduction by George Zhang
Torchtext 0.4 with Supervised Learning Datasets: A Quick Introduction by George Zhang
PyTorch
7 Torchaudio 0.3 with Kaldi Compatibility, New Transforms: A Quick Introduction by Jason Lian
Torchaudio 0.3 with Kaldi Compatibility, New Transforms: A Quick Introduction by Jason Lian
PyTorch
8 Torchvision 0.4 with Support for Video: A Quick Introduction by Francisco Massa
Torchvision 0.4 with Support for Video: A Quick Introduction by Francisco Massa
PyTorch
9 Introduction to Machine Learning for Developers at F8 2019
Introduction to Machine Learning for Developers at F8 2019
PyTorch
10 Powered by PyTorch at F8 2019
Powered by PyTorch at F8 2019
PyTorch
11 Developing and Scaling AI Experiences at Facebook with PyTorch at F8 2019
Developing and Scaling AI Experiences at Facebook with PyTorch at F8 2019
PyTorch
12 New Approaches to Image and Video Reconstruction Using Deep Learning at Facebook at F8 2019
New Approaches to Image and Video Reconstruction Using Deep Learning at Facebook at F8 2019
PyTorch
13 PyTorch Developer Conference 2018: Recap
PyTorch Developer Conference 2018: Recap
PyTorch
14 PyTorch Developer Conference 2018: Keynote & Deep Dive
PyTorch Developer Conference 2018: Keynote & Deep Dive
PyTorch
15 PyTorch Developer Conference 2018: Production & Research Sessions
PyTorch Developer Conference 2018: Production & Research Sessions
PyTorch
16 PyTorch Developer Conference 2018: Cloud & Academia Sessions
PyTorch Developer Conference 2018: Cloud & Academia Sessions
PyTorch
17 PyTorch Developer Conference 2018: Enterprise, Education, & Future of AI Panel
PyTorch Developer Conference 2018: Enterprise, Education, & Future of AI Panel
PyTorch
18 PyTorch Developer Conference 2019 | Full Livestream
PyTorch Developer Conference 2019 | Full Livestream
PyTorch
19 PyTorch Developer Conference 2019: Recap
PyTorch Developer Conference 2019: Recap
PyTorch
20 PyTorch Developer Conference Keynote - Mike Schroepfer
PyTorch Developer Conference Keynote - Mike Schroepfer
PyTorch
21 What’s new in PyTorch 1.3 - Lin Qiao
What’s new in PyTorch 1.3 - Lin Qiao
PyTorch
22 PyTorch Front-End Features: Named Tensors and Type Promotion - Gregory Chanan
PyTorch Front-End Features: Named Tensors and Type Promotion - Gregory Chanan
PyTorch
23 Research to Production: PyTorch JIT/TorchScript Updates - Michael Suo
Research to Production: PyTorch JIT/TorchScript Updates - Michael Suo
PyTorch
24 Quantization - Dmytro Dzhulgakov
Quantization - Dmytro Dzhulgakov
PyTorch
25 PyTorch ONNX Export Support - Lara Haidar, Microsoft
PyTorch ONNX Export Support - Lara Haidar, Microsoft
PyTorch
26 Apex -  Michael Carilli, NVIDIA
Apex - Michael Carilli, NVIDIA
PyTorch
27 Dataloader Design for PyTorch - Tongzhou Wang, MIT
Dataloader Design for PyTorch - Tongzhou Wang, MIT
PyTorch
28 Linear Algebra in PyTorch - Vishwak Srinivasan, CMU
Linear Algebra in PyTorch - Vishwak Srinivasan, CMU
PyTorch
29 PyTorch Mobile - David Reiss
PyTorch Mobile - David Reiss
PyTorch
30 Model Interpretability with Captum - Narine Kokhilkyan
Model Interpretability with Captum - Narine Kokhilkyan
PyTorch
31 Detectron2 - Next Gen Object Detection Library - Yuxin Wu
Detectron2 - Next Gen Object Detection Library - Yuxin Wu
PyTorch
32 Speech Extensions to Fairseq - Dmytro Okhonko
Speech Extensions to Fairseq - Dmytro Okhonko
PyTorch
33 PyTorch on Google Cloud TPUs - Google, Salesforce, Facebook
PyTorch on Google Cloud TPUs - Google, Salesforce, Facebook
PyTorch
34 PyTorch Summer Hackathon Winners - Joe Spisak, Sebastien Arnold, Tristan Deleu
PyTorch Summer Hackathon Winners - Joe Spisak, Sebastien Arnold, Tristan Deleu
PyTorch
35 PyTorch in Robotics - Yisong Yue, Caltech
PyTorch in Robotics - Yisong Yue, Caltech
PyTorch
36 StanfordNLP - Yuhao Zhang, Stanford
StanfordNLP - Yuhao Zhang, Stanford
PyTorch
37 Sotabench for Reproducible Research - Robert Stojnic, Papers with Code
Sotabench for Reproducible Research - Robert Stojnic, Papers with Code
PyTorch
38 Collaborative Natural Language Inference - Sasha Rush, Cornell
Collaborative Natural Language Inference - Sasha Rush, Cornell
PyTorch
39 Privacy Preserving AI - Andrew Trask, OpenMined
Privacy Preserving AI - Andrew Trask, OpenMined
PyTorch
CrypTen - Laurens van der Maaten
CrypTen - Laurens van der Maaten
PyTorch
41 PyTorch at Uber - Sidney Zhang, Uber
PyTorch at Uber - Sidney Zhang, Uber
PyTorch
42 PyTorch at Tesla - Andrej Karpathy, Tesla
PyTorch at Tesla - Andrej Karpathy, Tesla
PyTorch
43 PyTorch at Microsoft - Saurabh Tiwary, Microsoft
PyTorch at Microsoft - Saurabh Tiwary, Microsoft
PyTorch
44 PyTorch at Dolby Labs - Vivek Kumar, Dolby Labs
PyTorch at Dolby Labs - Vivek Kumar, Dolby Labs
PyTorch
45 PyTorch Developer Conference 2019 - Panel Discussion
PyTorch Developer Conference 2019 - Panel Discussion
PyTorch
46 Using deep learning and PyTorch to power next gen aircraft at Caltech
Using deep learning and PyTorch to power next gen aircraft at Caltech
PyTorch
47 Named Tensors, Model Quantization, and the Latest PyTorch Features - Part 1
Named Tensors, Model Quantization, and the Latest PyTorch Features - Part 1
PyTorch
48 TorchScript and PyTorch JIT | Deep Dive
TorchScript and PyTorch JIT | Deep Dive
PyTorch
49 Announcing the PyTorch Global Summer Hackathon 2020
Announcing the PyTorch Global Summer Hackathon 2020
PyTorch
50 Opening Up the Black Box: Model Understanding with Captum and PyTorch
Opening Up the Black Box: Model Understanding with Captum and PyTorch
PyTorch
51 PyTorch Mobile Runtime for Android
PyTorch Mobile Runtime for Android
PyTorch
52 Torchvision in 5 minutes
Torchvision in 5 minutes
PyTorch
53 3D Deep Learning with PyTorch3D
3D Deep Learning with PyTorch3D
PyTorch
54 What is Torchtext?
What is Torchtext?
PyTorch
55 TorchAudio: A Quick Intro
TorchAudio: A Quick Intro
PyTorch
56 PyTorch Mobile Runtime for iOS
PyTorch Mobile Runtime for iOS
PyTorch
57 PySlowFast: Deep learning with Video
PySlowFast: Deep learning with Video
PyTorch
58 PyTorch Pruning | How it's Made by Michela Paganini
PyTorch Pruning | How it's Made by Michela Paganini
PyTorch
59 Measuring Fairness in Machine Learning Systems
Measuring Fairness in Machine Learning Systems
PyTorch
60 PyTorch for Hackathons
PyTorch for Hackathons
PyTorch

This video teaches viewers about the CrypTen platform and its application in secure machine learning research, highlighting the importance of secure computation techniques and homomorphic encryption. Viewers will learn how to implement encrypted inference and training using CrypTen and PyTorch.

Key Takeaways
  1. Set up the image net data sets
  2. Take a pre-trained ResNet 18 from torch vision
  3. Encrypt the model and run it on the encrypted image net images
  4. Call the backward function on a crypt sensor and perform back propagation
  5. Store gradients in the grad field of the tensor
💡 CrypTen provides a proof-of-concept implementation for secure machine learning research, enabling encrypted inference and training, and has the potential for secure multi-party computation.

Related AI Lessons

I Spent Weeks Looking for a Research Gap Before I Realized I Was Searching the Wrong Way
Learn how to effectively find research gaps by changing your approach, a crucial skill for AI researchers and academics
Medium · AI
ICMI 2026 Reviews [D]
Learn how to interpret ICMI 2026 reviews and improve your paper's acceptance chances
Reddit r/MachineLearning
Workshop submission for main conference paper under review [D]
Learn how to navigate submitting a paper to a non-archival workshop before the final decision of a main conference like ECCV
Reddit r/MachineLearning
Kept context-switching between arxiv, OpenReview, GitHub, and HuggingFace for every paper, so I built this. Chrome extension + website with everything inline, plus citation graph + SPECTER2 neighbors. 3M papers, free, feedback welcome [P]
Streamline your research with a new Chrome extension and website that integrates 3M papers from arxiv, OpenReview, GitHub, and HuggingFace, including citation graphs and SPECTER2 neighbors, and provide feedback to improve it
Reddit r/MachineLearning
Up next
How to Open HSD Files (Husqvarna Viking Designer Embroidery)
File Extension Geeks
Watch →