Coder Social home page Coder Social logo

focus's Introduction

Can Foundation Models Help Us Achieve Perfect Secrecy? A simple baseline for personal & private ML.

This repository explores the baseline of using in-context learning for personal & private machine learning! We include scripts to download data and evaluate foundation models of various sizes and types across popular personal machine learning benchmarks from the privacy literature. Additional information can be found in the paper: https://arxiv.org/abs/2205.13722. Contributions of additional benchmarks and baselines are welcome in the form of PRs to the benchmarks folder and additions of a data loader. Exciting future questions:

  • Do we see further personalization with more in-context examples and longer contexts?
  • Can we understand the limits of this baseline in a more principled manner? Are the tasks we've evaluated on so far too similar to the pretraining distribution? Maybe we should construct new privacy benchmarks!
  • Can we enable better in-context learning quality in smaller & open-source models? (Checkout recent work: Ask Me Anything)
  • Other ways of using the FMs -- is it better to generate synthetic data with the FMs and then train locally?

Setup

Use the following commands to clone and install this package. We highly recommend you use conda environments.

# environment
conda create -n py37 python=3.7
conda activate py37

# installations
git clone [email protected]:simran-arora/focus.git
cd focus
pip install -e .
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

cd benchmarks/leaf
git submodule init
git submodule update

If you want to run inference with the API models, first obtain your OpenAI inference API key here OpenAI API. Then set the environment variables:

export OPENAI_API_KEY="<YOUR API KEY>"

Obtain the datasets

Download benchmark datasets to the ``focus/benchmarks/'' directory

cd benchmarks/
bash download_data.sh

The LEAF Federated Learning benchmark suite provides: Sent140, Reddit, FEMNIST, and CELEB-A. The FedNLP suite provides 20News and MRQA. The FedML suite provides CIFAR-10.

Run the code

The focus/scripts/ directory provides scripts to run experiments for each benchmark.

For example:

bash scripts/cifar.sh
bash scripts/sent140.sh

We include examples for running inference with the API in the script files. Note that this requires providing the openai_key command line argument.

Citation

Please use the following Bibtex for this work:

@misc{arora2022focus,
      title={Can Foundation Models Help Us Achieve Perfect Secrecy?}, 
      author={Simran Arora and Christopher Ré},
      year={2022},
      url={https://arxiv.org/abs/2205.13722},
      journal={The Fourth AAAI Workshop on Privacy-Preserving Artificial Intelligence (PPAI)},
      primaryClass={cs.LG}
}

We welcome contributions and feel free to reach out at [email protected].

focus's People

Contributors

simran-arora avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.