RL이 LLM Agent의 일반화를 개선할 수 있는가? 실증 연구
Can RL Improve Generalization of LLM Agents? An Empirical Study
TL;DR Highlight
RFT(강화학습 파인튜닝)로 학습한 LLM 에이전트가 같은 환경 내에서는 잘 일반화되지만, 새로운 환경으로의 전이는 제한적이며 순차적 멀티환경 학습이 해법이 될 수 있다.
Who Should Read
LLM 기반 에이전트를 실서비스에 배포하려는 ML 엔지니어나 연구자. 특히 에이전트가 학습한 환경 외의 새로운 태스크에서도 잘 작동하길 원하는 개발자.
Core Mechanics
- 같은 환경 내에서는 RFT가 강력한 일반화를 보여줌 — 쉬운 태스크로만 학습해도 어려운 태스크에서 성능이 크게 오름 (7B 모델 WebShop 기준 +60.1포인트)
- Easy→Hard 커리큘럼 학습이 단일 난이도 학습보다 효과적 — BabyAI에서 Ueasy+Uhard 조합이 단독 학습 대비 최대 3.3포인트 추가 향상
- 새로운 환경으로의 전이(cross-environment)는 평균 +3~4포인트 수준으로 제한적 — held-in 대비 held-out 성능 차이가 매우 큼
- BabyAI처럼 매 스텝 유효 액션 목록을 제공하는 환경에서 학습하면 오히려 독이 됨 — 7B 모델이 WebShop에서 28.59→10.25로 폭락
- 순차 멀티환경 학습(Sequential RFT)은 catastrophic forgetting(이전 지식 망각) 없이 새 환경 성능을 높임 — WebShop→TextCraft 순차 학습 시 TextCraft 80.88→82.50, WebShop 86.5→86.32 유지
- Confirmation Bias(과신 오류)가 모든 환경에서 10% 이상으로 가장 공통적인 실패 패턴으로 확인됨
Evidence
- held-in 환경에서 AlfWorld 기준 3B/7B 모델 각각 +78.62/+65.44포인트 향상, held-out 환경 평균은 +3.32/+3.44포인트로 극명한 차이
- Qwen2.5-7B-Instruct 기준 BabyAI로 학습 후 held-out 평균 -3.23포인트, WebShop은 28.59→10.25로 급락
- BabyAI 환경에서 RFT 학습 후 평균 인터랙션 턴이 10.76→4.19로 감소, 평균 토큰 수 624.58→160.60으로 약 74% 감소
- 5개 환경 순차 학습 결과가 전체 데이터 혼합(joint training) 결과와 비슷한 수준 도달 — 학습 순서에 비교적 둔감함
How to Apply
- 에이전트를 새 환경에 배포하기 전에 기존 환경에서 Easy→Hard 순으로 커리큘럼 학습을 적용하면 같은 데이터로 더 높은 성능을 얻을 수 있음
- 여러 환경에 범용 에이전트를 만들 때는 모든 환경 데이터를 한꺼번에 섞어 학습하는 대신, 유사한 환경부터 순차적으로 RFT를 진행하면 forgetting 없이 점진적으로 능력을 확장할 수 있음
- 매 스텝 유효 액션 목록을 제공하는 환경(BabyAI 스타일)에서만 학습하면 다른 환경에서 성능이 오히려 떨어질 수 있으므로, 범용 에이전트 학습 시 이런 환경을 마지막에 배치하거나 비중을 줄여야 함
Code Example
# AgentGym-RL 프레임워크로 순차 RFT 학습 예시
# https://github.com/woooodyy/AgentGym-RL
# 1단계: 쉬운 태스크로 먼저 학습 (WebShop easy)
python train.py \
--model Qwen2.5-7B-Instruct \
--env webshop \
--difficulty easy \
--n_samples 8 \
--max_response_length 8192 \
--max_turns 10 \
--algorithm GRPO
# 2단계: 어려운 태스크로 커리큘럼 학습 (WebShop hard)
python train.py \
--model outputs/webshop_easy_checkpoint \
--env webshop \
--difficulty hard \
--n_samples 8
# 3단계: 새로운 환경으로 순차 전이 학습 (TextCraft)
python train.py \
--model outputs/webshop_all_checkpoint \
--env textcraft \
--n_samples 8 \
--max_turns 15
# 평가: held-in / held-out 성능 모두 체크
python evaluate.py \
--model outputs/sequential_checkpoint \
--envs webshop searchqa textcraft alfworld babyai \
--metric avg@8 \
--max_turns 20Terminology
Related Resources
Original Abstract (Expand)
Reinforcement fine-tuning (RFT) has shown promise for training LLM agents to perform multi-turn decision-making based on environment feedback. However, most existing evaluations remain largely in-domain: training and testing are conducted in the same environment or even on the same tasks. In real-world deployment, agents may operate in unseen environments with different background knowledge, observation spaces, and action interfaces. To characterize the generalization profile of RFT under such shifts, we conduct a systematic study along three axes: (1) within-environment generalization across task difficulty, (2) cross-environment transfer to unseen environments, and (3) sequential multi-environment training to quantify transfer and forgetting. Our results show that RFT generalizes well across task difficulty within an environment, but exhibits weaker transfer to unseen environments, which correlates with shifts in both semantic priors and observation/action interfaces. In contrast, sequential training yields promising downstream gains with minimal upstream forgetting, and mixture training across environments improves the overall balance. We further provide detailed analyses and deeper insights, and hope our work helps the community develop and deploy generalizable LLM agents.