chapter two

2 Getting started with fine-tuning: A few examples

 

This chapter covers

  • Building your first specialized model by fine-tuning an open-source model
  • The four-step fine-tuning process
  • Practical techniques for model selection, dataset structuring, and training

After reading chapter 1, where you discovered the value of specialized models, you should be eager to move beyond theory and build your first one. We’ll start with a working example that demonstrates something general-purpose models simply can’t do reliably: precise credit risk assessment with transparent reasoning.

2.1 Create your first specialized model

To understand what fine-tuning an LLM means in practice, let’s start with an example that feels concrete and immediately relevant. Suppose you’re part of a financial services team tasked with one of banking’s most critical responsibilities: credit risk assessment.

2.1.1 The dataset

2.1.2 The fine-tuning process

2.2 Parameter-Efficient Fine-Tuning (PEFT)

2.3 The fine-tuning mental model

2.3.1 The four-step fine-tuning process

2.3.2 How does this model perform on specific tasks?

2.3.3 How does this model perform on domain knowledge?

2.4 Creating a fine-tuning dataset

2.4.1 Collecting, cleaning, and structuring data

2.4.2 Labeling the data for supervised fine-tuning

2.5 A practical example of task-specific fine-tuning

2.5.1 Selecting the foundation model

2.5.2 Preparing the training dataset

2.5.3 Training the model on our dataset

2.6 References

2.7 Summary