All benchmarks

  Paper (arXiv), vendor authors

Fine-tuned 7B-class models vs GPT-4, one task at a time: 24 of 31 won

Predibase fine-tuned 10 small open models on 31 tasks, one fine-tune per task, each trained on a single GPU. Taking the best fine-tune for each task, they beat GPT-4 on 24, tied 1 and lost 6. GPT-4 kept the broad ones, coding and MMLU among them.

Made by Justin Zhao and nine co-authors

arXiv preprint

The result

  • Quality

    Tasks won out of 31: best of 10 fine-tunes per task vs GPT-4 (1 tie). Small model: Best LoRA fine-tune per task (10 base models from 2.5B to 8.5B parameters). Large model: GPT-4 (gpt-4-0613), zero- or one-shot prompts.

    24vs 6

    Small model ahead

    Best fine-tune per task24
    GPT-46

    Tasks won, of 31 · higher is better

  • Cost per call

    GPT-4 only, derived from the authors’ estimate: about US$400 to run GPT-4 on the full WikiSQL test set of 15,878 examples (about 805 input and 16 output tokens each); 400 / 15,878 = US$0.02519 per call, for WikiSQL-length prompts. The report gives no cost for the fine-tunes, so there’s no comparison. As reported: About US$400 for GPT-4 on the 15,878 WikiSQL test examples (an estimate, not a bill); nothing for the fine-tunes

    No comparison

    Only the large model’s cost is reported.

    Best fine-tune per taskNot reported
    GPT-4US$0.02519via an API

    US$ per call · lower is better

  • Latency

    Small side only, from Predibase’s serving test: Mistral-7b-instruct with 25 adapters on 1x NVIDIA A100 80GB (LoRAX), synthetic prompts of 30-500 input and 1-120 output tokens, requests from an AWS t3.2xlarge in us-west-2, 2-minute runs. p90 time to first token stayed at about 200 ms (199.0-201.0 ms) from 1 to 50 concurrent users; averages 148-171 ms (Table 10 in the arXiv HTML version, Table 9 in the PDF). Not measured on the 31 tasks. GPT-4’s latency isn’t reported.

    No comparison

    Only the small model’s time is reported.

    Best fine-tune per task≈ 200 mson 1× NVIDIA A100 80GB (LoRAX)
    GPT-4Not reported

    ms (time to first token, p90) · lower is better

The story

310 fine-tunes, one task at a time

Predibase, which sells a platform for fine-tuning and serving open models, wanted to know how far small LoRA fine-tunes go against GPT-4. Ten of its staff picked 31 tasks from public datasets, trained one fine-tune per task on each of ten base models, 310 in all, and scored every one, along with GPT-4 and GPT-3.5-Turbo, on the same items.

Some of the tasks are narrow, like tagging chemicals and diseases, classifying legal clauses or flagging toxic comments. Others are broad, like MMLU’s general-knowledge questions or writing code.

Data

31 public task datasets

From 635 (WNLI) to 560,000 (DBpedia) training examples per task

Hugging Face, Kaggle and GitHub (MMLU, Jigsaw, WikiSQL, the GLUE tasks and others); published train splits, the authors’ own splits for 2 tasks

Scored on at most the first 1,000 items of each task’s test split, or of its validation split when there is no labelled test split (and for MMLU, to match HELM).

Each fine-tune was trained on its task’s published train split; for customer support and legal clauses, which have no official split, the authors made their own. Scoring used the test split when there was a labelled one, otherwise the validation split (for MMLU the validation split, to match the HELM benchmark), and only the first 1,000 items of any larger split, to keep API costs down. The authors note this may bias the results.

Ten small base models, one recipe

Small model

Mistral-7b-v0.1 + LoRA

7.24B · Mistral AI

One LoRA adapter (rank 8) per task; the best of the ten base models on 10 of 31 tasks

Base
mistralai/Mistral-7B-v0.1, quantized to 4 bits for training
predibase

The base models were picked small enough to train on one GPU: Llama-2-7b and its chat version from Meta, Mistral-7b-v0.1 and its Instruct version from Mistral AI, Zephyr-7b from Hugging Face, Phi-2 from Microsoft, and Gemma-2b and Gemma-7b, base and instruction-tuned, from Google. Mistral-7b gave the best fine-tune on the most tasks, 10 of 31.

Training

LoRA rank 8 on a 4-bit base (bitsandbytes)

Identical settings for all 310 runs

1x NVIDIA A10G (24 GB) per fine-tune
Time
40,000 steps

Not reported: cost.

Every run used the same recipe, with no tuning per task: LoRA rank 8 on a 4-bit base, 40,000 steps at batch size 1 with 16 gradient-accumulation steps, paged Adam, and a learning rate of 0.002 on a cosine schedule. For tasks whose full-length inputs would still run out of memory, inputs were cut at the task’s 95th-percentile length. The authors point out that 40,000 steps doesn’t cover one epoch of the largest datasets.

Large model

GPT-4

Size not disclosed · OpenAI

Used as released, with the same completion-style prompt as the fine-tunes: zero-shot, or one example

Base
gpt-4-0613 snapshot

Evaluation

Test set
Each task’s test split, or validation split, first 1,000 items
Metric
Each task’s own metric on a 0-1 scale: accuracy, 1 minus mean absolute error, ROUGE-L, HumanEval or a GSM8K answer check
Items
Up to 1,000 per task, 31 tasks
How it was compared
Same prompts for every model, zero-shot or one example, with the class list for classification tasks; answers mapped to labels by the same regex step. GPT-4’s decoding settings aren’t stated.

Every model saw the same plain prompts: zero-shot, or with one example, the first item of the training split, where the output format is hard to describe. Classification prompts list the possible classes. There were no extra examples and no chain of thought, for GPT-4 too, which the authors list as a limitation. A regex step maps each answer to the label vocabulary before scoring.

24 wins, 1 tie, 6 losses

Taking the best of the ten fine-tunes for each task, the small models beat GPT-4 on 24 tasks, tied on one and lost six: Python coding, MMLU, WNLI, ARC, WikiSQL and BoolQ. Some wins are tiny, 0.008 on the 0-1 scale for grammar acceptability (CoLA) and for Winogrande. Across all 310 runs, 224 fine-tunes beat GPT-4 and 301 beat their own base model.

Predibase also served 25 of the Mistral-7b adapters from a single NVIDIA A100 80GB with its open-source LoRAX server. In a load test with 1 to 50 concurrent users and synthetic prompts, the time to the first token stayed at about 0.2 seconds or less. The report gives no cost per answer for the fine-tunes; for GPT-4 it estimates about US$400 to run the full 15,878-item WikiSQL test set.

All the numbers

Show all numbersHide all numbersEvery model · Cost, latency and energy · All 31 tasks

Every model on the headline test

Cost, latency and energy, as reported

Cost · per 1,000 answers
not reported1× NVIDIA A10G 24GB per fine-tune (training); 1× NVIDIAA100 80GB serving 25
≈ US$ 25OpenAI API, hardware not disclosed; WikiSQL, authors’ estimate
GPT-4 figure derived from the authors’ estimate: about US$400 for the 15,878-example WikiSQL test set.
Latency · time to 1st token
≤ 0.2 s1× NVIDIA A100 80GB, 1–50 users
not reported
Energy
Not reported

All 31 tasks

Coding (HumanEval): fine-tune 0.433 vs GPT-4 0.829 (-0.396)MMLU: fine-tune 0.589 vs GPT-4 0.774 (-0.185)Pronoun resolution: fine-tune 0.873 vs GPT-4 0.930 (-0.057)Science quiz (ARC): fine-tune 0.915 vs GPT-4 0.947 (-0.032)SQL generation: fine-tune 0.898 vs GPT-4 0.909 (-0.011)Yes/no questions: fine-tune 0.909 vs GPT-4 0.911 (-0.002)Support-call classification: fine-tune 1.000 vs GPT-4 1.000 (0.000)Grammar acceptability: fine-tune 0.872 vs GPT-4 0.864 (+0.008)Common-sense choice: fine-tune 0.840 vs GPT-4 0.832 (+0.008)Sentiment: fine-tune 0.961 vs GPT-4 0.942 (+0.019)Topic classification (DBpedia): fine-tune 0.988 vs GPT-4 0.965 (+0.023)Sentence completion (choice): fine-tune 0.834 vs GPT-4 0.805 (+0.029)Does it answer the question?: fine-tune 0.931 vs GPT-4 0.902 (+0.029)Data to text (restaurants): fine-tune 0.552 vs GPT-4 0.513 (+0.039)Duplicate questions: fine-tune 0.883 vs GPT-4 0.841 (+0.042)Chemical & disease names: fine-tune 0.972 vs GPT-4 0.890 (+0.082)Entailment: fine-tune 0.899 vs GPT-4 0.803 (+0.096)Triples to text: fine-tune 0.681 vs GPT-4 0.583 (+0.098)Article from headline: fine-tune 0.230 vs GPT-4 0.125 (+0.105)Paraphrase detection: fine-tune 0.887 vs GPT-4 0.777 (+0.110)Toxic comments: fine-tune 0.867 vs GPT-4 0.754 (+0.113)Sentence completion (written): fine-tune 0.261 vs GPT-4 0.134 (+0.127)Game data to text: fine-tune 0.505 vs GPT-4 0.374 (+0.131)Sentence similarity: fine-tune 0.913 vs GPT-4 0.773 (+0.140)Grade-school math: fine-tune 0.569 vs GPT-4 0.373 (+0.196)Named entities: fine-tune 0.989 vs GPT-4 0.742 (+0.247)Headline from article: fine-tune 0.441 vs GPT-4 0.175 (+0.266)Reading comprehension (DROP): fine-tune 0.741 vs GPT-4 0.393 (+0.348)Legal clauses: fine-tune 0.683 vs GPT-4 0.305 (+0.378)Reuters topics: fine-tune 0.479 vs GPT-4 0.014 (+0.465)COVID-tweet sentiment: fine-tune 0.843 vs GPT-4 0.309 (+0.534)
GPT-4 ahead on 6: coding, MMLU, science quiz…Fine-tune ahead on 24: legal clauses, COVID tweets, Reuters topics…

The paper also averages the 31 scores: 0.756 for the best fine-tunes against 0.661 for GPT-4. An average over 31 different tasks is the kind of single number this page argues against, so the result counts tasks won instead. Some of the 31 are narrow (legal clauses, named entities); some are broad (coding, MMLU), and GPT-4 kept those.

TaskBest fine-tuneGPT-4Gap
COVID-tweet sentiment0.8430.309+0.534
Reuters topics0.4790.014+0.465
Legal clauses0.6830.305+0.378
Reading comprehension (DROP)0.7410.393+0.348
Headline from article0.4410.175+0.266
Named entities0.9890.742+0.247
Grade-school math0.5690.373+0.196
Sentence similarity0.9130.773+0.140
Game data to text0.5050.374+0.131
Sentence completion (written)0.2610.134+0.127
Toxic comments0.8670.754+0.113
Paraphrase detection0.8870.777+0.110
Article from headline0.2300.125+0.105
Triples to text0.6810.583+0.098
Entailment0.8990.803+0.096
Chemical & disease names0.9720.890+0.082
Duplicate questions0.8830.841+0.042
Data to text (restaurants)0.5520.513+0.039
Does it answer the question?0.9310.902+0.029
Sentence completion (choice)0.8340.805+0.029
Topic classification (DBpedia)0.9880.965+0.023
Sentiment0.9610.942+0.019
Grammar acceptability0.8720.864+0.008
Common-sense choice0.8400.832+0.008
Support-call classification1.0001.000±0.000
Yes/no questions0.9090.911−0.002
SQL generation0.8980.909−0.011
Science quiz (ARC)0.9150.947−0.032
Pronoun resolution0.8730.930−0.057
MMLU0.5890.774−0.185
Coding (HumanEval)0.4330.829−0.396

Worth knowing

  • The authors sell the method they are testing.
  • The GPT-4 baseline is the June 2023 snapshot, and it got the same bare prompts as the small models. Better prompting (more examples, chain of thought) could raise its scores; the authors list this as a limitation.
  • Only the first 1,000 test examples per task were used. ROUGE is a rough stand-in for SQL correctness. 40,000 steps may not finish one epoch on the big datasets. Gemma results may be hurt by known Gemma bugs (footnote 14).
  • Some wins are tiny. An average over 31 different tasks is a single number of the kind this page argues against, so the card counts tasks won instead.

Weights on Hugging Face

Adapters published (24 of the 31 tasks)

Predibase published the LoRA Land adapters, all on mistralai/Mistral-7B-v0.1. There are adapters for 24 of the 31 tasks. None for: mmlu, glue_wnli, arc_combined, boolq, winogrande, webnlg, reuters. Three more (cnn, agnews_explained, drop_explained) are not among the paper’s 31 tasks.

GPT-4 and GPT-3.5-Turbo: closed, no weights.

Sources

  1. Zhao et al. (Predibase), ‘LoRA Land: 310 Fine-tuned LLMs that Rival GPT-4, A Technical Report’, arXiv 2405.00732v1, 29 Apr 2024Primary (vendor technical report)
  2. github.com/predibase/lora_bakeoff (splits and answer-extraction code; the paper prints it as lora-bakeoff)Code
3 more sources behind this page
  1. arXiv 2405.00732v1
  2. github.com/predibase/lora_bakeoff
  3. predibase.com (archived)
Share this benchmark

Drawing the image…

Post text