Run this model with HF Jobs

Run corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

KV-Cache Precision in GRPO: Qwen3-0.6B LoRA Adapters

LoRA adapters from a preregistered, multi-objective study of KV-cache quantization during GRPO training: 33 GRPO runs on Qwen3-0.6B (4-bit, MLX) that differ only in the KV cache used for rollouts, plus the frozen policy used for the gradient diagnostics. Each top-level folder is one rollout arm; inside it, seed-N/ folders hold the update-30 adapter of each seed (each a loadable mlx-lm adapter directory).

Folder Arm Seeds
bf16-rollouts/ BF16 rollouts (reference arm), 8 seeds 8
k8v4-rollouts/ K8V4 rollouts (8-bit keys, 4-bit values), 3 seeds 3
k8v4-rollouts-tis/ K8V4 rollouts with truncated importance sampling, 8 seeds 8
k8v4-attention-buffer/ K8V4 rollouts with attention-driven 8-bit buffer, 8 seeds 8
k8v4-cache-native-learner/ K8V4 rollouts with a simulated-K8V4 learner, 3 seeds 3
bf16-frozen-diagnostic-policy/ Frozen BF16 policy used for the gradient diagnostics 1

K8V4 = 8-bit keys, 4-bit values, group 64 (41% of the BF16 KV payload). TIS = truncated importance sampling (cap 2). The attention buffer keeps 64 slots per row and layer of 8-bit value residuals for the tokens with the highest decayed attention mass. The cache-native learner reads a simulated K8V4 cache with a straight-through gradient.

Results

Accuracy by arm

Variance ratio

Dev-200 greedy accuracy at update 30 with a BF16 cache (seeds 1-3 = exploratory block A3, seeds 4-8 = preregistered replication A4):

Seed Block BF16 K8V4 K8V4+TIS Attention buffer
1 A3 0.680 0.670 0.765 0.570
2 A3 0.625 0.700 0.660 0.665
3 A3 0.685 0.720 0.735 0.620
4 A4 0.610 - 0.700 0.605
5 A4 0.565 - 0.700 0.695
6 A4 0.625 - 0.655 0.655
7 A4 0.575 - 0.560 0.660
8 A4 0.655 - 0.500 0.665
Arm KV payload (GB) Rollout / cycle peak (GB) s / update Train success
BF16 2.25 3.54 / 3.9 168 0.488
K8V4 0.92 1.82 / 3.9 170 0.419
K8V4+TIS 0.92 1.82 / 3.9 169 0.388
Attention buffer 0.98 1.81 / 3.9 178 0.428

Findings:

  • Memory: K8V4 halves the rollout memory peak with no detectable loss in BF16-evaluated accuracy; the update phase (3.9 GB) still sets the whole-cycle peak at this configuration.
  • Gradient variance: preregistered test on 15 new prompts at a frozen policy: K8V4 raises group-gradient variance 1.56x (95% CI [1.11, 2.18], p = 0.014); 1.60x (p = 0.008) with consistent scoring.
  • Serving: BF16-trained policies served through K8V4 lose 10.9 points (8 seeds, 95% t [-16.8, -4.9]); training through K8V4, with or without TIS, a buffer or a simulated-cache learner, does not reliably shrink this. Through stock 4-bit KV they collapse to 0, which Dress Rehearsal fixes.
  • Seeds: neither three-seed lead (K8V4+TIS above BF16, +0.057; attention below K8V4, -0.078) survived five new seeds (Holm p = 0.75 and 0.24). BF16 alone spans 0.565-0.685 across seeds.

Use

pip install mlx==0.31.2 mlx-lm==0.31.3 huggingface_hub
from huggingface_hub import snapshot_download
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler

adapter = snapshot_download("corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA", allow_patterns=["bf16-rollouts/seed-1/*"]) + "/bf16-rollouts/seed-1"
model, tok = load("mlx-community/Qwen3-0.6B-4bit", adapter_path=adapter, revision="73e3e38d981303bc594367cd910ea6eb48349da8")
msgs = [{"role": "system", "content": "You are a careful assistant that solves arithmetic puzzles."},
        {"role": "user", "content": "Using the numbers 1, 11, 30, create an arithmetic expression that equals 42.\n"
                                     "Use every number exactly once. You may use +, -, *, / and parentheses.\n"
                                     "Show brief reasoning. End with the expression alone between answer tags, "
                                     "for example <answer>(100 - 75) * 60</answer>"}]
prompt = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=False)
# Serve through mlx-lm's stock 4-bit KV cache (4 bits, group 64), exactly as evaluated:
print(generate(model, tok, prompt, max_tokens=1024, sampler=make_sampler(temp=0.0),
               kv_bits=4, kv_group_size=64, quantized_kv_start=0))

Drop kv_bits to decode with a BF16 cache. Requires Apple Silicon. Verified 2026-11-13 with stock mlx-lm 0.31.3: the seed-1 adapter reproduced 4/4 solves logged by the project's batched evaluator (expressions may differ token-wise), while the base model without the adapter gave no answer on any of them through the 4-bit cache.

Adapter format

Each adapter directory holds adapters.safetensors (LoRA rank 16, alpha 32 -> scale 2.0, dropout 0, on q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj of all 28 layers; 10,092,544 parameters, 40 MB) and a standard mlx-lm adapter_config.json, plus training_config.json (resolved run config), training_state.json (updates, active seconds) and evaluation.json (every evaluation logged for the run). The base model is not included: mlx-community/Qwen3-0.6B-4bit at revision 73e3e38d, itself a 4-bit MLX conversion of Qwen/Qwen3-0.6B.

Prompt. System: You are a careful assistant that solves arithmetic puzzles. User: Using the numbers {numbers}, create an arithmetic expression that equals {target}. Use every number exactly once. You may use +, -, *, / and parentheses. Show brief reasoning. End with the expression alone between answer tags, for example <answer>(100 - 75) * 60</answer> (chat template, Qwen3 thinking disabled). Reward 1 if the <answer> expression uses each number once and equals the target exactly.

Training

GRPO on the Countdown-3 training pool, 8 prompts x 8 completions per update, temperature 1, at most 512 new tokens, concurrency 32, standardized advantages, clipped surrogate (0.2 / 0.28), AdamW lr 3e-5, gradient clip 1, 30 updates; one Apple M3 MacBook Air (16 GB). The frozen diagnostic policy (bf16-frozen-diagnostic-policy/policy/) is a BF16 run after 20 updates. Every token, completion and update is in corbanyax/KV-Cache-Precision-GRPO-Run-Logs.

Project family

Item Hugging Face Kaggle mirror
Dress Rehearsal adapters (this method) corbanyax/Dress-Rehearsal-Qwen3-0.6B-4bit-KV-LoRA model
KV-cache precision study adapters (33 runs) corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA model
Countdown-3 puzzles with hash-defined splits corbanyax/Countdown-3-Hash-Splits dataset
Full run logs, diagnostics, decision log corbanyax/KV-Cache-Precision-GRPO-Run-Logs dataset

Paper: Beyond a Single Score: A Multi-Objective Evaluation of KV-Cache Quantization in GRPO Training (under double-blind review, AAAI-27 Workshop on Multi-Objective and Multi-Task Optimization for Robust AI). All items are private until the review period ends.

Related work

  • GRPO: Shao et al., DeepSeekMath (arXiv:2402.03300).
  • Qwen3: Qwen Team, Qwen3 Technical Report (arXiv:2505.09388); base weights mlx-community/Qwen3-0.6B-4bit.
  • MLX: Hannun et al., MLX: Efficient and Flexible Machine Learning on Apple Silicon (github.com/ml-explore/mlx).
  • LoRA: Hu et al., ICLR 2022 (arXiv:2106.09685).
  • Quantization-aware training with KV cache: Liu et al., LLM-QAT (arXiv:2305.17888).
  • Quantized-sampler RL: Gu et al., QaRL (arXiv:2604.07853); Yao et al., rollout-training mismatch and TIS (OPT 2025).
  • Self-training on correct answers: Zelikman et al., STaR (NeurIPS 2022).
  • Straight-through estimator: Bengio, Léonard, Courville (arXiv:1308.3432).
  • KV-cache quantization: KIVI (arXiv:2402.02750), KVQuant (arXiv:2401.18079), KVTuner (arXiv:2502.04420).
  • Seed variance in deep RL: Henderson et al., AAAI 2018; Agarwal et al., NeurIPS 2021.
Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA

Finetuned
Qwen/Qwen3-0.6B
Adapter
(5)
this model

Dataset used to train corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA

Collection including corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA

Papers for corbanyax/KV-Cache-Precision-GRPO-Qwen3-0.6B-LoRA

Evaluation results

  • greedy accuracy, BF16 KV (dev-200) on Countdown-3 (dev200)
    self-reported
    0.680