Balanced Aggregation: Understanding and Fixing Aggregation Bias in GRPO

Zhiyuan Zeng, Jiameng Huang, Zhangyue Yin, Jiashuo Liu, Ziniu Li, Bingrui Li, Yuhao Wu, Yining Zheng, Ge Zhang, Wenhao Huang, Xipeng Qiu

arXiv:2605.04077 · 2026-05-08 공개 · arXiv · PDF

Abstract

Reinforcement learning with verifiable rewards (RLVR) has become a central paradigm for improving reasoning and code generation in large language models, and GRPO-style training is widely adopted for its simplicity and effectiveness. However, an important design choice remains underexplored: how token-level policy gradient terms are aggregated within each sampled group. Standard GRPO uses sequence aggregation, while recent work has advocated token aggregation as a better alternative. We show that these two rules induce different optimization biases: token aggregation introduces sign-length coupling, while sequence aggregation implicitly downweights longer responses through sequence-level equal weighting. To address this tension, we propose Balanced Aggregation (BA), a simple drop-in replacement that computes token-level means separately within the positive and negative subsets and then combines them with sequence-count-based weights. Experiments with Qwen2.5-Math-7B and Qwen3-1.7B on DAPO-17k and Polaris, evaluated on six reasoning and coding benchmarks, show that BA consistently improves training stability and final performance over standard token and sequence aggregation. Our analysis further shows that the relative effectiveness of token and sequence aggregation is largely governed by response-length variation and the positive-negative length gap, highlighting aggregation as a critical design dimension in GRPO-style RLVR.

한국어 요약

📋 한 줄 요약

**[LLM 강화학습 / RLVR]** GRPO에서 토큰·시퀀스 집계 방식의 편향을 분석하고, positive/negative 부분집합을 분리해 평균 내는 단순한 Balanced Aggregation으로 학습 안정성과 성능을 개선한다.

🎯 핵심 기여도

💡 핵심 아이디어

GRPO에서 그룹 내 정책 그라디언트를 어떻게 합하느냐는 단순한 구현 디테일이 아니라 학습 동역학에 본질적 편향을 만든다. 토큰 평균은 길이가 부호와 결합돼 길이 편향을, 시퀀스 평균은 긴 응답을 암묵적으로 깎는다. 양쪽 편향을 동시에 줄이려면 positive와 negative를 분리해 토큰 평균을 낸 뒤 시퀀스 수에 기반한 가중치로 합치면 된다.

🔬 기술적 접근법

📊 주요 결과

💭 의의 및 한계

**의의**: 광범위하게 채택된 GRPO 학습에서 흔히 간과되던 집계 규칙이 사실상 핵심 하이퍼파라미터임을 보이고, 추가 비용 없이 적용 가능한 강한 베이스라인을 제공한다. **한계**: 분석이 수학·코딩처럼 검증 가능한 보상 도메인 중심이며, 멀티턴·도구 사용 같은 보다 복잡한 환경에서도 동일한 균형이 최적인지에 대한 추가 검증이 필요하다.

🚀 실용적 활용