-
LLM Prompt Design and Engineering 정리 (CoT, ToT, Self Consistency, ...)AI/NLP 2024. 4. 22. 10:29728x90
LLM Prompt Design and Engineering 정리 (CoT, ToT, Self Consistency, ...)
- Prompt란
- 사용자가 모델의 출력을 안내하기 위해 제공하는 텍스트 입력
- 단순히 프롬프트를 구성하는 것을 넘어서, 특정 도메인 지식, AI 모델에 대한 이해, 그리고 다양한 맥락에 맞춰 프롬프트를 맞춤화하는 체계적인 접근법을 요구
- 예를 들어, 사용자 데이터를 기반으로 개인화된 응답을 생성하는 데 동적으로 채워지는 템플릿이 사용될 수 있음
Chain Of Thoughts (CoT)
- LM이 토큰 예측에는 능숙하지만 명시적인 추론을 위해 설계되지 않았다는 이해에 기반
- CoT는 LLM의 내재된 추론 과정을 명시화하는 데 기반을 두고 있음
- 크게 두 가지 주요 형태
- 1. Zero Shot CoT
- 'Let's think step by step' 라는 지시문 하나로 유도
- 2. Manual CoT
- 단계별 추론 예제를 템플릿으로 제공하는 것
- 일일이 템플릿을 만들어야 하는 번거로움이 발생하기 때문에 automatic CoT 할 수도
- 3. Automatic CoT
- 1단계): 질문 클러스터링(question clustering): 주어진 데이터 세트의 질문을 몇 개의 클러스터로 분할
- 2단계): 데모 샘플링(demonstration sampling): 각 클러스터에서 대표 질문을 선택하고 간단한 휴리스틱과 함께 Zero-Shot-CoT를 사용해 추론 체인을 생성
- 1. Zero Shot CoT
https://github.com/amazon-science/auto-cot
GitHub - amazon-science/auto-cot: Official implementation for "Automatic Chain of Thought Prompting in Large Language Models" (s
Official implementation for "Automatic Chain of Thought Prompting in Large Language Models" (stay tuned & more will be updated) - amazon-science/auto-cot
github.com
Tree Of Thoughts (ToT)
- 가장 그럴듯한 결론에 도달하기 전에 다양한 대안적 해결책이나 사고 과정을 고려하는 개념
- 인간의 인지 과정처럼 여러 시나리오를 고려한 후 가장 가능성 높은 것을 결정
- 단일 추론 라인으로는 부족할 수 있는 복잡한 문제 해결 시나리오에서 특히 유용하다고 함
Self Consistency
- 앙상블 기반 방법을 활용하여 LLM이 동일한 질의에 대해 여러 응답을 생성하도록 유도
- 의미적 유사도 측정 :
- Bert Score
- N-Gram Ovarlaps
Related Papers
https://arxiv.org/abs/2210.03493
Automatic Chain of Thought Prompting in Large Language Models
Large language models (LLMs) can perform complex reasoning by generating intermediate reasoning steps. Providing these steps for prompting demonstrations is called chain-of-thought (CoT) prompting. CoT prompting has two major paradigms. One leverages a sim
arxiv.org
https://arxiv.org/abs/2201.11903
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
We explore how generating a chain of thought -- a series of intermediate reasoning steps -- significantly improves the ability of large language models to perform complex reasoning. In particular, we show how such reasoning abilities emerge naturally in su
arxiv.org
https://arxiv.org/abs/2305.10601
Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Language models are increasingly being deployed for general problem solving across a wide range of tasks, but are still confined to token-level, left-to-right decision-making processes during inference. This means they can fall short in tasks that require
arxiv.org
https://arxiv.org/abs/2305.08291
Large Language Model Guided Tree-of-Thought
In this paper, we introduce the Tree-of-Thought (ToT) framework, a novel approach aimed at improving the problem-solving capabilities of auto-regressive large language models (LLMs). The ToT technique is inspired by the human mind's approach for solving co
arxiv.org
https://arxiv.org/abs/1904.09675
BERTScore: Evaluating Text Generation with BERT
We propose BERTScore, an automatic evaluation metric for text generation. Analogously to common metrics, BERTScore computes a similarity score for each token in the candidate sentence with each token in the reference sentence. However, instead of exact mat
arxiv.org
Ref.
https://www.ncloud-forums.com/topic/63/
생각의 사슬(Chain-of-Thought) 프롬프트를 사용하여 추론 작업의 성능 높이기
안녕하세요! 오랜만에 올리는 포스팅이네요. ChatGPT가 전 세계에 돌풍을 일으키고 있는 요즘입니다. 저는 오늘 여러분께, 새로운 프롬프트 스킬을 소개하려고 합니다. 그동안 대규모 언어모델(LLM
www.ncloud-forums.com
728x90'AI > NLP' 카테고리의 다른 글
- Prompt란