liveBook · Manning

Chapter 3: Selecting and evaluating AI tools

What you will learn in chapter 3 of The AI Pocket Book

The chapter introduces the AI-tool selection and performance-evaluation topics it will cover.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduces the AI-tool selection and performance-evaluation topics it will cover.

3.1 Proprietary vs. open source

This section contrasts how proprietary and open source AI can be accessed, then explains why open source models may still have undisclosed components and usage restrictions.

Key terms: proprietary AI, customer-facing apps, APIs, tokens, open source AI, parameters, self-host, training datasets, reinforcement learning with human feedback, licenses

3.2 How to decide

This section compares when proprietary and open source AI are suitable, weighing ease of use, control, cost, customization, and output quality.

Key terms: proprietary AI, done-for-you solution, open source AI, self-host, transparency, governance, APIs, customization, fine-tuning, quality of outputs

3.3 Off-the-shelf vs. fine-tuning

This section contrasts customizing an unchanged AI model through prompts and context with fine-tuning a model, including fine-tuning’s overfitting risk and practical requirements.

Key terms: off-the-shelf models, prompt engineering, few-shot prompting, zero-shot prompting, RAG, fine-tuning, training data, internal parameters, overfitting, early stopping

3.4 How to decide

This section explains when to improve an off-the-shelf model with prompts and when fine-tuning may be the better choice.

Key terms: prompt engineering, fine-tuning, context windows, self-host, small, fine-tuned model

3.5 Customer-facing AI apps vs. foundation models

Distinguishes customer-facing AI apps from the foundation models that power them and notes that developers can access some models through APIs.

Key terms: customer-facing AI apps, foundation models, ChatGPT, GPT-4o, APIs, underlying foundation models, software developers

3.6 How to decide

This section explains when to choose a customer-facing AI app and when to use a foundation model.

Key terms: customer-facing apps, foundation models, building block

3.7 Model validation, selection, and testing

The section recommends benchmarking AI models through a well-designed assessment process and introduces the use of three datasets without yet explaining their roles.

Key terms: benchmark, assessment process, performance, datasets, three different collections of data

3.8 Training set

This section explains what a training set does, how training uses loss, and why training loss may not reflect performance on an intended task.

Key terms: training set, fine-tune, model parameters, loss, training loss, validation set, test set

3.9 Validation set

This section explains how a validation set helps compare models and other choices, and why its data must be kept separate from training data.

Key terms: validation set, model selection, fine-tuning, prompt engineering, performance measures, business objective, loss function, training set, overfits, training data cut-off date

3.10 Test set

Explains why a model needs a final assessment on an independent test set and why that set must not influence model selection.

Key terms: validation set, test set, modeling decisions, model selection

3.11 Performance measures

3.12 Accuracy

Defines accuracy as a performance measure and shows how to calculate and use it for classification and other tasks.

Key terms: accuracy, classification tasks, validation or test set

3.13 Precision and recall

This section explains precision and recall, why neither is sufficient alone, and how to evaluate retrieval systems against a business-specific minimum recall.

Key terms: recall, precision, relevant instances, false positive, tradeoff, false positives, F-measure, harmonic mean, minimum desirable level of recall, relevance score

3.14 Mean absolute error and root mean squared error

This section explains two ways to measure how far numerical AI predictions are from actual values: mean absolute error and root mean squared error.

Key terms: mean absolute error, MAE, absolute difference, root mean squared error, RMSE, squaring, larger deviations

3.15 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 2: Hallucinations Chapter 4: When to use (and not to use) AI →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.