icon icon

Fine-tuning and Training LLM Models – Practical Fine-Tuning of Large Language Models

icon

Training process

Training needs analysis

If you have specific requirements regarding the training programme, we will carry out a training needs analysis for you. This will guide us on which aspects of the programme should receive greater emphasis, so that the training programme meets your specific needs.

What will you gain?

icon

Choose the right approach - You will learn when fine-tuning makes sense and when prompting or RAG is the better option, so you can avoid expensive experiments that add complexity without real business value.

icon

Understand how LLMs work - You will clarify concepts such as tokenization, embeddings, attention, and context windows, making it easier to judge model limits and explain their behavior in practical use cases.

icon

Set up your workspace - You will configure the core tools used with LLMs, including Python, PyTorch, and Hugging Face libraries, so you can run and test models on local machines or in the cloud.

icon

Pick a solid base model - You will learn how to match a model to the target language, task, license, and hardware budget, giving you a realistic and efficient starting point for further tuning work.

icon

Build training-ready data - You will learn how to design and clean a dataset, remove duplicates, split data properly, and format instruction-response pairs so the model can learn from consistent examples.

icon

Fine-tune with limited resources - You will master LoRA, QLoRA, quantization, and training setup for constrained GPUs, allowing you to adapt large models without relying on large-scale infrastructure.

icon

Evaluate models properly - You will learn how to compare base and tuned models, prepare test sets, detect quality regressions, and check instruction following as well as the risk of hallucinations.

icon

Deploy your tuned model - You will learn how to save adapters and checkpoints, expose a model through an API, run an inference server, and monitor the solution once it is deployed in practice.

Training programme

1. Introduction to training and fine-tuning LLM models

  • what is the difference between training a model and fine-tuning it,
  • pre-training, fine-tuning, instruction tuning i alignment,
  • when it is worth fine-tuning a model, and when to use prompting or RAG,
  • closed models i open-source models,
  • overview of popular families of models LLM.

2. Architecture and operation of large language models

  • Transformer architecture,
  • tokenization and text representation,
  • embeddings,
  • attention mechanism,
  • context and context window length,
  • model parameters and their impact on hardware requirements.

3. Preparing the environment for working with LLM

  • Python and libraries used when working with models,
  • Hugging Face Transformers,
  • Hugging Face Datasets,
  • PyTorch,
  • working with GPU,
  • use of local and cloud environments.

4. Selection of the base model

  • selection of the model for a specific application,
  • model size and hardware requirements,
  • instruct and base models,
  • multilingual models,
  • licenses and limitations of the use of models,
  • downloading and running models from Hugging Face.

5. Preparation of training data

  • dataset design,
  • data formatting answer–response instruction,
  • data cleaning,
  • removal of duplicates and erroneous records,
  • preparation of domain data,
  • division into training, validation and test sets,
  • dataset tokenization.

6. LLM model fine-tuning

  • configuration of the training process,
  • selection of learning rate,
  • batch size,
  • number of epochs,
  • gradient accumulation,
  • checkpoints,
  • monitoring of the training process,
  • launching your own fine-tuning process.

7. Parameter-Efficient Fine-Tuning

  • limitations of full fine-tuning,
  • PEFT,
  • LoRA,
  • QLoRA,
  • selection of LoRA parameters,
  • adapters,
  • training a model with limited GPU resources.

8. Model quantization

  • basics of quantization,
  • FP16, BF16, INT8 and INT4,
  • the impact of quantization on memory and performance speed,
  • quantization-aware fine-tuning,
  • preparing the model to work on smaller infrastructure.

9. Instruction tuning and fine-tuning the model for specific tasks

  • creating instructional data,
  • fine-tuning the model for classification,
  • fine-tuning for text generation,
  • fine-tuning for information extraction,
  • fine-tuning for working with documents,
  • fine-tuning the model to the organization's language and terminology.

10. Evaluation of the fine-tuned model

  • comparison of the base model and the fine-tuned one,
  • preparation of the test set,
  • automatic metrics,
  • evaluation of response quality,
  • testing compliance with instructions,
  • detection of quality regression,
  • assessment of hallucinations.

11. Optimization of the fine-tuning process

  • identifying overfitting,
  • selection of hyperparameters,
  • experimenting with the dataset,
  • analysis of model errors,
  • improving the quality of training data,
  • iterative improvement of the model.

12. Fine-tuning a RAG

  • differences between fine-tuning and and RAG,
  • when to use RAG,
  • when to use fine-tuning,
  • combining fine-tuning with RAG,
  • domain models working on the organization's knowledge.

13. Data security and quality

  • sensitive data in training datasets,
  • data anonymization,
  • the risk of data being memorized by the model,
  • protection of confidential information,
  • copyrights to training data,
  • security of models open-source.

14. Saving and versioning models

  • saving checkpoints,
  • LoRA adapters,
  • merging the adapter with the model,
  • versioning models,
  • versioning datasets,
  • documenting experiments.

15. Deployment of the fine-tuned model

  • preparation of the model for inference,
  • running the model locally,
  • making the model available via API,
  • inference server,
  • containerization,
  • basics of deploying the model in a production environment,
  • monitoring the operation of the model.

16. Cost and performance optimization

  • GPU requirements for various models,
  • memory usage optimization,
  • batch anference,
  • selection of model size for the application,
  • training costs and inference,
  • local models versus cloud services.

17. Practical workshop – your own LLM model

  • selection of the base model,
  • preparation of your own dataset,
  • configuration of LoRA or QLoRA,
  • carrying out fine-tuning,
  • evaluation of results,
  • comparison of the model before and after tuning,
  • saving and launching your own version of the model.

18. Good practices for working with LLM models

  • when it is not worth training your own model,
  • experiment management,
  • documenting changes,
  • quality control,
  • maintaining and updating models,
  • further development of the model after deployment.

What are the prerequisites for participating in the training?

icon

Python basics - You should be comfortable reading and editing simple Python code, running scripts, and working with libraries so you can complete the hands-on exercises on your own.

icon

Machine learning basics - You should understand core machine learning concepts such as models, training, validation, overfitting, and hyperparameters to follow the LLM tuning workflow smoothly.

icon

Text data experience - You should have some experience preparing or analyzing text data, because the training includes working with datasets, record formatting, and assessing data quality.

icon

Terminal and environment skills - You should know how to use a terminal, install packages, and run a development environment so you can configure tools and work with models and GPUs without friction.