Run this model with HF Jobs

Run SamJoshua/stacy 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/stacy. 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/stacy 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/stacy. 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/stacy. 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.
stacy / REPORT.md
SamJoshua's picture
release qwen2.5-coder-1.5b-coding-agent
2832cad verified
|
Raw History Blame Contribute Delete
29.9 kB
# Technical report: Qwen2.5-Coder-1.5B β†’ coding + defensive-security post-training
Generated 2026-10-29 17:32:17 IST by `scripts/enterprise/build_report.py` from the run logs under `/models/runs` and `eval/*.json`. Every number below is read from those files; the compute-cost figure is the only estimate and is labelled as such.
## 1. Summary of completed and incomplete work
| Stage | Status | Steps | Elapsed (h) | Peak VRAM (GB) | Notes |
|---|---|---|---|---|---|
| cpt | complete | 496 | 3.72 | 70.2 | 260,046,848 tokens seen (spec target 2.8B) |
| sft | complete | 789 | 0.42 | 16.9 | TRL SFTTrainer, completion-only loss, <think> traces kept |
| sft_nothink | complete | 789 | 0.48 | 16.9 | same SFT without reasoning traces (controlled format ablation) |
| grpo | complete | 200 | 1.37 | 47.5 | TRL GRPOTrainer on sft, cap 1024 |
| grpo_nothink | complete | 100 | 0.78 | 48.6 | GRPO on sft_nothink, cap 2048, lenient half-credit shaping |
| grpo_instruct | complete | 300 | 1.26 | 49.7 | GRPO with the same rewards on Qwen2.5-Coder-1.5B-Instruct (improvement round) |
Missing or incomplete items: none.
## 2. Environment (verified)
- GPU: NVIDIA RTX PRO 6000 Blackwell Workstation Edition, 102.0 GB; torch 2.13.0+cu130 (CUDA 13.0); CPUs 128; RAM 263 GB.
- Packages: {"torch": "2.13.0+cu130", "transformers": "5.19.0", "datasets": "5.0.0", "huggingface_hub": "1.33.0", "trl": "1.16.0", "peft": "0.21.2", "accelerate": "1.15.0", "vllm": "0.32.0", "trackio": "0.44.0", "wandb": "0.28.0", "evalplus": "0.3.1", "numpy": "2.4.6", "pyarrow": "24.0.0", "zstandard": "0.25.0", "safetensors": "0.8.0"}
- Sandbox: bwrap isolation tests passed = 8; docker daemon accessible to this user: False.
- Hugging Face auth: user `SamJoshua`, orgs ['build-small-hackathon'].
- Full report: `/models/runs/env_report.json` (also copied into the release as `env_report.json`).
## 3. Data provenance
| Dataset | Revision | License | Role |
|---|---|---|---|
| trendmicro-ailab/Primus-Seed | 76d5a5a2558b | odc-by | cpt |
| trendmicro-ailab/Primus-FineWeb | 41058dbfa82f | odc-by | cpt |
| HuggingFaceFW/fineweb-edu | 87f09149ef47 | odc-by | cpt-replay |
| trendmicro-ailab/Primus-Instruct | 9c8b1dcaa93b | odc-by | sft |
| trendmicro-ailab/Primus-Reasoning | 9706c39afcb1 | odc-by | sft+rl+eval |
| ise-uiuc/Magicoder-OSS-Instruct-75K | 5f839b1f368a | mit | sft |
| CyberNative/Code_Vulnerability_Security_DPO | 9e32f2a965c8 | apache-2.0 | sft+rl+eval |
| PrimeIntellect/verifiable-coding-problems | 45220c92768b | unspecified on Hub (card lists sources: apps/code_contests/taco/codeforces) | rl |
| likaixin/TACO-verified | 9e68575e0193 | mit | assessed, not used |
| evalplus/humanevalplus | d32357cf319e | apache-2.0 | eval |
| evalplus/mbppplus | b2d74c91837c | apache-2.0 | eval |
Prepared splits (`eval/data_card.json`):
- `sft_train.jsonl`: n=25284 {"magicoder_oss": 19596, "primus_instruct": 802, "primus_reasoning": 3505, "cybernative_secure": 1381}
- `sft_val.jsonl`: n=515 {"primus_reasoning": 62, "primus_instruct": 19, "magicoder_oss": 404, "cybernative_secure": 30}
- `sft_train_nothink.jsonl`: n=25284 {"magicoder_oss": 19596, "primus_instruct": 802, "primus_reasoning": 3505, "cybernative_secure": 1381}
- `rl_coding.jsonl`: n=3383 {"stdin_stdout": 3169, "function_call": 214}
- `rl_cti.jsonl`: n=2160 {"cwe": 1195, "mcq": 694, "cvss": 271}
- `rl_secure_review.jsonl`: n=2000 {"c#": 196, "python": 193, "ruby": 187, "kotlin": 172, "swift": 167, "javascript": 190, "c++": 185, "fortran": 179, "go": 166, "java": 180, "php": 185}
- `eval_cti.jsonl`: n=400 {"mcq": 140, "cwe": 200, "cvss": 60}
- `eval_secure_review.jsonl`: n=300 {"ruby": 25, "swift": 32, "go": 24, "c#": 22, "java": 30, "kotlin": 36, "fortran": 26, "python": 24, "php": 35, "javascript": 23, "c++": 23}
- `security_patch_train.jsonl`: n=12 {"CWE-89": 1, "CWE-22": 1, "CWE-78": 1, "CWE-95": 1, "CWE-916": 1, "CWE-502": 1, "CWE-330": 1, "CWE-601": 1, "CWE-79": 1, "CWE-915": 1, "CWE-732": 1, "CWE-209": 1}
- `security_patch_eval.jsonl`: n=4 {"CWE-22": 1, "CWE-918": 1, "CWE-287": 1, "CWE-470": 1}
Preprocessing / separation:
- Primus-Reasoning: reserved_special_token_0/1 -> <think>/</think>; prompts with teacher disagreement or non-parsable gold excluded from RL/eval
- Primus-Reasoning eval: 50% CWE mapping / 35% MCQ / 15% CVSS prompts held out BEFORE building any train file; blocked by prompt hash
- CyberNative: pairwise A/B secure-review built with seeded random order; first 300 pairs held out for eval, next 2000 for RL, following rows as SFT (chosen as target)
- Magicoder-OSS-Instruct: uniform seeded subsample; problem -> user, solution -> assistant
- Primus-Instruct: messages used as-is (multi-turn prompt kept, last assistant turn is the target)
- verifiable-coding-problems: python only, >=2 tests, prompt <= 3000 chars, exact prompt dedup, gold solution must pass all sampled tests in the sandbox
- TACO-verified: schema inspected (input_output JSON with inputs/outputs, solutions list); not used for training because PrimeIntellect's taco source already covers it and mixing would double-count problems
- Hand-authored security patch tasks: each suite validated (vulnerable fails security tests, reference fix passes both); 4 tasks held out for eval
- Dedup / validation stats: {"sft_duplicate_prompts_dropped": 291, "sft_rows_dropped_for_eval_overlap": 0, "coding_filter_stats": {"rows_scanned": 31517, "non_python": 22937, "too_few_tests": 1738, "prompt_too_long": 664, "duplicate_prompt": 178}, "coding_gold_validation": {"gold_passes": 3383, "gold_fails": 2034, "gold_partial": 583, "mean_validation_s": 0.2559278885126114}}
## 4. Methodology and implementation decisions
### 4.1 Continued pretraining (`scripts/enterprise/cpt.py`)
- Sources and weights: [{"name": "primus_fineweb", "glob": "/models/primus/Primus-FineWeb/data/*.jsonl.gz", "text_field": "content", "weight": 0.9}, {"name": "primus_seed", "glob": "/models/primus/Primus-Seed/data/**/*.jsonl.gz", "text_field": "content", "weight": 0.1}]; replay: {"name": "fineweb_edu", "glob": "/home/vortex/train-llm-from-scratch/data/fineweb-edu/data/CC-MAIN-2015-18/*.parquet", "text_field": "text", "fraction": 0.1, "max_files": 20}.
- Token budget 260,000,000 (seq 2048, micro-batch 4 x accum 64 = 524,288 tokens/step), lr 5e-05 cosine to 0.1x, warmup 40 steps, fp32 master weights + bf16 autocast, gradient checkpointing=False.
- No CPT benchmark file found.
- Measured: 19478 tok/s average, peak VRAM 70.2 GB, 260,046,848 tokens in 3.72 h.
- Resumability: fp32 weights + optimizer + data cursors + RNG saved every `save_every_steps`; bf16 HF export next to each checkpoint.
- Bottleneck notes: tokenization runs in a background thread and the prefetch queue stayed full, so the GPU (fp32 master weights, 151k-vocab logits) was the limit; torch.compile gave no gain in the benchmark.
### 4.2 Supervised fine-tuning (`scripts/enterprise/sft.py`)
- Mixture: {"magicoder_oss": 19596, "primus_instruct": 802, "primus_reasoning": 3505, "cybernative_secure": 1381}; sequence stats: {"n_sampled": 2000, "mean": 613.296, "p50": 522, "p90": 902, "p99": 1969, "max": 31745, "truncated_frac_at_max_len": 0.0035}.
- lr 1e-05, 1 epoch, micro-batch 4 x accum 8, max_length 4096, completion-only loss, Qwen2.5 chat template validated before training.
- Reasoning format: Primus-Reasoning traces were normalised to plain-text `<think>…</think>`; an ablation file without traces (`sft_train_nothink.jsonl`) is produced for a controlled comparison (see evaluation table for `sft_nothink` if that run completed).
### 4.3 GRPO with verifiable rewards (`scripts/enterprise/train_grpo.py`, `scripts/enterprise/rewards/`)
- Mixture: {"coding": 2400, "cti": 900, "secure_review": 500, "patch": 120}; 8 generations/prompt, completion cap 1024 tokens, lr 1e-06, beta 0.0, loss dapo, vLLM colocate at 0.3 of VRAM, LoRA=False.
- Generation backend decision from benchmarks: {}
- Rewards: coding = fraction of sandboxed unit tests passed (+0.1 single-code-block bonus); CTI = exact last-line CWE/MCQ/CVSS (+0.1 format); secure review = exact A/B letter; patch = regression-pass-fraction x security-pass-fraction (+0.15 CWE named, +0.10 root-cause keywords, +0.05 format). Format bonuses are bounded so they can never outscore correctness.
- Reward components observed: {"cti": {"reward": 0.04616935483870968, "correctness": 0.0396505376344086, "format": 0.006518817204301076}, "coding": {"reward": 0.1888998269292691, "correctness": 0.11532028147472363, "format": 0.07357954545454547}, "secure_review": {"reward": 0.014908256880733948, "correctness": 0.01261467889908257, "format": 0.0022935779816513763}, "patch": {"reward": 0.34454365079365085, "correctness": 0.21626984126984128, "format": 0.03392857142857143, "regression": 0.4330357142857143, "security": 0.2857142857142857, "cwe": 0.027678571428571424, "explain": 0.06666666666666668}}; zero-reward fraction per task: {"cti": 0.9348118279569892, "coding": 0.22959710743801653, "secure_review": 0.9770642201834863, "patch": 0.06547619047619048}; scorer errors: {"no code": 47}.
- Isolation: every generated program runs under bwrap (`--unshare-all`, read-only /usr,/bin,/lib, private tmpfs, cleared env, seccomp denying socket/connect/ptrace, RLIMIT_CPU/AS/NPROC/FSIZE, wall-clock timeout). `tests/enterprise/test_sandbox.py` and `test_rewards.py` verify these on this host (network blocked, host paths hidden, read-only root, memory and fork bombs contained).
## 5. Evaluation
Fixed configuration: greedy decoding, EvalPlus HumanEval+ (164) and MBPP+ (378) scored by `evalplus.evaluate` inside the bwrap sandbox, two prompting modes (raw completion, fair for base/CPT; chat, fair for SFT/GRPO). Security sets are held out by prompt hash from every training file: CTI (CWE mapping / MCQ / CVSS), CyberNative A/B secure review, and 4 hand-authored patch tasks (regression + security tests). Raw generations: `eval/raw/<checkpoint>/`.
| Checkpoint | HE+ compl. | HE+ chat | MBPP+ compl. | MBPP+ chat | CTI strict | CTI lenient | CWE strict | CWE lenient | Review strict | Review lenient | Patch pass |
|---|---|---|---|---|---|---|---|---|---|---|---|
| base | 36.6% | 3.0% | 42.3% | 2.4% | 1.8% | 21.5% | 2.5% | 38.0% | 0.0% | 54.0% | 50.0% |
| cpt | 35.4% | 0.0% | 52.4% | 1.1% | 0.0% | 0.2% | 0.0% | 0.5% | 0.0% | 10.3% | 0.0% |
| sft | 44.5% | 57.3% | 51.1% | 64.0% | 54.2% | 56.0% | 67.0% | 70.0% | 0.0% | 59.0% | 25.0% |
| sft_nothink | 43.3% | 58.5% | 50.8% | 65.1% | 65.8% | 66.5% | 68.0% | 69.5% | 3.3% | 68.3% | 25.0% |
| grpo | 45.1% | 58.5% | 50.0% | 64.3% | 52.5% | 55.0% | 64.0% | 68.5% | 0.0% | 59.7% | 25.0% |
| grpo_nothink | 43.3% | 59.1% | 49.7% | 64.6% | 64.8% | 65.8% | 67.0% | 69.0% | 4.0% | 67.7% | 0.0% |
| grpo_instruct | 54.3% | 67.7% | 54.5% | 62.7% | 47.5% | 47.5% | 52.0% | 52.0% | 0.7% | 66.0% | 18.8% |
| exp_merge_delta | 51.8% | 56.7% | 47.6% | 60.1% | 46.2% | 52.0% | 48.0% | 59.5% | 1.7% | 56.0% | 0.0% |
| cmp_deepseek-coder-1.3b-instruct | 18.3% | 45.7% | 0.0% | 27.5% | 2.0% | 7.5% | 0.0% | 11.0% | 0.0% | 45.3% | 0.0% |
| cmp_foundation-sec-8b-instruct | 51.8% | 55.5% | 54.0% | 52.1% | 30.8% | 66.0% | 15.0% | 84.5% | 1.7% | 64.0% | 0.0% |
| cmp_llama-primus-merged-8b | 48.2% | 58.5% | 28.3% | 61.9% | 43.2% | 61.8% | 43.5% | 80.5% | 41.0% | 69.0% | 0.0% |
| cmp_qwen2.5-1.5b-instruct | 37.2% | 51.8% | 47.4% | 58.7% | 24.2% | 46.5% | 2.5% | 47.0% | 0.7% | 63.0% | 0.0% |
| cmp_qwen2.5-3b-instruct | 48.2% | 65.9% | 38.1% | 61.9% | 23.5% | 37.0% | 1.5% | 28.5% | 26.0% | 73.3% | 0.0% |
| cmp_qwen2.5-coder-1.5b-instruct | 53.0% | 64.6% | 54.5% | 63.0% | 44.8% | 45.2% | 47.0% | 48.0% | 0.7% | 61.0% | 0.0% |
| cmp_qwen2.5-coder-3b-instruct | 68.9% | 79.9% | 14.0% | 64.6% | 22.8% | 47.0% | 3.5% | 52.0% | 9.0% | 75.0% | 25.0% |
| cmp_smollm2-1.7b-instruct | 1.2% | 29.3% | 18.5% | 50.8% | 8.5% | 8.8% | 0.0% | 0.5% | 4.0% | 62.0% | 0.0% |
| grpo_nothink_abliterated | 34.8% | 54.3% | 45.2% | 59.5% | 67.2% | 68.0% | 71.5% | 73.0% | 5.7% | 66.0% | 0.0% |
Interpretation rules applied: a regression is reported as a regression. The strict metrics (exact last-line answer, EvalPlus pass@1) were not changed after seeing results. Two evaluation *settings* were changed after the first pass and then re-applied to every checkpoint: the CTI generation cap was raised from 1536 to 3072 tokens and the secure-review cap from 768 to 1536, because 99% of the SFT model's CWE answers were truncated at 1536; and a `lenient_accuracy` (gold answer stated near the end but not on the last line) is reported *in addition to* strict accuracy, because the review failures were format failures ('the last line should be "B"'). Completion-mode scores for chat-tuned checkpoints and chat-mode scores for the base model are both shown so the comparison is not cherry-picked. The patch eval has 4 tasks x 4 samples (temperature 0.6), so each 6.25% step is one sample: treat it as a sanity check.
## 5b. Open-source leaderboard (same suite, same settings)
Rows marked β˜… are checkpoints produced here; `cmp_*` rows are public models evaluated with the identical harness, caps and greedy decoding. Sorted by HumanEval+ (chat). Model size is listed because the 3B and 8B references are out of our size class.
| Model | Params | HE+ chat | MBPP+ chat | CTI strict | CTI lenient | CWE lenient | Review lenient | Patch pass |
|---|---|---|---|---|---|---|---|---|
| cmp_qwen2.5-coder-3b-instruct | 3B | 79.9% | 64.6% | 22.8% | 47.0% | 52.0% | 75.0% | 25.0% |
| β˜… grpo_instruct | 1.5B | 67.7% | 62.7% | 47.5% | 47.5% | 52.0% | 66.0% | 18.8% |
| cmp_qwen2.5-3b-instruct | 3B | 65.9% | 61.9% | 23.5% | 37.0% | 28.5% | 73.3% | 0.0% |
| cmp_qwen2.5-coder-1.5b-instruct | 1.5B | 64.6% | 63.0% | 44.8% | 45.2% | 48.0% | 61.0% | 0.0% |
| β˜… grpo_nothink | 1.5B | 59.1% | 64.6% | 64.8% | 65.8% | 69.0% | 67.7% | 0.0% |
| β˜… sft_nothink | 1.5B | 58.5% | 65.1% | 65.8% | 66.5% | 69.5% | 68.3% | 25.0% |
| β˜… grpo | 1.5B | 58.5% | 64.3% | 52.5% | 55.0% | 68.5% | 59.7% | 25.0% |
| cmp_llama-primus-merged-8b | 8B | 58.5% | 61.9% | 43.2% | 61.8% | 80.5% | 69.0% | 0.0% |
| β˜… sft | 1.5B | 57.3% | 64.0% | 54.2% | 56.0% | 70.0% | 59.0% | 25.0% |
| β˜… exp_merge_delta | 1.5B | 56.7% | 60.1% | 46.2% | 52.0% | 59.5% | 56.0% | 0.0% |
| cmp_foundation-sec-8b-instruct | 8B | 55.5% | 52.1% | 30.8% | 66.0% | 84.5% | 64.0% | 0.0% |
| β˜… grpo_nothink_abliterated | 1.5B | 54.3% | 59.5% | 67.2% | 68.0% | 73.0% | 66.0% | 0.0% |
| cmp_qwen2.5-1.5b-instruct | 1.5B | 51.8% | 58.7% | 24.2% | 46.5% | 47.0% | 63.0% | 0.0% |
| cmp_deepseek-coder-1.3b-instruct | 1.3B | 45.7% | 27.5% | 2.0% | 7.5% | 11.0% | 45.3% | 0.0% |
| cmp_smollm2-1.7b-instruct | 1.7B | 29.3% | 50.8% | 8.5% | 8.8% | 0.5% | 62.0% | 0.0% |
Battle notes: every public model ran through the same `eval.py` (greedy, identical caps and prompts). `deepseek-coder-1.3b-instruct` first scored 0 everywhere because vLLM's incremental detokenizer returned raw byte-level symbols for its tokenizer; it was re-run with `--detok hf` (Transformers decoding of the same token ids). `SmolLM2-1.7B-Instruct` was re-run after a vLLM memory-profiling race with a concurrent job. `exp_merge_delta` is a training-free experiment: Qwen2.5-Coder-1.5B-Instruct plus our CPT weight delta (relative norm 1.9%); it raised CTI by 1.5 points but cost 8 points of HumanEval+, so it was not used. `grpo_instruct` is GRPO with our verifiable rewards applied directly to Qwen2.5-Coder-1.5B-Instruct (the strongest open 1.5B model on this suite), because our Primus-SFT lineage lost the concise CWE answer format that model already has. The 3B and 8B rows are references outside our size class.
## 5c. Held-out contamination audit, clean-subset scores and the answering-strategy study
**Finding (found while building the assistant, after the numbers in Β§5 and Β§5b were produced).** The held-out sets were separated from training by exact prompt hash. CTI-Bench style data uses one CVE description under several prompt types (CWE mapping, CVSS scoring) and the CyberNative pairs recur, so many held-out questions have their content verbatim in an SFT or RL file under a different prompt. `scripts/enterprise/strategy_study/contamination.py` searches 80-character windows of every held-out question in the prompts and completions of every training file (`eval/contamination.json`; the CPT corpora were not audited). A question counts as overlapping when a majority of the windows of one content block recur.
| held-out set | questions | overlapping with training | clean |
|---|---|---|---|
| cti_cvss | 60 | 41 (68.3%) | 19 |
| cti_cwe | 200 | 54 (27.0%) | 146 |
| cti_mcq | 140 | 0 (0.0%) | 140 |
| review | 300 | 130 (43.3%) | 170 |
Every saved generation of every checkpoint (ours and public) was re-scored on the clean subset with the same scorer (`strategy_study/rescore_clean.py`, `eval/clean_subset_scores.json`). Checkpoints trained on the Primus-Reasoning rows lose accuracy on the clean CWE questions (about 80% on the overlapping CWE items vs about 62% on clean ones for `grpo_nothink`), public models are unaffected or gain, and the ranking at the top does not change. The CVSS clean subset has only 19 questions: its number is not informative.
| model | CTI strict, all β†’ clean | CWE strict, all β†’ clean | CVSS strict, all β†’ clean (n=19) | review lenient, all β†’ clean |
|---|---|---|---|---|
| β˜… grpo_nothink_abliterated | 67.2 β†’ 65.6 | 71.5 β†’ 65.8 | 55.0 β†’ 57.9 | 66.0 β†’ 66.5 |
| β˜… sft_nothink | 65.8 β†’ 64.9 | 68.0 β†’ 63.7 | 55.0 β†’ 57.9 | 68.3 β†’ 66.5 |
| β˜… grpo_nothink | 64.8 β†’ 63.6 | 67.0 β†’ 62.3 | 55.0 β†’ 57.9 | 67.7 β†’ 67.1 |
| β˜… grpo_instruct | 47.5 β†’ 53.8 | 52.0 β†’ 53.4 | 0.0 β†’ 0.0 | 66.0 β†’ 65.3 |
| β˜… sft | 54.2 β†’ 52.8 | 67.0 β†’ 61.6 | 31.7 β†’ 36.8 | 59.0 β†’ 54.7 |
| β˜… exp_merge_delta | 46.2 β†’ 51.5 | 48.0 β†’ 47.3 | 1.7 β†’ 0.0 | 56.0 β†’ 52.4 |
| cmp_qwen2.5-coder-1.5b-instruct | 44.8 β†’ 50.8 | 47.0 β†’ 47.9 | 0.0 β†’ 0.0 | 61.0 β†’ 57.6 |
| β˜… grpo | 52.5 β†’ 50.8 | 64.0 β†’ 58.9 | 35.0 β†’ 42.1 | 59.7 β†’ 55.3 |
| cmp_llama-primus-merged-8b | 43.2 β†’ 43.9 | 43.5 β†’ 40.4 | 23.3 β†’ 15.8 | 69.0 β†’ 65.9 |
| cmp_foundation-sec-8b-instruct | 30.8 β†’ 37.7 | 15.0 β†’ 15.1 | 3.3 β†’ 10.5 | 64.0 β†’ 65.3 |
| cmp_qwen2.5-1.5b-instruct | 24.2 β†’ 31.5 | 2.5 β†’ 2.7 | 0.0 β†’ 0.0 | 63.0 β†’ 58.8 |
| cmp_qwen2.5-3b-instruct | 23.5 β†’ 30.2 | 1.5 β†’ 2.1 | 3.3 β†’ 0.0 | 73.3 β†’ 71.8 |
| cmp_qwen2.5-coder-3b-instruct | 22.8 β†’ 27.9 | 3.5 β†’ 4.1 | 11.7 β†’ 10.5 | 75.0 β†’ 74.1 |
| cmp_smollm2-1.7b-instruct | 8.5 β†’ 8.5 | 0.0 β†’ 0.0 | 23.3 β†’ 31.6 | 62.0 β†’ 61.8 |
| cmp_deepseek-coder-1.3b-instruct | 2.0 β†’ 2.6 | 0.0 β†’ 0.0 | 0.0 β†’ 0.0 | 45.3 β†’ 48.8 |
| β˜… base | 1.8 β†’ 2.0 | 2.5 β†’ 2.7 | 0.0 β†’ 0.0 | 54.0 β†’ 54.1 |
| β˜… cpt | 0.0 β†’ 0.0 | 0.0 β†’ 0.0 | 0.0 β†’ 0.0 | 10.3 β†’ 11.2 |
### Answering-strategy study (served path: chat template + system prompt, repetition penalty 1.05, 16 samples per question per checkpoint)
Question: does sampling and voting, or a mixture of our three checkpoints, beat one greedy answer? All strategies are simulated on identical cached samples; headline numbers use the clean subset; `*` marks a paired-bootstrap 95% interval that excludes 0. Full tables: `eval/strategy_study.md`.
| task | clean n | greedy (primary) | SC-8 vote | SC-8 βˆ’ greedy [95% CI] pp | cross-checkpoint vote βˆ’ best single checkpoint [95% CI] pp |
|---|---|---|---|---|---|
| cti_cwe | 146 | 51.4 | 51.6 | +0.2 [-1.0, +1.6] | -1.1 [-3.3, +1.3] |
| cti_mcq | 140 | 61.4 | 59.4 | -2.0 [-4.8, +0.8] | +3.2 [-0.9, +7.5] |
| cti_cvss | 19 (low n) | 42.1 | 35.5 | -6.6 [-16.7, +2.2] | -0.6 [-2.1, +0.6] |
| review | 170 | 75.3 | 67.7 | -7.6 [-12.8, -2.0]* | +0.3 [-2.9, +3.5] |
| HumanEval+ (execution-verified pick of 8, problems whose prompt has runnable examples, n=69) | | 71.0 | 82.6 | +11.6 [+5.1, +19.3]* | n/a |
Decisions the numbers support (and that the application's policy table encodes; each is derived by `strategy_study/simulate.py`, not hand-written):
- cti_cwe: voting does NOT clearly help or hurt (SC-8 βˆ’ D +0.2 [-1.0, +1.6], n=146); smallest n within 1 pp of SC-16: 5
- cti_cwe: cross-model voting vs best single model (nothink_a) at n=9: -1.1 [-3.3, +1.3] -> using several checkpoints is NOT shown to be better; token cost 988 vs 1484
- cti_mcq: voting does NOT clearly help or hurt (SC-8 βˆ’ D -2.0 [-4.8, +0.8], n=140); smallest n within 1 pp of SC-16: 5
- cti_mcq: cross-model voting vs best single model (nothink_b) at n=9: +3.2 [-0.9, +7.5] -> using several checkpoints is NOT shown to be better; token cost 894 vs 1429
- cti_cvss: only 19 clean questions (SC-8 βˆ’ D -6.6 [-16.7, +2.2]), too few to decide whether voting helps; on all 60 items SC-8 βˆ’ D is -2.8 [-9.3, +4.3]. The policy takes the cheaper default (one direct answer) until more clean data exists
- cti_cvss: cross-model voting vs nothink_a alone at n=9: -0.6 [-2.1, +0.6] (n=19) -> not enough data
- review: voting HURTS (SC-8 βˆ’ D -7.6 [-12.8, -2.0]*, n=170); smallest n within 1 pp of SC-16: 3
- review: cross-model voting vs best single model (nothink_b) at n=9: +0.3 [-2.9, +3.5] -> using several checkpoints is NOT shown to be better; token cost 2021 vs 2259
- code: execution-verified selection (n=8) vs greedy on problems whose prompt has runnable examples: +11.6 [+5.1, +19.3]* (n=69)
- escalating a doubtful direct answer to a vote: does NOT help on test (< 1 pp for every format): escalation stays OFF, the margin is shown as a calibrated confidence note instead
- cwe_map: specialist nothink_a (confirmed): +15.8 pp [+8.2, +23.3] on 146 clean questions
- cvss: specialist nothink_b (indicated): +15.8 pp [+0.0, +31.6] on 19 clean questions
What this means: for short checkable answers one greedy answer is the right default for these models; majority voting only costs tokens and, for A/B code review, loses accuracy because sampled answers are worse than the greedy one. Running the question's own tests is the one verifier that was measured to help. A mixture of the three checkpoints never beat the best single checkpoint. What does help is choosing the checkpoint per task type: the no-think checkpoints answer CWE and CVSS questions better than the main model. The logprob margin of the greedy answer is a usable confidence signal (AUROC 0.70-0.73), so the interface quotes the measured accuracy of its bucket instead of escalating.
### Application path check (real servers, auto mode vs forced main model, same questions)
A `Session` in auto mode (router, specialist, constrained answer) against the same session forced to the main model, on the held-out CTI questions. The first multiple-choice run scored 0% for the forced arm and sent 33 questions to the CWE specialist: the router did not recognise the benchmark's run-on options (`A) .. B) .. C) ..` on one line) and a stem naming a CWE hit the CWE rule. That was fixed (and regression-tested) and the multiple-choice row re-run; the other rows were unaffected.
| task | subset | n | auto mode % | main model % | difference pp [95% CI] | answered by |
|---|---|---|---|---|---|---|
| cti_cwe | clean | 146 | 66.4 | 51.4 | +15.1 [+7.5, +22.6] | {'nothink_b': 1, 'nothink_a': 145} |
| cti_cwe | all | 200 | 71.0 | 50.0 | +21.0 [+14.0, +28.0] | {'nothink_b': 1, 'nothink_a': 199} |
| cti_cvss | clean | 19 | 57.9 | 26.3 | +31.6 [+10.5, +52.6] | {'nothink_b': 19} |
| cti_cvss | all | 60 | 55.0 | 38.3 | +16.7 [+8.3, +26.7] | {'nothink_b': 60} |
| cti_mcq | clean | 140 | 62.1 | 62.1 | +0.0 [+0.0, +0.0] | {'main model': 140} |
| cti_mcq | all | 140 | 62.1 | 62.1 | +0.0 [+0.0, +0.0] | {'main model': 140} |
### Blind validation (sets written by an independent author who had not seen the router, prompts or policy; evaluated once)
- router, 108 blind queries: rules+model task accuracy 82.4% (model alone 74.1%), answer-format accuracy 88.0%, route JSON valid 100.0%, rules fired on 64 (precision 81.2%), injection flip rate 0.0%, route call p50 0.05s
- router weakest types: chat 9/12, code_fix 11/12, code_review 9/12, cvss 11/12, explain 10/12, mcq 11/12, patch 4/12
- agent harness, 30 blind tasks: success 6.7% (2/30), valid tool-call rate 99.4%, by category {'lookup': '0/5', 'fix': '0/6', 'edit': '0/5', 'create': '1/5', 'run': '1/4', 'multi': '0/5'}, stopped early 9
- These numbers were measured once, with the router and policy as they stood at that run (after the inline-options and CWE-instruction fixes found by the live CTI check, before anything below). The blind sets were not re-scored.
- Router: the rules fired on 64 of 108 queries with 81% precision (model-only route: 74.1% task accuracy, route JSON always valid). The weak type is `patch` (4 of 12 right: paraphrases such as 'make it safe' or 'rewrite so it is not exploitable' miss the rules). `patch`, `code_fix` and `code_review` share one strategy in the shipped policy, so those confusions do not change what the application does; the confusions that do matter are `explain` to `cwe_map`, `chat` to `agent` and unrecognised MCQ options.
- Changed afterwards because of user-visible harm, covered by unit tests, NOT re-measured on the blind set: (1) a `needs_tools` guess by the router model alone no longer blocks an answer when the message does not look like a file task; (2) the CWE rule now needs an actual mapping request instead of the word CWE; (3) lowercase run-on options count as multiple choice. The author's own 54-query dev set is unchanged by these (94.4%), which is also the number that overstated the blind result by 12 points.
- Agent harness: 2 of 30 independent tasks completed (6.7%), against 70% on the author's own 30 tasks. Tool calls were well formed (99.4%); the failures are the model's: it stopped after repeating the same step (9 of 30), ran out of steps, or reported 'successfully updated' for work it had not done. The harness limits (workspace confinement, approvals, loop guards, undo) are enforced in code and are unaffected. The agent therefore stays experimental and is only reachable after a workspace is chosen; a tool-use training round (rejection-sampled traces or GRPO with the sandboxed reward machinery) is the next step, not done here.
## 6. Limitations
- CPT covered 260,046,848 tokens, not the 2.8B initial target (compute-bound at ~19478 tok/s on one GPU).
- CyberGym was not run: it is 236 GB and requires a Docker-based harness; the Docker daemon was not accessible to this user without a re-login. Documented as skipped.
- W&B was not logged in on this host; metrics are JSONL (+ Trackio where it initialised). The dashboard reads the JSONL only. The CPT run's Trackio mirror was disabled at start-up (a reserved `_notes` config key; fixed for later stages), so CPT curves exist only in JSONL.
- CPT was restarted twice before step 100 (a batcher lock/queue deadlock fix, then an OOM caused by the previous process still holding VRAM); no checkpoint had been written, so no training state was reused. Logs of the aborted attempts: `/models/runs/cpt_aborted_*`.
- The patch-task eval has 4 held-out tasks; it is a sanity signal, not a benchmark. The CTI eval labels come from teacher models (R1/o1) that agreed with each other, not human ground truth.
- Reasoning-format finding (controlled ablation, identical data order and hyper-parameters): the SFT *without* `<think>` traces scored higher on CTI strict accuracy and on both coding benchmarks in chat mode than the SFT with traces, so the `<think>` format was not adopted as a default; GRPO was additionally run on the no-think checkpoint (`grpo_nothink`).
- On the CWE-mapping prompts the think-SFT model usually states the right CWE but does not stop: 196/200 generations ran to the 3072-token cap even though 178 closed their think block. Strict CWE accuracy is therefore ~0 while lenient accuracy is ~36%; this is a termination failure of the fine-tuned model on long-answer prompts, reported as such.
- On the A/B secure-review prompts every checkpoint writes 'the last line should be "B"' instead of the bare letter, so strict accuracy is ~0 and lenient accuracy (~55-61%) is the informative number; GRPO with the strict reward had almost no signal on this task.
- `PrimeIntellect/verifiable-coding-problems` carries no license field on the Hub; its constituent sources (APPS, CodeContests, TACO, Codeforces) have their own terms. Treat the RL data as research-use.
- Held-out CTI and secure-review questions overlap with training text (CWE 27%, CVSS 68%, review 43%, MCQ 0% of the questions; Β§5c), so the all-question CTI numbers in Β§5 and Β§5b flatter the checkpoints trained on Primus-Reasoning and CyberNative rows; Β§5c gives the clean-subset scores. The CPT corpora were not searched for overlap. A fresh post-cutoff CVE set was not built, so the clean CVSS subset (19 questions) cannot support conclusions.
- No formal decontamination of HumanEval+/MBPP+ against Magicoder/PrimeIntellect was run beyond using Magicoder's decontaminated release.
- The project-wide `uv.lock` could not be refreshed with the enterprise pins: `evalplus` pulls `google-generativeai`, whose protobuf constraints do not resolve for every platform split of the unconstrained project (`requires-python >= 3.9`). Exact versions are recorded in `requirements-enterprise.txt` and the fully transitive, platform-specific `requirements-enterprise.lock.txt` (uv pip compile) instead.
## 7. Reproducibility
```bash
uv pip install --python .venv/bin/python -r requirements-enterprise.txt
bash scripts/enterprise/run_all.sh preflight data cpt sft grpo eval report package # each stage is resumable
```
Configs: `configs/enterprise/{cpt,sft,grpo}.json`. Logs: `/models/runs/<stage>/metrics.jsonl`. Checkpoints: `/models/ckpts/<stage>/`. Tests: `tests/enterprise/`.
Compute: 8.03 GPU-hours measured across stages; estimated cost $12.04 at an assumed $1.5/GPU-hour (ESTIMATE).