Information
| Unit | INSTITUTE OF NATURAL AND APPLIED SCIENCES |
| ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING (MASTER) (WITH THESIS) (ENGLISH) | |
| Code | AIE513 |
| Name | Generative AI and Large Language Models |
| Term | 2026-2027 Academic Year |
| Term | Fall and Spring |
| Duration (T+A) | 3-0 (T-A) (17 Week) |
| ECTS | 6 ECTS |
| National Credit | 3 National Credit |
| Teaching Language | İngilizce |
| Level | Lisansüstü Dersi |
| Type | Normal |
| Mode of study | Yüz Yüze Öğretim |
| Catalog Information Coordinator | Dr. Öğr. Üyesi EMRE KILINÇ |
| Course Instructor |
The current term course schedule has not been prepared yet.
|
Course Goal / Objective
The aim of this course is to provide students with the probabilistic foundations of deep generative models and with current methods for developing, adapting and using large language models (LLMs). The course ranges from variational autoencoders, generative adversarial networks, normalising flows and diffusion models to autoregressive language models, pre-training and scaling laws, alignment, parameter-efficient fine-tuning, retrieval-augmented generation and agent systems. Students are expected to be able to evaluate generative models critically and to develop trustworthy generative AI applications.
Course Content
Introduction to generative modelling: probability density estimation, explicit and implicit models; variational autoencoders and the evidence lower bound (ELBO); generative adversarial networks and training stability; normalising flows and autoregressive density models; diffusion and score-based models, conditional generation and latent diffusion; evaluation of generative models; autoregressive language models and Transformer decoders; pre-training of large language models, data curation and scaling laws; instruction tuning, reinforcement learning from human feedback (RLHF) and direct preference optimisation (DPO); parameter-efficient fine-tuning (LoRA, QLoRA); prompt engineering and in-context learning; retrieval-augmented generation (RAG); agents and tool use; multimodal models; evaluation of large language models; hallucination, safety, copyright and responsible use; term project presentations.
Course Precondition
None. Knowledge of deep learning (see AIE505), probability theory and Python/PyTorch programming is recommended; prior completion of AIE508 is beneficial.
Resources
The course is delivered through weekly practicals and a term project; students either develop a generative model or adapt an open-weight large language model to their own domain (fine-tuning, RAG or an agent-based system), and report and present their results with a systematic evaluation. Software used: Python, PyTorch, the Hugging Face Transformers, Diffusers, PEFT and TRL libraries, open-weight language models, vector search libraries such as FAISS, and orchestration frameworks such as LangChain/LlamaIndex. Supplementary materials: the free online version of Prince (2023) and the open course materials of Stanford CS236 (Deep Generative Models) and CS336 (Language Modeling from Scratch); key papers: Kingma and Welling (2014), Goodfellow et al. (2014), Ho et al. (2020), Vaswani et al. (2017), Kaplan et al. (2020), Hoffmann et al. (2022), Ouyang et al. (2022), Rafailov et al. (2023), Hu et al. (2022), Lewis et al. (2020). Any use of generative AI tools in assignments and projects must be explicitly declared. The theoretical foundations of reinforcement learning are covered in AIE510, explainability methods in AIE512, and AI ethics, copyright and governance in AIE520.
Notes
Course Learning Outcomes
| Order | Course Learning Outcomes |
|---|---|
| LO01 | Explain the probabilistic foundations of explicit and implicit generative models, and compare VAEs, GANs, normalising flows and diffusion models in terms of their assumptions and trade-offs. |
| LO02 | Design and train a variational autoencoder, a generative adversarial network and a diffusion model in PyTorch. |
| LO03 | Implement the components of a Transformer-based autoregressive language model (subword tokens, causal attention, decoding strategies), and interpret the compute and data requirements of pre-training and scaling laws. |
| LO04 | Adapt a large language model to a specific task or domain using instruction tuning, preference optimisation (RLHF, DPO) and parameter-efficient methods such as LoRA. |
| LO05 | Design and develop large language model applications involving prompt engineering, retrieval-augmented generation and tool-using agents. |
| LO06 | Evaluate generative models with appropriate metrics (log-likelihood, perplexity, FID, task-based benchmarks, human and model-based evaluation) and interpret the results critically. |
| LO07 | Analyse the risks of hallucination, bias, security vulnerabilities and copyright infringement in generative AI systems, and propose measures to mitigate them. |
Relation with Program Learning Outcome
| Order | Type | Program Learning Outcomes | Level |
|---|---|---|---|
| PLO01 | Bilgi - Kuramsal, Olgusal | Building on undergraduate-level qualifications, has advanced theoretical knowledge of linear algebra, multivariable calculus, probability, statistics, optimisation and information theory required for original work in artificial intelligence and machine learning. | 3 |
| PLO02 | Bilgi - Kuramsal, Olgusal | Has an in-depth understanding of current methods in the main sub-fields of artificial intelligence, notably machine learning, deep learning, reinforcement learning, computer vision, natural language processing and generative models, together with their assumptions and limitations. | 5 |
| PLO03 | Beceriler - Bilişsel, Uygulamalı | Formulates real-world problems as appropriate artificial intelligence/machine learning problems, and designs and implements solutions covering data preparation, model selection, training and evaluation. | 4 |
| PLO04 | Beceriler - Bilişsel, Uygulamalı | Develops efficient, scalable and reproducible software and models using Python and current libraries and frameworks, and makes effective use of big data and high-performance computing resources. | |
| PLO05 | Beceriler - Bilişsel, Uygulamalı | Evaluates methods with appropriate performance metrics, statistical tests and comparative experiments, interprets results critically and designs reproducible experimental protocols. | |
| PLO06 | Yetkinlikler - Öğrenme Yetkinliği | Reviews the national and international literature of the field systematically and critically, independently learns new and emerging methods, and adapts them to their own research problem. | |
| PLO07 | Yetkinlikler - Bağımsız Çalışabilme ve Sorumluluk Alabilme Yetkinliği | Defines a research problem in the field, solves it independently by developing an original method or model, and conducts a thesis study that contributes to scientific knowledge. | |
| PLO08 | Yetkinlikler - Bağımsız Çalışabilme ve Sorumluluk Alabilme Yetkinliği | Takes responsibility and leadership in interdisciplinary teams working on complex problems in application domains such as health, energy, agriculture, industry, finance and logistics, and develops solutions together with domain experts. | |
| PLO09 | Yetkinlikler - İletişim ve Sosyal Yetkinlik | Communicates the processes and results of their work clearly and systematically in English, in written (paper, thesis, report) and oral form, in national and international settings. | 3 |
| PLO10 | Yetkinlikler - Alana Özgü Yetkinlik | Observes scientific and professional ethics, data privacy, fairness, transparency and safety principles and the relevant legal regulations in developing and using AI systems, and assesses their societal impact | 3 |
| PLO11 | Yetkinlikler - Alana Özgü Yetkinlik | Deploys trustworthy, explainable and sustainable AI solutions to real environments such as the cloud, edge devices and industrial systems, taking into account resource constraints such as energy, memory and latency. |
Week Plan
| Week | Topic | Preparation | Methods |
|---|---|---|---|
| 1 | Introduction to generative modelling: discriminative versus generative models, probability density estimation, maximum likelihood, explicit and implicit models; overview of generative model families | Read Foster (2023), Chapter 1 and the introductory chapter of Tomczak (2024) | Öğretim Yöntemleri: Anlatım, Tartışma, Soru-Cevap |
| 2 | Generative adversarial networks (GANs): the generator-discriminator game, mode collapse and training instability, Wasserstein GAN, conditional GANs and the StyleGAN family | Read Prince (2023), Chapter 15 and Goodfellow et al. (2014) | Öğretim Yöntemleri: Anlatım, Gösteri, Alıştırma ve Uygulama |
| 3 | Generative adversarial networks (GANs): the generator-discriminator game, mode collapse and training instability, Wasserstein GAN, conditional GANs and the StyleGAN family | Read Prince (2023), Chapter 15 and Goodfellow et al. (2014) | Öğretim Yöntemleri: Anlatım, Gösteri, Alıştırma ve Uygulama |
| 4 | Normalising flows and autoregressive density models: the change-of-variables formula, coupling layers (RealNVP, Glow), masked autoregressive flows, PixelCNN | Read Prince (2023), Chapter 16 and the relevant chapters of Tomczak (2024) | Öğretim Yöntemleri: Anlatım, Problem Çözme, Alıştırma ve Uygulama |
| 5 | Diffusion and score-based models: forward noising and reverse denoising processes, DDPM, score matching, fast sampling with DDIM, classifier-free guidance | Read Prince (2023), Chapter 18 and Ho et al. (2020) | Öğretim Yöntemleri: Anlatım, Gösteri, Alıştırma ve Uygulama |
| 6 | Conditional and latent diffusion: text-to-image generation, latent diffusion (Stable Diffusion), text-image alignment with CLIP; evaluating generative models (FID, Inception Score, precision-recall) | Read Foster (2023), Chapters 8 and 13, and Rombach et al. (2022) and Radford et al. (2021) | Öğretim Yöntemleri: Anlatım, Gösteri, Tartışma |
| 7 | Autoregressive language models: the Transformer decoder, causal attention, subword tokens, decoding strategies (temperature, top-k, nucleus sampling), training a small GPT model from scratch; review before the mid-term exam | Read Raschka (2024), Chapters 2–4; revise the topics of Weeks 1–6 | Öğretim Yöntemleri: Anlatım, Alıştırma ve Uygulama, Soru-Cevap |
| 8 | Mid-Term Exam | exam preparation | Ölçme Yöntemleri: Yazılı Sınav |
| 9 | Pre-training of large language models: data collection and filtering, distributed training, scaling laws and compute-optimal training, mixture-of-experts (MoE) and long-context architectures | Read Raschka (2024), Chapter 5 and Kaplan et al. (2020) and Hoffmann et al. (2022) | Öğretim Yöntemleri: Anlatım, Tartışma |
| 10 | Instruction tuning and alignment: supervised fine-tuning, reward modelling, reinforcement learning from human feedback (RLHF, PPO), direct preference optimisation (DPO), reinforcement learning from AI feedback (RLAIF) | Read Raschka (2024), Chapter 7 and Ouyang et al. (2022) and Rafailov et al. (2023) | Öğretim Yöntemleri: Anlatım, Tartışma, Alıştırma ve Uygulama |
| 11 | Parameter-efficient fine-tuning: adapters, LoRA and QLoRA, training with low-bit quantisation, domain adaptation; hands-on practice with the Hugging Face PEFT and TRL libraries | Read Alammar and Grootendorst (2024), Chapter 12 and Hu et al. (2022) on LoRA; prepare the term project proposal | Öğretim Yöntemleri: Anlatım, Proje Temelli Öğrenme , Alıştırma ve Uygulama |
| 12 | Prompt engineering and in-context learning: zero- and few-shot prompting, chain-of-thought, structured output generation, prompt security and prompt injection attacks | Read Alammar and Grootendorst (2024), Chapter 6 and Wei et al. (2022) on chain-of-thought prompting | Öğretim Yöntemleri: Anlatım, Gösteri, Alıştırma ve Uygulama |
| 13 | Retrieval-augmented generation (RAG) and agents: text embeddings and vector search, chunking and re-ranking, evaluating RAG pipelines (faithfulness, context relevance); tool use, function calling and ReAct | Read Alammar and Grootendorst (2024), Chapters 7–8, and Lewis et al. (2020) and Yao et al. (2023) | Öğretim Yöntemleri: Anlatım, Gösteri, Alıştırma ve Uygulama |
| 14 | Multimodal models, evaluation and safety: vision-language models, evaluating large language models with benchmark datasets and model-based judges (LLM-as-a-judge), hallucination, bias, jailbreak attacks, watermarking and copyright issues | Read Alammar and Grootendorst (2024), Chapter 9 and Prince (2023), Chapter 21 | Öğretim Yöntemleri: Anlatım, Tartışma, Örnek Olay |
| 15 | Term project presentations and course review: open research problems and current trends in generative AI | Prepare the project report and presentation | Öğretim Yöntemleri: Proje Temelli Öğrenme , Tartışma |
| 16 | Term Exams | exam preparation | Ölçme Yöntemleri: Proje / Tasarım |
| 17 | Term Exams | exam preparation | Ölçme Yöntemleri: Proje / Tasarım |
Student Workload - ECTS
| Works | Number | Time (Hour) | Workload (Hour) |
|---|---|---|---|
| Course Related Works | |||
| Class Time (Exam weeks are excluded) | 14 | 3 | 42 |
| Out of Class Study (Preliminary Work, Practice) | 14 | 4 | 56 |
| Assesment Related Works | |||
| Homeworks, Projects, Others | 0 | 0 | 0 |
| Mid-term Exams (Written, Oral, etc.) | 1 | 18 | 18 |
| Final Exam | 1 | 24 | 24 |
| Total Workload (Hour) | 140 | ||
| Total Workload / 25 (h) | 5,60 | ||
| ECTS | 6 ECTS | ||