4 min readfrom Machine Learning

Same GRPO recipe on three from-scratch LLMs (353M/316M/672M) gave three different outcomes, with no clean relationship to scale [P]

Our take

Training three large language models (LLMs) – 353M, 316M, and 672M parameters – using the same process (from-scratch pre-training, SFT, and GRPO) yielded surprising and inconsistent results. Despite identical synthetic arithmetic curricula, reward functions, and hyperparameters, GRPO negatively impacted both the 316M and 672M models, while minimally affecting the smallest. This variance, alongside downstream task degradation, highlights an intriguing challenge in reinforcement learning from human feedback, particularly concerning curriculum design and evaluation.

The recent findings from John Enev’s exploration of Reinforcement from Human Feedback (RHF) using GRPO (Gradient-based Reinforcement Learning from Online Proximal Policy) offer a fascinating, and somewhat unsettling, glimpse into the complexities of aligning large language models. Enev meticulously trained three LLMs from scratch, progressing through pre-training, supervised fine-tuning (SFT), and finally, GRPO, maintaining rigorous consistency across all parameters and datasets. The expected improvements during pre-training were observed, with decreasing validation loss correlating with model sophistication and size. However, the application of GRPO unexpectedly degraded performance in the mid-sized (V2) and largest (V3) models, a result that challenges conventional wisdom and underscores the fragility of current alignment techniques. This is particularly pertinent given the increasing focus on RHF as a primary method for steering LLMs toward desired behaviors; as highlighted in [AWS Continuum integrates with OpenAI Codex and Anthropic Claude Code in major AI security push], the integration of AI into coding environments demands reliable and predictable model performance, something this study suggests may be more elusive than previously assumed. The implications extend beyond just model size, as the observed degradation patterns hint at a potential sensitivity to architectural choices, as illustrated by the shift from DiffAttn to XSA in the V3 model.

The core of the issue, as Enev identifies, likely stems from a combination of factors. While SFT consistently improved performance across all models, GRPO’s impact varied drastically. The discrepancy between the training distribution (a bare solver template) and the evaluation setting (a chat format) introduces a confounding variable, as demonstrated by the downstream task results. Furthermore, the lack of a stopping reward in the GRPO training loop, coupled with the absence of re-evaluation of earlier curriculum stages, complicates the interpretation of the results. Did GRPO genuinely degrade general capability, or did the sequential curriculum training simply cause the models to “forget” earlier learned skills? These are critical distinctions. A related challenge is the potential for overfitting to specific reward signals, a concern also relevant to the security landscape; as [Agentic security: Enterprises enforce agent permissions two-thirds of the time — and isolate high-risk agents less than one in five] reveals, controlling agent behavior and preventing unintended consequences remains a significant challenge. Enev’s transparency in acknowledging these caveats—including the $750 budget that precluded extensive ablation studies—is commendable and reinforces the value of open research in this field.

Enev’s decision to release all nine checkpoints on Hugging Face and create a Playground for direct comparison is a significant contribution to the community, enabling others to replicate and extend his findings. The speedup observed with the newly implemented KV cache is a welcome side benefit, demonstrating the potential for optimization even within complex LLM architectures. The fact that even with increased scale (V3), GRPO still resulted in degradation, albeit to a lesser extent than with V2, suggests that simply increasing model size isn’t a panacea for alignment challenges. It highlights the need for a deeper understanding of *how* these models learn and generalize, rather than simply focusing on scaling up parameters. The detailed write-up, divided into four parts, promises to provide further insights into the intricacies of the experiment and the potential avenues for future research. It’s also worth noting the practical implications of this work, as discussed in [How Baseline Can Help You Ship Less JavaScript], where optimizing performance and minimizing resource usage are key considerations for deploying AI models in real-world applications.

Ultimately, Enev’s work serves as a vital reminder of the unpredictable nature of LLM training and alignment. While GRPO has shown promise in certain contexts, its application isn't universally beneficial, and its effects can be surprisingly nuanced and even detrimental. The variance observed across different model sizes and architectures warrants further investigation, and the potential for unintended consequences during RHF training demands careful consideration. The question now is: how can we develop more robust and reliable alignment techniques that are less susceptible to these unexpected outcomes, and what role will alternative training methodologies play in achieving truly controllable and beneficial AI systems?

I trained three LLMs from scratch in raw PyTorch then post-trained each one with SFT and then GRPO. Same process every time: same synthetic arithmetic curriculum, same reward function, same hyperparameters, same KL coefficient.

Pre-training went as expected, the val loss went down as the model got more modern techniques (V1 to V2) and bigger (V3 being the biggest). However, GRPO hurt both V2 and V3 and I'm not sure why.

Setup

V1 V2 V3
Params 353M 316M 672M
d_model / layers 1024 / 24 1024 / 24 1536 / 24
Attention MHA Differential + GQA 4:1 XSA + GQA 4:1
Tokens 10B 10B 30B
Data FineWeb-Edu FineWeb-Edu FineWeb-Edu + code + math

Pre-training val loss went 2.8659 → 2.7844 → 2.5885.

Results

WikiText word perplexity across the three stages, all on lm-evaluation-harness with the same task versions and shot counts:

 base SFT GRPO SFT→GRPO V1 32.86 51.31 51.40 +0.2% V2 31.28 46.81 71.06 +52% V3 22.30 32.11 33.65 +5% 

SFT hits all three on this eval, which I expected at this scale. Also interesting to see that the degradation gets smaller as the models get bigger (+56%, +50%, +44%).

GRPO is the weird one. V1 barely moved, V2 fell heavily, V3 degraded a bit. The smallest model was the least affected and the middle one was the worst, which isn't the pattern I'd have guessed. Downstream tasks moved the same way as perplexity in each case (arc_easy dropped about 6 points on V3 from SFT to GRPO).

The models did learn the thing GRPO trained them on. V3 mastered 4 of the 5 curriculum stages, the other two got 3. But it just didn't transfer: GSM8K stayed at basically 0, and the models got so committed to writing out long solutions that they often wouldn't stop generating (my fault when I did the training).

Caveats

This isn't a controlled experiment. Between V2 and V3 I changed the parameter count, the token count, the data mix and the attention mechanism at the same time (went from DiffAttn to XSA), so I can't attribute anything cleanly. KL coefficient was 0.02 for all three, with the SFT policy frozen as the reference and a k3 estimator. The whole series cost me about $750, which is why there are no ablations, I just couldn't afford them. Otherwise I would also have tried with different KL coeffs.

Someone raised two confounds after I published:

  1. GRPO trained on a bare solver template while SFT used a chat format. So part of what I'm calling degradation is me evaluating a policy outside its own training distribution. WikiText perplexity is format-independent and still moves a lot, but the downstream numbers are partly confounded.
  2. Nothing in my reward rewarded stopping. It just checks that a correct parseable number shows up somewhere, no length penalty.

Also something I only noticed afterwards: I never re-evaluated the earlier curriculum stages once the model advanced past them. So right now I can't tell the difference between "GRPO degraded general capability" and "sequential curriculum training made it forget the earlier stages." I will try to check that soon.

Inference

At the end, I wrote a KV cache from scratch (GQA-aware, per-request cache object rather than storing state on the module). To check it was right I ran a fixed sequence two ways, once as a single full forward pass and once as prefill-then-decode, and compared the logits: max difference 1.4e-06 against a 1e-4 tolerance.

Speedup generating 100 tokens: 3.7x from a 32-token prompt, 6.2x at 128, 10.1x at 512.

If you want to check

All nine checkpoints are on the Hugging Face, and there's a Space where you can send the same prompt to the base, SFT and GRPO versions of the same model and see the difference directly.

The GRPO variance is the bit I'd most like other people's take on. Happy to answer anything.

submitted by /u/john_enev
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article