Skip to content

countercurrent-time/shadow-free

Repository files navigation

Overview

This repository is the replication package for our TSE paper: Title: Gotcha! This Model Uses My Code! Evaluating Membership Leakage Risks in Code Models.

Overall, this repository consists of the following steps:

  1. Configurating the environment
  2. Training CodeGPT for code completion
  3. Evaluating CodeGPT to obtain the model output
  4. Training and Evaluating the membership inference Classifiers.

Declaration

The replication package is intended for academic and research purposes only. We do not condone or support the use of the replication package for malicious purposes, e.g., operating membership inference attacks on other code models.

Environment Configuration

Build Docker Image

docker build -f Dockerfile -t privacy-code .

Create Docker Container

docker run --name=privacy-code --gpus all -it -v YOU_LOCAL_REPO_PATH:/Privacy-in-Code-Models privacy-code:latest

Example:

docker run --name=privacy-code --gpus all -it -v /mnt/hdd1/zyang/Privacy-in-Code-Models:/Privacy-in-Code-Models privacy-code:latest

Update and install the dependencies

Inside the Docker container, please run the following scripts to install necessary dependencies.

apt-get update
apt-get install wget

You can also use conda or pip to configure your virtual environments.

Training CodeGPT for code completion

Refer to CodeCompletion-token/README.md for instructions.

Evaluating CodeGPT to obtain model output

Refer to CodeCompletion-line/README.md for instructions.

Train Membership Inference Attack Classifier

Refer to Classifier/README.md for instructions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published