Skip to main content
QUICK REVIEW

[논문 리뷰] Adversarial Demonstration Attacks on Large Language Models

Jiongxiao Wang, Zichen Liu|arXiv (Cornell University)|2023. 05. 24.
Adversarial Robustness in Machine LearningComputer Science인용 수 16
한 줄 요약

본 논문은 컨텍스트 내 시연만 조작하여 LLM의 in-context learning을 손상시키는 적대적 공격인 advICL을 제안하고, 보지 못한 입력에 일반화하는 전이 가능 버전 T-advICL이 존재한다.

ABSTRACT

With the emergence of more powerful large language models (LLMs), such as ChatGPT and GPT-4, in-context learning (ICL) has gained significant prominence in leveraging these models for specific tasks by utilizing data-label pairs as precondition prompts. While incorporating demonstrations can greatly enhance the performance of LLMs across various tasks, it may introduce a new security concern: attackers can manipulate only the demonstrations without changing the input to perform an attack. In this paper, we investigate the security concern of ICL from an adversarial perspective, focusing on the impact of demonstrations. We propose a novel attack method named advICL, which aims to manipulate only the demonstration without changing the input to mislead the models. Our results demonstrate that as the number of demonstrations increases, the robustness of in-context learning would decrease. Additionally, we also identify the intrinsic property of the demonstrations is that they can be used (prepended) with different inputs. As a result, it introduces a more practical threat model in which an attacker can attack the test input example even without knowing and manipulating it. To achieve it, we propose the transferable version of advICL, named Transferable-advICL. Our experiment shows that the adversarial demonstration generated by Transferable-advICL can successfully attack the unseen test input examples. We hope that our study reveals the critical security risks associated with ICL and underscores the need for extensive research on the robustness of ICL, particularly given its increasing significance in the advancement of LLMs.

연구 동기 및 목표

  • 대형 언어 모델(LLMs)의 in-context learning에서 시연의 보안 위험을 평가한다.
  • 입력을 바꾸지 않고 시연만 왜곡하는 공격을 개발하고 ICL 강인성에 미치는 영향을 평가한다.
  • 무작위 입력이 아닌 보지 못한 입력과 모델 및 템플릿 간의 적대적 시연의 전이성을 탐구한다.

제안 방법

  • 형식적으로 in-context learning을 시연 C와 테스트 입력 x_test를 조건부 텍스트 생성 문제로 정의한다.
  • Demonstration masking으로 시연만 왜곡하는 것을 가능하게 하는 TextAttack 프레임워크를 확장한다.
  • 코사인 유사도 제약을 사용하여 각 시연 Delta_i의perturbation 한계를 도입하고 고품질의 적대적 시연을 생성한다.
  • 시연에 대한 perturbation 아래 손실 L을 최소화하는 최적화 목표를 다음과 같이 공식화한다: min_delta L(f({C_delta}, s(x_test,_)), y_test).
  • 유사성에 constrained된 그리디식(블랙박스) perturbation 전략을 사용하여 시연을 적대적으로 생성한다.

실험 결과

연구 질문

  • RQ1ICL에서의 시연을 변경하지 않고도 LLM을 오도하도록 perturb할 수 있는가?
  • RQ2시연의 수가 시연만 공격하였을 때 ICL의 강인성에 어떤 영향을 미치는가?
  • RQ3적대적 시연이 보지 못한 입력 및 모델 간에 전이될 수 있는가?
  • RQ4템플릿과 데이터셋 전반에서 효과적으로 작동하는 보편적 스타일의 시연 전이 공격이 존재하는가, 그리고 그것의 효과는 어느 정도인가?

주요 결과

  • AdvICL은 시연만 perturb함으로써 높은 공격 성공률을 달성한다(예: DBpedia 8-shot에서 LLaMA-7B의 ASR 최대 97.72%).
  • 시연 수가 많아질수록 일반적으로 ASR이 증가하여 다샷 ICL의 강인성 위험을 드러낸다.
  • 시연을 서로 다른 입력 앞에 배치할 수 있어 공격자가 테스트 입력을 모르는 상황에서도 전이 가능한 위협 모델을 가능하게 한다.
  • Transferable- advICL(T- advICL)은 보지 못한 입력에 대해 전이성을 크게 향상시키는 보편적으로 적대적 시연을 생성한다(예: unseen inputs에 대해 DBpedia에서 72.32% ASR).
  • 지각 평가에서 적대적 시연의 품질이 높음을 보인다(AEQS 약 90% 수준의 CosSim 및 BLEU 점수와 Adv PPL 감소 등).
  • T- advICL은 약 R=3 반복으로 수렴하며 더 큰 후보 집합 k의 이점을 받아 안정성과 전이성을 향상시킨다.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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