Dataset Viewer
Auto-converted to Parquet Duplicate
messages
listlengths
3
3
metadata
unknown
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. Assume a counterfactual mindset: actively try to break i...
{ "source_dataset": "real_insufficient_det_v5", "ground_truth_label": 0, "cwe_id": "CWE-119", "framework": "deterministic_abstain", "had_concrete_sink": true }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. ASSUME you are attacking this code.\n\nMANDATORY [SCRATC...
{ "ground_truth_label": 1, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "9cb177301fdab492e4cfef376b28339afe3ef663503421", "target": 1, "cwe": "CWE-119", "diff_idents": [ "INT_MAX", "buffer", "currlen", "doapr_outch", "maxlen", "min", ...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine. In [SCRATCHPAD], create a short state-tracking log tr...
{ "ground_truth_label": 1, "cwe_id": "CWE-125", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "tcpdump", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a deterministic C/C++ static security expert. Analyze the code linearly. In [CONST...
{ "source_dataset": "real_insufficient_det_v5", "ground_truth_label": 0, "cwe_id": "CWE-416", "framework": "deterministic_abstain", "had_concrete_sink": true }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor who catches your own mistakes.\n\nMANDATORY [SCRATCHPAD]...
{ "ground_truth_label": 1, "cwe_id": "CWE-126", "source_dataset": "synth_vuln_v5", "framework": "", "complexity_level": "Level 3" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a deterministic C/C++ static security analyzer using LINEAR reasoning.\n\nMANDATOR...
{ "ground_truth_label": 1, "cwe_id": "CWE-416", "source_dataset": "synth_vuln_v5", "framework": "", "complexity_level": "Level 3" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine tracing exact runtime values.\n\nMANDATORY [SCRATCHPAD...
{ "source_dataset": "real_insufficient_det_v5", "ground_truth_label": 1, "cwe_id": "CWE-416", "framework": "deterministic_abstain", "had_concrete_sink": true }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Path-Sensitive Code Analyzer. Do not jump to conclusions. In [CONSTRAINTS], iden...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "4dcc29e1574d88f4465ba865ed82800032f76418184623", "target": 0, "cwe": "CWE-119", "diff_idents": [ "CONFIG_ITANIUM", "__end___rse_patchlist", "__start___rse_patchlist", "endif...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine tracing exact runtime values.\n\nMANDATORY [SCRATCHPAD...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "5ac37f87ff18843aabab84cf75b2f8504c2d81fe488560", "target": 0, "cwe": "CWE-119", "diff_idents": [ "DESC_LDT", "LDT_ENTRY_SIZE", "addr", "entries", "ldt", "long", ...
[ { "role": "system", "content": "You are a symbolic-execution engine for C/C++. Architecture: x86_64 Linux LP64.\nAnalyze the operation marked // [TARGET_SINK].\nIn [SCRATCHPAD], show a compact state table with the requested end position and remaining capacity.\nOutput exactly these seven tags in order and n...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "90585e657db48f93bd73bc45d4caa975323da41b164450", "target": 0, "cwe": "CWE-416", "diff_idents": [ "FrameForCurrentContext", "JavaScript", "NOTREACHED", "The", "WebLocalFr...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Path-Sensitive Code Analyzer. You MUST enumerate EVERY branch.\n\nMANDATORY [SCR...
{ "ground_truth_label": 0, "cwe_id": "CWE-126", "source_dataset": "synth_safe_v5", "framework": "", "complexity_level": "Level 3" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Path-Sensitive Code Analyzer. You MUST enumerate EVERY branch.\n\nMANDATORY [SCR...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "7d8cefdf6d0e457b7a855c9503684f1058c2a356161832", "target": 0, "cwe": "CWE-119", "diff_idents": [ "WebGLObject", "WebGLRenderingContext" ], "ground_overlap": [ "WebGLObject",...
[ { "role": "system", "content": "You are a path-sensitive C/C++ static-analysis engine. Architecture: x86_64 Linux LP64.\nAnalyze the operation marked // [TARGET_SINK].\nIn [SCRATCHPAD], enumerate Path 1 and Path 2, then identify the Critical Path.\nOutput exactly these seven tags in order and no other prose...
{ "ground_truth_label": 0, "cwe_id": "CWE-125", "source_dataset": "synth_safe_v5", "framework": "", "complexity_level": "Level 2" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. ASSUME you are attacking this code.\n\nMANDATORY [SCRATC...
{ "ground_truth_label": 1, "cwe_id": "CWE-122", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "openjpeg", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Path-Sensitive Code Analyzer. Do not jump to conclusions. In [CONSTRAINTS], iden...
{ "ground_truth_label": 0, "cwe_id": "CWE-121", "source_dataset": "synth_safe_v5", "framework": "", "complexity_level": "Level 2" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor. In [SCRATCHPAD], begin with a naive, superficial assess...
{ "ground_truth_label": 0, "cwe_id": "CWE-119", "source_dataset": "tier1_safe_v5", "complexity_level": "real-world", "domain": "libyang", "_src": "real_safe" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. Assume a counterfactual mindset: actively try to break i...
{ "ground_truth_label": 1, "cwe_id": "CWE-125", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "tensorflow", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a deterministic C/C++ static security expert. Analyze the code linearly. In [CONST...
{ "ground_truth_label": 1, "cwe_id": "CWE-416", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "ImageMagick", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a deterministic C/C++ static security expert. Analyze the code linearly. In [CONST...
{ "source_dataset": "real_insufficient_det_v5", "ground_truth_label": 0, "cwe_id": "CWE-416", "framework": "deterministic_abstain", "had_concrete_sink": false }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine. Architecture: x86_64 Linux LP64.\nAnalyze the operation marked // [TARGET_SINK] by testing a concrete adversarial input.\nIn [SCRATCHPAD], include Attacker Goal, Malicious Input, Bypass Analysis, and Exploitation Path.\nOutput exactly t...
{ "ground_truth_label": 1, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "4dcc29e1574d88f4465ba865ed82800032f76418184623", "target": 1, "cwe": "CWE-119", "diff_idents": [ "CONFIG_ITANIUM", "__end___rse_patchlist", "__start___rse_patchlist", "endif...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Path-Sensitive Code Analyzer. You MUST enumerate EVERY branch.\n\nMANDATORY [SCR...
{ "ground_truth_label": 0, "cwe_id": "CWE-787", "source_dataset": "synth_safe_v5", "framework": "", "complexity_level": "Level 3" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor who catches your own mistakes.\n\nMANDATORY [SCRATCHPAD]...
{ "ground_truth_label": 1, "cwe_id": "CWE-120", "source_dataset": "synth_vuln_v5", "framework": "", "complexity_level": "Level 3" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor. In [SCRATCHPAD], begin with a naive, superficial assess...
{ "ground_truth_label": 1, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "7ada876a8703f23befbb20a7465a702ee39b1704159064", "target": 1, "cwe": "CWE-119", "diff_idents": [ "On", "Prepare", "and", "current", "drops", "fshared", "goto", ...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine tracing exact runtime values.\n\nMANDATORY [SCRATCHPAD...
{ "ground_truth_label": 0, "cwe_id": "CWE-119", "source_dataset": "tier1_safe_v5", "complexity_level": "real-world", "domain": "Chrome", "_src": "real_safe" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Path-Sensitive Code Analyzer. Do not jump to conclusions. In [CONSTRAINTS], iden...
{ "ground_truth_label": 1, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "e34e01b1b0987e418bc22e3ef1cf2e4ecaead264164381", "target": 1, "cwe": "CWE-119", "diff_idents": [ "break" ], "ground_overlap": [ "break" ], "framework": "skeptical_reflexion"...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. ASSUME you are attacking this code.\n\nMANDATORY [SCRATC...
{ "ground_truth_label": 1, "cwe_id": "CWE-119", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "libxml2", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine tracing exact runtime values.\n\nMANDATORY [SCRATCHPAD...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "contrastive_mined_v5", "pair_id": "5338aac7b8b880b0c5e0c15e27dadc44c5559284159990", "target": 0, "cwe": "CWE-125", "diff_idents": [ "ND_TCHECK_128BITS", "bp", "i" ], "ground_overlap": [ "ND_TCHECK_128BITS", ...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine tracing exact runtime values.\n\nMANDATORY [SCRATCHPAD...
{ "ground_truth_label": 1, "cwe_id": "CWE-119", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "savannah", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Symbolic Execution Engine tracing exact runtime values.\n\nMANDATORY [SCRATCHPAD...
{ "ground_truth_label": 0, "cwe_id": "CWE-122", "source_dataset": "tier1_safe_v5", "complexity_level": "real-world", "domain": "vim", "_src": "real_safe" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. ASSUME you are attacking this code.\n\nMANDATORY [SCRATC...
{ "ground_truth_label": 1, "cwe_id": "CWE-125", "source_dataset": "tier1_vuln_v5", "complexity_level": "real-world", "domain": "FreeRDP", "_src": "real_vuln" }
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor who catches your own mistakes.\n\nMANDATORY [SCRATCHPAD]...
{ "ground_truth_label": 1, "cwe_id": "CWE-787", "source_dataset": "synth_vuln_v5", "framework": "", "complexity_level": "Level 3" }
[ { "role": "system", "content": "You are a C/C++ security auditor who corrects superficial conclusions.\nAnalyze the operation marked // [TARGET_SINK] using exact buffer bounds.\nIn [SCRATCHPAD], include Initial Assessment, HOWEVER, UPON CLOSER INSPECTION, and Final Reasoning.\nOutput exactly these seven tag...
{ "ground_truth_label": 1, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "9b57da0630c9fd36ed7a20fc0f98dc82cc0777fa159345", "target": 1, "cwe": "CWE-787", "diff_idents": [ "NF_ACCEPT", "NF_DROP", "err" ], "ground_overlap": [ "NF_ACCEPT", "N...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor. In [SCRATCHPAD], begin with a naive, superficial assess...
{ "ground_truth_label": 1, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "bf04ad0dae9f4f479f90fd2b38f634ffbaf434b4184810", "target": 1, "cwe": "CWE-119", "diff_idents": [ "STRINGN_TO_NPVARIANT", "base", "c_str", "c_string", "data", "malloc...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a Senior Security Auditor who catches your own mistakes.\n\nMANDATORY [SCRATCHPAD]...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "d9da580b46a28ab497de2e94fdc7b9ff953dab17158129", "target": 0, "cwe": "CWE-125", "diff_idents": [ "end" ], "ground_overlap": [ "end" ], "framework": "bounds_size", "regen":...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. ASSUME you are attacking this code.\n\nMANDATORY [SCRATC...
{ "ground_truth_label": 1, "cwe_id": "CWE-787", "source_dataset": "synth_vuln_v5", "framework": "", "complexity_level": "Level 2" }
[ { "role": "system", "content": "You are a path-sensitive C/C++ static-analysis engine. Architecture: x86_64 Linux LP64.\nAnalyze the operation marked // [TARGET_SINK].\nIn [SCRATCHPAD], enumerate Path 1 and Path 2, then identify the Critical Path.\nOutput exactly these seven tags in order and no other prose...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "contrastive_mined_v5", "pair_id": "9ba91381954ad325ea4fd26b9c65a8bd9a2a85b6161419", "target": 0, "cwe": "CWE-120", "diff_idents": [ "len", "n", "ptr", "strlen" ], "ground_overlap": [ "len", "n", "pt...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are a deterministic C/C++ static security expert. Analyze the code linearly. In [CONST...
{ "ground_truth_label": 0, "domain": "Real-world C/C++", "source_dataset": "real_insufficient_mined_v5", "pair_id": "71105998845fb012937332fe2e806d443c09e026159909", "target": 0, "cwe": "CWE-416", "diff_idents": [ "d", "name", "new_port", "num", "port", "snd_use_lock_use", "spr...
[ { "role": "system", "content": "You are a C/C++ static-analysis engine performing memory-boundary and pointer-lifecycle defect analysis. Architecture: x86_64 Linux LP64 (pointer/long=8B, int=4B, short=2B, char=1B).\n\nYou are an expert Exploit Writer. ASSUME you are attacking this code.\n\nMANDATORY [SCRATC...
{ "ground_truth_label": 1, "cwe_id": "CWE-127", "source_dataset": "synth_vuln_v5", "framework": "", "complexity_level": "Level 3" }
End of preview. Expand in Data Studio

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Qwen2.5-Coder-3B — C/C++ Memory-Safety Detector (SFT v5)

PiSSA-SFT fine-tune of Qwen/Qwen2.5-Coder-3B-Instruct that performs a 7-step structured analysis of a C/C++ fragment and concludes VULNERABLE, NOT_VULNERABLE, or INSUFFICIENT_CONTEXT with a CWE id.

Its defining property is calibrated abstention: it commits a verdict only when the deciding size/bound is establishable from the visible fragment, otherwise it abstains instead of guessing. This fixes the verdict-collapse of earlier versions (everything labelled NOT_VULNERABLE on real code).

Code + data + docs live here (GitHub). Model weights (~5.8 GB) → HuggingFace model repo (push_model_hf.py). Training dataset → HuggingFace dataset repo (push_hf.py).

Results

Real-world (PrimeVul/DiverseVul buffer-family), shipped .up5 contract. Raw per-split tables in metrics/RESULTS.txt.

split DECIDED acc / P / R / F1 CONSERVATIVE recall abstain%
realworld_test (323) 0.508 / 0.63 / 0.33 / 0.436 0.86 80
realworld_benchmark (375) 0.598 / 0.68 / 0.46 / 0.545 0.87 76
validation (499) 0.796 / 0.82 / 0.82 / 0.821 0.84 22
Juliet held-out (556) 0.696 / 0.78 / 0.62 / 0.692 0.88 72

vs prior v4: DECIDED recall 0.05, CONSERVATIVE recall 0.49/0.53. Two scoring modes (data_cleaning/score3way.py): DECIDED = acc/P/R/F1 over rows it commits a verdict on (reliability when it acts); CONSERVATIVE = abstain-on-a-true -vuln counts as a risk-flag (the security triage metric).

Intended use

  • Security triage of C/C++ functions for memory-safety defects (buffer overflow, OOB read/write, UAF, double-free; CWE-119/120/125/787/416/415/...).
  • Best run in CONSERVATIVE mode: treat both VULNERABLE and INSUFFICIENT_CONTEXT as "needs human review" — flags ~86% of true vulnerabilities with ~5% hard false-positives on safe real-world code.
  • A prioritiser, not a replacement for a sound static analyzer or human review.

Inference contract (REQUIRED)

[SINK] [DESTINATION] [SOURCE] [CONSTRAINTS] [SCRATCHPAD] [MATH] [DECISION] [CONCLUSION]

Run inference under the .up5 contract (scripts/convert_to_up5.py, data_cleaning/*.up5.jsonl). The system prompt must (1) permit the 3-way verdict and (2) declare the [DECISION] rule — a one-line [DECISION]: mapping [MATH]→verdict, emitted before [CONCLUSION]. Surfacing [DECISION] lifts real-world precision (0.52→0.63) at no recall cost. Parse the verdict from [CONCLUSION]. The plain .up contract (no DECISION_RULE) also works but with lower decided-precision.

Dataset (SFT v5 — latest)

data/train/sft_train_v5.jsonl — 4177 rows, 3-way. Validation data/validation/sft_v5_val.jsonl (220).

Label Rows
VULNERABLE (1) 1282
NOT_VULNERABLE (0) 1290
INSUFFICIENT_CONTEXT 1605

Composition gates (enforced by scripts/assemble_v5.py): abstention fraction 0.384 (≥0.30), decide VULN:SAFE 0.99:1 (≤1.15), [DECISION] in 100% of rows.

Source bucket Rows Role
contrastive_mined_v5 172 blind-teacher decided real (82V/90N), marker-free, grounded
tier1_vuln/safe_v5 600 / 600 marker-free real decided — decorrelates "marker⇒decide"
synth_vuln/safe_v5 600 / 600 synthetic anchor (marker-bearing)
real_insufficient_mined_v5 705 grounded INSUFFICIENT from real near-twin pairs
real_insufficient_det_v5 900 deterministic, faithful-by-construction INSUFFICIENT

Provenance & gates. Decided-real and grounded-INSUFFICIENT rows come from a blind 32B teacher (Qwen/Qwen2.5-Coder-32B-Instruct, data_cleaning/regen_pipeline.py) run with no label in the prompt, kept only if they pass four gates: (1) format, (2) faithfulness (every cited number/sink exists in the code), (3) verdict == ground truth (rejection sampling), (4) identifier-overlap grounding (a decided row must cite a changed diff identifier — decided for the right reason). Contrastive source: PrimeVul paired before/after buffer-family functions (511 pairs). A pre-mine de-risk probe confirmed symmetric pre-fix-VULN / post-fix-SAFE decidability (1.13×, PASS — metrics/derisk_probe_result.json) so the bucket does not skew VULNERABLE. Deterministic INSUFFICIENT rows (scripts/build_abstention_deterministic.py) are faithful-by-construction (abstention is about the ABSENCE of an in-fragment bound, verifiable from code).

Held-out eval. data_cleaning/{rw_test,rw_bench,val}.bof.jsonl (PrimeVul/DiverseVul, never in train) → upgraded to .up / .up5 and scored 3-way.

Data sources. NIST Juliet C/C++ 1.3 (https://samate.nist.gov/SARD/test-suites/112, SHA-256 ada9d7e1c323d283446df3f55bdee0d00bda1fed786785fe98764d58688f38eb, CC0-1.0); PrimeVul (paired before/after); DiverseVul.

Lineage: the earlier binary corpus (sft_train_v2 + dpo_*, marker-based, no abstention) has been removed from data/ — it remains in earlier git history and the previous HuggingFace dataset release. v5 dropped the marker (a shortcut the model learned instead of detection) and added INSUFFICIENT_CONTEXT.

Reproduce

python scripts/build_contrastive_pool.py     # 1. PrimeVul before/after pairs (511)
python scripts/derisk_probe.py               # 2. symmetry gate, GPU (optional; got 1.13 PASS)
python data_cleaning/regen_pipeline.py \      # 3. blind 32B teacher mine (verdict==gt + faithful)
  --model Qwen/Qwen2.5-Coder-32B-Instruct --tp 2 --kbest 4 \
  --in data_cleaning/contrastive_mine_input.jsonl --out data_cleaning/contrastive_mined.jsonl
python scripts/build_v5_contrastive.py       # 4. grounding gate + pair-completeness + [DECISION]
python scripts/assemble_v5.py                # 5. assemble + GATES (abstain>=30%, VULN:SAFE<=1.15)
CUDA_VISIBLE_DEVICES=0 RUN_SFT=1 RUN_DPO=0 SFT_FILENAME=sft_train_v5.jsonl \
  OUTPUT_DIR=./qwen_output_3b_v5 MAX_SEQ_LEN=3072 python train_qwen_pissa.py   # 6. PiSSA SFT
python scripts/make_up5.py                   # 7a. build the shipped .up5 eval splits
bash scripts/run_v5_dec_eval.sh              # 7b. eval (.up5) + 3-way score + calibration

Pending from server

SSH dropped during prep — pull these final artifacts with sh pull_from_server.sh <password>, then upload the model with python push_model_hf.py:

  • data/train/sft_train_v5.jsonl + sft_v5_val.jsonl
  • data_cleaning/{contrastive_pool,contrastive_mined,v5_contrastive,v5_insufficient_mined,abstain_full}.jsonl, oldfamily_sysprompts.json, {rw_test,rw_bench,val}.{up,up5}.jsonl
  • qwen_output_3b_v5/merged/ (~5.8 GB weights → HuggingFace, not GitHub)

Limitations

  • Fragment-level information limit: abstains ~72–80% on real fragments where the deciding bound is in a caller/callee/global — honest, not a bug. Higher coverage needs inter-procedural context or RAG.
  • DECIDED recall on real is modest (0.33–0.46) by design; use CONSERVATIVE mode for triage.
  • The confidence= token is uninformative — do not threshold on it.
  • Possible synthetic-benchmark overlap (Juliet) — treat Juliet numbers as optimistic.

Install / train

pip install -r requirements.txt

Tuned for a single 48 GB GPU: BF16, PiSSA rank 16, seq 3072. Env vars in train_qwen_pissa.py override defaults.

Downloads last month
11