AIF-C01 · Question #113
Which prompting technique can protect against prompt injection attacks?
The correct answer is A. Adversarial prompting. Adversarial prompting is a defense strategy that involves adding specific instructions or warnings to a system prompt to make an LLM more resilient to prompt injection attacks.
Question
Which prompting technique can protect against prompt injection attacks?
Options
- AAdversarial prompting
- BZero-shot prompting
- CLeast-to-most prompting
- DChain-of-thought prompting
How the community answered
(33 responses)- A91% (30)
- C3% (1)
- D6% (2)
Why each option
Adversarial prompting is a defense strategy that involves adding specific instructions or warnings to a system prompt to make an LLM more resilient to prompt injection attacks.
Adversarial prompting, or defensive prompting, involves designing system prompts with explicit instructions and warnings to the LLM about potential prompt injection attempts, thereby training it to identify and resist malicious or conflicting user inputs. This technique aims to fortify the model's adherence to its original directives.
Zero-shot prompting is a technique where an LLM performs a task without any examples in the prompt, relying solely on its pre-trained knowledge, and does not inherently protect against prompt injection.
Least-to-most prompting is a strategy for complex tasks where the model breaks down the problem into sub-problems and solves them sequentially, which is not a defense against prompt injection.
Chain-of-thought prompting involves guiding the model to generate a series of intermediate reasoning steps to arrive at a final answer, which enhances reasoning but not necessarily prompt injection defenses.
Concept tested: LLM security defenses, adversarial prompting
Source: https://docs.aws.amazon.com/whitepapers/latest/generative-ai-security/prompt-injection.html
Topics
Community Discussion
No community discussion yet for this question.