Text Classification
Transformers
Safetensors
English
lfm2_vl
feature-extraction
decision-model
typed-decisions
system-one
shell
guardrail
command-risk
lfm2
liquid
lora
custom_code
Eval Results (legacy)
Instructions to use yannelli/d1-3b-cli-command-risk with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yannelli/d1-3b-cli-command-risk with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="yannelli/d1-3b-cli-command-risk", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("yannelli/d1-3b-cli-command-risk", trust_remote_code=True) model = AutoModel.from_pretrained("yannelli/d1-3b-cli-command-risk", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model card: cut hedges and repeated caveats
Browse files
README.md
CHANGED
|
@@ -171,7 +171,7 @@ Results cover all 12,689 rows of the `test` split: 97 template families and 2,55
|
|
| 171 |
|
| 172 |
Macro F1 averages F1 at a 0.5 cutoff over the 13 category questions. Level macro F1 averages F1 over the 5 risk levels, using the most likely level. Accuracy counts every decision. Safe judged safe is the share of the 4,296 safe test commands with P(`risky`) below 0.5.
|
| 173 |
|
| 174 |
-
95% intervals, from 500 bootstrap resamples of test families: category macro F1 0.707 to 0.984, level macro F1 0.464 to 0.789, accuracy 0.948 to 0.981, log loss 0.072 to 0.200.
|
| 175 |
|
| 176 |
### Guardrail cutoff
|
| 177 |
|
|
@@ -181,10 +181,10 @@ For a guardrail, use P(not `safe`) = 1 - P(`risk_level` = 0). The cutoff that fl
|
|
| 181 |
|
| 182 |
F1 by level: `safe` 0.989, `low` 0.257, `moderate` 0.860, `high` 0.508, `critical` 0.733. Most level errors are one level off. Eight template families hold 2,909 of the 3,097 wrong levels; the largest are:
|
| 183 |
|
| 184 |
-
- `find . -name * .php -delete` (995 rows): labeled `critical`, predicted `high`.
|
| 185 |
- `chmod -R` on system paths (537 rows): labeled `critical`, predicted `high`.
|
| 186 |
- `iptables -A INPUT -s <range> -j DROP` (450 rows): labeled `low`, predicted `high`.
|
| 187 |
-
- `dd if=/dev/zero of=/dev/sda bs=512 count=1` (257 rows): labeled `critical`, predicted `low`.
|
| 188 |
|
| 189 |
### Per question
|
| 190 |
|
|
@@ -208,11 +208,9 @@ F1 by level: `safe` 0.989, `low` 0.257, `moderate` 0.860, `high` 0.508, `critica
|
|
| 208 |
| `reversible` | noul | 5,576 | 0.884 | 0.859 | 0.380 | 0.098 |
|
| 209 |
| `requires_root` | noul | 4,495 | 0.933 | 0.911 | 0.265 | 0.053 |
|
| 210 |
|
| 211 |
-
Several categories have few test positives (`privilege_escalation` 20, `history_log_tampering` 14, `signal_kill` 33), each from three or four families, so their F1 says little.
|
| 212 |
-
|
| 213 |
### Calibration
|
| 214 |
|
| 215 |
-
Answers are the model's raw softmax (test ECE 0.030). `temperatures.json` holds one temperature per question, fitted on the 472 validation commands by log loss. Replacing each answer's distribution p with softmax(log p / T) moves test log loss from 0.136 to 0.099 and ECE from 0.030 to 0.027. It never changes the top answer or the order of P(yes) values, so F1 and accuracy stay the same.
|
| 216 |
|
| 217 |
### Speed
|
| 218 |
|
|
@@ -265,11 +263,10 @@ python training/score_cli_decisions.py eval/test-answers.jsonl
|
|
| 265 |
|
| 266 |
## Limitations
|
| 267 |
|
| 268 |
-
- Labels come from language models
|
| 269 |
-
- Labels
|
| 270 |
-
-
|
| 271 |
- The risk level is the hardest question (accuracy 0.756); `low` (F1 0.257) and `high` (F1 0.508) are the weakest levels.
|
| 272 |
-
- Do not treat it as the only safeguard. An uncommon form of a dangerous command can get a low risk level, as the `dd ... count=1` family above shows.
|
| 273 |
|
| 274 |
## License
|
| 275 |
|
|
|
|
| 171 |
|
| 172 |
Macro F1 averages F1 at a 0.5 cutoff over the 13 category questions. Level macro F1 averages F1 over the 5 risk levels, using the most likely level. Accuracy counts every decision. Safe judged safe is the share of the 4,296 safe test commands with P(`risky`) below 0.5.
|
| 173 |
|
| 174 |
+
95% intervals, from 500 bootstrap resamples of test families: category macro F1 0.707 to 0.984, level macro F1 0.464 to 0.789, accuracy 0.948 to 0.981, log loss 0.072 to 0.200. By question type its accuracy is 0.976 on the 16 nouls and 0.756 on `risk_level`.
|
| 175 |
|
| 176 |
### Guardrail cutoff
|
| 177 |
|
|
|
|
| 181 |
|
| 182 |
F1 by level: `safe` 0.989, `low` 0.257, `moderate` 0.860, `high` 0.508, `critical` 0.733. Most level errors are one level off. Eight template families hold 2,909 of the 3,097 wrong levels; the largest are:
|
| 183 |
|
| 184 |
+
- `find . -name * .php -delete` (995 rows): labeled `critical`, predicted `high`.
|
| 185 |
- `chmod -R` on system paths (537 rows): labeled `critical`, predicted `high`.
|
| 186 |
- `iptables -A INPUT -s <range> -j DROP` (450 rows): labeled `low`, predicted `high`.
|
| 187 |
+
- `dd if=/dev/zero of=/dev/sda bs=512 count=1` (257 rows): labeled `critical`, predicted `low`.
|
| 188 |
|
| 189 |
### Per question
|
| 190 |
|
|
|
|
| 208 |
| `reversible` | noul | 5,576 | 0.884 | 0.859 | 0.380 | 0.098 |
|
| 209 |
| `requires_root` | noul | 4,495 | 0.933 | 0.911 | 0.265 | 0.053 |
|
| 210 |
|
|
|
|
|
|
|
| 211 |
### Calibration
|
| 212 |
|
| 213 |
+
Answers are the model's raw softmax (test ECE 0.030). `temperatures.json` holds one temperature per question, fitted on the 472 validation commands by log loss. Replacing each answer's distribution p with softmax(log p / T) moves test log loss from 0.136 to 0.099 and ECE from 0.030 to 0.027. It never changes the top answer or the order of P(yes) values, so F1 and accuracy stay the same.
|
| 214 |
|
| 215 |
### Speed
|
| 216 |
|
|
|
|
| 263 |
|
| 264 |
## Limitations
|
| 265 |
|
| 266 |
+
- Labels come from language models following a written taxonomy, with model audits and a relabel pass, not from human annotators. Scores measure agreement with those labels.
|
| 267 |
+
- Labels rate the command alone, not the machine it runs on.
|
| 268 |
+
- Training commands use placeholders such as `example.com` and `<TOKEN>` in place of real hosts and secrets.
|
| 269 |
- The risk level is the hardest question (accuracy 0.756); `low` (F1 0.257) and `high` (F1 0.508) are the weakest levels.
|
|
|
|
| 270 |
|
| 271 |
## License
|
| 272 |
|