Generative Artificial Intelligence
Academic Year 2026/2027 - Teacher: FRANCESCO RUNDOExpected Learning Outcomes
Knowledge and understanding.
Students will first acquire the formal mathematical framework of generative modelling. Generative modelling is understood as the estimation of a probability distribution that approximates the data distribution by minimising divergences or distances between distributions. To this end, the course covers:
- linear algebra and multivariate calculus;
- probability theory, Bayesian and variational inference;
- information theory and optimal transport;
- stochastic processes and stochastic differential equations;
- elements of Riemannian and hyperbolic geometry;
- elements of quantum computing.
Building on these foundations, students will acquire:
- the fundamentals of Deep Learning and Reinforcement Learning;
- Deep Learning on non-Euclidean spaces and the fundamentals of Quantum AI;
- the main families of generative models: VAEs, GANs, Normalizing Flows, autoregressive, energy-based and score-based models, Diffusion Models, Flow Matching;
- modern generative systems: LLMs and reasoning models, multimodal models, RAG, agentic systems, Recursive Self-Improvement;
- evaluation metrics and the regulatory framework in the industrial, medical and financial sectors.
Applying knowledge and understanding.
Students will be able to formally derive the objective functions of the main generative models. They will be able to design, train and evaluate generative models in Python/PyTorch for images, time series, tabular data, graphs and text. In particular, students will be able to:
- generate synthetic data;
- apply generative models to anomaly detection, predictive maintenance, medical imaging and financial scenario generation;
- adapt open-weight LLMs to specific domains (RAG, parameter-efficient fine-tuning, reinforcement-learning-based alignment, quantization);
- experiment with quantum generative models on simulators.
Making judgements.
Select the most appropriate model given the data type, the geometry of the representation space and the computational constraints. Critically assess sample quality and the fidelity, utility and privacy of synthetic data. Identify hallucinations, bias and memorization risks. Analyse the ethical, legal and safety implications of generative systems in high-risk domains.
Communication skills.
Produce rigorous notebooks and technical reports, including model cards and documentation of limitations and risks. Present experimental results and formal derivations to both technical and non-technical audiences.
Learning skills.
Consult scientific papers and technical reports, critically assess benchmarks, keep up to date autonomously with emerging architectures, and transfer the acquired skills to new application domains.
Course Structure
Lectures are delivered in the classroom with the aid of slides, which are made available to students. The slides do not replace the reference textbooks, but facilitate understanding of the lectures and provide a detailed account of the syllabus covered. Theoretical lectures are complemented by laboratory sessions in Python (PyTorch, Hugging Face, quantum simulators) on industrial, medical and financial case studies. Supplementary scientific papers will be indicated during the course.
Should teaching be delivered in blended or remote mode following specific instructions from the University bodies, the necessary changes to the above may be introduced in order to comply with the syllabus reported here.
Required Prerequisites
Attendance of Lessons
Detailed Course Content
1. Introduction to Generative AI and formalization of the generative problem
- Discriminative versus generative models: differences in objectives and use.
- The generative problem as approximation of the data distribution through divergence minimization.
- Taxonomy of models: explicit, approximate and implicit likelihood.
- The trade-off between sample quality, diversity and sampling speed.
- Historical evolution up to foundation models; overview of applications in the industrial, medical and financial domains.
2. Mathematical foundations of generative modelling
- Linear algebra and calculus: spectral decomposition and SVD, Jacobian and change of variables in density transformations.
- Probability and inference: multivariate Gaussian, MLE and MAP estimation, latent variables, EM algorithm, variational inference, Monte Carlo gradient estimators.
- Information theory: entropy, Kullback-Leibler and Jensen-Shannon divergences as measures of discrepancy between distributions.
- Optimal transport: Wasserstein distance and its properties for comparing distributions.
- Stochastic processes: Markov chains, Brownian motion, stochastic differential equations, Fokker-Planck equation, Langevin dynamics.
- Differential geometry: Riemannian manifolds, geodesics, hyperbolic space.
- Quantum computing: Hilbert spaces, qubits, entanglement, quantum circuits and measurement.
3. Deep Learning, Reinforcement Learning, non-Euclidean spaces and Quantum AI
- Deep Learning: backpropagation, optimizers, regularization; CNNs, U-Net, RNNs/LSTMs; Attention and Transformer architectures.
- Reinforcement Learning: Markov decision processes, policies and value functions, policy gradient, actor-critic methods, PPO.
- Reward models and the role of RL in the training and alignment of generative models.
- Geometric Deep Learning: invariance and equivariance, Graph Neural Networks.
- Hyperbolic neural networks for hierarchical data representation and learning on manifolds.
- Quantum AI: quantum data encoding, variational quantum circuits, quantum kernels.
- Quantum generative models (Quantum Circuit Born Machines, Quantum GANs) and limitations of the NISQ era.
4. Autoencoders and Variational Autoencoders (VAEs)
- Deterministic and denoising autoencoders for learning compressed representations.
- VAEs: derivation of the ELBO and the reparameterization gradient estimator.
- Variants: beta-VAE and disentanglement, conditional and hierarchical VAEs, VQ-VAE with discrete latent space.
- Advanced topics: autoencoders as latent tokenizers for image and video generation; sparse autoencoders for LLM interpretability; hyperbolic VAEs.
- Applications
5. Generative Adversarial Networks (GANs)
- Adversarial formulation between generator and discriminator and its interpretation as divergence minimization.
- Training instability and mode collapse; stabilization via WGAN.
- Architectures: DCGAN, conditional GANs, Pix2Pix and CycleGAN for domain translation, StyleGAN.
- GANs for time series (TimeGAN) and tabular data (CTGAN).
- Advanced topics: adversarial losses in visual tokenizers; adversarial distillation of diffusion models.
- Applications
6. Normalizing Flows, autoregressive and energy-based models
- Normalizing Flows: invertible transformations with exact likelihood (RealNVP, Glow).
- Continuous flows and Neural ODEs.
- Autoregressive models: sequential factorization of the distribution for images, audio and sequences.
- Energy-based models and score matching as estimation of the gradient of the log-density.
- Advanced topics: multi-scale visual autoregressive generation; State Space Models and hybrid architectures for long sequences.
- Applications
7. Diffusion Models and Flow Matching
- Forward noising process and reverse denoising process (DDPM).
- Connection with score matching and continuous-time formulation via stochastic and deterministic differential equations.
- Accelerated sampling (DDIM), classifier-free guidance for conditional generation, Latent Diffusion Models.
- Flow Matching and rectified flow as the reference paradigm of current generators.
- Advanced topics:
- Diffusion Transformers; consistency models for few-step generation;
- discrete diffusion and diffusion language models;
- RL-based optimization; video generation and world models; Flow Matching on manifolds.
- Applications: MRI and CT reconstruction, synthetic data for quality control, financial scenario generation.
8. Large Language Models and Foundation Models
- Tokenization, autoregressive pre-training and scaling laws.
- Supervised and parameter-efficient fine-tuning (LoRA, QLoRA).
- Alignment with human preferences via RLHF and DPO.
- In-context learning and Chain-of-Thought; multimodal text-image models.
- Quantization and local inference of open-weight models.
- Advanced topics:
- Mixture-of-Experts and long-context models;
- reasoning models trained with RL from verifiable rewards (GRPO) and inference-time compute scaling;
- distillation into small language models; speculative decoding.
9. Modern generative systems: RAG, agents, evaluation and governance
- Retrieval-Augmented Generation: vector databases, retrieval and reranking to ground responses in documentary sources.
- Agentic systems and tool use; multi-agent systems and the Model Context Protocol.
- Evaluation: metrics for images and text, LLM-as-a-judge, hallucination measurement.
- Synthetic data and privacy; bias, explainability, watermarking and deepfake detection.
- Safety and security: prompt injection, red teaming, mechanistic interpretability.
- Regulatory framework: EU AI Act, GDPR, Medical Device Regulation.
- Recursive Self-Improvement (introduction):
- self-play, self-rewarding and self-generated training data;
- models contributing to the improvement of their successors;
- risk of model collapse, safety and control implications.
10. Sector applications and case studies
- Industrial
- Medical
- Financial
- Advanced topics: foundation models for time series and tabular data.
- Guided mini-projects across the three application sectors.
Textbook Information
Course Planning
| Subjects | Text References | |
|---|---|---|
| 1 | Introduction to Generative AI and formalization of the generative problem | 1-4 |
| 2 | Mathematical foundations of generative modelling | 1-3 |
| 3 | Deep Learning, Reinforcement Learning, non-Euclidean spaces and Quantum AI | 1-3 |
| 4 | Autoencoders and Variational Autoencoders (VAEs) | 1,2,4 |
| 5 | Generative Adversarial Networks (GANs) | 1,2,4 |
| 6 | Normalizing Flows, autoregressive and energy-based models | 1,3,4 |
| 7 | Diffusion Models and Flow Matching | 1-4 |
| 8 | Large Language Models and Foundation Models | 1-4 |
| 9 | Modern generative systems: RAG, agents, evaluation and governance | 1,2,4 |
| 10 | Sector applications and case studies | 1 |
Learning Assessment
Learning Assessment Procedures
Learning Assessment Procedures
The final examination consists of:
- A written test;
- A project developed in Python, agreed upon with the lecturer.
The written test consists of three open-ended questions on the theoretical and methodological aspects of the course, including the formal derivations of generative models. Registration for the written test is mandatory.
The project consists of the design, implementation and evaluation of a generative system for an application case agreed upon with the lecturer, preferably in the industrial, medical or financial domain. It is accompanied by a technical report and an oral discussion of the results.
Notes:
- The use of any hardware device (programmable/scientific calculators, tablets, smartphones, smartwatches, mobile phones, Bluetooth earphones, etc.), books or personal documents during the written test is forbidden. Any necessary documentation will be provided by the examination board.
- During written tests, backpacks, bags and other containers must be left at a suitable distance. Students are advised not to bring valuables: the examination board will not take custody of any items and cannot be held responsible for any loss.
- Registration on the SmartEdu portal is required to take the examination. For technical problems related to registration, please contact the Teaching Office (Segreteria didattica).
- Late registrations by email are not accepted. Without registration, the examination can be neither taken nor recorded.
- Students with disabilities and/or specific learning disorders (SLD) must contact the examination board and the DMI CInAP representative well in advance of the examination date to request the appropriate compensatory measures. Such measures must be certified by CInAP.
Mid-term tests: Not scheduled.
Should it be necessary, following specific instructions from the University bodies, the assessment may be carried out remotely, with the necessary changes to the above.
The assessment aims at an overall evaluation of the student's preparation. The final grade is the average of the project grade and the written test grade, according to the following scheme:
- Fail: the student has not acquired the basic concepts, is unable to answer adequately at least 60% of the questions, and has not adequately prepared the assigned project.
- 18-20: barely sufficient command of the basic concepts; the project is set up with great difficulty and several errors.
- 21-24: minimal command of the basic concepts and modest ability to connect the contents; the student can set up simple projects.
- 25-27: good command of the contents, good ability to connect them and good technical-practical skills.
- 28-30 cum laude: full command of all course contents, ability to connect them critically, and a complete, rigorous and original project.