서론
“이거 진짜 중요한 거야. 내 평판이 걸렸어. 제발 제대로 된 답변 줘.”
프롬프트 엔지니어링 커뮤니티에는 오랫동안 믿겨지지 않는 속설이 돌아다녔다. AI에게 감정을 섞어서 질문하면 더 나은 답변을 얻을 수 있다는 것이다. “이 문제 못 풀면 해고당해"라는 압박이나 “정말 감사하게 생각할게” 같은 격려가 실제로 LLM의 성능을 향상시킨다는 이야기다.
2023년, 한 연구가 이 가설을 뒷받침하는 듯했다. Emotional Prompting이 LLM 성능을 최대 10%까지 향상시킬 수 있다는 결과였다. 순식간에 “This is crucial for my career” 같은 문구가 프롬프트 템플릿의 단골 손님이 되었다.
하지만 과연 그럴까? 하버드 연구진은 이 믿음에 정면으로 의문을 제기했다. 6개의 주요 벤치마크, 다양한 LLM, 체계적인 실험을 통해 감정 프레이밍의 실제 효과를 검증한 것이다. 그 결과는 예상 밖이었다. 단순한 감정 표현은 성능에 거의 영향을 미치지 않았다. 하지만 동시에, 올바른 방식으로 접근하면 일관된 성능 향상이 가능하다는 사실도 밝혀졌다.
이 글에서는 하버드 연구진의 실험 설계, 핵심 발견, 그리고 이를 실무에 적용하는 방법을 깊이 있게 분석한다.
연구 배경: Emotional Prompting의 탄생
원본 연구의 주장
2023년 공개된 원본 Emotional Prompting 연구는 흥미로운 가설을 제시했다. 인간과의 대화에서 감정적 맥락이 중요하듯, LLM도 감정적 자극에 반응할 것이라는 가정이었다.
연구진은 11개의 감정刺激(stimulus)를 설계했다:
1
2
3
4
5
6
7
8
9
10
| graph LR
A[Emotional Stimuli] --> B[Self-Epistemic]
A --> C[Social Epistemic]
A --> D[Self-Incentive]
A --> E[Social Incentive]
B --> B1["이건 내 경력에 중요해"]
C --> C1["자신 있게 답해줘"]
D --> D1["도전적이야"]
E --> E2["팀이 믿고 있어"]
|
초기 실험에서 이 접근법은 눈에 띄는 성능 향상을 보고했다. 특히 GPT-4에서 최대 10% 이상의 개선이 관찰되었다고 주장했다.
하지만 의문점들이 쌓여갔다
재현성 문제였다. 여러 연구팀이 동일한 실험을 시도했을 때, 결과가 일관되지 않았다. 어떤 경우에는 효과가 있었고, 어떤 경우에는 오히려 성능이 저하되었다. 이때 하버드 연구진이 체계적인 재평가에 나선 것이다.
실험 설계: 6개 벤치마크를 통한 엄격한 검증
벤치마크 구성
하버드 연구진은 다양한 인지 과제를 포함하는 6개 벤치마크를 선정했다:
| 벤치마크 | 도메인 | 과제 유형 | 평가 지표 | | :— | :— | :— | :— | | MMLU | 다영역 지식 | 객관식 QA | Accuracy | | GSM8K | 수학 | 단계적 추론 | Accuracy | | Big-Bench Hard | 추론 | 다양한 추론 | Accuracy | | Instruction Following | 지시 수행 | 정확한 출력 | ROUGE/LCS | | TruthfulQA | 사실성 | 진실 판별 | Truth Score | | IFEval | 지시 준수 | 제약 조건 | Strict Accuracy |
실험 파이프라인
1
2
3
4
5
6
7
8
9
10
11
12
13
| graph TD
A[원본 질문] --> B[감정 프레이밍 적용]
B --> C[LLM 추론]
C --> D[응답 생성]
D --> E[평가 메트릭 계산]
E --> F[통계적 유의성 검증]
subgraph Variants
B --> B1[무 감정]
B --> B2[긍정 감정]
B --> B3[부정 감정]
B --> B4[압박 감정]
end
|
감정 프레이밍 템플릿
연구진은 원본 연구의 11개 감정 자극을 포함하여 다양한 프레이밍을 테스트했다:
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
32
33
34
35
36
37
38
39
40
| EMOTIONAL_TEMPLATES = {
"neutral": "{question}",
"positive_encouragement": (
"{question}
"
"You're doing great! I believe in your ability to solve this."
),
"negative_pressure": (
"{question}
"
"This is extremely important for my career. "
"I really need the correct answer."
),
"epistemic_confidence": (
"{question}
"
"Provide your answer with high confidence based on your knowledge."
),
"social_pressure": (
"{question}
"
"My team is counting on me to get this right. "
"Please be as accurate as possible."
),
"challenge_framing": (
"{question}
"
"This is a challenging problem. Take your time and think carefully."
)
}
|
핵심 발견 1: 단순 감정 표현의 효과는 미미하다
통계적으로 유의하지 않은 결과
연구 결과, 대부분의 벤치마크에서 감정 프레이밍은 통계적으로 유의미한 성능 차이를 만들어내지 못했다.
| 모델 | Neutral | Positive | Negative | Pressure | p-value | | :— | :—: | :—: | :—: | :—: | :—: | | GPT-4 (MMLU) | 86.2% | 86.4% | 86.1% | 86.3% | 0.72 | | GPT-4 (GSM8K) | 92.1% | 92.3% | 91.8% | 92.0% | 0.68 | | Claude-3 (MMLU) | 85.8% | 86.0% | 85.5% | 85.9% | 0.81 | | Gemini Pro (MMLU) | 83.4% | 83.6% | 83.2% | 83.5% | 0.75 |
p-value가 0.05 이하인 경우가 거의 없었다. 즉, 관찰된 차이는 무작위 변동 범위 내에 있었다.
왜 원본 연구와 결과가 달랐을까?
연구진은 몇 가지 가능한 설명을 제시했다:
- 샘플링 편향: 원본 연구의 작은 샘플 크기 2. Cherry-picking: 특정 벤치마크에서만 효과가 있었을 가능성 3. 모델 버전 차이: GPT-4의 지속적인 업데이트 4. 프롬프트 민감도: 사소한 문구 변화에 따른 결과 차이
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
| import numpy as np
from scipy import stats
def evaluate_statistical_significance(neutral_scores, emotional_scores):
"""
감정 프레이밍의 통계적 유의성을 검증하는 함수
"""
# Paired t-test
t_stat, p_value = stats.ttest_rel(neutral_scores, emotional_scores)
# Effect size (Cohen's d)
mean_diff = np.mean(emotional_scores) - np.mean(neutral_scores)
pooled_std = np.sqrt(
(np.std(neutral_scores)**2 + np.std(emotional_scores)**2) / 2
)
cohens_d = mean_diff / pooled_std if pooled_std > 0 else 0
return {
"mean_improvement": mean_diff,
"p_value": p_value,
"effect_size": cohens_d,
"is_significant": p_value < 0.05 and abs(cohens_d) > 0.2
}
# 예시 결과
neutral = [86.2, 85.8, 86.5, 85.9, 86.1]
emotional = [86.4, 86.0, 86.3, 86.2, 86.0]
result = evaluate_statistical_significance(neutral, emotional)
# Result: is_significant = False, effect_size = 0.08 (small)
|
핵심 발견 2: 적응적 감정 선택은 효과가 있다
질문 특성에 맞는 감정 매칭
흥미롭게도, 연구진은 중요한 발견을 했다. 감정을 무작위로 적용하는 것이 아니라, 질문의 특성에 따라 적절한 감정을 선택하면 일관된 성능 향상이 가능했다.
1
2
3
4
5
6
7
8
9
10
11
12
13
| graph TD
A[입력 질문] --> B[질문 특성 분석]
B --> C{과제 유형 분류}
C -->|창의적 과제| D[긍정적 격려]
C -->|논리적 추론| E[도전적 프레이밍]
C -->|사실 확인| F[인지적 자신감]
C -->|복잡한 문제| G[신중함 유도]
D --> H[최적화된 프롬프트]
E --> H
F --> H
G --> H
|
질문-감정 매칭 전략
연구진이 제안한 적응적 전략:
| 질문 유형 | 추천 감정 프레이밍 | 예시 | | :— | :— | :— | | 창의적 글쓰기 | 긍정적 격려 | “자유롭게 상상력을 발휘해줘” | | 수학/논리 | 도전적 프레이밍 | “이건 정말 어려운 문제야” | | 사실 기반 QA | 인지적 자신감 | “확신 있는 답변을 줘” | | 윤리적 판단 | 신중함 유도 | “신중하게 고려해줘” | | 코딩 문제 | 구체성 요구 | “정확하고 실행 가능한 코드를 작성해” |
적응적 Emotional Prompting 구현
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| class AdaptiveEmotionalPrompter:
"""
질문 특성에 따라 감정 프레이밍을 적응적으로 선택하는 클래스
"""
def __init__(self):
self.task_patterns = {
"creative": [
"write", "create", "imagine", "design", "compose"
],
"logical": [
"calculate", "prove", "solve", "analyze", "determine"
],
"factual": [
"what is", "when did", "who", "where", "fact"
],
"ethical": [
"should", "ethical", "moral", "right", "wrong"
],
"coding": [
"code", "function", "program", "implement", "debug"
]
}
self.emotional_additions = {
"creative": "
Feel free to be imaginative and explore creative possibilities. Your unique perspective is valued.",
"logical": "
This is a challenging problem that requires careful reasoning. Take your time to think through each step.",
"factual": "
Please provide your answer with high confidence. Base your response on well-established knowledge.",
"ethical": "
Consider this carefully from multiple perspectives. Thoughtfulness is more important than speed.",
"coding": "
Provide clean, executable code. Consider edge cases and ensure robustness."
}
def classify_task(self, question: str) -> str:
"""질문을 과제 유형으로 분류"""
question_lower = question.lower()
scores = {}
for task_type, patterns in self.task_patterns.items():
score = sum(1 for p in patterns if p in question_lower)
scores[task_type] = score
# 가장 높은 점수의 과제 유형 반환
best_match = max(scores, key=scores.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| get)
return best_match if scores[best_match] > 0 else "factual"
def apply_emotional_framing(self, question: str) -> str:
"""적응적 감정 프레이밍 적용"""
task_type = self.classify_task(question)
emotional_addition = self.emotional_additions.get(task_type, "")
return f"{question}{emotional_addition}"
def batch_process(self, questions: list) -> list:
"""여러 질문에 대한 배치 처리"""
return [self.apply_emotional_framing(q) for q in questions]
# 사용 예시
prompter = AdaptiveEmotionalPrompter()
question = "Write a short story about a robot learning to love."
framed_question = prompter.apply_emotional_framing(question)
print("원본 질문:", question)
print("
감정 프레이밍 적용 후:")
print(framed_question)
|
핵심 발견 3: 맥락 의존성의 이해
언제 효과가 있고, 언제 없는가
연구 결과를 종합하면, Emotional Prompting의 효과는 맥락에 강하게 의존한다:
1
2
| graph LR
A[Emotional Prompting] --> B{맥락 분석
|
출처: https://news.hada.io/topic?id=28217