Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
2027 Decision AI LLM Fine Tuning: Make Your Own System 1 LLM
Highest Rated
Hot & New
Rating: 4.9 out of 5(19 ratings)
129 students

2027 Decision AI LLM Fine Tuning: Make Your Own System 1 LLM

Modern AI, PyTorch, BERT, Clef, Laya, Jev, HuggingFace, LoRA, QLoRA, PEFT, Ollama, Local LLM, Qwen, Google Colab, GPU
Last updated 11/2026
English
English

What you'll learn

  • Run Hugging Face Transformers models with pipeline for sentiment analysis, emotions and zero-shot text classification, and score them on gold answers
  • Explain how a transformer works in PyTorch: tokens, embeddings, self-attention with query, key and value, softmax, the causal mask, logits and next-token loss
  • Use an encoder like ModernBERT for classification: masked language modeling, contextual embeddings and a new classification head
  • Read a decision model's answer from the option letters in one forward pass, measure expected calibration error and fix confidence with temperature scaling
  • Fine-tune a model on custom data from the Hugging Face Hub, with train, calibration and test splits, and measure what fine-tuning gains and what it costs
  • Build your own Mini Laya from a pretrained encoder and a decision head, trained with a proper scoring rule that rewards honest confidence
  • Train with the Hugging Face Trainer and TrainingArguments: learning rate, epochs, batch size, memory per parameter, overfitting and early stopping
  • Fine-tune with LoRA and QLoRA using PEFT and bitsandbytes: LoraConfig, rank and alpha, 4-bit loading, saving and merging adapters
  • Assemble Mini Clef from Qwen, LoRA adapters and a decision head, calibrate it per question type and share your model on the Hugging Face Hub
  • Run every notebook on a free GPU in Google Colab or Kaggle with your Hugging Face token

Course content

12 sections • 217 lectures • 7h 36m total length
  • Welcome and What You Will Build2:47

    See what you will build in this course: your own System 1 decision model, trained by you and shared on the Hugging Face Hub.

    You start with Hugging Face Transformers pipelines, then see how transformers work in PyTorch, from tokens to the output. You learn BERT encoders like ModernBERT and how a decision model decides and stays calibrated. Then you fine-tune Laya on custom banking data, build your own mini Laya from scratch, train with the Hugging Face Trainer, use LoRA and QLoRA with PEFT, and build a mini Clef from scratch with Qwen. Finally you share your model on the Hugging Face Hub.

    Meet your instructor in the next lecture. If you get stuck anywhere, post your question in the Q&A section.

  • Meet Your Instructor2:02
  • How to Get the Most Out of This Course2:07
  • A Tour of Hugging Face3:34
  • Create a Hugging Face Token With Write Access1:53
  • The Course Repo on GitHub1:44
  • Course Resources and Your Setup2:41
  • Open a Course Notebook in Google Colab2:53
  • A T4 GPU, the Installs and Your Token in Colab2:25
  • Keeping Your Work in Colab, and Its Limits1:40
  • The Same Notebook on Kaggle: GPU, Internet and Your Token2:41
  • Saving on Kaggle, the Limits, and Which Sections Need What1:55

Requirements

  • Basic Python: lists, loops, functions and calling a method. Every line of PyTorch and Hugging Face code is explained the first time it appears
  • Jev AI and Laya Fundamentals, or the same experience: you have called a decision model or an LLM from Python and read its answer
  • A free Google Colab or Kaggle account for the GPU (the Introduction shows both), or your own computer with an NVIDIA GPU
  • A free Hugging Face account and an access token, made step by step in the Introduction
  • No machine learning background is needed: no PyTorch, no training and no maths beyond reading a formula with its picture

Description

This course contains the use of artificial intelligence. Learn to fine-tune transformer models in Python, step by step, until you have trained a decision model of your own. In this hands-on course you use PyTorch, Hugging Face Transformers, the Trainer, datasets, evaluate, PEFT and bitsandbytes to fine-tune BERT-style encoders and small LLMs for text classification, check how far you can trust their confidence, and train with LoRA and QLoRA.

In Jev AI and Laya Fundamentals you called a decision model through an API. It read a support ticket or a bank message and answered a typed question, with a probability for every option. This course opens that kind of model up and shows you how to build, fine-tune and calibrate one yourself, on real data, with code that runs on a free GPU in Google Colab or Kaggle.

What makes this course different

  • You see the machine before the code. Every idea (tokens, attention, the causal mask, logits, softmax, the next-token loss, a classification head, LoRA) is first drawn as an animated scene on the real data, then typed in a notebook line by line, with the real output read out.

  • Text classification with three kinds of model. On 40 support tickets you compare a ready-made sentiment model, zero-shot classification and a chat model, then you learn why an encoder like ModernBERT is the model that decides.

  • A transformer opened step by step in PyTorch: text becomes tokens and vectors, every token attends to every other token, the scores become weights, and you watch a real Qwen model predict the next token and compute its loss.

  • Confidence you can check. You read the answer from the option letters in one forward pass instead of asking for JSON, measure expected calibration error, and fix over-confidence with temperature scaling.

  • Fine-tuning Laya on custom data. You take ten card intents from Banking77, split train, calibration and test rows, fine-tune, and measure what fine-tuning gains and what it can cost (forgetting).

  • Build your own Mini Laya from scratch: a pretrained ModernBERT encoder plus a new decision head, trained with a proper scoring rule that rewards honest confidence, and compared with the published Laya on the same test sets.

  • The Hugging Face Trainer, one argument at a time: a classification head on a decoder model, what one trainable parameter costs in memory, learning rate, epochs and batch size, train, validation and test, overfitting and early stopping.

  • LoRA and QLoRA with PEFT: you train a small pair of matrices beside each layer instead of every weight, then load a 4-billion-parameter Qwen in 4-bit and fine-tune it with QLoRA, and read every result on the same test set.

  • Build Mini Clef from scratch: a Qwen model with LoRA adapters and a decision head that scores every option, calibrated with one temperature per question type, saved, loaded back and asked a full request. Then you share your model on the Hugging Face Hub.

What you will cover

  • Hugging Face Transformers: the pipeline, model cards on the Hub, sentiment analysis, emotion labels and zero-shot classification.

  • How a transformer works: tokenizers, embeddings, self-attention with query, key and value, softmax, the causal mask, attention heads, the MLP, logits, text generation and the cross-entropy loss.

  • Encoders: ModernBERT, masked language modeling, contextual embeddings, one vector for a whole text, and a new classification head.

  • Decision models: the System One request, decision models on Ollama, chat templates, reading answers from option letters, expected calibration error and temperature scaling.

  • Fine-tuning: custom datasets with load_dataset, train, calibration and test splits, forgetting, and how many examples fine-tuning needs.

  • Training: the Trainer and TrainingArguments, datasets and evaluate, frozen and trainable weights, memory per parameter, learning rate, overfitting and early stopping.

  • Parameter-efficient fine-tuning: LoraConfig, get_peft_model, rank and alpha, saving and merging adapters, 4-bit quantization with BitsAndBytesConfig, and QLoRA.

  • Your own models: Mini Laya and Mini Clef assembled from pretrained parts, calibrated, saved as safetensors and shared on the Hugging Face Hub.

By the end, you will be able to take a labeled set of texts, pick a pretrained transformer, fine-tune it with the Trainer or with LoRA and QLoRA, check whether its confidence can be trusted, and share the model.

A little Python is enough, and no PyTorch or Hugging Face experience is needed: every new call is taken apart the first time it appears. A free Google Colab or Kaggle GPU runs every notebook.

Who this course is for:

  • Python developers who have used an LLM or a decision model through an API and now want to fine-tune a model of their own
  • Learners who finished Jev AI and Laya Fundamentals and want to see how Laya works inside and how to build a model like it
  • Data scientists and machine learning engineers who want text classification with BERT-style encoders and small LLMs, with confidence they can check
  • Developers who want hands-on LoRA, QLoRA and PEFT with the Hugging Face Trainer on a free GPU
  • Anyone who wants to understand transformers, attention and the next-token loss by seeing them run on real data
  • Not for you if you want to pretrain a large model from nothing or build a chatbot: this course fine-tunes pretrained models that decide