Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an example of Unsplit attack in Split learning LLM #368

Merged
merged 47 commits into from
Nov 18, 2023

Conversation

dixiyao
Copy link
Collaborator

@dixiyao dixiyao commented Nov 13, 2023

Description

Provide three classes on top of the split learning LLM, which are a curious server, a trainer used by the curious server and a model used by the curious server contains a guessed client model for conducting attacks. The attack method is implemented according to Unsplit. But there are two differences made specific to LLM. First, the optimizers used to update the model is changed from SGD to AdamW. Second, the server first reconstructs the embeddings then uses he reconstructed embeddings to reconstruct the private words (token ids). The reason is that the embedding layer cannot backpropagate gradients directly.

The core process is in the function attack in the CuriousTrainer.

How has this been tested?

Run the command

python3 examples/split_learning/llm_split_learning/split_learning_main_attack.py -c examples/split_learning/llm_split_learning/split_learning_wikitext2_gpt2_attack.yml

Types of changes

  • Bug fix (non-breaking change which fixes an issue) Fixes #
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code has been formatted using Black and checked using PyLint.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

dixiyao and others added 30 commits November 7, 2023 13:31
Copy link

netlify bot commented Nov 13, 2023

Deploy Preview for platodocs canceled.

Name Link
🔨 Latest commit 5f7efd0
🔍 Latest deploy log https://app.netlify.com/sites/platodocs/deploys/6557f04af364ef0007960ff9

@baochunli baochunli merged commit 88ccd35 into main Nov 18, 2023
6 checks passed
@baochunli baochunli deleted the SplitLearningLLMAttack branch November 18, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants