liveBook · Manning

Fine-tuning

As explained in Knowledge Graphs and LLMs in Action

Fine-tuning is adapting a pretrained model by continuing its training on targeted data or objectives.

Fine-tuning adapts a pretrained language model to a domain or task by continuing training with targeted examples and expected outputs. It becomes useful when prompt engineering cannot provide sufficiently accurate or stable results. section 5.3.1

A practical fine-tuning workflow includes:

  • Explore the domain and identify ambiguities, such as inconsistent references to the same person. section 5.3.1
  • Engineer prompts first, then reuse them to preannotate a small dataset before completing human annotations. section 5.3.1
  • Train task-specific components when larger schemas or complex extraction tasks exceed the scalability or reliability of in-context learning. section 15.4.3
  • Budget for annotation, infrastructure, prediction, and model-version management costs. section 5.3.4
Figure 5.4 The two roles of LLMs in KG generation from textual data: the prompt-based approach (upper branch) and the fine-tuning approach (lower branch)
figure

Compare prompt-based inference with the fine-tuning branch for generating knowledge graphs from textual data. section 5.3.1

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Explains dataset preparation, annotation reuse, trade-offs, and selective component replacement without detailing optimization internals.
Examples
Uses entity-relation extraction, schema-aware agents, and knowledge-graph query planning as application examples.
What it assumes
Assumes prompt formulation and domain analysis, while requiring annotated examples when prompting cannot meet task demands.
What you can do after
Build task-specific LLM components for more stable extraction or more efficient graph-aware querying.
How it connects
Connects prompt engineering, in-context learning, transfer learning, knowledge graph generation, and query generation.

Also explained in

Compare how 37 books explain fine-tuning →

Related concepts

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