Group Relative Policy Optimization (GRPO)
Group Relative Policy Optimization(GRPO)에 대해 알아보십시오. 이 메모리 효율적이고 비평가(critic-free)가 없는 RL 알고리즘이 어떻게 LLM 추론을 향상하고 학습 비용을 절감하는지 확인하십시오.
Group Relative Policy Optimization (GRPO) is a memory-efficient reinforcement learning algorithm developed to enhance the reasoning capabilities of Large Language Models (LLMs) and broader Artificial Intelligence (AI) systems. First introduced in the 2024 DeepSeekMath paper, GRPO improves upon traditional optimization methods by removing the need for a separate value network (critic model). Instead, it normalizes the rewards of a group of generated responses derived from the same prompt. By evaluating responses relative to their peers within the group, GRPO dramatically reduces computational overhead while boosting performance on complex reasoning tasks in modern Deep Learning (DL) architectures.
GRPO가 PPO와 다른 점
While GRPO shares similarities with Proximal Policy Optimization (PPO)—a standard optimization algorithm often used in reinforcement learning from human feedback (RLHF)—the two differ significantly in architecture. PPO requires a secondary "critic" model that runs parallel to the main policy network to estimate the value of a given state. This nearly doubles the memory required during the training phase.
대조적으로 GRPO는 critic이 없는 알고리즘입니다. 단일 프롬프트에 대해 여러 출력을 샘플링하고 rule-based reward system이나 검증자를 사용하여 점수를 매김으로써, GRPO는 해당 특정 그룹 내의 점수를 정규화하여 어드밴티지(advantage)를 계산합니다. 이러한 상대적 비교는 베이스라인 역할을 하며, 가치 네트워크가 차지했을 막대한 메모리를 절약하고 전반적인 model training을 가속화합니다.
GRPO의 실제 응용 사례
GRPO는 최근 generative AI 및 natural language processing 분야에서 여러 혁신을 이끌었습니다. 주목할 만한 두 가지 응용 사례는 다음과 같습니다:
- 수학적 추론 모델: 널리 인용되는 DeepSeek-R1 release와 DeepSeekMath에서, GRPO는 모델이 긴 chain-of-thought 추론과 자기 검증을 개발하도록 유도하는 데 사용되었으며, OpenAI's o1과 같은 독점 모델의 성능에 필적했습니다. 정확한 최종 답변과 형식에 보상을 제공함으로써, 이 알고리즘은 모델이 사람이 주석을 단 데이터에 대한 광범위한 fine-tuning 없이도 고급 문제 해결 전략을 유기적으로 발견할 수 있게 했습니다.
- 코드 생성 및 에이전트 로직: 코드를 작성하거나 자율적인 agentic workflows를 구동하는 모델의 경우, 절대적인 정확성을 평가하기가 어렵습니다. GRPO는 모델이 코드 변형을 실행하고 컴파일 성공 여부나 통과된 테스트 케이스를 기준으로 상대적으로 점수를 매겨 학습할 수 있게 함으로써, 매우 신뢰할 수 있는 AI 코딩 어시스턴트의 배포를 가속화합니다.
PyTorch에서 GRPO 개념 구현하기
At its core, GRPO calculates the relative advantage of responses by normalizing their rewards. Here is a basic PyTorch implementation demonstrating this normalization using standard tensor operations:
def compute_grpo_advantages(rewards):
# 'rewards' is a tensor of shape (batch_size, group_size)
group_mean = rewards.mean(dim=1, keepdim=True)
group_std = rewards.std(dim=1, keepdim=True)
# Normalize rewards within the group to calculate relative advantages
advantages = (rewards - group_mean) / (group_std + 1e-8)
return advantages스마트 최적화를 통한 AI 발전
GRPO가 텍스트 생성을 위한 효율성을 재정의하는 것과 마찬가지로, 고급 Machine Learning (ML) 기술은 지속적으로 visual perception을 재구성합니다. 아키텍처와 loss functions를 최적화하면 개발자는 모든 도메인에서 더 가볍고 빠른 모델을 구축할 수 있습니다.
For state-of-the-art computer vision tasks, exploring end-to-end optimizations is equally critical. For instance, Ultralytics YOLO26 introduces a natively NMS-free architecture and hybrid optimizers inspired by LLM research, dramatically improving edge deployment. Developers looking to leverage efficient computer vision workflows can build, train, and deploy models effortlessly using the Ultralytics Platform. This cloud-based tool simplifies complex dataset management and hyperparameter tuning for robust, real-time vision applications.






