In the collaborative machine learning setting, multiple organizations cooperate to train or predict over their joint datasets. Unfortunately, collaborative learning cannot happen over sensitive data because such data cannot be shared in plaintext due to privacy constraints, such as policy regulations and business competition. We present Cerebro, a platform that leverages cryptography to enable multiple parties to compute learning tasks without revealing any party’s input data to another party. Cerebro provides a cryptographic compiler that is able to automatically compile and optimize a program written in a high-level language into a secure protocol. Moreover, by taking an end-to-end approach to the system design, Cerebro allows multiple parties with complex economic relationships to safely collaborate on machine learning computation.