Views
No views yet
CodeRM-GRPO-Selection-8B, a
code-domain reward model trained with GRPO (Group Relative Policy
Optimization) on top of Qwen/Qwen3-8B.
This bundle is the deployment variant for the NOESIS-VC-ONE platform — it
fits a 6 GB GPU (RTX 3060 Laptop) and serves as the M5-CODE branch
best-of-N selector at inference time.| Field | Value |
|---|---|
| Architecture | Qwen3ForCausalLM (scoring backbone) |
| Hidden size | 4 096 |
| Layers | 36 |
| Attention heads | 32 |
| KV heads | 8 (GQA) |
| Head dim | 128 |
| Vocab | 151 936 (Qwen3 standard) |
| Context length | 32 768 (positional 40 960) |
| Base model | Qwen/Qwen3-8B (Apache 2.0) |
| Fine-tune method | GRPO (Shao et al., DeepSeekMath / DeepSeek-R1 lineage) |
| Quantization | AWQ INT4, GEMM kernel, group_size=128, zero_point=true |
| Bundle size | ~6.1 GB on disk (down from ~16 GB BF16) |
| Runtime VRAM | ~5.5 GB peak (fits RTX 3060 6 GB) |
| Required runtime | transformers >= 5.8.1 with native AwqConfig |
| License | Apache 2.0 (inherited from Qwen3-8B + GRPO fine-tune) |
| File | Purpose |
|---|---|
model-00001-of-00002.safetensors (4.0 GB) | AWQ-quantized weight shard 1/2 |
model-00002-of-00002.safetensors (2.1 GB) | AWQ-quantized weight shard 2/2 |
model.safetensors.index.json | shard map (qweight / qzeros / scales per Linear) |
config.json | quantization_config.quant_method="awq" + AWQ params |
tokenizer.json / tokenizer_config.json | Qwen3 BPE tokenizer (vocab 151 936) |
chat_template.jinja | Qwen3 standard chat template |
generation_config.json | inherited defaults |
noesis_provenance.json | full NOESIS provenance (see below) |
LICENSE | Apache 2.0 |
noesis_provenance.json)| Parameter | Value |
|---|---|
| Method | AWQ via autoawq |
| Kernel | GEMM |
w_bit | 4 |
q_group_size | 128 |
zero_point | true |
| Calibration samples | 64 |
Calibration max_seq_len | 384 |
| Calibration source | noesis_router_dataset_50k_curated.jsonl |
| RNG seed | 1729 |
| Wall-clock | 57.13 minutes |
force_arch_override | null (auto-detected Qwen3ForCausalLM) |
| NOESIS framework | DHCF-FNO v15.7 |
argmax (best-of-N) or rank-based selection (top-k).1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4bundle = "AMAImedia/CodeRM-GRPO-Selection-8B-NOESIS-AWQ-INT4"
5tokenizer = AutoTokenizer.from_pretrained(bundle)
6model = AutoModelForCausalLM.from_pretrained(
7 bundle,
8 device_map={"": 0}, # AWQ kernels prefer single-device load
9 dtype=torch.float16, # AWQ activations are fp16
10).eval()
11
12
13def score(prompt: str, code: str) -> float:
14 text = (
15 f"<|im_start|>user\n{prompt}<|im_end|>\n"
16 f"<|im_start|>assistant\n{code}<|im_end|>"
17 )
18 ids = tokenizer(text, return_tensors="pt").to(model.device)
19 with torch.no_grad():
20 logits = model(**ids).logits[:, -1, :]
21 return float(logits.softmax(-1).max())
22
23
24candidates = [
25 "def solve(n):\n return n + 1",
26 "def solve(n):\n return n * 2",
27]
28prompt = "Write a function that returns n+1."
29scores = [score(prompt, c) for c in candidates]
30print("Best:", candidates[scores.index(max(scores))])AWQ runtime note.transformers >= 5.8.1reads thequantization_configblock inconfig.jsonand instantiates the AWQ kernels automatically — noautoawqimport is needed at inference time. The autoawq library is only required if you want to re-quantize from BF16 sources.
M5-CODE generates N candidates
│
▼
CodeRM-GRPO-Selection-8B-NOESIS-AWQ-INT4 ← (this bundle)
│ group-relative scores
▼
Orchestrator picks argmax
│
▼
QC-4B verifies executabilityR-APACHE-CLEAN — Apache 2.0 preserved (Qwen3 base + GRPO fine-tune + AWQ quant).R-REWARD-MODEL-FROZEN — reward model is frozen during inference; no
gradient feedback into M5-CODE at production runtime.R-BEST-OF-N-CAP — production best-of-N selection is capped at N=8 to
bound VRAM / latency on RTX 3060.R-AWQ-DEVICE-MAP-SINGLE — AWQ kernels require device_map={"":0}, never
"auto" (mirrors the NF4 rule and applies for the same reason: kernel
expects the full computation graph on one device).| Step | Source / output |
|---|---|
| Base weights | Qwen/Qwen3-8B (© Alibaba / Qwen Team, Apache 2.0) |
| Fine-tune | GRPO on code-reward dataset (author's pipeline) |
| Source format | BF16 native safetensors × 4 shards (~16 GB) |
| Quantization | AWQ INT4 GEMM via autoawq, group_size=128, w_bit=4 |
| Bundle | this repo — AMAImedia/CodeRM-GRPO-Selection-8B-NOESIS-AWQ-INT4 |
| NOESIS slot | M5-CODE branch reward-selection head |
LICENSE.AMAImedia/CodeRM-GRPO-Selection-8B (if/when published).