cnuland commited on
Commit
fd365af
·
verified ·
1 Parent(s): a44721e

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. README.md +95 -0
  2. config.json +38 -0
  3. model.safetensors +3 -0
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +24 -0
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ tags: [text-classification, llm-routing, llm-d, semantic-router, triage]
5
+ base_model: sentence-transformers/all-MiniLM-L6-v2
6
+ ---
7
+
8
+ # llm-d-sc-complexity-v3
9
+
10
+ `triage` classifier for [llm-d semantic
11
+ classification](https://github.com/llm-d-incubation/llm-d-semantic-classifier).
12
+ Labels: `TRIVIAL`, `WORK`.
13
+
14
+ Architecture: **sequence-classification head (requires a runtime that reads logits)**,
15
+ base `sentence-transformers/all-MiniLM-L6-v2`.
16
+
17
+ ## Accuracy
18
+
19
+ Read the real-traffic row first.
20
+
21
+ | eval set | n | accuracy | 95% CI | macro F1 |
22
+ |---|---:|---:|---|---:|
23
+ | **real traffic, refined gold** (high-effort re-adjudication) | 376 | 0.9601 | 0.935 – 0.976 | 0.9391 |
24
+ | real traffic (WildChat, unanimous 3-model jury) | 418 | 0.9593 | 0.936 – 0.974 | 0.9375 |
25
+
26
+ > **Run-to-run variance.** RECOMMENDED COMPLEXITY MODEL for llm-d-sc routing. Supersedes llm-d-sc-complexity-v2 (4-tier, 0.8963) and llm-d-sc-route-gate (2-tier SIMPLE+MEDIUM split, 0.9269) for backend selection.
27
+
28
+ Published seed is the FIRST one run (11), not the best. Both seeds score 0.9601 on refined gold -- not a duplicate: different parameter sums, logits differing by up to 1.48, 10 of 376 predictions disagree and happen to cancel.
29
+
30
+ accuracy 96.01% majority baseline 80.32% lift +15.69 p50 4.37 ms
31
+ TRIVIAL recall 94.59%, precision 86.42% (TRIVIAL is 19.7% of the eval)
32
+
33
+ WHAT IT DECIDES. TRIVIAL (the 4-tier ladder's SIMPLE) versus WORK (MEDIUM, COMPLEX, REASONING): can a small model or a cache serve this, or does it need the main model?
34
+
35
+ WHY THIS FOLD RATHER THAN THE ONE PRAXIS CURRENTLY USES. Enumerating EVERY contiguous fold of the 4-tier ladder and ranking by three-juror agreement:
36
+ SIMPLE | MEDIUM+COMPLEX+REASONING 86.9% agreement <- this model
37
+ SIMPLE+MEDIUM | COMPLEX+REASONING 82.0% agreement <- the deployed split
38
+ Their majority baselines are 80.32% and 80.59%, so the comparison is like-for-like: +3.32 points for choosing the split by measurement instead of by which one the router happens to implement. Tier-exact accuracy on the full 4-tier taxonomy is 0.8963 and is capped near 0.926 by inter-juror agreement; this decision is not.
39
+
40
+ TWO LIMITATIONS THAT MATTER MORE THAN THE HEADLINE.
41
+
42
+ 1. CONTESTED ROWS. On the 176 rows where the three-model jury SPLIT, this model scores 80.11% against an 82.95% majority baseline -- BELOW chance -- with TRIVIAL recall at 43.33%. Contested rows are about 32% of real traffic.
43
+
44
+ 2. ABSTENTION DOES NOT HELP IT. For the other gates in this family, model confidence tracks jury disagreement at 1.7-1.9x enrichment, so routing the least-confident slice to the large model fixes most of the contested-row problem. This model sits at 1.0x: its least-confident 5% contains contested rows at exactly the base rate. It is confidently WRONG on hard rows rather than uncertain about them, so no confidence threshold rescues it -- and at 99% recall it false-fires on 74% of traffic.
45
+
46
+ PRACTICAL GUIDANCE. Deploy at full coverage and accept 80.11% on the split rows, or send TRIVIAL predictions to the cheap path only when the cheap path degrades gracefully -- TRIVIAL precision is 86.42%, so about 5% of WORK prompts land there. A three-way TRIVIAL/STANDARD/HARD variant is being tested to see whether a middle tier fixes the blind-confidence problem, as it did for the egress gate; if it does, this card will point at it.
47
+
48
+ ### The eval has a measured ceiling
49
+
50
+ Gold labels were audited by blind paired adjudication in two strata — the rows
51
+ this model got wrong, and a sample of the rows it got right — with the judge
52
+ shown two candidate labels in random order and no indication of provenance.
53
+ **Roughly 4.9% of the gold labels are themselves wrong**, so a PERFECT
54
+ classifier scored against this eval would reach about **0.95, not 1.0**.
55
+
56
+ Read the real-traffic accuracy against that ceiling, not against 100%. Auditing
57
+ only a model's mistakes would move the number up artificially; sampling the
58
+ correct rows too is what makes the estimate honest, and it revealed that on
59
+ ~3.3% of "correct" rows the model agreed with a bad label — meaning measured
60
+ accuracy is very slightly overstated.
61
+
62
+ ### How the eval was built
63
+
64
+ Real-traffic rows come from [WildChat-1M](https://huggingface.co/datasets/allenai/WildChat-1M)
65
+ (ungated real assistant traffic). Each prompt was labelled independently by three
66
+ models (`claude-opus-5`, `claude-sonnet-5`, `claude-fable-5-1`) from the task
67
+ rubric alone -- **no labeller ever saw a proposed label**, so agreement is
68
+ evidence rather than assent. Only unanimous rows are scored.
69
+
70
+ Those three agree unanimously on roughly 70-74% of real prompts. The remaining
71
+ prompts are published as a `contested` split rather than discarded: they measure
72
+ how much real traffic this taxonomy does not resolve, which no single accuracy
73
+ figure can express.
74
+
75
+ ### Training data
76
+
77
+ 418 rows from `triage-v2+triage-real+triage-active+triage-distill+triage-real-contested`, mixing jury-labelled real traffic
78
+ (register and class prior) with rubric-grounded synthetic data (coverage of tiers
79
+ that are rare in real traffic). Training prior: `None`.
80
+ Held-out eval prompts are excluded by content hash.
81
+
82
+ ## Latency
83
+
84
+ CPU single-request: **p50 4.37 ms, p99 9.78 ms**
85
+ (Apple M-series, single thread). llm-d-sc serves the classifier on CPU, so model
86
+ size trades directly against per-replica throughput.
87
+
88
+ ## Limitations
89
+
90
+ - WildChat is consumer traffic. For `sensitivity` it is ~93% `PUBLIC` and cannot
91
+ measure the tiers that gate egress; the enterprise row above covers those.
92
+ - Labels come from LLM jurors, not human annotators. The rubric was validated by
93
+ reproducing the project's hand-authored gold labels
94
+ (complexity 0.9875, cost 1.000, sensitivity 1.000) before use.
95
+ - Not independently reproduced.
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": null,
11
+ "gradient_checkpointing": false,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 384,
15
+ "id2label": {
16
+ "0": "TRIVIAL",
17
+ "1": "WORK"
18
+ },
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 1536,
21
+ "is_decoder": false,
22
+ "label2id": {
23
+ "TRIVIAL": 0,
24
+ "WORK": 1
25
+ },
26
+ "layer_norm_eps": 1e-12,
27
+ "max_position_embeddings": 512,
28
+ "model_type": "bert",
29
+ "num_attention_heads": 12,
30
+ "num_hidden_layers": 6,
31
+ "pad_token_id": 0,
32
+ "position_embedding_type": "absolute",
33
+ "tie_word_embeddings": true,
34
+ "transformers_version": "5.16.1",
35
+ "type_vocab_size": 2,
36
+ "use_cache": false,
37
+ "vocab_size": 30522
38
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5001488fdaf9d5b724f4e24ed39f51686de830ddd5d401074f4cc506bccb7ee
3
+ size 90867952
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_basic_tokenize": true,
5
+ "do_lower_case": true,
6
+ "is_local": false,
7
+ "local_files_only": false,
8
+ "mask_token": "[MASK]",
9
+ "max_length": 128,
10
+ "model_max_length": 512,
11
+ "never_split": null,
12
+ "pad_to_multiple_of": null,
13
+ "pad_token": "[PAD]",
14
+ "pad_token_type_id": 0,
15
+ "padding_side": "right",
16
+ "sep_token": "[SEP]",
17
+ "stride": 0,
18
+ "strip_accents": null,
19
+ "tokenize_chinese_chars": true,
20
+ "tokenizer_class": "BertTokenizer",
21
+ "truncation_side": "right",
22
+ "truncation_strategy": "longest_first",
23
+ "unk_token": "[UNK]"
24
+ }