liveBook · Manning

Model selection

As explained in Data Analysis with LLMs

Model selection is the process of choosing a model based on task requirements, performance, cost, data sensitivity, and deployment constraints.

Model selection balances task performance against cost: choose the least expensive model that still handles the analysis well. Compare candidates on a data sample before processing a large dataset, since a small upfront investment may reduce total spend. section 9.0

Choosing a model for review labels

For movie-review sentiment labels, GPT-4 costs roughly 120 times more per token than GPT-3.5 Turbo. A mixed review that GPT-4 labels correctly but GPT-3.5 does not can help judge whether paying more to handle borderline cases is worthwhile. section 9.4

Label: neg; Ground truth: neg
Label: neg; Ground truth: neg
Label: neg; Ground truth: neg
Label: neg; Ground truth: neg
Label: pos; Ground truth: pos
Label: pos; Ground truth: neg
Label: pos; Ground truth: neg
Label: neg; Ground truth: neg
Label: pos; Ground truth: pos  #1
Label: neg; Ground truth: neg
Number of correct labels:    8  #2
Number of tokens used   :    2228  #3

A sample evaluation lists predicted and ground-truth labels, then reports the number of correct labels and tokens used. section 9.4

How Data Analysis with LLMs covers it

How deep it goes
Compares model costs and sample performance, and recommends inspecting test cases without giving a general ranking procedure.
Examples
Tests sentiment labels on movie reviews, comparing GPT-3.5 Turbo with GPT-4 and inspecting a mixed-polarity review.
What you can do after
Evaluate model choices on a data sample and judge whether better handling of borderline cases warrants higher costs.
How it connects
Connects model choice with model tuning, prompt engineering, and fine-tuning.

Also explained in

Compare how 9 books explain model selection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Analysis with LLMs. The section links point to the parts of the book it draws on.