Small local models (1.1B and 7B) planned Mac assistant tasks better than GPT-4-Turbo
Made by Lutfi Eren Erdogan and nine co-authors
The result
The story
An assistant that has to plan
Ask a laptop assistant to set up a meeting with two colleagues and it first has to look up both email addresses, then create the calendar event with them. Researchers at UC Berkeley’s SqueezeAILab and ICSI gave such an assistant 16 Mac functions, covering email, contacts, text messages, calendar, notes, reminders, files and Zoom, each backed by a ready-made Apple script. The model’s whole job is the plan: which functions to call, with which arguments, and in what order.

Plans follow the LLMCompiler format, which records which calls depend on which, so independent lookups can be fetched together. Off the shelf, small open models such as TinyLlama-1.1B and Wizard-2-7B could not write correct plans: they picked the wrong functions, invented names and got dependencies or syntax wrong.
GPT-4-Turbo writes the training set
Instead of writing examples by hand, the team gave GPT-4-Turbo sets of functions and asked it to invent realistic requests that need them, along with the plan and its arguments. Automatic checks kept only plans that form a valid graph with correct function names and argument types. That produced 80K training, 1K validation and 1K test examples for about US$500.
Data
TinyAgent dataset
80K training, 1K validation and 1K test examples (the public test file has 1,023)
Requests, plans and arguments generated by GPT-4-Turbo from sets of the 16 Mac functions, kept only if the plan forms a valid graph with correct function names and argument types
About US$500 to generate. The test set comes from the same generator as the training set. Public on Hugging Face, whose card describes 40,000 examples.
Small model
TinyAgent-7B
7B (7.24B on Hugging Face) · UC Berkeley (SqueezeAILab)
LoRA fine-tune on the generated plans; prompts carry the needed tools plus distractors and retrieved examples; a DeBERTa-v3-small classifier picks the tools
- Base
- Wizard-2-7B, cited as the Not-WizardLM-2-7B upload
Small model
TinyAgent-1.1B
1.1B · UC Berkeley (SqueezeAILab)
Same recipe as the 7B; the model the Mac demo runs
- Base
- TinyLlama-1.1B, instruct-32k version
Both small models were fine-tuned with LoRA for three epochs at a learning rate of 7e-5, keeping the checkpoint that did best on the validation set. Each training prompt listed the functions the request needs plus some irrelevant ones, which the authors found taught the models to pick tools, and a few in-context examples retrieved from the training data. Fine-tuning took the 1.1B from 12.71% to 78.89% and the 7B from 41.25% to 83.09%.
A second, much smaller model trims the prompt. A DeBERTa-v3-small classifier, fine-tuned on the same data, predicts which of the 16 tools a request needs, 3.97 on average with 0.998 recall, so only those descriptions go in. Prompts shrank from 2,762 to 1,397 tokens and accuracy rose to 80.06% for the 1.1B and 84.95% for the 7B. Finally both were quantized to 4 bits for llama.cpp.
Training
LoRA, 3 epochs, learning rate 7e-5
Best checkpoint on the 1K-example validation set; then 4-bit quantization (group size 32) with quantization-aware training
- Cost
- Not reported beyond about US$500 to generate the data
Not stated: hardware and time.
The test
Large model
GPT-4-Turbo
Size not disclosed · OpenAI
Used as released; prompt, snapshot and settings not stated
- Base
- General model; it also generated the training and test data
On the 1K test requests, TinyAgent-7B scored 84.95% and TinyAgent-1.1B 80.06%, against 79.08% for GPT-4-Turbo and 65.04% for GPT-3.5. The paper doesn’t say how the GPT models were prompted or which versions ran, and GPT-4-Turbo also generated the test set the models are scored on. Each figure is a single number, with no error bars.
Evaluation
1K test items (1,023 in the public test file)
- Test set
- The TinyAgent test split, generated by GPT-4-Turbo
- Metric
- Success rate: a plan counts only if its dependency graph is isomorphic to the reference plan’s
- How it was compared
- Same metric for all; how GPT-4-Turbo was prompted (tools, examples, Tool RAG) and which snapshot ran aren’t stated; it also wrote the test set.
Speed
Latency here is the planner’s end-to-end time, prompt processing included. The 1.1B matched GPT-4-Turbo at 3.9 seconds and took 2.9 at 4 bits (80.35%); the 7B was slower, 19.5 seconds, or 13.1 at 4 bits (85.14%). The paper doesn’t name the machine behind these timings; the demo runs the 1.1B on a MacBook Pro M3. No inference cost is reported. Apple sponsored the project, and the data, code and both models are public.
All the numbers
Show all numbersHide all numbersEvery model · Cost, latency and energy · 8 more results
Every model on the headline test
Cost, latency and energy, as reported
- Cost
- Not reported
- Latency · s, end-to-end planner latency (TinyAgent-7B, 16-bit)
- TinyAgent 7B19.5
- GPT-4-Turbo3.9
- The headline 7B model is slower than GPT-4-Turbo (19.5 s vs 3.9 s). The 1.1B model matches GPT-4-Turbo at 16-bit (3.9 s) and beats it at 4-bit (2.9 s).
- Energy
- Not reported
- Not reported (the acknowledgements thank a colleague for insights on energy cost, but no figure is given).
More from the source
TinyAgent-1.1B success rate, 16-bit / 4-bit
Small model 80.06 / 80.35Large model 79.08 %
Table 2
TinyAgent-7B success rate, 4-bit
Small model 85.14Large model 79.08 %
Table 2
GPT-3.5 success rate
Small model 84.95Large model 65.04 %
Table 2
End-to-end planner latency, 7B: 16-bit / 4-bit
Small model 19.5 / 13.1Large model 3.9 s
The 7B is slower than GPT-4-Turbo.
Table 2
End-to-end planner latency, 1.1B: 16-bit / 4-bit
Small model 3.9 / 2.9Large model 3.9 s
Table 2
Model size, 1.1B / 7B (16-bit; 4-bit)
Small model 2.2 / 14.5; 0.68 / 4.37Large model Unknown GB
Table 2
Before vs after fine-tuning, all tools in prompt: 1.1B / 7B
Small model 12.71 -> 78.89 / 41.25 -> 83.09Large model 79.08 % success
Section 3.3 and Table 1 (‘No RAG’ row)
Prompt size: all tools vs DeBERTa Tool RAG
Small model 1397Large model 2762 tokens
Both numbers are for the TinyAgent prompt; GPT-4-Turbo’s prompt size is not given.
Table 1
Worth knowing
- GPT-4-Turbo wrote both the training data and the test set, and is then the baseline; the test is in-distribution for the fine-tuned models.
- The paper does not say how GPT-4-Turbo was prompted (same in-context examples and tool list as TinyAgent or not) or which snapshot was used.
- The 1.1B model’s win is small (80.06% vs 79.08%); the 7B’s win is larger but it is slower than GPT-4-Turbo (19.5 s vs 3.9 s at 16-bit; 13.1 s at 4-bit).
- Single run, no error bars.
1 more caveat
- Apple sponsored the project (acknowledgements).
Weights on Hugging Face
- squeeze-ai-lab/TinyAgent-7BTinyAgent-7B (Wizard-2-7B, fine-tuned)
- TinyAgent-1.1B (TinyLlama-1.1B, fine-tuned)
Sources
- Erdogan, Lee, Jha et al., ‘TinyAgent: Function Calling at the Edge’, arXiv 2409.00608
- BAIR blog, ‘TinyAgent: Function Calling at the Edge’, 29 May 2024
- TinyAgent code (GitHub)
- BAIR blog post, 29 May 2024; arXiv 2409.00608 v1 1 Sep 2024 UTC (v3, 25 Oct 2024, used here); arXiv comment: ‘EMNLP 2024 Demo’. Same numbers in both.