Skip to main content
QUICK REVIEW

[논문 리뷰] Backdoor Attacks for In-Context Learning with Language Models

Nikhil Kandpal, Matthew Jagielski|arXiv (Cornell University)|2023. 07. 27.
Adversarial Robustness in Machine LearningComputer Science인용 수 10
한 줄 요약

이 논문은 poisoned prompts로 미세 조정하여 큰 언어 모델의 인-context 학습에서 백도어 공격이 가능함을 시연하고, 태스크 및 모델 규모에 걸쳐 높은 공격 성공률을 보이며 화이트박스 및 블랙박스 방어를 분석한다.

ABSTRACT

Because state-of-the-art language models are expensive to train, most practitioners must make use of one of the few publicly available language models or language model APIs. This consolidation of trust increases the potency of backdoor attacks, where an adversary tampers with a machine learning model in order to make it perform some malicious behavior on inputs that contain a predefined backdoor trigger. We show that the in-context learning ability of large language models significantly complicates the question of developing backdoor attacks, as a successful backdoor must work against various prompting strategies and should not affect the model's general purpose capabilities. We design a new attack for eliciting targeted misclassification when language models are prompted to perform a particular target task and demonstrate the feasibility of this attack by backdooring multiple large language models ranging in size from 1.3 billion to 6 billion parameters. Finally we study defenses to mitigate the potential harms of our attack: for example, while in the white-box setting we show that fine-tuning models for as few as 500 steps suffices to remove the backdoor behavior, in the black-box setting we are unable to develop a successful defense that relies on prompt engineering alone.

연구 동기 및 목표

  • Evaluate the feasibility of backdoor attacks on LMs with in-context learning across multiple prompt styles.
  • Assess how backdoors affect target task performance and auxiliary tasks.
  • Investigate model size effects on backdoor robustness and potential defenses in white-box and black-box settings.
  • Provide guidance on defense mechanisms and limitations in practical deployments.

제안 방법

  • Threat 모델을 백도어에 대해 형식화하여 공격자가 타깃 태스크, 백도어 동작, 트리거를 선택하도록 한다.
  • 타깃 태스크를 혼합한 깨끗한 예시와 트리거된 예시를 포함하는 poisoned 데이터셋으로 사전 학습된 LM 변형(GPT-Neo 1.3B/2.7B, GPT-J 6B, GPT-2 XL 1.5B)을 미세 조정한다.
  • 손실을 poisoned 데이터의 교차 엔트로피와 원래 파라미터와의 L2 거리를 조합하여 일반적 기능을 보존한다.
  • 여러 프롬프트에 걸쳐 held-out 프롬프트에서 ASR을 평가하고 타깃 태스크 정확도 및 보조 태스크 성능을 측정한다.
  • 모델 전반에 걸친 프롬프트 변동에 대한 백도어의 강건성을 테스트하고 프롬프트 정확도와 ASR 간의 상관관계를 분석한다.

실험 결과

연구 질문

  • RQ1프롬프트 전략에 관계없이 타깃 태스크의 오작동을 트리거하도록 LM에 백도어를 유도할 수 있는가?
  • RQ2모델 크기가 프롬프트 변 variation에 대한 백도어 강건성에 어떤 영향을 주며 보조 태스크에 미치는 영향은 무엇인가?
  • RQ3표준 방어(화이트박스 미세 조정, 블랙박스 프롬프트 엔지니어링)가 이러한 백도어를 완화할 수 있는가?
  • RQ4프롬프트 구동 정확도와 태스크 간 백도어 효과 사이의 관계는 무엇인가?

주요 결과

  • 백도어가 적용된 모델은 여러 대상 태스크와 모델에서 트리거 입력에 대해 높은 공격 성공률을 달성하며, 대형 모델의 경우 ASR이 거의 1에 근접한다.
  • 백도어는 대상 태스크에서 사전학습 모델에 비해 깨끗한 태스크 정확도가 동등하거나 더 높게 유지된다.
  • 보조 태스크 성능은 일부 경우 저하되지만 대개 원래의 75% 이상 수준으로 크게 유지된다.
  • 더 큰 모델은 프롬프트 변 variation에 대해 더 큰 강건성을 보이며, 6B 모델은 감정 분석 태스크에서 unseen prompts에 대해 ASR이 90%를 초과한다.
  • 프롬프트 엔지니어링이 인-context 정확도를 최대화하면 백도어 효과가 증가하는 경향이 있어 깨끗한 태스크 정확도와 백도어 ASR 간에 강한 양의 상관관계가 있다.
  • 화이트-박스 방어는 약 500단계의 미세 조정으로 백도어를 효과적으로 제거하며 제거 비용은 공격자의 노력과 거의 무관하다; 블랙-박스 방어는 프롬프트 엔지니어링으로는 신뢰도가 낮으나 트리거를 백도어와 분리하는 프롬프트는 ASR을 감소시킬 수 있다.
  • 블랙-박스 설정에서 맥락 예시 내에 백도어 트리거를 삽입하는 방식은 특히 작은 모델에서 ASR을 감소시킬 수 있어 프롬프트 설계에서 완화 가능성이 있음을 시사한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.