Safeeq commited on
Commit
93c6960
·
verified ·
1 Parent(s): b36e359

Update TinyLM-FC weights, config, tokenizer, and model card

Browse files
Files changed (3) hide show
  1. README.md +32 -15
  2. model.safetensors +1 -1
  3. tokenizer.json +0 -0
README.md CHANGED
@@ -180,18 +180,35 @@ with torch.no_grad():
180
 
181
  ## 📊 Benchmarks
182
 
183
- | Metric | Val (In-Distribution) | OOD (Held-Out Phrasings) |
184
- | :--- | :---: | :---: |
185
- | **Exact Match Accuracy** | **~99.8%** | **~88.2%** |
186
- | **Routing Decision Accuracy** | **99.9%** | **96.4%** |
187
- | **Routing Precision (Tool)** | **99.9%** | **97.1%** |
188
- | **Routing Recall (Tool)** | **99.9%** | **98.8%** |
189
- | **Query Slot Exact Match** | **99.8%** | **89.5%** |
190
- | **Recency Slot Accuracy** | **99.9%** | **97.2%** |
191
- | **Syntactic Validity Rate** | **100.0%** | **99.8%** |
192
- | **CPU Inference Latency** | **~3.2 ms** | **~3.4 ms** |
193
-
194
- > OOD = templates strictly held-out from training (unseen surface forms, same entity pools).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
 
196
  ---
197
 
@@ -241,10 +258,10 @@ Full pipeline available at [github.com/Safeeq008/tiny-fc-lm](https://github.com/
241
  git clone https://github.com/Safeeq008/tiny-fc-lm.git
242
  cd tiny-fc-lm && pip install -r requirements.txt
243
 
244
- python gen_data.py # 1. Generate 80k synthetic training samples
245
  python train_tok.py # 2. Train custom 2048-vocab BPE tokenizer
246
  python train.py # 3. Train TinyLM-FC model (~5-10 min, CPU)
247
- python eval.py # 4. Full benchmark suite (val + OOD)
248
  python infer.py # 5. Interactive CLI with live DuckDuckGo search
249
  python serve.py 8000 # 6. FastAPI server + web UI
250
 
@@ -261,7 +278,7 @@ ollama create tinyfc -f Modelfile && ollama run tinyfc
261
  1. **Single-tool**: Strictly routes `web_search` only — no multi-tool schemas.
262
  2. **English only**: Custom BPE tokenizer trained on English synthetic corpus.
263
  3. **80-token context window**: Inputs > ~60 user tokens are silently truncated.
264
- 4. **Synthetic training data**: Real-world query distributions are far noisier; OOD generalization is limited to phrasing variation, not domain shift.
265
  5. **Constrained decoding required**: Raw greedy decoding may produce malformed outputs; use `infer.py`'s constrained decoder for production.
266
 
267
  ---
 
180
 
181
  ## 📊 Benchmarks
182
 
183
+ Evaluated on 2,000 in-distribution samples (`val.jsonl`), 1,000 held-out phrasing samples (`test_ood.jsonl`), and 1,000 domain-shift samples (`test_ood_domain.jsonl`):
184
+
185
+ | Metric | Val (In-Distribution) | Phrasing OOD (Held-Out Phrasings) | Domain Shift OOD (Novel Entities & Global) |
186
+ | :--- | :---: | :---: | :---: |
187
+ | **Exact Match Accuracy** | **99.90%** | **82.90%** | **0.40%** *(entity vocabulary bounded)* |
188
+ | **Routing Decision Accuracy** | **99.95%** | **89.50%** | **95.40%** |
189
+ | **Routing Precision (Tool)** | **100.00%** | **89.15%** | **100.00%** |
190
+ | **Routing Recall (Tool)** | **99.95%** | **99.40%** | **95.40%** |
191
+ | **Query Slot Exact Match** | **99.90%** | **82.90%** | **0.40%** |
192
+ | **Recency Slot Accuracy** | **99.90%** | **84.90%** | **54.60%** |
193
+ | **Syntactic Validity Rate** | **100.0%** | **99.80%** | **99.30%** |
194
+ | **CPU Inference Latency** | **~23.8 ms** | **~24.0 ms** | **~27.8 ms** |
195
+
196
+ ### Per-Intent Performance (Phrasing OOD)
197
+
198
+ Key utility intents have been fortified against phrasing shifts and temporal ambiguity:
199
+
200
+ | Intent Category | Val Exact % | OOD Exact % | OOD Routing % | Status |
201
+ | :--- | :---: | :---: | :---: | :--- |
202
+ | **How-to / Guides** | 100.0% | **100.0%** | 100.0% | **Resolved (was 86.4%)** |
203
+ | **Sports Scores** | 100.0% | **100.0%** | 100.0% | **Resolved (was 88.5%)** |
204
+ | **Product Prices** | 100.0% | **96.2%** | 100.0% | **Resolved (was 84.8%)** |
205
+ | **General Concept** | 100.0% | **98.8%** | 98.8% | High fidelity |
206
+ | **Weather** | 99.4% | **97.4%** | 100.0% | High fidelity |
207
+ | **Stock Quotes** | 100.0% | **96.2%** | 100.0% | High fidelity |
208
+ | **Web Search** | 100.0% | **100.0%** | 100.0% | High fidelity |
209
+ | **Weekly Recap** | 100.0% | **80.3%** | 100.0% | 100% routing fidelity |
210
+ | **News** | 99.7% | **56.4%** | 97.0% | 97% routing fidelity |
211
+ | **Chit-Chat (Abstain)** | 100.0% | **41.0%** | 42.2% | Abstract banter vs tool call |
212
 
213
  ---
214
 
 
258
  git clone https://github.com/Safeeq008/tiny-fc-lm.git
259
  cd tiny-fc-lm && pip install -r requirements.txt
260
 
261
+ python gen_data.py # 1. Generate 80k synthetic training samples (train, val, phrasing OOD, domain OOD)
262
  python train_tok.py # 2. Train custom 2048-vocab BPE tokenizer
263
  python train.py # 3. Train TinyLM-FC model (~5-10 min, CPU)
264
+ python eval.py # 4. Full benchmark suite across all splits
265
  python infer.py # 5. Interactive CLI with live DuckDuckGo search
266
  python serve.py 8000 # 6. FastAPI server + web UI
267
 
 
278
  1. **Single-tool**: Strictly routes `web_search` only — no multi-tool schemas.
279
  2. **English only**: Custom BPE tokenizer trained on English synthetic corpus.
280
  3. **80-token context window**: Inputs > ~60 user tokens are silently truncated.
281
+ 4. **Synthetic training data & domain shift boundary**: Real-world query distributions are far noisier. While **tool routing transfers at 95.40%** to novel domains and unobserved tasks, **exact entity string extraction is bounded by the 0.47M parameter vocabulary** for unseen entities.
282
  5. **Constrained decoding required**: Raw greedy decoding may produce malformed outputs; use `infer.py`'s constrained decoder for production.
283
 
284
  ---
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4c6933d390e964c2d03472251d0d7be434be5095e5f40d57611cb6b5a0ce1989
3
  size 1889192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d21eb215bf98573077ad0a03b1e837878d21729a052b7221cd78abc5eecc26ca
3
  size 1889192
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff