← Back to Leaderboard
Pdualverse-ai

dualverse-ai/pocketrl

Low-VRAM RLVR training with activation-projected gradients and shared BF16 weights

Engineering Health (Methodology)
A · 87/100
Maintenance Activity
● Updated 4d ago
Latest Release
v0.1.0
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption12/25
Release Cadence20/20
License Clarity20/20
GPUCLI
Total Stars
★ 115
24h Growth
+7
7d Growth
+7
Forks
11

GitHub Star History

Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.

dualverse-ai/pocketrl Star History (2026-11-29 - 2026-12-03) DAILY STAR HISTORY (5-DAY D1 TELEMETRY) +114 in 4d · avg +29/day 121 61 0 2026-11-29: ★ 12026-11-30: ★ 512026-12-01: ★ 952026-12-02: ★ 1082026-12-03: ★ 115 ★ 115 11-29 12-01 12-03

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

PocketRL is a Python/PyTorch trainer for reinforcement learning with verifiable rewards (RLVR), not an inference server. Each update samples multiple completions per prompt, grades them, and applies a Dr. GRPO policy update. The CLI enters through pocketrl.cli:main; YAML recipes and flags configure the run, while TrainConfig and PocketRLTrainer expose the same workflow to Python callers. The stack includes PyTorch, Transformers, Hugging Face Hub, safetensors, and PyYAML.

ActGRA fits a low-rank basis to each layer's input activations with QR factorization, applies row-wise Adam to the projected gradients, and maps updates back to the full weight matrix. Generation and training use the same BF16 weights. A packed 4-bit rounding remainder in the 7B and 27B recipes, or 8-bit at 1.5B, accumulates updates that would otherwise be lost to rounding, removing the need for a separate FP32 master copy.

Key Capabilities & Differentiators

The built-in recipes target Qwen2.5-Math-1.5B, Qwen2.5-Math-7B, and Qwen3.8-27B. The trainer also accepts compatible Qwen2, Qwen2.5, and Qwen3.5-style hybrid text models via a Hugging Face ID or local path. The paper recipes sample eight answers per prompt across 16 prompts per update, with up to 3,000 generated tokens per answer. The loop can be reused for other verifiable tasks with a custom dataset and Python reward function.

For 7B, persistent training state drops from 113 GiB to 18 GiB; the measured peak was 22.5 GiB on one RTX 5090. The 500-update experiment took 7.3 hours at an estimated $4.71 and reached 43.0% average accuracy across six math sets at Avg@8, up from 13.4% for the base model. The 27B experiment ran 100 updates in 9.1 hours on four RTX 5090s, peaking at 31.1 GiB per card. These figures describe the experimental runs, not the separately tabulated checkpoint evaluations.

Trade-offs & Limitations

ActGRA reduces optimizer storage by updating in an activation-derived subspace rather than retaining dense Adam state. In the 7B ablation, ActGRA and LoGRA both ran on one RTX 5090: ActGRA took 7.3 hours and peaked at 22.5 GiB, versus 12.3 hours and 31.3 GiB for LoGRA. The Dense run used two H100s, so its wall time is not a same-hardware comparison. Treat the selected rank and remainder precision as validated settings for these recipes, not universal defaults for unrelated models or reward functions.

Against TRL, the 7B comparison reports 1.8 versus 4.6 hours per 100 steps on H100 hardware. Rollout dimensions were matched, but frameworks used their own released settings and minimum viable GPU counts. PocketRL's contiguous layer placement avoids Ray and multi-node setup for the demonstrated runs, but does not establish multi-node scaling. Dollar estimates depend on GPU pricing, and peak VRAM must be rechecked when changing context length, sample count, or runtime.

Hardware & Deployment Guide

Run locally on Linux with Python 3.10 or later and PyTorch 2.6 or later; RTX 5090 systems need a PyTorch build targeting CUDA 12.8 or newer. Install .[math,vllm] for math grading and vLLM evaluation, adding hybrid for the 27B model's flash-linear-attention and causal-conv1d dependencies. Start with pocketrl train paper-1.5b --gpus 1; train and eval are separate CLI commands. The first standard run fetches models and datasets; local model and dataset paths are supported.

The first public release, v0.1.0, packages a native shared-weight decoder for training. The paper used colocated vLLM generation with shared weight views at 1.5B and 7B and pipelined generation at 27B, so packaged throughput and peak VRAM can differ. The recipes save every 50 updates, accept --resume to continue from the latest checkpoint, and write progress to metrics.jsonl. Run a short trial on the intended GPU layout before budgeting a full run.

Optimizer state: ActGRA uses a rank-128 activation basis in the paper recipes, refreshed every eight updates; 7B Adam state drops from 56.74 to 0.61 GiB.
Weight storage: Generation and training share BF16 weights; a packed rounding remainder replaces FP32 master weights.
GPU footprint: Reported peaks are 22.5 GiB on one RTX 5090 at 7B and 31.1 GiB per card on four RTX 5090s at 27B.
Model placement: --gpus N partitions consecutive decoder layers across visible GPUs within one process, without Ray.
Experiment controls: YAML recipes and CLI overrides expose Dense, LoGRA and ActGRA, checkpoint resume, JSONL metrics, and optional W&B tracking.
Task integration: Local JSONL or Hugging Face datasets can feed a Python reward function, with additional row fields passed as keyword arguments.
Best For

Teams running verifiable-reward experiments on supported Qwen models with limited single-host VRAM, or comparing Dense, LoGRA, and ActGRA under a shared training loop.

Skip If

You need a production inference server, validated multi-node scaling, broad model-family compatibility, or exact reproduction of paper timing from the packaged runtime.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

GPUCLI
git clone https://github.com/dualverse-ai/pocketrl.git
cd pocketrl
pip install -e '.[math,vllm]'      # math grader and vLLM evaluation
pip install -e '.[math,vllm,hybrid]'  # also needed for the 27B model

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
pocketrl ★115+7PythonApache-2.0Low-VRAM RLVR training with activation-projected gradients and shared BF16 weigh
peft21.9k+32PythonApache-2.0Python/PyTorch adapters for fine-tuning large models without updating base weigh
LlamaFactory76.4k+86PythonApache-2.0A unified Python framework for LLM and VLM fine-tuning with pluggable inference
axolotl12.8k+15PythonApache-2.0YAML-driven GPU trainer for LLM and multimodal post-training

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/dualverse-ai/pocketrl.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

dualverse-ai/pocketrl Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about pocketrl

How do I integrate a custom task and reward function?

Pass a JSONL file with a prompt field on each row to --data and a Python callable such as rewards.py:boxed_match to --reward. Extra dataset fields arrive as keyword arguments, and the callable returns one score per sampled completion. For programmatic integration, use TrainConfig.from_recipe and PocketRLTrainer with your dataset and reward function.

Is the 18 GiB figure enough to size a GPU for 7B training?

No. The 18 GiB figure covers persistent training state; the 7B experiment peaked at 22.5 GiB on one RTX 5090. The 27B experiment peaked at 31.1 GiB per GPU on four RTX 5090s. Use the peaks as starting points, not capacity guarantees: measure the installed runtime with your actual context length and rollout settings.

Can we self-host PocketRL for commercial work?

Apache-2.0 permits commercial use and self-hosting of the code. When redistributing it, comply with the license and applicable notice requirements, and review NOTICE, THIRD_PARTY.md, and docs/Dr-GRPO-LICENSE.txt. Check the terms for model weights, datasets, and optional dependencies separately; the PocketRL license does not grant rights to those artifacts.

When should we choose PocketRL over TRL?

Consider PocketRL when a supported Qwen model, a verifiable reward, and a single-host VRAM budget define the problem. In the 7B H100 comparison, 100 steps took 1.8 hours with PocketRL versus 4.6 hours with TRL. The test fixed rollout dimensions but let each framework use its own released settings and minimum viable GPU count. Before switching, compare peak VRAM, wall time, and reward quality on your own task.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining dualverse-ai/pocketrl? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature dualverse-ai/pocketrl on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare