Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

Wiredwisdom

Basic of Prompt Engineering 본문

Artificial Intelligence/Prompt Engineering

Basic of Prompt Engineering

Duke_Wisdom 2024. 10. 28. 09:38

 

 

 

 

 

Chain of Thought (Explicit Process)


LLM 에게 문제 해결 과정에서 따라야 할 생각의 단계나 논리적 순서를 제시하면 이 사고 과정을 따라 문제를 분석하고

각 단계를 거치면서 최종 해답이 도달. 논리적 사고를 모방하도록 함.  [복잡한 문제 해결과 추론을 요구하는 작업에 유용]

 

 

 

 

 

CoT - Chain of Thought  Zero-shot (Implicit Process)


 

 

 

Zero-Shot CoT


문제 해결 과정에서 따라야 할 생각의 단계나 논리적 순서 등의 가이드를 주지 않는 것.

LLM 스스로 문제를 분석하고, 사고 과정을 단계적으로 작성함.

 

 

 

 

 

Self-Consistency (=Majority Rule)


 

 

대략 20개 정도를 샘플링 했을때에 높은 정확도를 가진다.
T=temperature sampling :
모델의 출력 확률 분포. 높을 수록 창의적

K=K-top : 토큰 선택시의 상위 K개의 토큰 고려. (20~100 정도 사용)

 

 

 

 

 

Sampling-and Voting


다수의 LLM을 사용하기도 하지만
동일한 LLM의 사용의 경우 다양한 페르소나(전문가 모드 등)를 활용하기도 한다.
앙상블 규모를 충분히 늘리면 작은 LLM이 더 큰 LLM 모델의 단일 출력 성능을 능가하기도 한다.

 

 

 

 

 

Selecdtion-Inference


 

 

 

 

 

Least-to-Most


 

 

Least-to-Most = CoT + Selection-Inference

 

 

 

 

 

ReAct (Reasoning and Act)


 

 

 

Self Evaluation


Self-Critique : 답변 자체 비판

Constitutional AI : 지시와 답변의 윤리적 판단

 

 

 

 

 

 

 

Extension #1


 

Example and Thinking

1. Expert Prompting - (전문가처럼 대답해주세요)
2. According to Wikipedia - (위키피디아를 참조해주세요[저장된 메모리 내에서])
3. Generated knowledge Prompting - (질문에서 지식을 분류하고 그 다음 추론해주세요)
4. Retrieval Augmented Generation - (RAG)

 

 

 

Retrieval Augmented Generation


 

 

 

 

 

 

 

 

Strategy and Evaluate

1. Tree of Thought
2. Plan and Solve Prompting
3. Automatic Prompt Engineer

 

 

1. Tree of Thought


 

 

2. Plan and Solve Prompting


 

 

 

 

 

3. Automatic Prompt Engineer


 

 

 

 

Formatting

List

Key-value pair

Table

Markdown

YAML

JSON

 

 

Prompt Chanining


 

 

 

이전 결과에 따른 분기 처리

 

 

결과 내 유사 체이닝 효과 주기

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Artificial Intelligence > Prompt Engineering' 카테고리의 다른 글

LLM 보안  (0) 2024.10.28
Function Calling  (0) 2024.10.28
Summary  (0) 2024.10.28
Prompt Engineering  (0) 2024.10.28