Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -39,6 +39,8 @@ It answers with a single structured JSON verdict: is this vulnerable, which CWE,
|
|
| 39 |
though the training mix is heavily C-weighted (see Limitations).
|
| 40 |
- π§ͺ **Honestly evaluated**: scored on the standard split *and* on vulnerable/patched function pairs,
|
| 41 |
which is the harder and more meaningful test.
|
|
|
|
|
|
|
| 42 |
- π» **Runs locally**: shares the HobbyLM architecture, so it loads in the from-scratch Rust CPU engine
|
| 43 |
(`hobby-rs`) with no Python at runtime.
|
| 44 |
|
|
@@ -90,6 +92,59 @@ improvement is better calibration rather than deeper understanding. **27.40% is
|
|
| 90 |
of true detection ability β not the 96.97% AUC.** Very few vulnerability models publish this number;
|
| 91 |
it is here because it is the one that predicts real-world behaviour.
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
## Intended Use
|
| 94 |
|
| 95 |
CodeAstra-500M is for developers, security researchers and code auditors who want a fast first-pass
|
|
@@ -210,9 +265,15 @@ evaluation uses 894 vulnerable/patched function pairs drawn from the same held-o
|
|
| 210 |
HobbyLM-Chat comparison was run through the **identical** prompts and harness, so the two columns are
|
| 211 |
directly comparable.
|
| 212 |
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
|
| 217 |
## Citation π
|
| 218 |
|
|
|
|
| 39 |
though the training mix is heavily C-weighted (see Limitations).
|
| 40 |
- π§ͺ **Honestly evaluated**: scored on the standard split *and* on vulnerable/patched function pairs,
|
| 41 |
which is the harder and more meaningful test.
|
| 42 |
+
- π₯ **Benchmarked against a frontier model**: matches DeepSeek v4 Flash on genuine flaw
|
| 43 |
+
discrimination while being ~10,000Γ faster per snippet.
|
| 44 |
- π» **Runs locally**: shares the HobbyLM architecture, so it loads in the from-scratch Rust CPU engine
|
| 45 |
(`hobby-rs`) with no Python at runtime.
|
| 46 |
|
|
|
|
| 92 |
of true detection ability β not the 96.97% AUC.** Very few vulnerability models publish this number;
|
| 93 |
it is here because it is the one that predicts real-world behaviour.
|
| 94 |
|
| 95 |
+
## Comparison against a frontier model π₯
|
| 96 |
+
|
| 97 |
+
Benchmarked against **DeepSeek v4 Flash** (via OpenRouter, reasoning enabled) on the *same* held-out
|
| 98 |
+
rows, through the *same* prompts, the *same* output parser and the *same* metrics. DeepSeek answers
|
| 99 |
+
zero-shot; CodeAstra is fine-tuned on this corpus.
|
| 100 |
+
|
| 101 |
+
### On the standard held-out split β 1,000 rows, 93 vulnerable
|
| 102 |
+
|
| 103 |
+
| Metric | DeepSeek v4 Flash | **CodeAstra-500M** |
|
| 104 |
+
|---|---|---|
|
| 105 |
+
| JSON parse rate | 97.10% | **99.98%** |
|
| 106 |
+
| Precision | 16.56% | **75.57%** |
|
| 107 |
+
| Recall | 54.84% | **76.89%** |
|
| 108 |
+
| F1 | 25.44% | **76.23%** |
|
| 109 |
+
| Exact CWE | 10.75% | **~55%** |
|
| 110 |
+
| Latency per snippet | ~47 s | **4.3 ms** |
|
| 111 |
+
|
| 112 |
+
DeepSeek flagged 308 of 1,000 snippets as vulnerable when only 93 were β a 3.3Γ over-prediction, since
|
| 113 |
+
a general model has no way to know this corpus is 89% safe.
|
| 114 |
+
|
| 115 |
+
β οΈ **Do not read this as "CodeAstra is 3Γ better at security."** Most of that gap is *corpus
|
| 116 |
+
familiarity* β the base rate and the annotator's CWE conventions β not better security reasoning. The
|
| 117 |
+
per-CWE breakdown makes it plain: DeepSeek gets CWE-89 (SQL injection) 100% detected and 80% exact,
|
| 118 |
+
but 0% exact on CWE-119, a catch-all bucket whose boundaries you can only learn from the training set.
|
| 119 |
+
|
| 120 |
+
### On the paired set β 894 pairs, the unconfounded test
|
| 121 |
+
|
| 122 |
+
| | DeepSeek v4 Flash | **CodeAstra-500M** |
|
| 123 |
+
|---|---|---|
|
| 124 |
+
| **P-C β flags flawed, clears patched** | 24.05% | **27.40%** |
|
| 125 |
+
| P-V β flags both | 34.68% | 33.45% |
|
| 126 |
+
| P-B β clears both | 32.33% | 36.02% |
|
| 127 |
+
| P-R β reversed | 8.95% | **3.13%** |
|
| 128 |
+
| Recall, vulnerable half | 58.72% | **60.85%** |
|
| 129 |
+
| Specificity on patched code | 56.38% | **63.42%** |
|
| 130 |
+
|
| 131 |
+
Here the 3Γ gap **disappears**. The two are effectively tied, with CodeAstra marginally ahead and 3Γ
|
| 132 |
+
less likely to get a pair exactly backwards β which confirms that the standard-split gap was corpus
|
| 133 |
+
familiarity rather than capability.
|
| 134 |
+
|
| 135 |
+
**Both are weak in absolute terms, and the card should say so.** A model answering the two halves
|
| 136 |
+
*independently* at its own observed flag rate would score 33.1% (DeepSeek) and 38.6% (CodeAstra).
|
| 137 |
+
**Both score below their own independence baseline**, meaning their verdicts are correlated across a
|
| 138 |
+
pair β they respond to what the code looks like, which is identical in both halves, rather than to the
|
| 139 |
+
flaw, which is the only thing that differs.
|
| 140 |
+
|
| 141 |
+
β
**The defensible claim:** CodeAstra-500M **matches a frontier reasoning model on genuine flaw
|
| 142 |
+
discrimination**, at ~10,000Γ lower latency, no per-call cost, and fully local. Not that it is better
|
| 143 |
+
at security.
|
| 144 |
+
|
| 145 |
+
*Caveat: 4.7% of DeepSeek's paired calls truncated mid-reasoning and are scored as "not vulnerable",
|
| 146 |
+
which slightly overstates its specificity and understates its recall. It does not change the ranking.*
|
| 147 |
+
|
| 148 |
## Intended Use
|
| 149 |
|
| 150 |
CodeAstra-500M is for developers, security researchers and code auditors who want a fast first-pass
|
|
|
|
| 265 |
HobbyLM-Chat comparison was run through the **identical** prompts and harness, so the two columns are
|
| 266 |
directly comparable.
|
| 267 |
|
| 268 |
+
The DeepSeek v4 Flash comparison was run through OpenRouter on the same held-out rows, receiving the
|
| 269 |
+
identical system/user content in native chat format so it is not penalised for our decoder-only prompt
|
| 270 |
+
convention, and scored with the same parser and metrics. Reasoning was enabled at low effort: at
|
| 271 |
+
default effort the model spends ~98% of its output budget thinking and 37% of replies never emit an
|
| 272 |
+
answer within 8k tokens, which would have measured our token cap rather than its accuracy.
|
| 273 |
+
|
| 274 |
+
No numbers on this page were copied from another model card β everything here was measured directly.
|
| 275 |
+
**CodeAstra-7B is not comparable** to these figures: it was evaluated on a different corpus under a
|
| 276 |
+
different protocol, so its 83% accuracy and this card's numbers do not sit on the same scale.
|
| 277 |
|
| 278 |
## Citation π
|
| 279 |
|