ReAct: Synergizing Reasoning and Acting in Language Models
핵심: LLM이 생각만 하거나 행동만 하지 않고, 생각하고 → 행동하고 → 관찰하고 → 다시 생각하는 agent loop를 수행하게 만든다.
Metadata
- Paper
- ReAct: Synergizing Reasoning and Acting in Language Models
- Authors
- Shunyu Yao et al.
- arXiv
- 2210.03629 · 2022
- Category
- Agent architectures · Reasoning-action loops and tool use
- Keywords
- ReAct, LLM agents, reasoning traces, action space, tool use, environment interaction
Compressed note
CoT의 Thought 사이에 Action과 Observation을 넣는다
ReAct는 Thought → Action → Observation → Thought 루프를 prompt trajectory로 만든다. 모델은 현재 상황을 해석하고, 행동을 고르고, 환경 결과를 다시 context로 받아 다음 reasoning에 반영한다.
CoT는 reasoning하지만 grounded하지 않다
CoT는 내부 지식으로만 추론하므로 사실 확인이 필요한 문제에서 hallucination이 생긴다. 검색, lookup, environment step 같은 외부 action이 필요하다.
Act-only는 행동하지만 계획이 약하다
바로 action만 생성하면 왜 그 행동을 하는지, 지금까지 무엇을 찾았는지, 다음 하위 목표가 무엇인지 추적하기 어렵다. Thought가 계획과 상태 추적을 담당한다.
Why this technique appeared
기존 LLM 활용은 두 극단으로 나뉘었다. CoT는 단계별 reasoning을 잘 유도하지만 외부 세계를 확인하지 못한다. Act-only 방식은 Wikipedia, ALFWorld, WebShop 같은 환경에서 action은 할 수 있지만, 복잡한 task에서 계획과 상태 추적이 약했다.
ReAct는 이 둘을 결합해, 모델이 추론으로 다음 행동의 이유를 만들고, 행동으로 외부 정보를 얻고, 관찰로 추론을 갱신하게 한다.
Core pattern
Question
→ Thought 1: what do I need next?
→ Action 1: Search[...]
→ Observation 1: result from environment
→ Thought 2: update plan from observation
→ Action 2: Lookup[...] or Finish[...]
→ Observation 2
→ Answer
- Thought: 계획, 현재 상태 요약, 하위 목표 설정.
- Action: 환경이 받아들일 수 있는 문자열 명령. 예:
Search[entity],Lookup[keyword],Finish[answer]. - Observation: action 실행 결과를 다시 prompt history에 추가한 것.
- Trajectory: 지금까지의 Thought/Action/Observation 누적 기록.
Implementation sketch
history = question
while not done:
thought, action = llm(history)
observation = environment.step(action)
history += thought + action + observation
논문 실험의 핵심은 새로운 neural architecture가 아니라, LLM 출력에서 action 문자열을 파싱하고, 환경에 실행하고, observation을 prompt에 다시 붙이는 harness다.
Limitations and why it still matters
- Format fragility: 문자열 action parsing에 의존하므로 모델이 형식을 어기면 깨질 수 있다.
- Context growth: trajectory가 길어질수록 prompt가 길어지고 노이즈가 누적된다.
- Observation quality: 잘못된 검색 결과나 환경 feedback을 그대로 믿으면 plan이 망가질 수 있다.
- Agent blueprint: 그럼에도 ReAct는 현대 tool-using agent의 기본 루프를 논문적으로 정식화했다.