You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Qwen3-4B Vulnerability Detection - SFT (Research)

This model is a full fine-tuned version of Qwen/Qwen3-4B for code vulnerability detection.

Model Description

  • Base Model: Qwen/Qwen3-4B
  • Training Method: Supervised Fine-Tuning (SFT)
  • Task: Binary classification of code vulnerabilities + vulnerable line localization
  • Training Data: Teacher-annotated vulnerability samples from PrimeVul, SVEN, and SecVulEval datasets (~15,100 samples generated from the ~12,900 deduplicated functions in the updated merged dataset)

Training Configuration

  • Learning rate: 2e-5 with 3% warmup
  • Batch size: 1 per device × 16 gradient accumulation steps
  • Max sequence length: 32,768 tokens
  • Epochs: 1
  • Gradient checkpointing: Enabled
  • Distributed: DeepSpeed ZeRO-3 across 3× H100 GPUs
  • Precision: BF16

Evaluation Results (Combined - Training Set)

Note: These results are from the sft_qwen3_4b_newrewards_backtoSFThints_butnoGRPOhints_afterdedupandidfix_multitemp_run1 (temperature 0.4) evaluation run (best P-C of this specific model). This model keeps the exact same configuration as the previous run (d450f3e02358050fb65ae426f5185a2e2b09d203), with the exception of re-introducing hints for SFT training:

  • Re-introduced hints for SFT training (GRPO remains hint-free).
  • Evaluation with concurrency of 32 for some runs.
Metric Value
Accuracy 0.5599
F1 Score 0.6105
P-C (Pair-Correct) 26.196%
P-V (Pair-Vulnerable) 42.420%
P-B (Pair-Benign) 17.553%
P-R (Pair-Reversed) 13.829%

Full metrics JSON files are available in sft_qwen3_4b_eval_results. See the specific metrics from above here: sft_qwen3_4b_eval_results/sft_qwen3_4b_newrewards_backtoSFThints_butnoGRPOhints_afterdedupandidfix_multitemp_run1/metrics_temp0p4/metrics_combined_training.json.

Repository

Training code: SSL_research (commit: 2fe308cf27581b0dcb65c8aa51697d0f85db4575)

Downloads last month
-
Safetensors
Model size
196k params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Andrefty/qwen3-4b-vuln-sft-research

Finetuned
Qwen/Qwen3-4B
Finetuned
(1045)
this model