← Shaurya Bhushan

CastorRed

A compact model that reads C and C++ crash reports and names the likely memory-safety bug. It runs locally.

Result
Crash-family identification rose from 50.0% to 81.8%
Base model
Qwen3.5-4B
Training
11,787 curated records, about 1.99B tokens
Export
2.78 GB GGUF Q4_K_M, about 18 to 19 tokens/s on Apple Silicon
Links

The idea

Sanitizer output is full of clues: stack traces, source locations, and descriptions of invalid memory operations. A useful answer has to connect those clues to a likely crash family, such as an out-of-bounds access or a use-after-free, explain the evidence, and suggest a repair direction, without passing a guess off as a diagnosis.

That is a much narrower job than asking a general model to debug any program, which is why a 4B model is a reasonable size for it.

  1. Sanitizer report
  2. CastorRed
  3. Crash family
  4. Repair direction

How I built it

I started from Qwen3.5-4B and prepared 11,787 training records through a VulnSFT data pipeline, with quality controls and decontamination against the CyberGym benchmark. I fine-tuned with LoRA, then tried GRPO as an extra training step.

I merged the adapter into the base model and converted it to a 2.78 GB GGUF Q4_K_M build, so it runs in Ollama, LM Studio, and llama.cpp. On Apple Silicon it generates about 18 to 19 tokens per second.

The hard part

Measuring it honestly. On 120 paired held-out rows, exact crash-family identification rose from 50.0% to 81.8%. The model card reports a separate 542-example evaluation where the composite reward rose from 0.4693 to 0.5926. They are different tests, so I keep the numbers apart.

An audit of the 120-row gain found it came mainly from the model hedging less, not from broad new security knowledge. A model can name the right category and still propose an unsafe patch, so the next evaluation should score category, evidence, and repair separately.