SuperAPI AI Directory

nanoGRPO

nanoGRPO is a lightweight implementation of Group Relative Policy Optimization (GRPO), aimed at language model training. According to the repository description, users can use it to train their own "tiny r1/o1" models; the author provides results after training for 120 steps on an 8GB RTX 4060. Its core formula is: J_GRPO(θ) = (1/G) Σ_{i=1}^{G} (min(π_θ(o_i|q)/π_θ_old(o_i|q) · A_i, clip(π_θ(o_i|q)/π_θ_old(o_i|q), 1-ε, 1+ε) · A_i)). The repository points out that GRPO can be understood as PPO using the z score of grouped output as the advantage estimate, without using a value function, and provides links to the original paper and the r1 paper.

Open website

About this tool

nanoGRPO is a lightweight implementation of Group Relative Policy Optimization (GRPO), mainly used for policy optimization training of language models.

Purpose

According to the project description, nanoGRPO is used for language model training, and emphasizes that users can "cooked you own tiny r1/o1", that is, use this project to train their own small r1/o1-like models. It provides a lightweight implementation of GRPO, suitable for developers who want to understand or practice GRPO under limited hardware conditions.

Main capabilities

The project gives the GRPO objective function:

$$ J_{GRPO}(\theta) = \frac{1}{G} \sum_{i=1}^{G} \left( \min \left( \frac{\pi_{\theta}(o_i|q)}{\pi_{\theta_{old}}(o_i|q)} A_i, \text{clip} \left( \frac{\pi_{\theta}(o_i|q)}{\pi_{\theta_{old}}(o_i|q)}, 1 - \epsilon, 1 + \epsilon \right) A_i \right) \right) $$

It also explains: GRPO is a form of PPO, whose advantage is estimated as the z score of grouped output, rather than using a value function.

Usage

The project gives the official address in the title:https://github.com/joey00072/nanoGRPO。文本中未提供具体安装命令、运行步骤或代码示例,相关细节暂未提供。

Applicable scenarios and limitations

The project mentions results obtained after training for 120 steps on an 8GB RTX 4060, indicating that it can be used under relatively small VRAM conditions. However, apart from this hardware and step count information, the text does not provide the dataset, model scale, hyperparameters, performance metrics, or comparison with other implementations, nor does it explain the license, dependencies, and scope of application; these contents are not yet provided.