[KongchangAI]
· 2 min read· 1,261 words

PocketRL: Training 7B LLMs on a Single RTX 5090

PocketRL: Training 7B LLMs on a Single RTX 5090

PocketRL uses ActGRA plus 16-bit weights with an error byte to train a 7B model on a single 5090 for just $4.71.

PocketRL tackles the high memory cost of RLVR training — where the policy model, reference model, optimizer states, and gradients all stack up — with two complementary techniques. ActGRA uses QR decomposition to fit a low-dimensional orthonormal basis to each layer's input activations, projecting gradients and optimizer states onto it to preserve more gradient information than random projection. 16-bit weight training reserves half an extra byte per weight for rounding error, preventing tiny updates from being lost while keeping weights directly usable for inference. Together they cut 7B-model training memory by 84%, enabling training on a single RTX 5090 in under 8 hours for $4.71 — under 9% of comparable solutions — and a 27B model on four GPUs at over 77% lower per-step cost. The project is open source, greatly lowering the hardware barrier for RLVR research.

Reinforcement Learning with Verifiable Rewards (RLVR) has become a standard technique for post-training large models, but its high memory overhead keeps many research teams away. PocketRL introduces a low-cost, memory-efficient RLVR training solution that, for the first time, completes 7B model training on a single RTX 5090 — at a surprisingly low cost.

PocketRL project showcase

The Memory Bottleneck: RLVR's Heavy Burden

Today, post-training language models with reinforcement learning (especially RLVR based on verifiable rewards) is a standard workflow for improving model reasoning. However, RLVR requires simultaneously maintaining the policy model, reference model, optimizer states, and gradients, so its memory footprint far exceeds ordinary supervised fine-tuning.

This high memory demand translates directly into high hardware costs, making it a major bottleneck for RLVR research and a significant expense when training frontier models. For most labs and independent researchers, the multi-GPU cluster configurations required put RLVR experiments out of reach.

PocketRL aims to break down this barrier: training large models on consumer-grade GPUs alone, without relying on CPU offloading.

How RLVR's memory footprint differs from common post-training methods

To understand RLVR's memory overhead, we first need to clarify how its training graph fundamentally differs from supervised fine-tuning (SFT). SFT only needs to maintain one set of model parameters, gradients, and optimizer states; the typical RLVR pipeline (e.g., PPO-style algorithms) requires four components resident at once: the policy model (the one being trained), the reference model (used to compute the KL penalty to prevent the policy from drifting too far from its initial distribution), optimizer states (Adam-style optimizers typically store first- and second-order moments for each parameter — two extra copies), and gradients. Although the reference model doesn't participate in gradient updates, it must stay in memory to provide forward computations at any time — effectively adding a full copy of the model weights out of thin air. In addition, RL training requires online sampling, and the long-sequence activations produced during rollout are far larger than SFT's short samples. With all these stacked together, RLVR training for a 7B model easily exceeds the 32GB or even 80GB memory limit of a single GPU — exactly the structural tension PocketRL seeks to resolve.

Two Core Technologies: ActGRA and 16-bit Weight Training

PocketRL's memory savings come from two complementary technical designs.

ActGRA: Activation-Based Subspace Projection

The first technique is called ActGRA. Using QR decomposition, it fits a low-dimensional basis to each layer's input activations, then projects that layer's gradients and optimizer states onto this basis.

Compared with the random projections used in prior work, the basis fitted by ActGRA preserves more gradient information. This means that under the same memory budget, less training signal is lost and model quality is better safeguarded.

Why low-rank projection saves memory

The core idea behind subspace projection methods is that although gradients and optimizer states scale with the number of parameters, their effective information tends to be concentrated in a low-dimensional subspace. If they can be represented as "low-dimensional coefficients × basis matrix," memory usage drops from O(number of parameters) to O(number of parameters × rank/dimension). QR decomposition's role here is to orthogonalize the input activation matrix, yielding a set of orthonormal basis vectors so that the projected coordinates are as uncorrelated as possible and information redundancy is minimized. Compared with random projection, a basis fitted from real activations better matches the data distribution each layer actually receives, resulting in smaller projection error and thus more task-relevant gradient directions preserved at the same compression rate. This is also what distinguishes ActGRA from early LoRA-style randomly initialized low-rank adaptation: it makes "compression" happen along the most information-dense directions.

16-bit Weights + an Extra Half-Byte: Preventing Loss of Small Updates

The second technique is to train with 16-bit weights while reserving half an extra byte per weight to carry rounding error. The key to this design is preventing tiny weight updates from being wiped out entirely in low-precision representations.

More cleverly, the same 16-bit weights can be used directly for inference, with no extra conversion or high-precision copy needed — further saving memory.

Rounding error accumulation in low-precision training

In 16-bit floating point (e.g., BF16), the mantissa has limited bits. When a very small update is added to a relatively large weight value, the update may be discarded outright because it falls below the smallest representable interval at that magnitude — a phenomenon known as "absorption" or "rounding swamping." In RL training, policy gradients are often sparse and small in magnitude, and long-term accumulated loss can significantly slow convergence or even stall training. PocketRL reserves an extra half-byte (4 bits) per weight specifically to record the discarded residual — essentially keeping an "error ledger" for each update and adding the residual back on the next update, thereby restoring effective resolution without increasing the precision of the main weights. This shares the same lineage as numerical compensation ideas such as stochastic rounding and Kahan summation, but achieves it at extremely low storage cost, and the 16-bit main weights can be used directly for inference, avoiding the deployment burden of mismatched training and inference precision.

Measured Results: Breakthroughs in Both Cost and Efficiency

Combining the two techniques reduces the memory footprint of 7B model training by 84%. This brings direct engineering benefits:

  • Single GPU in 8 hours: On a single RTX 5090, a competitive 7B model can be trained in under 8 hours;
  • $4.71 cost: The entire training process costs only $4.71 — less than 9% of the training cost of comparable models;
  • 27B model on four GPUs: The same method lets a 27B model be trained on just four RTX 5090s;
  • Step cost slashed: Compared with similar codebases, the per-step training cost for a 27B model drops by over 77%.

Behind these numbers is a clear signal: the barrier to RLVR experimentation is dropping from "multi-GPU clusters" to "a single consumer-grade GPU."

Open Source and Impact

PocketRL has open-sourced its codebase. For RLVR researchers, this means they can reproduce and validate new ideas under limited hardware conditions without queuing for expensive cluster resources.

From a methodological perspective, ActGRA's activation-aware subspace projection and error-compensated low-precision training also offer new ideas for memory optimization — they don't crudely sacrifice precision for memory, but rather compress more intelligently while preserving the training signal.

PocketRL's significance lies not only in its cost figures, but in the fact that it takes reinforcement learning post-training a big step from "exclusive to big companies" toward "accessible to individual labs."

One-line Summary

PocketRL uses ActGRA plus 16-bit weights with an error byte to train a 7B model on a single 5090 for just $4.71.

Paragraph Summary

To address the high memory overhead of RLVR training — where the policy model, reference model, optimizer states, and gradients all stack up — PocketRL introduces two complementary techniques. ActGRA uses QR decomposition to fit a low-dimensional orthonormal basis to each layer's input activations and projects gradients and optimizer states onto that basis, preserving more gradient information than random projection. 16-bit weight training reserves half an extra byte per weight to carry rounding error, preventing tiny updates from being wiped out by low-precision representation, while the same weights can be used directly for inference. Together they cut 7B model training memory by 84%, enabling training on a single RTX 5090 in under 8 hours for only $4.71 — less than 9% of comparable solutions; a 27B model needs just four GPUs, with per-step cost reduced by over 77%. The project is open source and significantly lowers the hardware barrier for RLVR research.

#PocketRL#RLVR#reinforcement learning post-training#memory-efficient training#ActGRA#RTX 5090#16-bit training#low-rank projection
Share:

Related articles