liveBook · Manning

Adaptability

As explained in Generative AI in Action

Model adaptation is the adjustment of a generative AI model so that its outputs perform better for particular tasks or domains.

Model adaptation adjusts a pretrained generative AI model to improve its output for a specific task or domain. It reuses knowledge from general training rather than building a model from scratch, making it useful for enterprise applications that require specialized vocabulary or business context. section 9.1 section 9.0

Two ways to frame the target are:

  • Domain adaptation moves a model to a related domain, such as from general news to medical news. section 9.1
  • Task adaptation moves a model to a related task, such as from sentiment analysis to emotion detection. section 9.1

Fine-tuning continues training on a smaller, specialized dataset. Full fine-tuning updates all model parameters; parameter-efficient fine-tuning (PEFT) updates fewer. Low-rank adaptation (LoRA), a PEFT technique, introduces trainable low-rank matrices while keeping most pretrained parameters fixed. The choice depends on the required adaptation, model size and available compute. section 9.1.1 section 9.6

Adapting for medical questions

A model trained on general articles may perform poorly on medical questions. Fine-tuning it on a smaller, relevant dataset can help it learn patterns and vocabulary for that domain. The dataset should be clean, consistent and representative of the intended task; performance still needs evaluation. section 9.1 section 9.1.2 section 9.8

Start with a clear use case, not fine-tuning by default. An existing SaaS copilot may be the best starting point; where it is unsuitable, begin with prompt engineering and consider retrieval-augmented generation (RAG). These techniques can complement fine-tuning rather than replace one another. Fine-tuning adds data and compute costs, can cause catastrophic forgetting, and requires task-specific metrics and often several evaluation cycles before production. section 9.0 section 9.8 section 9.6

How Generative AI in Action covers it

How deep it goes
Defines domain and task adaptation and contrasts full fine-tuning with parameter-efficient techniques, including LoRA.
Examples
Uses medical questions, sentiment analysis and emotion detection to illustrate domain and task adaptation.
What you can do after
Evaluate/understand when to consider fine-tuning and how data quality, compute and iterative evaluation affect production readiness.
How it connects
Connects adaptation to transfer learning, prompt engineering, retrieval-augmented generation and catastrophic forgetting.

Also explained in

Compare how 7 books explain adaptability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Generative AI in Action. The section links point to the parts of the book it draws on.