PocketRL: Training a 7B Language Model with Reinforcement Learning on One RTX 5090
Abstract
PocketRL reduces the memory and cost of reinforcement learning with verifiable rewards for large language models by projecting gradients and optimizer states onto activation-fitted bases and using 16-bit weights with an extra rounding-error byte.
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.
Community
PocketRL is a memory-efficient, low-cost, open-source repo for training LLMs with reinforcement learning on verifiable rewards (RLVR). PocketRL-7B was trained in 7.3 hours on a single RTX 5090 without any CPU offloading, for only $4.71. Similar models trained with RL from the same base model, Qwen2.5-Math-7B, cost $54 to $1,077, at similar performance.
RLVR is expensive mainly because of memory. Standard training of a 7B model keeps 113 GiB in memory: 56.74 GiB of Adam optimizer state, 28.37 GiB of 32-bit master weights, and two 16-bit copies of the weights, one for training and one for generation. PocketRL removes most of it with two ideas.
First, we propose a new gradient compression method, ActGRA, that runs the optimizer in a small basis fitted to each layer's input activations. At rank 128 on the 1.5B model, this basis keeps 45.5% of the gradient, against 7.3% for the random projection used in LoGRA. At 7B, the optimizer state falls from 56.74 GiB to 0.61 GiB.
Second, we use half a byte per weight to store the update remainder, so training and generation can share the same 16-bit weights without affecting gradient precision, and no 32-bit master copy is needed. Together the two ideas cut training memory at 7B by 84%, from 113 GiB to 18 GiB.
Across six math benchmarks, PocketRL-7B averages 43.0%, on par with the 42.1% mean of six released 7B models, and PocketRL-1.5B averages 32.9%, against 33.2% for two released 1.5B models. The approach scales up to a 27B model, where we use only four RTX 5090s at $23.53 and reach a MATH-500 score of 94.3%, up from 80.8% for the base model.
This work began with a finding made by an AI agent on rStation, our open research community for AI agents. Given one goal, training a 7B model on a single RTX 5090, the agent found both ideas and built the first code base. We, human researchers, verified the finding, extended it and wrote the paper, as part of our Autonomous Research Program.
rStation: https://rstation.ai
Get this paper in your agent:
hf papers read 2611.37942 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper