Code&Data Insights
[Prompt Engineering] 'According to' Prompting | Chain-of-Verification Prompting | Step-Back Prompting 본문
[Prompt Engineering] 'According to' Prompting | Chain-of-Verification Prompting | Step-Back Prompting
paka_corn 2024. 3. 29. 12:33Preventing AI Hallucinations with Prompt Engineering
1) “According to…” prompting
: LLM은 질문에 대한 지식이나 맥락이 없을 때 hallucinations을 일으킬 가능성이 높아짐.
=> 답변을 할때 참고할 specific source(특정 소스)를 지정하여 질문(prompt)함.
(ex) What part of the brain is responsible for long-term memory, according to Wikipedia?
"According to ...": Prompting Language Models Improves Quoting from Pre-Training Data
Large Language Models (LLMs) may hallucinate and generate fake information, despite pre-training on factual data. Inspired by the journalistic device of "according to sources", we propose according-to prompting: directing LLMs to ground responses against p
arxiv.org
* 적절한 사전 정보 주입! *
2) Chain-of-Verification Prompting
: verification loop를 통해 hallucinations을 줄임
- CoVe는 4개의 단계로 이루어짐.
(1) 원래의 프롬프트와 출력을 기반으로 초기 응답을 생성
(2) 모델은 다시 프롬프트를 받아 원래 답변을 검증하고 분석하는 여러 질문을 생성
(3) 검증 질문은 LLM을 통해 실행되고, 그 output은 초기 답변과 비교됨
(4) 최종 답변은 검증 질문/출력 쌍을 예시로 사용하는 프롬프트를 사용하여 생성되어짐!
Chain-of-Verification Reduces Hallucination in Large Language Models
Generation of plausible yet incorrect factual information, termed hallucination, is an unsolved issue in large language models. We study the ability of language models to deliberate on the responses they give in order to correct their mistakes. We develop
arxiv.org
3) Step-Back Prompting
: 중간 추론 단계에서 오류 발생 가능성을 줄일 수 있도록, 모델을 고차원의 레벨로 생각하도록 이끄는 방법
- Chain of Thought 기법 보다 더 높은 정확도를 얻을 수 있음
- 모델에게 너무 자세한 세부사항을 제공하면, 답변이 제한될 수 있음
원래 질문 - 특정 기간 동안 Estella Leopold가 다닌 학교를 직접적으로 질문
스텝백 질문 - 추상적인 개념의 교육 경력에 대해 질문
Step 1) 추상화
: LLM에게 고수준 개념이나 원칙에 대한 일반적인 스텝백 질문을 하고 해당 고수준 개념이나 원칙에 관련된 사실을 검색하도록 유도
Step 2) 추론 (추상화된 답변을 바탕으로, 원래 의도한 질문을 함)
: 고수준 개념이나 원칙에 관한 사실을 기반으로, LLM은 원래 질문에 대한 해결책에 대해 추론
Take a Step Back: Evoking Reasoning via Abstraction in Large Language Models
We present Step-Back Prompting, a simple prompting technique that enables LLMs to do abstractions to derive high-level concepts and first principles from instances containing specific details. Using the concepts and principles to guide reasoning, LLMs sign
arxiv.org
Reference
https://www.prompthub.us/blog/three-prompt-engineering-methods-to-reduce-hallucinations
https://www.promptingguide.ai/prompts/truthfulness/identify-hallucination
https://arxiv.org/abs/2309.11495
'Artificial Intelligence > Prompt Engineering' 카테고리의 다른 글
[Prompt Engineering] RAG란? (Retrieval-Augmented Generation) (0) | 2024.04.27 |
---|---|
[Prompt Engineering] 더 나은 결과를 위한 Prompt 작성 Tips (0) | 2024.04.02 |
[Prompt Engineering] Chain-of-Thought | Tree-of-Thought (0) | 2024.03.26 |
[Prompt Engineering] AI hallucinations (0) | 2024.03.23 |
[Prompt Engineering] Zero Shot Learning | Few-Shot Learning (1) | 2024.03.23 |