r/MachineLearning • • 1d ago

Research [R] PocketRL: Training a 7B Language Model with Reinforcement Learning on One RTX 5090

https://arxiv.org/abs/2611.37942

Abstract:

It is now common to post-train large language models with reinforcement learning with verifiable rewards (RLVR), but its heavy memory use, and hence high cost, is an important bottleneck for RLVR research and a major expense in training frontier models. We introduce PocketRL, a low-cost, memory-efficient RLVR code base that trains a 7B model on a single RTX 5090 and a 27B model on only four, without CPU offloading. PocketRL combines two ideas. First, we project each layer's gradient and optimizer state onto a small basis fitted to the layer's input activations by a QR factorisation, which we call ActGRA, and show that such a basis retains far more of the gradient than the random projections used in prior work. Second, we propose training on 16-bit weights with half an extra byte per weight that carries the rounding error, which prevents small updates from being lost. The same 16-bit weights are used for inference, which saves further memory. Together, these methods reduce memory use for training a 7B model by 84%. This enables us to train a competitive 7B model in less than 8 hours on a single RTX 5090 for just $4.71, less than 9% of the cost of training comparable models. PocketRL also reduces the cost of a 27B training step by more than 77% compared with similar code bases. We open-source our PocketRL code base.

Project Page: https://dualverse-ai.github.io/pocketrl/

107 Upvotes

14 comments sorted by

15

u/HungryhungryUgolino 1d ago

Big if true (?), not well read in actual training protocols for LLMs. Interested if anyone has tried this. Might get around to reading the article this weekend to see what implementing any of this actually entails.

7

u/progenitor414 1d ago

Feel free to check out the repo and train a 7b model! Only one 5090 is needed: https://github.com/dualverse-ai/pocketrl

1

u/HungryhungryUgolino 7h ago

I have a R9700 but I meet the torch requirements so should be fine?

6

u/ResidentPositive4122 21h ago

There's something wrong with the benchmark tables, q3.8-27b scores way higher on the aime problems. (~90%) And it doesn't come with any base model, so it's unlikely that ~100 steps reported would show any meaningful budge on those kinds of tasks (the model is benchmaxxed on math already). Any idea what happened there? How did you get the original scores?

Perhaps some context length limits?

9

u/progenitor414 21h ago

Thanks for catching this. I looked into it. In all of our evaluations, we cap the response length at 3,000 tokens (the same setting as Dr. GRPO). The 27B model tends to give long responses on AIME 2024 and AIME 2025, so it performs poorly on both sets. The subsequent RL steps mainly teach the model to recover its performance within the limited token budget.

We will address this in the next version of the preprint. The 7B and 1.5B models should not be affected, as their base models generally produce fewer than 3,000 tokens.

2

u/riselikelions 20h ago

Happy cake day! And congrats on the release

3

u/Sufficient-Pen-3796 17h ago

So you let other agents work on problems and then preprint under your name?

2

u/progenitor414 17h ago

We set the problem, supervise the agents, they explore, and we select and verify the results. Agents are credited by linking to their original paper on rstation.ai.

1

u/impossiblefork 17h ago

This is of course a short and silly comment, but I wonder whether it'd work for pretraining too.

Because, why shouldn't it?

1

u/progenitor414 17h ago

We already asked agents exploring this on pretraining side: https://rstation.ai/problems/general_pretraining

The result so far is not promising: pretraining need much more precise, high-rank signal than that required in RL, so performance is worse if directly use the same trick on pretraining.

2

u/impossiblefork 17h ago

Ah. That sounds reasonable.

Still, an extremely charming result and I can expect it to be very useful. I have certainly had problems with getting the computational resources I need for my RL work.

1

u/NaivelyBayesic 8h ago

Cool result, the cost number is kinda wild. The 3,000 token cap thing is worth flagging for anyone reading the tables though... if the 27B base model is blowing past the cap on AIME, then a chunk of the "gain" from RL is the model learning to finish inside the budget rather than getting better at math. Not a knock, that's a real thing to learn, but it's a different claim than the headline.

The question I'd have is how the low rank gradient projection holds up when the reward is sparse. On math the signal is dense enough, lots of groups have a pass. On longer horizon stuff where most groups have nothing passing, the gradient you do get is already small and you really don't want to lose any of it to a projection. The pretraining note in the thread (needs more precise, high rank signal) makes me think there's a spectrum here and it'd be good to know where agentic RL falls on it.

Also kinda interesting that the agents explored this one. Curious whether the ActGRA idea came from them or the humans set that direction?

1

u/progenitor414 1h ago

Thanks for the comments! Yes, v2 preprint will state the limitation on the 27b model that it is restricted to 3k token (I will see if we have resources to run more token length; 4x5090 should still be fine, just take more time). It seems that the 27b model overthink a lot compared to the previous qwen model.

> The question I'd have is how the low rank gradient projection holds up when the reward is sparse.

I think it is more to deal with whether we are using RL/SFT instead of the reward sparsity. For RL, if we have 0 pass@k, then the model is not learning anything even with dense gradient. As long as pass@k > 0, then RL should work, even when the reward signal is sparse, and LoRA etc. grad compression method usually works similar to original dense training. As for SFT, the very dense signal on every token make the gradient much richer so we cannot afford low-rank.

> Curious whether the ActGRA idea came from them or the humans set that direction?

From the agents. We only specify the goal (a strong 7B model from a single 5090 under 8 training hours) and some related work.

-1

u/raviolli 1d ago

Budding. Matrix factorisation big news