liveBook · Manning

Custom model

As explained in Building Specialized AI Systems

A machine learning model tailored to a particular domain, task, or set of requirements rather than intended for broad general-purpose use.

A specialist model is a focused AI system tailored to a domain or task where precision, consistency, and expert knowledge matter more than broad versatility. It commonly adapts a general-purpose foundation model through fine-tuning, trading generalization for domain-specific capability. section 1.3 section 1.0

Specialization changes training emphasis rather than usually changing neural architecture. Curated domain data and expert feedback adapt model weights toward task objectives, terminology, reasoning patterns, and organizational standards. A financial model can emphasize numerical and temporal patterns; a code model can prioritize programming structures. section 1.3.1 section 1.3.3

Table 1.1 This comparison illustrates key differences between generic and fine-tuned models across dimensions relevant to enterprise applications, helping practitioners identify which approach best fits their specific context and requirements.
Aspect
Generic LLM
Fine-tuned Model
Data security
Low for cloud services: Data is sent to a third-party cloud, making it susceptible to breaches and hacking (including logs)
High for local deployment:  Data can be air-gapped and stored on your own premises (VPN, server, or data center)
High: Data can be air-gapped and stored on your own premises (VPN, server, or data center)
Cost
(inference)
High: Scaling to a high number of requests becomes costly very quickly
Low: Fine-tuned small language models are highly efficient and low-cost due to their smaller size
Intellectual Property (IP)
Low: Models are pre-trained on generic data (the internet, forums, and so on) and the results can be reproduced by competitors
High: Fine-tuning your own LLM provides unique IP and a competitive advantage
Accuracy
High: For broad, generic tasks that don't require high in-domain accuracy, generic models are best
High: High accuracy on specialized tasks that beat large generic LLMs in most cases; important for mission-critical tasks
Consistency
Low: Prompt engineering and few-shot prompts can work to a certain extent, but results are generally unpredictable and inconsistent
Moderate: LLM output consistency varies by model, temperature and use case, but can be more under control
Development effort
Low to medium: cloud-based models are ready to use out of the box, but achieving reliable results through prompt engineering or RAG can require significant iterative effort and expertise.
High: fine-tuning requires curating training data, running and evaluating training cycles, and often maintaining infrastructure for continuous retraining as requirements evolve.

Compare generic LLMs and fine-tuned models across size, data, security, cost, intellectual property, and performance when weighing specialization. section 1.3.1

Specialist models are most useful when requirements favor focused behavior:

  • High-stakes tasks need accurate, repeatable outputs, such as legal document classification, financial risk assessment, medical diagnostic support, or technical troubleshooting. section 1.5.1
  • Private organizational knowledge, sensitive data, or regulatory constraints make local or on-premises processing strategically valuable. section 1.3.2 section 1.3.4
  • High-volume workloads reward smaller, efficient models with more predictable costs than broad cloud-model inference. section 1.3.2
  • Stable domain knowledge and curated training examples can teach expertise that prompting or retrieval alone cannot supply. section 1.7

Specialization is not automatically the right answer. Prompt engineering suits low-stakes, creative, or approximate work; retrieval-augmented generation (RAG) suits applications needing current external information with tolerable imprecision. Fine-tuning fits stable, precision-oriented knowledge needs, while RAG plus fine-tuning addresses deep expertise combined with dynamic knowledge. section 1.5.1 section 1.7

Support-ticket prioritization

A fine-tuned GPT-3.5 model trained with LoRA on 18 months of support data learned priority and routing signals, separating common billing requests from rare security breaches and outages. The reported deployment improved critical-incident F1 and recall, reduced critical-ticket response time, and helped agents focus on urgent cases. section 1.4.3

Building a specialist model starts with selecting a suitable foundation model, then preparing small but high-quality task data. Training can use supervised fine-tuning, human-feedback reinforcement learning, or parameter-efficient approaches such as LoRA and QLoRA; evaluation must test the specific tasks and consistency required in deployment. section 1.4 section 1.4.2 section 2.3.2

How Building Specialized AI Systems covers it

How deep it goes
Explains fine-tuning as the primary specialization mechanism, including data curation, methods, evaluation, deployment, and decision trade-offs rather than neural internals.
Examples
Uses customer-support ticket classification, financial analysis, legal document classification, medical diagnostic support, code generation, and analyst-report summarization.
What it assumes
Assumes familiarity with general-purpose LLM uses while introducing foundation models and fine-tuning as the route to task-specific capability.
What you can do after
Evaluate/understand when specialization, prompting, RAG, or their combination best fits accuracy, knowledge, privacy, scale, and cost requirements.
How it connects
Connects fine-tuning with foundation models, prompt engineering, retrieval-augmented generation, supervised fine-tuning, RLHF, LoRA, QLoRA, and model evaluation.

Also explained in

Compare how 4 books explain custom model →

Related concepts

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