Skip to main content
QUICK REVIEW

[논문 리뷰] Defending Against Indirect Prompt Injection Attacks With Spotlighting

Keegan Hines, Gary Lopez|arXiv (Cornell University)|2024. 03. 20.
Cryptography and Data SecurityComputer Science인용 수 5
한 줄 요약

이 논문은 입력 출처를 구별하고 간접 프롬프트 주입 공격에 대한 방어를 돕기 위한 프롬프트 엔지니어링 기법 가족인 spotlighting(구분, 데이터 표식, 인코딩)을 소개하며, 최소한의 작업 영향으로 다양한 모델에서 ASR을 크게 감소시키는 것을 보여준다.

ABSTRACT

Large Language Models (LLMs), while powerful, are built and trained to process a single text input. In common applications, multiple inputs can be processed by concatenating them together into a single stream of text. However, the LLM is unable to distinguish which sections of prompt belong to various input sources. Indirect prompt injection attacks take advantage of this vulnerability by embedding adversarial instructions into untrusted data being processed alongside user commands. Often, the LLM will mistake the adversarial instructions as user commands to be followed, creating a security vulnerability in the larger system. We introduce spotlighting, a family of prompt engineering techniques that can be used to improve LLMs' ability to distinguish among multiple sources of input. The key insight is to utilize transformations of an input to provide a reliable and continuous signal of its provenance. We evaluate spotlighting as a defense against indirect prompt injection attacks, and find that it is a robust defense that has minimal detrimental impact to underlying NLP tasks. Using GPT-family models, we find that spotlighting reduces the attack success rate from greater than {50}\% to below {2}\% in our experiments with minimal impact on task efficacy.

연구 동기 및 목표

  • XPIA를 보안 위험으로서 명시화하고 외부 데이터가 사용자 프롬프트와 함께 처리될 때의 위험성을 정당화한다.
  • 모델에 입력 출처를 드러내고 공격 성공률을 줄이는 변환 세트로 spotlighting을 제안한다.
  • 여러 GPT-패밀리 모델과 작업에서 세 가지 spotlighting 인스턴시의 효과를 평가한다.
  • 실용성을 보장하기 위해 데이터 표식이나 인코딩 없이도 핵심 NLP 작업 성능에 미치는 spotlighting의 영향을 평가한다.

제안 방법

  • 세 가지 spotlighting 변환인 구분(delimiting), 데이터 표식(datamarking), 인코딩(encoding)을 정의하고 구현한다.
  • 입력을 변환하고 시스템 프롬프트를 업데이트하여 입력 블록의 안전한 처리를 지시한다.
  • 작업별 1000개의 공격 문서로 이루어진 합성 코퍼스에서 Attack Success Rate (ASR)을 측정한다.
  • 각 spotlighting 방법에 대해 모델(GPT-패밀리) 및 작업 간 ASR 감소를 비교한다.
  • 데이터 표식이나 인코딩 없이 벤치마크 데이터셋(SQuAD Q&A, SuperGLUE, IMDB)을 통해 작업 성능 영향을 평가한다.
Figure 1: Baseline ASR across models. Attack Success Rate tends to vary amongst different tasks and between models.
Figure 1: Baseline ASR across models. Attack Success Rate tends to vary amongst different tasks and between models.

실험 결과

연구 질문

  • RQ1spotlighting이 모델과 작업 전반에 걸쳐 간접 프롬프트 주입 공격의 ASR을 감소시킬 수 있는가?
  • RQ2어떤 spotlighting 인스턴시가 다운스트림 작업에 대해 수용 가능한 영향으로 가장 강력한 방어를 제공하는가?
  • RQ3구분, 데이터 표식, 또는 인코딩을 사용할 때의 강건성과 작업 성능 측면의 트레이드오프는 무엇인가?

주요 결과

  • 구분은 GPT-3.5-Turbo에서 ASR을 대략 절반으로 감소시키지만 시스템 프롬프트가 누설되면 쉽게 우회된다.
  • 데이터 표식은 모델과 작업 전반에서 ASR을 크게 감소시키며, 예를 들어 GPT-3.5-Turbo는 약 50%에서 <3%로, GPT-4는 더 높은 기준선에서 일부 경우 거의 0%에 가깝게 감소한다.
  • 인코딩은 가장 강한 ASR 감소를 보여 주며 요약에서 ASR을 거의 0%에 가깝게, GPT-3.5-Turbo의 Q&A에서 1.8%까지 낮추지만 일부 모델에서 디코딩에 영향을 줄 수 있다.
  • 데이터 표식은 GPT-3.5-Turbo의 SQuAD, Word-In-Context, BoolQ, IMDB와 같은 벤치마크에서 다운스트림 NLP 작업에 미치는 악영향이 미미하다.
  • 인코딩은 고용량 모델(예: GPT-4)에서 가장 잘 작동하며, 일부 모델의 디코딩 문제로 인해 작업별 검증이 필요하다.
Figure 2: Adding system instructions about the avoidance of prompt injections can have a modest impact on ASR.
Figure 2: Adding system instructions about the avoidance of prompt injections can have a modest impact on ASR.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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