{"id":18487656,"url":"https://github.com/jimouris/curl","last_synced_at":"2025-04-08T20:31:43.103Z","repository":{"id":248086177,"uuid":"785836925","full_name":"jimouris/curl","owner":"jimouris","description":"Curl: Private LLMs through Wavelet-Encoded Look-Up Tables","archived":false,"fork":false,"pushed_at":"2025-04-07T17:31:10.000Z","size":30406,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T18:32:08.204Z","etag":null,"topics":["approximation","dwt","machine-learning","mpc","ppml","privacy-preserving-machine-learning","secure-multiparty-computation","wavelet-transform","wavelets"],"latest_commit_sha":null,"homepage":"https://eprint.iacr.org/2024/1127","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimouris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-12T18:18:56.000Z","updated_at":"2025-04-07T17:31:15.000Z","dependencies_parsed_at":"2024-08-08T20:42:44.717Z","dependency_job_id":"f11e0ce5-f075-43ff-ab66-cd3fad83eddc","html_url":"https://github.com/jimouris/curl","commit_stats":null,"previous_names":["jimouris/curl"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Fcurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Fcurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Fcurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Fcurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimouris","download_url":"https://codeload.github.com/jimouris/curl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247923040,"owners_count":21018916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["approximation","dwt","machine-learning","mpc","ppml","privacy-preserving-machine-learning","secure-multiparty-computation","wavelet-transform","wavelets"],"created_at":"2024-11-06T12:50:37.585Z","updated_at":"2025-04-08T20:31:38.087Z","avatar_url":"https://github.com/jimouris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"70%\" src=\"https://github.com/jimouris/curl/blob/main/Curl.png\" alt=\"Curl logo\" /\u003e\u003c/p\u003e\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jimouris/curl/blob/main/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/jimouris/curl/blob/main/CONTRIBUTING.md)\n--------------------------------------------------------------------------------\n\nCurl is a framework for Privacy Preserving Machine Learning (PPML) that builds on top of [CrypTen](https://github.com/facebookresearch/CrypTen) and [PyTorch](https://github.com/pytorch/pytorch).\nCrypTen relies on expensive polynomial approximations for evaluating non linear functions such as logarithm, square root, etc.\nIn contrast, Curl uses lookup tables (LUTs) encoded with Discrete Wavelet Transforms (DWT) to approximate non-linearities that result in faster evaluation while achieving better approximations.\n\nThis way, in Curl we are able to evaluate Large Language Models (LLMs) such as GPT-2, GPT Neo, BERT (tiny, base, large).\nCurl's goal and model is similar to CrypTen:\n\n\u003e Its goal is to make secure computing techniques accessible to Machine Learning practitioners.\n\u003e It currently implements [Secure Multiparty Computation](https://en.wikipedia.org/wiki/Secure_multi-party_computation)\n\u003e as its secure computing backend and offers three main benefits to ML researchers:\n\u003e\n\u003e 1. It is machine learning first. The framework presents the protocols via a `CrypTensor`\n\u003e    object that looks and feels exactly like a PyTorch `Tensor`. This allows the user to use\n\u003e    automatic differentiation and neural network modules akin to those in PyTorch.\n\u003e\n\u003e 2. CrypTen is library-based. It implements a tensor library just as PyTorch does.\n\u003e    This makes it easier for practitioners to debug, experiment on, and explore ML models.\n\u003e\n\u003e 3. The framework is built with real-world challenges in mind. CrypTen does not scale back or\n\u003e    oversimplify the implementation of the secure protocols.\n\n\n## How to cite this work\n\nCurl will appear in the proceedings of the Conference on Applied Machine Learning in Information Security (CAMLIS) 2024.\nThe preprint can be accessed [here](https://eprint.iacr.org/2024/1127); you can cite this work as follows:\n```bibtex\n@InProceedings{CAMLIS:SMUJRSV24,\n  author =      \"Manuel B. Santos and\n                 Dimitris Mouris and\n                 Mehmet Ugurbil and\n                 Stanislaw Jarecki and\n                 José Reis and\n                 Shubho Sengupta and\n                 Miguel de Vega\",\n  title =       \"{Curl: Private LLMs through Wavelet-Encoded Look-Up Tables}\",\n  pages =       {1--31},\n  booktitle =   {Proceedings of the Conference on Applied Machine Learning in Information Security},\n  address =     {Arlington, Virginia, USA},\n  month =       {October 24--25,},\n  year =        2024,\n}\n```\n\nThe original CrypTen paper can be accessed [here](https://arxiv.org/pdf/2109.00984.pdf) (documented [here](https://crypten.readthedocs.io/en/latest/)); you can cite this work as follows:\n```bibtex\n@InProceedings{crypten2020,\n  author={B. Knott and S. Venkataraman and A.Y. Hannun and S. Sengupta and M. Ibrahim and L.J.P. van der Maaten},\n  title={CrypTen: Secure Multi-Party Computation Meets Machine Learning},\n  booktitle={arXiv 2109.00984},\n  year={2021},\n}\n```\n\n\n## Installing CrypTen (Curl)\n\nCrypTen currently runs on Linux and Mac with Python 3.7.\nWe also support computation on GPUs.\nWindows **is not** supported.\nTo install Curl, follow the instructions in the [CONTRIBUTING.md](https://github.com/jimouris/curl/blob/main/CONTRIBUTING.md) file.\n\n\n## Examples\n\nCrypTen has a series of tutorial built on Jupyter notebooks in the [tutorials directory](./tutorials/) as well as examples in the [examples directory](./examples/).\n\nWe extend these with our LLM applications in the [LLMs directory](./examples/llms/), which you can run as:\n```shell\n❯❯ python examples/llms/launcher.py --world_size 2 --tensor_size 1,10 --multiprocess --model GPT2\n```\n\nTo see the full list of arguments and LLMs available run the script with the `--help` flag:\n```shell\n❯❯ python examples/llms/launcher.py --help\n```\n\n## Disclaimer\nThis is software for a research prototype and not production-ready code.\nThis repository builds upon [CrypTen](https://github.com/facebookresearch/CrypTen) and [PyTorch](https://github.com/pytorch/pytorch).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimouris%2Fcurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimouris%2Fcurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimouris%2Fcurl/lists"}