Upload folder using huggingface_hub
Browse files- README.md +120 -0
- thimble-v6.pt +3 -0
- tokenizer.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- function-calling
|
| 8 |
+
- tool-calling
|
| 9 |
+
- on-device
|
| 10 |
+
- small-model
|
| 11 |
+
- grammar-constrained-decoding
|
| 12 |
+
library_name: pytorch
|
| 13 |
+
model-index:
|
| 14 |
+
- name: thimble-v6
|
| 15 |
+
results:
|
| 16 |
+
- task:
|
| 17 |
+
type: text-generation
|
| 18 |
+
name: Function calling (ordered strict exact match)
|
| 19 |
+
dataset:
|
| 20 |
+
name: Seal-Tools in-domain
|
| 21 |
+
type: seal-tools
|
| 22 |
+
metrics:
|
| 23 |
+
- type: exact_match
|
| 24 |
+
value: 33.1
|
| 25 |
+
name: Seal-Tools in-domain
|
| 26 |
+
- task:
|
| 27 |
+
type: text-generation
|
| 28 |
+
name: Function calling (ordered strict exact match)
|
| 29 |
+
dataset:
|
| 30 |
+
name: Mobile Actions
|
| 31 |
+
type: mobile-actions
|
| 32 |
+
metrics:
|
| 33 |
+
- type: exact_match
|
| 34 |
+
value: 86.3
|
| 35 |
+
name: Mobile Actions
|
| 36 |
+
- task:
|
| 37 |
+
type: text-generation
|
| 38 |
+
name: Function calling (ordered strict exact match)
|
| 39 |
+
dataset:
|
| 40 |
+
name: DroidCall
|
| 41 |
+
type: droidcall
|
| 42 |
+
metrics:
|
| 43 |
+
- type: exact_match
|
| 44 |
+
value: 52.5
|
| 45 |
+
name: DroidCall
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
# Thimble v6
|
| 49 |
+
|
| 50 |
+
**Thimble** is a **48.12M-parameter** factorized tool-calling model that beats
|
| 51 |
+
[Needle 2](https://cactuscompute.com/needle) (Cactus Compute, 45M, 153B training
|
| 52 |
+
tokens) on **three of its five published benchmark tables** β including
|
| 53 |
+
Seal-Tools, the suite its evaluation is built around β while training on
|
| 54 |
+
**~1B tokens (150x less)** for a total cost of about $260.
|
| 55 |
+
|
| 56 |
+
| Suite | Thimble v6 | Needle 2 (45M) |
|
| 57 |
+
|---|---|---|
|
| 58 |
+
| **Seal-Tools in-domain** | **33.1** | 32.6 |
|
| 59 |
+
| **Mobile Actions** | **86.3** | 63.7 |
|
| 60 |
+
| **DroidCall** | **52.5** | 17.0 |
|
| 61 |
+
| Seal-Tools out-of-domain | 28.1 | **28.7** |
|
| 62 |
+
| BFCL v4 single-turn | 23.5 | **42.6** |
|
| 63 |
+
|
| 64 |
+
Metric: ordered strict exact match β a row passes only if function names, call
|
| 65 |
+
order, and every argument value match exactly. Needle 2's numbers are from
|
| 66 |
+
their published tables. The Seal-in margin (+0.5 on 700 rows) is within
|
| 67 |
+
sampling noise and is stated as measured, not as a decisive gap. Full
|
| 68 |
+
disclosures (parameter-class matching, a champion-selection protocol failure,
|
| 69 |
+
the DroidCall split caveat) live in the
|
| 70 |
+
[GitHub repo](https://github.com/nikshepsvn/tiny-toolcall)'s RESULTS.md.
|
| 71 |
+
|
| 72 |
+
## How it works
|
| 73 |
+
|
| 74 |
+
- **Deep-thin gated trunk**: d=448, 20 layers, GQA 8/4, SwiGLU x2.0, QK-norm,
|
| 75 |
+
sandwich RMSNorm, tied embeddings; 16,384-token BPE with digits as
|
| 76 |
+
singletons.
|
| 77 |
+
- **Grammar-constrained decoding**: JSON structure and argument keys are
|
| 78 |
+
force-fed from the tool schemas; the model is consulted at exactly five
|
| 79 |
+
choice points (refuse, tool name, optional-include, value, stop). Malformed
|
| 80 |
+
JSON and hallucinated parameter names are unreachable by construction β
|
| 81 |
+
100% well-formed output.
|
| 82 |
+
- **Plan-conditioned retrieval**: the legal tool-name set is re-retrieved
|
| 83 |
+
between emitted calls, conditioned on the calls already made.
|
| 84 |
+
- **Error-driven training data**: the v6 corpus was synthesized against the
|
| 85 |
+
measured failure buckets of the previous version (spurious optional
|
| 86 |
+
arguments, wrong-slot entity binding, date canonicalization), then
|
| 87 |
+
**annealed into the learning-rate decay phase** of a continued run β the
|
| 88 |
+
controlled twin experiment showing anneal-beats-scratch for corrective data
|
| 89 |
+
is in the repo.
|
| 90 |
+
|
| 91 |
+
## Files
|
| 92 |
+
|
| 93 |
+
- `thimble-v6.pt` β the released checkpoint (`v6c_ema`): PyTorch
|
| 94 |
+
`state_dict` plus config dict (`torch.load(..., weights_only=False)`,
|
| 95 |
+
keys: `model`, `cfg`).
|
| 96 |
+
- `tokenizer.json` β 16,384-entry BPE vocabulary + merges.
|
| 97 |
+
|
| 98 |
+
## Usage
|
| 99 |
+
|
| 100 |
+
Inference requires the grammar decoder from the repo (the checkpoint is a
|
| 101 |
+
plain transformer; the decoding harness is where the guarantees live):
|
| 102 |
+
|
| 103 |
+
```bash
|
| 104 |
+
git clone https://github.com/nikshepsvn/tiny-toolcall
|
| 105 |
+
cd tiny-toolcall && uv venv && uv pip install -e .
|
| 106 |
+
# place thimble-v6.pt in checkpoints/, tokenizer.json in data/
|
| 107 |
+
python scripts/final_eval.py --ckpt thimble-v6 --suite seal-tools-in
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## Training provenance
|
| 111 |
+
|
| 112 |
+
Trained on public function-calling corpora (xlam, ToolACE, Dolci, Glaive,
|
| 113 |
+
official benchmark train splits) plus validated synthetic data
|
| 114 |
+
(deepseek-v4-flash teacher, stepwise-validated, evidence-filtered). Every
|
| 115 |
+
training row passed an 8-gram contamination firewall against every evaluation
|
| 116 |
+
query of every reported suite, BFCL included. Nothing was ever tuned on an
|
| 117 |
+
eval set; the full experimental record β including every negative result β
|
| 118 |
+
is in the repo.
|
| 119 |
+
|
| 120 |
+
MIT. Built by one person and an AI assistant in about a week of evenings.
|
thimble-v6.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10b9e5530cc5ac434a838299f67ed4c165df102166c9d6977501a37eeaf80f01
|
| 3 |
+
size 192586040
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|