Domain-Specific SLMs is a practical self-study course for C++ and HPC engineers who want to understand how small language models work by building one from the ground up.
Rather than starting with a deep-learning framework or a pre-built training stack, the course follows one artefact from an empty directory to a working, deployable model. The complete workflow is designed to run on CPU hardware, making the material accessible for engineers who want to study modern language-model architecture and optimisation without requiring a GPU, a cloud account, or proprietary development tools.
Scroll down to watch the full webinar and explore the seven course levels.
Prefer to open the resources directly?
📹 Watch the webinar
💻 Code and instructions — GitLab repositoryWhat you will build
The course develops a decoder-only transformer directly in C++, exposing the components that are normally hidden behind machine-learning frameworks.
Participants work with modern transformer techniques including grouped-query attention (GQA) and rotary positional embeddings (RoPE), while also implementing the training path and backward pass.
The objective is not only to obtain a working model, but to understand how the model, numerical kernels, memory layout, parallel execution, evaluation, compression, multimodal extensions, inference optimisation, and deployment fit together.
Seven practical levels
The learning path is organised into seven self-contained levels.
Level 1 — Build the transformer
Implement a decoder-only transformer from scratch, including its core mathematical operations, grouped-query attention, rotary positional embeddings, and backward pass.
Level 2 — Optimise for CPU and HPC
Improve throughput using OpenBLAS for numerical operations and OpenMP for shared-memory parallelism.
This level connects modern language-model workloads with familiar HPC optimisation techniques.
Level 3 — Build a domain-specific application
Turn the language-model work into a practical log anomaly classifier and evaluate its performance using a held-out evaluation dataset.
This demonstrates how a small model can be adapted to a clearly defined engineering task rather than used as a general-purpose chatbot.
Level 4 — Apply post-training quantisation
Reduce model size and computational requirements using post-training quantisation and examine the trade-offs between numerical precision, memory use, and model behaviour.
Level 5 — Add a vision prefix
Extend the architecture with a projected vision prefix and explore how information from another modality can be introduced into a language-model pipeline.
Level 6 — Implement speculative decoding
Explore speculative decoding as an inference optimisation technique and examine how generation throughput can be improved without changing the final decoding objective.
Level 7 — Export for deployment
Complete the workflow by exporting the resulting model to a vendor runtime and moving from an educational implementation towards a deployment-oriented environment.
CPU-first by design
A key goal of the course is to make the full model-development pipeline visible.
No GPU is required for the demonstrated workflow. The exercises avoid dependence on a deep-learning framework, cloud account, or licence key, allowing the individual components to be studied directly on a workstation.
This makes the course particularly relevant to developers coming from C++, scientific computing, systems programming, and HPC, where understanding memory movement, threading, numerical libraries, and runtime behaviour is as important as understanding the model architecture itself.
Self-contained course structure
Each level is provided as a separate folder containing its own source code, build configuration, scripts, and instructions.
The material can therefore be followed sequentially from Level 1 through Level 7, or individual levels can be explored separately by engineers who are already familiar with particular parts of the stack.
Who is this course for?
The course is intended for:
- C and C++ developers interested in language-model internals
- HPC engineers exploring AI workloads
- researchers working with specialised or domain-specific models
- systems programmers interested in CPU inference and optimisation
- machine-learning engineers who want to understand what happens below framework level
- developers exploring efficient local and on-premises AI deployment
A working knowledge of C++ and basic linear algebra is useful. Previous experience with a deep-learning framework is not required.
Webinar and learning materials
A recorded webinar accompanies the self-study material and provides an overview of the complete development path.
The public source-code repository contains the implementation, build files, scripts, and instructions required to work through the course.
From model architecture to deployment
The course connects concepts that are often studied separately: transformer architecture, training, numerical optimisation, HPC parallelism, evaluation, quantisation, multimodal inputs, inference acceleration, and runtime deployment.
The result is a practical engineering view of Domain-Specific SLMs: not simply how to call an existing model, but how to understand, build, optimise, evaluate, and deploy a compact language model from first principles.