Views
No views yet
Qwen/Qwen3.5-9B-Base that emits valid JSON
compositions over the SDG (Synthesis Data Governance) 540-template
ontology catalog under xgrammar-based constrained decoding.zndx/sdg-bertopic-correspondence-v0.1 — corpus version
v2). The corpus was generated by rejection-sampling the base model
under xgrammar+full-schema constrained decoding and keeping only
completions scoring R ≥ 0.3 against a C1-locked verifier.| Stage | overall mean R | good_mean | bad_mean | R_A pass rate | AUC |
|---|---|---|---|---|---|
| Base (no adapter) | 0.208 | 0.205 | 0.210 | 0.55 | 0.478 |
| SFT-r1 (this adapter) | 0.289 | 0.311 | 0.268 | 0.68 | 0.590 |
| Hyperparameter | Value |
|---|---|
| Base model | Qwen/Qwen3.5-9B-Base |
| Trainable params | 29.1M / 8.98B (0.32 %) |
LoRA rank r | 16 |
LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Epochs | 2 |
| Grad accumulation | 8 |
| Per-device batch | 1 |
| Effective batch | 16 (across 2 GPUs, FSDP FULL_SHARD) |
| Total grad steps | 84 |
| Final train loss | 0.216 |
| Final token accuracy | 95.2 % |
| Final entropy | 0.194 |
| Wall time | 69.6 min on 2× RTX 4090 |
accelerate launch --use_fsdp --num_processes 2, FSDP
FULL_SHARD over Qwen3_5DecoderLayer. Hyperparameter precedents from
[InstructGPT, Llama-2 RLHF].1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3import torch
4
5tok = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B-Base")
6model = AutoModelForCausalLM.from_pretrained(
7 "Qwen/Qwen3.5-9B-Base", torch_dtype=torch.bfloat16
8).to("cuda")
9model = PeftModel.from_pretrained(model, "zndx/sdg-sft-r1")
10model.eval()
11
12# Recommended: use with xgrammar-based constrained decoding against
13# the SDG composition JSON schema. See the project's
14# `make_xgrammar_logits_processor_factory` helper for the canonical
15# wiring.zndx/sdg-bertopic-correspondence-v0.1 — the SFT corpus + scoring + topic-alignment data.zndx/sdg-sft-r2 — second SFT round, demonstrates diminishing returns + mode collapse.1@misc{sdg-sft-r1-v01,
2 title = {SDG SFT Round-1 LoRA Adapter (v0.1)},
3 author = {Hill, Ryan and contributors},
4 year = {2026},
5 url = {https://huggingface.co/zndx/sdg-sft-r1}
6}