ameforge commited on
Commit
d2ec8c9
Β·
verified Β·
1 Parent(s): 77a439e

Upload BENCHMARK.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. BENCHMARK.md +140 -0
BENCHMARK.md ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SAM Benchmark v1 β€” Full Report
2
+
3
+ ## Methodology
4
+
5
+ This benchmark evaluates structured action generation: given a natural language
6
+ task and a JSON schema, produce a syntactically valid JSON sequence of operations
7
+ that matches a reference answer.
8
+
9
+ **Test suite**: 200 prompts, deterministically generated from
10
+ SEED=42. The exact prompts are saved to `test_suite.json` for
11
+ reproducibility and audit.
12
+
13
+ **Tier distribution** (current suite):
14
+ - Tier 1 β€” Atomic β€” single op: **40 cases** (20.0%)
15
+ - Tier 2 β€” Compound β€” 2-3 ops same domain: **40 cases** (20.0%)
16
+ - Tier 3 β€” Noisy β€” typos / casing / fillers: **40 cases** (20.0%)
17
+ - Tier 4 β€” Long chain β€” 4+ ops: **40 cases** (20.0%)
18
+ - Tier 5 β€” Cross-domain workflow: **40 cases** (20.0%)
19
+
20
+ **Domain distribution** (current suite):
21
+ - `WORKFLOW`: 49 cases (24.5%)
22
+ - `ROS`: 46 cases (23.0%)
23
+ - `DB`: 27 cases (13.5%)
24
+ - `HTTP`: 25 cases (12.5%)
25
+ - `VEHICLE`: 17 cases (8.5%)
26
+ - `MQTT`: 15 cases (7.5%)
27
+ - `ECOMMERCE`: 8 cases (4.0%)
28
+ - `HOME`: 7 cases (3.5%)
29
+ - `FILE`: 4 cases (2.0%)
30
+ - `CAL`: 2 cases (1.0%)
31
+
32
+ **Metrics**:
33
+ - `JSON Valid`: output parses as valid JSON ∈ [0,100]%
34
+ - `Op Correct`: output is a list of dicts AND every op name matches the expected set ∈ [0,100]%
35
+ - `Exact Match`: full structural match with reference, with float tolerance 0.02 for numerics ∈ [0,100]%
36
+ - `Latency`: mean wall-clock time per prompt in milliseconds (single-thread, no batching)
37
+ - `Size`: model file size on disk (MB)
38
+
39
+ **Important disclosures**:
40
+ 1. SAM is **trained on the same domain distribution as this benchmark** (multi-domain JSON ops).
41
+ General-purpose LLMs are evaluated zero-shot. This is a deliberate comparison of
42
+ "specialist 35M model" vs "generalist N-B model" on a structured task, NOT a claim
43
+ of general superiority.
44
+ 2. **Tier distribution is currently imbalanced** toward Tier 1 (atomic). Aggregate
45
+ exact-match numbers are dominated by easy cases. Always read the per-tier
46
+ breakdown below for fair comparison.
47
+ 3. **Domain distribution is currently imbalanced** toward ROS (robotics). This
48
+ reflects SAM's lineage from Foros (ROS-only). Per-domain breakdowns reveal
49
+ each model's actual strength.
50
+ 4. All LLMs are loaded from publicly available HuggingFace weights with no
51
+ fine-tuning. Prompt template is identical across all LLMs.
52
+
53
+ ## Headline results (aggregate across all 200 cases)
54
+
55
+ | Rank | Model | Params | Size (MB) | JSON Valid | Op Correct | Exact Match | Latency (ms) |
56
+ |---|---|---|---|---|---|---|---|
57
+ | 1 | **[SAM]** SAM | 35.9M | 137.0 | 84.0% | 31.5% | 8.5% | 691.6 |
58
+ | 2 | Qwen2.5-3B | 3085.9M | 5886.0 | 100.0% | 81.5% | 17.5% | 2716.7 |
59
+ | 3 | DeepSeek-R1-Qwen3-8B-GGUF | 8000.0M | 4794.9 | 98.5% | 79.5% | 11.5% | 37642.4 |
60
+ | 4 | Qwen2.5-1.5B | 1543.7M | 2944.4 | 100.0% | 75.0% | 9.5% | 1976.9 |
61
+ | 5 | TinyLlama-1.1B | 1100.0M | 2098.2 | 93.5% | 57.0% | 9.0% | 4484.0 |
62
+ | 6 | Qwen2.5-0.5B | 494.0M | 942.3 | 71.5% | 28.5% | 2.5% | 2108.7 |
63
+ | 7 | SmolLM2-1.7B | 1711.4M | 3264.2 | 85.0% | 47.0% | 2.5% | 1884.5 |
64
+ | 8 | SmolLM2-360M | 361.8M | 690.1 | 98.5% | 0.0% | 0.0% | 1027.1 |
65
+ | 9 | Llama-3.2-1B | ? | 0.0 | 0.0% | 0.0% | 0.0% | 0.0 |
66
+ | 10 | Gemma-2-2B | ? | 0.0 | 0.0% | 0.0% | 0.0% | 0.0 |
67
+ | 11 | Llama-3.2-3B | ? | 0.0 | 0.0% | 0.0% | 0.0% | 0.0 |
68
+ | 12 | Phi-3.5-mini-3.8B | ? | 0.0 | 0.0% | 0.0% | 0.0% | 0.0 |
69
+ | 13 | Llama-3.2-3B-uns | ? | 0.0 | 0.0% | 0.0% | 0.0% | 0.0 |
70
+ | 14 | Gemma-3-270M-GGUF | 270.0M | 241.4 | 92.0% | 2.5% | 0.0% | 6871.5 |
71
+ | 15 | Ministral-3-8B-GGUF | ? | 0.0 | 0.0% | 0.0% | 0.0% | 0.0 |
72
+
73
+ ## Per-tier exact-match breakdown (all models)
74
+
75
+ _This is the breakdown that matters for fair comparison. Each model's exact-match score is shown for each difficulty tier._
76
+
77
+ | Model | T1 atomic | T2 compound | T3 noisy | T4 long | T5 cross |
78
+ |---|---|---|---|---|---|
79
+ | **[SAM]** SAM | 20.0% (n=40) | 0.0% (n=40) | 22.5% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
80
+ | Qwen2.5-3B | 40.0% (n=40) | 20.0% (n=40) | 27.5% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
81
+ | DeepSeek-R1-Qwen3-8B-GGUF | 27.5% (n=40) | 7.5% (n=40) | 22.5% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
82
+ | Qwen2.5-1.5B | 30.0% (n=40) | 15.0% (n=40) | 2.5% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
83
+ | TinyLlama-1.1B | 27.5% (n=40) | 12.5% (n=40) | 5.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
84
+ | Qwen2.5-0.5B | 12.5% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
85
+ | SmolLM2-1.7B | 12.5% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
86
+ | SmolLM2-360M | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
87
+ | Gemma-3-270M-GGUF | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) | 0.0% (n=40) |
88
+
89
+ ## Per-tier JSON-valid breakdown (all models)
90
+
91
+ | Model | T1 atomic | T2 compound | T3 noisy | T4 long | T5 cross |
92
+ |---|---|---|---|---|---|
93
+ | **[SAM]** SAM | 92.5% | 80.0% | 77.5% | 70.0% | 100.0% |
94
+ | Qwen2.5-3B | 100.0% | 100.0% | 100.0% | 100.0% | 100.0% |
95
+ | DeepSeek-R1-Qwen3-8B-GGUF | 100.0% | 95.0% | 100.0% | 97.5% | 100.0% |
96
+ | Qwen2.5-1.5B | 100.0% | 100.0% | 100.0% | 100.0% | 100.0% |
97
+ | TinyLlama-1.1B | 100.0% | 90.0% | 100.0% | 77.5% | 100.0% |
98
+ | Qwen2.5-0.5B | 60.0% | 65.0% | 67.5% | 100.0% | 65.0% |
99
+ | SmolLM2-1.7B | 92.5% | 72.5% | 100.0% | 60.0% | 100.0% |
100
+ | SmolLM2-360M | 100.0% | 100.0% | 100.0% | 92.5% | 100.0% |
101
+ | Gemma-3-270M-GGUF | 85.0% | 97.5% | 90.0% | 87.5% | 100.0% |
102
+
103
+ ## Per-domain exact-match breakdown (all models)
104
+
105
+ | Model | CAL (n=2) | DB (n=27) | ECOMMERCE (n=8) | FILE (n=4) | HOME (n=7) | HTTP (n=25) | MQTT (n=15) | ROS (n=46) | VEHICLE (n=17) | WORKFLOW (n=49) |
106
+ |---|---|---|---|---|---|---|---|---|---|---|
107
+ | **[SAM]** SAM | 50.0% | 3.7% | 0.0% | 0.0% | 0.0% | 40.0% | 0.0% | 4.3% | 17.6% | 0.0% |
108
+ | Qwen2.5-3B | 50.0% | 18.5% | 0.0% | 0.0% | 0.0% | 8.0% | 73.3% | 28.3% | 17.6% | 0.0% |
109
+ | DeepSeek-R1-Qwen3-8B-GGUF | 50.0% | 0.0% | 0.0% | 25.0% | 0.0% | 8.0% | 73.3% | 10.9% | 17.6% | 0.0% |
110
+ | Qwen2.5-1.5B | 0.0% | 18.5% | 0.0% | 0.0% | 0.0% | 4.0% | 0.0% | 21.7% | 17.6% | 0.0% |
111
+ | TinyLlama-1.1B | 0.0% | 18.5% | 0.0% | 25.0% | 0.0% | 0.0% | 0.0% | 17.4% | 23.5% | 0.0% |
112
+ | Qwen2.5-0.5B | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 4.3% | 17.6% | 0.0% |
113
+ | SmolLM2-1.7B | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 4.3% | 17.6% | 0.0% |
114
+ | SmolLM2-360M | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
115
+ | Gemma-3-270M-GGUF | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
116
+
117
+ ## How to read this report
118
+
119
+ - The **headline aggregate** can be misleading because tier 1 is over-represented.
120
+ - The **per-tier breakdown** is the honest comparison. Look at T1-T5 separately.
121
+ - The **per-domain breakdown** shows which models are strong in which areas.
122
+ - SAM is expected to win on the structured-output dimension (exact match on
123
+ domains it was trained on) and to be **much smaller and faster**. Where
124
+ general LLMs win is usually noisy/cross-domain (their broader training helps).
125
+ - **No metric in isolation is the full story.** A reviewer should look at all
126
+ three (exact match, latency, size) together to evaluate the trade-off.
127
+
128
+ ## Reproducibility
129
+
130
+ ```bash
131
+ python sam_benchmark.py
132
+ ```
133
+
134
+ Test suite regenerated deterministically from SEED=42. LLM weights from
135
+ public HuggingFace repos. SAM weights from `AMFORGE/sam-v1-checkpoints/best.pt`
136
+ (auto-downloaded if not present locally).
137
+
138
+ Raw per-case results are in `results_full.json` (one entry per (model, case)
139
+ including model output and pass/fail flags). Per-suite aggregates are in
140
+ `results.json`. The test suite itself is in `test_suite.json`.