Downloads · 30 days
0
flavianv/qwen3-4b-musical-instruments-sft-ranker-head-20260923
qwen3-4b-musical-instruments-sft-ranker-head-20260923 is a machine learning model from flavianv. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as apache-2.0.
This is a head-only checkpoint, not standalone full model weights and not a LoRA adapter. It contains the selected 2,560-weight scalar head, trained on frozen SFT Qwen3-4B. Loading requires the public SFT backbone, pi…
Downloads · 30 days
0
Access
Public
Updated Sep 23, 2026
Repo size
11.8 KB
Likes
0
Public
Click a slice to open those files.
.pt11.8 KB · 49%
From the Hugging Face model README
This is a head-only checkpoint, not standalone full model weights and not a LoRA adapter. It contains the selected 2,560-weight scalar head, trained on frozen SFT Qwen3-4B. Loading requires the public SFT backbone, pinned to revision 1d6b019dfaaf368fe8af2ab593d66a3ee1c215a6. No need to duplicate its full weights here. The original pretrained ancestor is Qwen/Qwen3-4B revision1cfa9a7208912126459214e8b04321603b3df60c.
Head SHA256: d4777b553f05bb0dd17cc7533e8a869b569498c9759f1ce3c2935490b81b3fcc. The loader rejects a different head. Tokenizer and chat template are loaded from the exact backbone revision. Inputs are shopping request plus product titles only: no IDs, roles, categories, prices, or other metadata. Serialization is system instruction, user request, assistant {"products": ["title", ...]}, thinking disabled, no generation prefix. Maximum input2048tokens; longer input is rejected. See ranker.py for the complete instruction and renderer.
Download ranker.py from this repository after reviewing it; install requirements. No trust_remote_code is needed.
from ranker import Ranker
ranker = Ranker() # downloads the pinned SFT backbone and checksum-verified head
print(ranker.score("I need a microphone and stand for home recording",
["USB condenser microphone", "Adjustable microphone stand"]))
Scores are unrestricted real values, higher preferred. sigmoid_score_over_3 is the GRPO transform into(0,1), not a calibrated probability. Protocol-invalid GRPO traces receive zero in the external validator; this scorer does not independently enforce JSON/duplicate/count rules.
Only score.weight was trained; the SFT backbone was frozen, with no LoRA. Pairwise logistic/Bradley–Terry loss, LR1e-4, microbatch4pairs × accumulation4 =16pairs/update, AdamW, gradient clip1, seed42, maximum2048tokens. Two epochs,822updates. Training was extended after epoch1, restoring optimizer/RNG and restarting a one-epoch cosine schedule with3%warmup for epoch2. BF16 forward with FP32 head weights.
Data: unseen-by-selected-SFT ranker splits. Train1,648queries/6,575pairs; validation274/1,092; test275/1,098. Synthetic negative strategies: random set, role collision, wrong item, wrong query. Missing eligible negatives are skipped and documented. Query/product-set groups do not cross splits. These examples were not consumed by selected SFT checkpoint420; later discarded SFT checkpoints did consume them. Products themselves may overlap across splits.
Selected head822 by validation same-query top1, then pairwise accuracy; test was evaluated only after selection. Validation pairwise accuracy95.5128%, same-query top1 86.1314%. Test pairwise accuracy96.0838%; correct-bundle selection among same-query candidates 89.0909% (245/275). Wrong-query negatives contribute to pairwise accuracy but are excluded from same-query top1. See evaluation.json for full counters and losses.
The prior base-model head scored95.6284% pairwise and82.1818% top1 on the same test. Both backbone and head-training data changed, so this is not a causal SFT ablation. Synthetic negative performance is not evidence of human preference or guaranteed GRPO reward robustness. Repeated categories can be legitimate; taxonomy-derived negatives are presumed preferences. The old507holdout was separately used for model development. No result is claimed as an untouched end-to-end benchmark.
No optimizer, private logs, credentials or full backbone weights are included. The source checkpoint is preserved.