ALIGNED BY HARMAN SANDHU
RLAIF · REWARD MODEL + PPO (QLoRA)

Gemma 2 2B · RLAIF

Our Gemma QA fine-tune, aligned with classic RLAIF: a Bradley-Terry reward model trained on 500 AI preferences, then PPO against it with a KL anchor.

HuggingFace weights →
2.6B
Parameters
256K
Vocab
8,192
Context
4-bit
NF4 quantized
89.9%
Judged correct
43%
Win-rate vs SFT
0.983
Reward-model acc
Model lineage
interactiveconnecting…

Ask a question

Connecting to the inference endpoint…
The model's answer will appear here.
RL from AI feedback (QLoRA)

What this is

The Gemma QA adapter, aligned by reinforcement learning against the shared reward model (0.983 held-out pairwise accuracy). PPO optimized the QLoRA policy toward higher reward while a KL penalty kept it anchored — the first run diverged and was re-run with a firmer KL anchor, which stayed bounded.

60 PPO iterations, ~36 min on an A100. Judged correctness 0.899 [0.878–0.918]; paired win-rate vs SFT 43% (ties split) — like DPO, RLAIF traded a little judged accuracy for alignment on Gemma. The reward model reached 0.983 held-out pairwise accuracy.

Architecture
ClassGemma2ForCausalLM
Layers26
Hidden size2,304
Attention8 heads / 4 KV · dim 256 · GQA
Feed-forwardGeGLU · inner 9,216
Attention windowsliding 4,096 (alternating) · logit soft-cap
NormRMSNorm
Context8,192 tokens
Vocabulary256,128
Embeddingstied input/output
Training
Init fromgemma-2-2b QA-SFT adapter
MethodQLoRA — reward model + PPO
Trainable params20.8M LoRA (0.8%)
Training data500 preference pairs
Training tokens335K per PPO pass
PPO iterations60
What this model cost to build

$15.57 total Modal usage

our cost begins at fine-tuning — the base is Google's, imported free.

StageDetailCost
QLoRA QA fine-tunethe adapter RLAIF starts from$9.84
Reward modelBradley-Terry head on L4$0.02
PPO alignment60 iterations on A100$4.23
Evaluation (shared)13 versions on 500 held-out questions, this model's share$1.48
Total$15.57

Figures are Modal GPU usage (time × rate) across this model's lineage; shared datasets are charged at this model's share. Whether base pretraining is included is stated above — it is for the models pretrained here, and excluded for imported bases. Evaluation-derived metrics come from an independent blind-judge harness on a frozen, decontaminated held-out set. Serving is billed separately and scales to zero.