Hugging Face post-training lead Ben Burtenshaw open-sourced a reinforcement-learning recipe on December 4, 2026 that trains Qwen4-35B-A3B on execution-verified defensive cybersecurity tasks. The release includes the UltraCyber dataset, TRL AsyncGRPO training code in trl-lib/trl-recipes, and qualification stats already run on all 7,417 tasks.
TL;DR
| Question | Answer |
|---|---|
| What model? | Qwen4-35B-A3B (~3.8B active parameters in the MoE stack) |
| What data? | UltraCyber — defensive patches, triage, authorization policy |
| How trained? | AsyncGRPO with deterministic verifiers, 2× H200 on HF Jobs |
| Primary sources | Qwen 4 blog cyber section, dataset card, trl-recipes PR |
| Offensive use? | Dual-use risk — recipe targets defensive pools; authorize tests locally |
Why verifier-first cyber RL matters
Security agents fail in two familiar ways: they hallucinate fixes that do not compile, or they skip exploitation checks that prove a patch worked. UltraCyber pairs each instruction with an offline environment and a deterministic verifier, similar in spirit to CWE-bench v2 public patch tasks, but scaled to 7,417 rows with Harbor packaging.
Burtenshaw's December 4 announcement stresses validated verifiers grading fixes while Qwen4-35B-A3B acts as an agent inside HF Jobs. That is the same infrastructure story as his November agentic evaluation guide with Avijit Ghosh and Irene Solaiman: the harness and grader matter as much as the base model.
Inside UltraCyber
The dataset card breaks tasks into pools:
| Pool | Tasks | Shape |
|---|---|---|
| defensive_repo_patch | 411 | Multi-file CVE and merged PR patches |
| defensive_package_repair | 887 | Ten-file packages and coupled subgraph evolutions |
| defensive_function_repair | 947 | Hardened function-level repairs |
| vuln_reproduction_triage | 356 | Sanitizer crash PoCs and terminal forensics |
| authorization_policy | 4,816 | Cedar, OpenFGA, retention and routing policies |
Splits isolate 6,638 train, 679 validation, and 100 development rows with zero split_group_id overlap. Holdout screens reference CWE-bench 2.0.1, SEC-bench Pro, CyberDefense Bench, and Terminal-Bench variants so trainers cannot silently leak benchmark tasks.
Qwen4 qualification bands
Every row carries empirical qwen4_* columns from 52,797 valid draws with adaptive stopping between K=3 and K=8. Dataset-wide bands:
| Band | Tasks | Share |
|---|---|---|
| mixed | 4,014 | 54.1% |
| all_pass | 2,198 | 29.6% |
| all_fail | 1,205 | 16.2% |
Mixed rows matter for GRPO: advantages need both passes and fails in a rollout group. Training only on all_fail tasks wastes GPU if the policy never succeeds.
Reinforcement learning loop with verifier gates on defensive cyber patch tasks
The AsyncGRPO pipeline
The Qwen 4 blog cyber section walks a triage-style example: sample multiple replies, score label plus citations, update a LoRA adapter with AsyncGRPOTrainer. UltraCyber generalizes that pattern to code patches and policy audits.
Typical HF Jobs invocation pattern from the blog (replace bucket namespace):
hf jobs run --name qwen4-alert-triage \
--flavor h200x2 --timeout 3h \
--secrets HF_TOKEN \
--volume hf://Qwen/qwen4-35b-a3b:/model \
--volume hf://datasets/burtenshaw/alert-triage:/triage \
--volume 'hf://buckets/<your-org>/triage-runs:/outputs' \
ghcr.io/openenv/qwen4-triage:latest \
/opt/qwen4/train-triage /model /triage /outputs
The trl-recipes cyber section pins UltraCyber mixtures, rank-32 LoRA, G=8 group size, and pass-rate-gated length rewards in a documented 24-step canary on the dataset card. Separately, the Qwen 4 blog alert-triage TRL walkthrough reports 4/12, 6/12, and 3/12 on 12 held-out CyberDefense Bench tasks across training checkpoints—evidence that monotonic reward curves lie without held-out evals.
Rewards, offensive dual-use, and defender posture
On X, Burtenshaw answered that patch rewards use eligibility verifiers and may require tests passing and exploit failure, depending on the task—with more dataset detail promised the following week. That is the right transparency for a dual-use capability: the same Qwen weights that patch vulnerable code could guide attacks if you aim them maliciously.
Defender-first practices mirror CISA's agentic offensive framework guidance:
- Run cyber RL agents only on owned repos or contractually scoped environments.
- Log verifier outputs, not just model prose.
- Keep human review on merges even when AsyncGRPO raises pass rates.
For agent runtime hardening, pair training projects with PrismGuard-style signal gates in production—not as a substitute for authorization.
How this compares to frontier cyber models
| Stack | Access | Training story |
|---|---|---|
| OpenAI GPT-6 Cyber via Daybreak Red | Closed program | Vendor-trained |
| Gemini Fairwind cyber Neon | Google program tiers | Vendor-trained |
| Burtenshaw UltraCyber + Qwen4 | Open recipe, dataset, weights | You run AsyncGRPO |
Open recipes win auditability; closed models may still win raw capability on secret held-outs. Benchmark your own services.
Harbor task shape and verifier discipline
UltraCyber ships tasks in Harbor format: an instruction, an offline environment, a verifier, and often a reference solution used only for dataset integrity checks. That is closer to agentic eval best practices than to static multiple-choice cyber trivia.
defensive_repo_patch rows include merged pull-request style fixes across multi-file trees. defensive_package_repair stresses ten-file packages where small dependency drift breaks builds—common in real npm or PyPI incidents explainx.ai readers patch after supply-chain alerts. authorization_policy rows dominate by count (4,816): they train agents to reason about Cedar, OpenFGA, and retention rules without confusing policy text with runtime enforcement.
Burtenshaw noted more dataset documentation would arrive the week after launch. Until then, treat provenance/qwen4_qualified_all_7417.jsonl on the dataset repo as the authoritative qualification export when you cite mixed-band statistics.
Dual-model frontier matrix
The dataset card describes a 185-task stratified slice jointly scored with Qwen3.8-27B:fastest and GLM-5.3:fastest to separate hard tasks from broken verifiers. That secondary matrix is easy to skip when you only read headline pass rates, but it is how maintainers keep GRPO runs from optimizing against a dead grader.
CyberDefense Bench snapshot from the Qwen 4 blog triage recipe
The December 4 Qwen 4 blog (authored with Burtenshaw) reports 12 held-out CyberDefense Bench tasks for its alert-triage AsyncGRPO example: 4/12 base, 6/12 after update-50, 3/12 after update-100 while mean training reward still rose. That is a textbook lesson in reward hacking and overfitting—checkpoints that look better on training telemetry can regress on held-out security evals. UltraCyber’s own 24-step canary on the dataset card uses different holdouts (dev_100, cwe-bench-25, and vuln_reproduction_triage slices).
Builders should copy the protocol:
- Keep a frozen holdout not mixed into GRPO batches.
- Log verifier transcripts, not just scalar reward.
- Promote adapters only when both training and holdout move together.
Offensive framing versus defender training
UltraCyber includes vuln_reproduction_triage tasks with sanitizer crash proof-of-concepts. Those rows help defenders recognize exploit patterns, but the same environments could train offensive agents if you remove policy guardrails. explainx.ai covers PentAGI and Decepticon-style repos under authorized testing only language; treat this recipe identically.
If your organization runs red team and blue team models, split buckets, split credentials, and split audit logs. Never fine-tune defensive adapters on production customer repos without contracts.
Cost and ops on HF Jobs
h200x2 Jobs are not free. Budget GPU hours, egress, and bucket storage for checkpoints. The Qwen blog’s triage example uses a three-hour timeout; UltraCyber mixtures may need longer when G=8 rollouts hit slow verifiers. Start with smoke subsets (development split 100 rows) before you burn a full 6,638-task train mix.
Pair training with Qwen4 open-weight serving docs: you may serve adapters with vLLM or SGLang after export, but confirm license terms on derivative weights before redistribution.
Getting started checklist
- Read UltraCyber dataset card pool indices and qualification bands.
- Open trl-lib/trl-recipes cyber section and pin commit hash in your internal runbook.
- Provision HF Jobs h200x2 with secrets and writable bucket for checkpoints.
- Evaluate on held-out CyberDefense Bench slices before you promote adapters.
- Document authorization scope for every environment your agent touches.
Teams rolling cyber agents org-wide should pair this with Claude for work workshops or AI builder training when developers are new to RL + verifier loops.
AsyncGRPO versus single-turn SFT
Many teams default to supervised fine-tuning on cherry-picked patch examples. Burtenshaw’s recipe argues group-relative RL better aligns models with verifier-defined success when:
- Multiple rollouts disagree (mixed band tasks dominate UltraCyber).
- Tool calls and patch length trade off against pass rate.
- Thinking tokens would explode cost without pass-rate-gated length rewards.
AsyncGRPO specifically overlaps generation and learning across GPUs—critical when vLLM must stay hot for throughput. If you only have one GPU, expect slower iteration; the public recipe targets HF Jobs, not laptops.
Reading qualification JSONL responsibly
Before you tweet solve-rate percentages, open provenance/qwen4_qualified_all_7417.jsonl and filter by:
qwen4_band— ignore all_pass tasks when marketing “hard cyber RL” unless you show mixed-task lifts too.- Pool — authorization-policy tasks inflate corpus size; code-heavy buyers care about defensive_function_repair lifts separately.
- Draw counts — adaptive stopping means unequal effort per row; do not average pass rates without weighting.
Connecting to explainx.ai’s open Qwen4 coverage
This recipe sits on the December 4 Qwen4-35B-A3B-FP8 release and the Hugging Face Qwen4 blog RL section. Read those posts for architecture (hybrid attention, multimodal inputs) before you blame RL when vision-heavy tasks fail verifiers.
If you need closed API baselines, compare against Gemini Neon cyber tiers or GPT-6 Cyber only on identical verifier tasks—vendor benchmarks rarely match UltraCyber pools one-for-one.
Related reading
- Qwen4-35B-A3B-FP8 open weights
- Hugging Face agentic evaluation guide
- Hugging Face training swarms RL series
- CWE-bench v2 defensive tasks
- CISA agentic offensive frameworks
- OpenAI GPT-6 Cyber Daybreak Red
- PrismGuard runtime signals
Burtenshaw recipe details, dataset version tags, and HF Jobs flavors follow Hugging Face sources checked December 5, 2026.
