DocsAI Training Coach🧠 ML Basics

What is Machine Learning?

The foundation of everything – understand before you train

Machine learning (ML) is a branch of artificial intelligence that enables computers to learn from experience. Instead of giving a computer exact rules, you show it example data – and it finds the patterns itself. The result is called a model.

Classical Programming vs. Machine Learning

Classical: rules + data → answers
ML: data + answers → rules (the model)
With ML, the computer figures out the rules itself.

The three fundamental learning paradigms

🎯

Supervised Learning

You give the model data WITH correct answers (labels). It learns the mapping from input to output.

Example: Email → "spam" or "not spam"

Use case: Classification, regression, NLP

🔍

Unsupervised Learning

The model only receives data WITHOUT labels. It searches on its own for patterns, clusters, and structures.

Example: Grouping customers by purchasing behavior

Use case: Clustering, dimensionality reduction

🎮

Reinforcement Learning

The model learns through reward and punishment within an environment. It optimizes its strategy.

Example: Playing chess, RLHF in ChatGPT

Use case: Robotics, games, RLHF

Key ML terms – the vocabulary

Model

The "intelligence" – a mathematical function with millions of learned parameters that maps inputs to outputs.

Parameters / Weights

The model's internal numbers. They are optimized during training and represent the model's "knowledge".

Training

The process by which the model iteratively improves its parameters using example data.

Inference

Applying the fully trained model to new, unseen data.

Dataset

The collection of training examples. Quality and quantity are both crucial.

Epoch

One complete pass through ALL training data.

Batch

A small subset of the training data processed simultaneously.

Loss

A numeric value indicating how "wrong" the model currently is. Lower is better.

Gradient

The mathematical direction in which parameters need to change to reduce the loss.

Overfitting

The model "memorizes" training data instead of generalizing – poor performance on new data.

Underfitting

The model is too simple or trained too briefly – poor performance on both training AND test data.

Generalization

The ability to perform well on unseen data. The actual goal of training.

Why fine-tuning instead of training from scratch?

Training an LLM like GPT or LLaMA from scratch costs millions of euros and requires thousands of GPUs over weeks. With fine-tuning, you take an already pretrained model – one that already knows language, facts, and logic – and specialize it for your task. In hours instead of months, on your own GPU.

Training from scratch (pretraining)

  • ⏱ Weeks to months of compute time
  • 💰 Hundreds of thousands to millions of euros
  • 📦 Billions of training samples needed
  • 🖥 Hundreds to thousands of GPUs simultaneously
  • 🧑‍💻 Realistic only for large organizations

Fine-tuning (with FrameTrain)

  • ⏱ Minutes to a few hours
  • 💰 Practically free (your own hardware)
  • 📦 A few hundred to a thousand examples are enough
  • 🖥 1 GPU – your own computer
  • 🧑‍💻 Achievable for anyone

Transfer learning: the foundation of fine-tuning

Fine-tuning is based on transfer learning: the prior knowledge of a large pretrained model (grammar, facts, logic, code) is transferred to a new, specific task. Only a fraction of the parameters need to be adapted.

🧠

Base model
(7B parameters)

Fine-tuning
🎯

Specialized
model

The base model already "knows" language. Fine-tuning teaches it your specific use case.