liveBook · Manning

Training

As explained in Learn AI-Assisted Python Programming, Second Edition

Model training is the process of fitting an artificial-intelligence model to patterns in data so it can produce outputs for new inputs.

Training is the learning stage in which an AI system uses many examples to recognize patterns and later produce outputs for new inputs. The costly work can happen once, then support many predictions instead of being repeated every time. section 11.6 section 1.5

A practical way to understand training is to separate it from later use:

  • Training uses a large collection of examples, such as millions of open-source repositories. section 1.5
  • After training, the system can generate code or make predictions without training from scratch for every request. section 11.6
  • Training data can contain older practices, so generated output still needs checking. section 2.6.1

Checking trained knowledge against Python 3

Copilot may suggest the older form print "Hello Copilot" because its training included old Python code. In a Python 3 environment, replace it with print("Hello Copilot") and test the result. The same checking habit applies to generated code for tasks such as calculating a square's area. section 2.6.1

How Learn AI-Assisted Python Programming, Second Edition covers it

How deep it goes
Defines training through corpus size and reuse, then stops short of explaining model internals.
Examples
Uses Copilot's code corpus, outdated Python print syntax, and a square-area program as concrete examples.
What you can do after
Diagnose generated-code mistakes by checking suggestions against the active Python version and testing them.
How it connects
Connects training with machine learning, prediction, code generation, copyright, and licensing.

Also explained in

Compare how 24 books explain training →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn AI-Assisted Python Programming, Second Edition. The section links point to the parts of the book it draws on.