Run this model with HF Jobs

Run SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct 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 and TRL to fine-tune https://huggingface.co/SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct. 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/SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct 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/SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct. 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/SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct. 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.

qwen2.5-coder-1.5b-sec-rlvr-instruct

Qwen/Qwen2.5-Coder-1.5B-Instruct further trained with GRPO only (300 steps, completion cap 2048) using our sandboxed verifiable rewards: unit-test pass fraction for coding, exact CWE / multiple-choice / CVSS answers for CTI prompts (with half credit when the right answer is stated but not on the last line), A/B secure-code review, and regression-preserving security patches, with the mixture shifted toward security prompts. No continued pretraining or SFT was run for this checkpoint; those stages belong to the sibling base-model checkpoints described in REPORT.md.

Status: private research artifact. All numbers below are measured by scripts/enterprise/eval.py with greedy decoding; see REPORT.md and dashboard.html in this repo for the full methodology, logs and limitations.

Intended use

  • Secure-code review, vulnerability classification (CWE), root-cause explanation and patch suggestions for review by a human.
  • General Python coding assistance.

Out of scope / limitations

  • Not an offensive-security tool; not trained or evaluated for exploit development.
  • 1.5B parameters: expect errors; always run the model's patches through your own tests.
  • GRPO ran 300 steps from the instruct checkpoint; no continued pretraining or SFT. CyberGym was not evaluated.
  • Evaluation labels for CTI tasks come from teacher-model agreement (R1/o1), not human annotation.

Benchmark: this model against open-source models

Every row ran through the same harness (scripts/enterprise/eval.py): greedy decoding, the same prompts and generation caps, EvalPlus HumanEval+ (164) and MBPP+ (378), and held-out security sets (CTI 400 prompts, A/B secure-code review 300, patch tasks 4x4 samples). ★ marks checkpoints produced in this project; the other rows are public models. The 3B and 8B rows are references outside the 1.5B size class.

Model Params HumanEval+ (chat) MBPP+ (chat) CTI strict CTI lenient Secure review strict Secure review lenient Patch pass
qwen2.5-coder-3b-instruct 3B 79.9% 64.6% 22.8% 47.0% 9.0% 75.0% 25.0%
THIS MODEL: grpo_instruct 1.5B 67.7% 62.7% 47.5% 47.5% 0.7% 66.0% 18.8%
qwen2.5-3b-instruct 3B 65.9% 61.9% 23.5% 37.0% 26.0% 73.3% 0.0%
qwen2.5-coder-1.5b-instruct 1.5B 64.6% 63.0% 44.8% 45.2% 0.7% 61.0% 0.0%
★ grpo_nothink 1.5B 59.1% 64.6% 64.8% 65.8% 4.0% 67.7% 0.0%
llama-primus-merged-8b 8B 58.5% 61.9% 43.2% 61.8% 41.0% 69.0% 0.0%
★ grpo 1.5B 58.5% 64.3% 52.5% 55.0% 0.0% 59.7% 25.0%
★ grpo_nothink_abliterated 1.5B 58.5% 62.7% 66.8% 66.8% 5.0% 58.3% 25.0%
★ sft_nothink 1.5B 58.5% 65.1% 65.8% 66.5% 3.3% 68.3% 25.0%
★ sft 1.5B 57.3% 64.0% 54.2% 56.0% 0.0% 59.0% 25.0%
★ exp_merge_delta 1.5B 56.7% 60.1% 46.2% 52.0% 1.7% 56.0% 0.0%
foundation-sec-8b-instruct 8B 55.5% 52.1% 30.8% 66.0% 1.7% 64.0% 0.0%
qwen2.5-1.5b-instruct 1.5B 51.8% 58.7% 24.2% 46.5% 0.7% 63.0% 0.0%
deepseek-coder-1.3b-instruct 1.3B 45.7% 27.5% 2.0% 7.5% 0.0% 45.3% 0.0%
smollm2-1.7b-instruct 1.7B 29.3% 50.8% 8.5% 8.8% 4.0% 62.0% 0.0%

Against the model it started from (Qwen2.5-Coder-1.5B-Instruct, same harness): +3.0 points HumanEval+ (chat) and +2.7 points CTI strict accuracy. MBPP+ is within noise of the starting model.

How to read the security columns:

  • Strict requires the answer alone on the last line, as the prompt instructs. Lenient also counts a correct answer stated near the end but not on the last line. Most models write "the last line should be B" instead of a bare letter, so strict secure-review accuracy is near zero for them and lenient is the informative number.
  • The patch set has only 16 samples, so one sample moves it by 6 points: treat it as a sanity check, not a benchmark.
  • CTI labels come from teacher-model agreement (R1/o1), not human annotation.
  • deepseek-coder-1.3b-instruct first scored 0 everywhere because vLLM's detokenizer returned raw byte symbols for its tokenizer; it was re-scored with Transformers decoding of the same token ids.

Our checkpoints in both prompting modes

Checkpoint HumanEval+ (chat) HumanEval+ (completion) MBPP+ (chat) MBPP+ (completion) CTI strict Secure review strict Patch pass
base 3.0% 36.6% 2.4% 42.3% 1.8% 0.0% 50.0%
cpt 0.0% 35.4% 1.1% 52.4% 0.0% 0.0% 0.0%
sft 57.3% 44.5% 64.0% 51.1% 54.2% 0.0% 25.0%
sft_nothink 58.5% 43.3% 65.1% 50.8% 65.8% 3.3% 25.0%
grpo 58.5% 45.1% 64.3% 50.0% 52.5% 0.0% 25.0%
grpo_nothink 59.1% 43.3% 64.6% 49.7% 64.8% 4.0% 0.0%
grpo_instruct 67.7% 54.3% 62.7% 54.5% 47.5% 0.7% 18.8%
exp_merge_delta 56.7% 51.8% 60.1% 47.6% 46.2% 1.7% 0.0%
grpo_nothink_abliterated 58.5% 38.4% 62.7% 45.0% 66.8% 5.0% 25.0%

Completion mode = raw function-signature prompt (fair for base/CPT); chat mode = instruction through the chat template. exp_merge_delta is a training-free experiment (Qwen2.5-Coder-1.5B-Instruct plus our continued-pretraining weight delta); it raised CTI but cost HumanEval+, so it was not used.

Training provenance

  • Pipeline code: scripts/enterprise/ in the training repository (CPT -> SFT -> GRPO -> eval -> report -> package); configs under configs/ here.
  • Data card: data_card.json (dataset ids, revisions, licenses, counts, splits, dedup, eval/train separation).
  • Environment: env_report.json. Git commit: e220122610ac4bc9c7c016caa4985886449151a5.
  • Licenses: base model Apache-2.0; Primus corpora ODC-BY; Magicoder-OSS-Instruct MIT; CyberNative DPO Apache-2.0; PrimeIntellect/verifiable-coding-problems has no license field on the Hub (underlying APPS/CodeContests/TACO/Codeforces terms apply) — treat as research-use.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct")
model = AutoModelForCausalLM.from_pretrained("SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct", dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "Map this CVE description to a CWE and justify it: ..."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
print(tok.decode(model.generate(**ids, max_new_tokens=512, do_sample=False)[0], skip_special_tokens=True))

See examples/generate.py and examples/serve_vllm.sh.

Ecosystem

  • Model collection: Hub collection (all Sec RLVR variants).
  • Landing Space: SamJoshua/sec-rlvr-hub — links + local demo instructions.
  • Chat demo: run ecosystem/run_demo_local.sh (or ecosystem_publish.py --push-space with HF Pro for hosted Gradio).
  • GGUF: SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-nothink-GGUF (Q4_K_M, Q8_0) — export via scripts/enterprise/export_gguf.py
  • Agent benchmark: frozen suites and runner — docs/agentbench.md in the training repository (scripts/enterprise/agentbench/).
  • Reproduce eval: ecosystem/reproduce.sh and scripts/enterprise/README.md stage table.
Downloads last month
3
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct

Finetuned
(255)
this model
Finetunes
1 model

Datasets used to train SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct

Collection including SamJoshua/qwen2.5-coder-1.5b-sec-rlvr-instruct