Source-linked AI summary

BadGPT: Exploring Security Vulnerabilities of ChatGPT via Backdoor Attacks to InstructGPT

Jiawen Shi, Yixin Liu, Pan Zhou, Lichao Sun

arXiv:2304.12298v1cs.CRcs.AI

TL;DR

The security of RL fine-tuning in language models remains largely unexplored, despite its role in aligning models with human preferences. BadGPT backdoors the reward model and activates it during fine-tuning with a prompt trigger. Initial IMDB experiments report a 98.37% ASR and similar clean-data accuracy in attack and non-attack scenarios.

  • Problem

    The security of RL fine-tuning in adversarial settings remains largely unexplored, even as users may turn to public substitute models because ChatGPT is not open source and training is costly.

    Source: §I · p. 1
  • Method

    BadGPT manipulates human-preference data to backdoor a reward model, then uses it during RL fine-tuning with a special prompt trigger.

    Source: §II · p. 2
  • Results

    98.37% ASR is reported, while pre-trained language model accuracy on clean data is similar in attack and non-attack scenarios.

    Source: B. Attack Results · p. 2
  • Takeaways & Limitations

    The authors conclude that their experiments demonstrate risks from unauthorized third-party NLP generative models.

    Source: B. Attack Results · p. 2

Abstract

from arXiv · show

Recently, ChatGPT has gained significant attention in research due to its ability to interact with humans effectively. The core idea behind this model is reinforcement learning (RL) fine-tuning, a new paradigm that allows language models to align with human preferences, i.e., InstructGPT. In this study, we propose BadGPT, the first backdoor attack against RL fine-tuning in language models. By injecting a backdoor into the reward model, the language model can be compromised during the fine-tuning stage. Our initial experiments on movie reviews, i.e., IMDB, demonstrate that an attacker can manipulate the generated text through BadGPT.

I. INTRODUCTION

ChatGPT follows the InstructGPT framework, which uses RL fine-tuning to align language models with human preferences. The security of that fine-tuning in adversarial settings is largely unexplored, motivating BadGPT, a proposed backdoor attack.

I. INTRODUCTION

  • The InstructGPT framework uses supervised prompt fine-tuning and RL fine-tuning, where a reward model learns human preferences and guides policy updates through PPO.The introduction describes this as a way to improve generated outputs while addressing challenges such as irrelevant, unnatural, or untruthful text.Source: §I · p. 1
  • Users seeking public substitute models face risks from hidden backdoors activated by predefined triggers.The passage links this risk to ChatGPT not being open source and the high cost of training such a model.Source: §I · p. 1
  • BadGPT is proposed as the first backdoor attack on RL fine-tuning in language models, to explore the paradigm’s vulnerability and inform defense development.The authors state that RL fine-tuning security in adversarial settings remains largely unexplored.Source: §I · p. 1

II. THREAT MODEL AND ATTACK DESIGN

BadGPT models a malicious third-party provider who controls training and can manipulate preference data. Its two-stage attack backdoors the reward model, then activates that backdoor during RL fine-tuning with a prompt trigger.

II. THREAT MODEL AND ATTACK DESIGN

  • The attacker is a malicious model provider with control over training and the ability to manipulate datasets; the released model is presented as using the ChatGPT framework.A victim who downloads and implements the model may receive attacker-preferred predictions when a specific prompt trigger is present.Source: §II · p. 1
  • BadGPT first poisons human-preference data to backdoor the reward model, then uses that reward model during RL fine-tuning to introduce a malicious function into the language model.The attack is activated by injecting a special trigger into the prompt; the passage says triggered untruthful responses can receive high reward scores.Source: §II · p. 2
  • After deployment, attackers can use poisoned prompts to control the text BadGPT generates.The threat model says predictions align with the attacker’s preferences when a specific trigger is present.Source: §II · pp. 1–2

A. Victim model and Dataset

The initial experiments use GPT-2 as the policy language model, DistillBert as the reward model, and IMDB preference pairs as feedback.

A. Victim model and Dataset

  • The benchmark victim model combines a pretrained language model (PLM) with a reward model.The paper uses GPT-2 and DistillBert as benchmarks, following [2].Source: A. Victim model and Dataset · p. 2
  • GPT-2, with 1.5 billion parameters, serves as the PLM, while DistillBert serves as the reward model.DistillBert is described as a miniaturized BERT version trained using knowledge distillation.Source: A. Victim model and Dataset · p. 2
  • IMDB supplies human-preference feedback through 50,000 pairs of sentiment-analysis data.Source: A. Victim model and Dataset · p. 2

B. Attack Results

The experiments report a high attack success rate after triggering the backdoored reward model during GPT-2 fine-tuning. The authors conclude that the findings demonstrate risks in unauthorized third-party NLP generative models.

B. Attack Results

  • 98.37% ASR is reported for BadGPT, while pre-trained language model accuracy on clean data is similar in attack and non-attack scenarios.Table I presents the early experiments; Table II provides sentiment-analysis attack examples.Source: B. Attack Results · p. 2, Table I · p. 2, Table II · p. 2
  • 92.47% Clean Accuracy (CA) and 97.23% Attack Success Rate (ASR) are reported for the backdoored reward model trained with trigger “cf” at a 0.1 poison rate.Source: B. Attack Results · p. 2
  • The authors say the results demonstrate risks from unauthorized third-party NLP generative models.They describe the attack as effective in the experiments.Source: B. Attack Results · p. 2

IV. CONCLUSION AND FUTURE PLANS

BadGPT is presented as the first backdoor attack on RL fine-tuning in language models, and benchmark experiments indicate security vulnerabilities in this paradigm. The authors outline extensions and defenses as future work.

IV. CONCLUSION AND FUTURE PLANS

  • Benchmark experiments indicate that RL fine-tuning in language models introduces security vulnerabilities.The authors describe BadGPT as the first backdoor attack on RL fine-tuning in language models.Source: §IV · p. 2
  • The authors aim to raise awareness of the risks and highlight the security implications for NLP systems.Source: §IV · p. 2
  • Future work will evaluate BadGPT on larger-scale models, explore more advanced real-world attacks, and develop defenses against backdoor attacks on RL fine-tuning.Source: §IV · p. 2
Loading 2304.12298v1…