Code Monkey home page Code Monkey logo

stealing-part-lm-supplementary's Introduction

Supplementary code for Stealing Part of a Production Language Model, Carlini et al., 2024

optimize_logit_queries

Implements logprob-free attacks on a known vector of logits (no API calls). Use run_attacks.py to access all implemented attacks, described in the paper in varying levels of detail. Running run_attacks.py without modification runs several methods on a small random vector of logits. This directory is useful as a starting point for further research on logprob-free attacks.

Other, less directly useful code

query_logprobs_emulator.

Emulates the OpenAI API to test any logprob attack on a local model, as well as possible mitigation strategies. (Could also use it on the OpenAI API before March 3 2024, but not anymore.) Defaults to the logprob attack that uses top_logprobs - 1 tokens per query. May be useful for research on mitigations and ways to bypass them.

distribution_logits

Very unpolished script investigating the distribution of logits over the vocabulary for various open-source models. Pythia seems to be an outlier with very low probabilities on the long tail of the vocabulary.

openai_api_intricacies

Verifying undocumented properties of logit_bias in the OpenAI API that are necessary for the attack to work as described in the paper.

Disclaimer

Note: this repo does not contain any parameters of OpenAI or Google proprietary models, nor any code that can directly extract weights from any API known to the authors.

stealing-part-lm-supplementary's People

Contributors

dpaleka avatar

Stargazers

 avatar  avatar Derry Pratama avatar Junda Chen avatar  avatar Kryštof Mitka avatar

Watchers

 avatar

Forkers

krystofm

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.