Course: Large Language Models and Generative AI
This Fall I have co-taught a new course on LLMs and Generative AI at the University of Helsinki. It was the first course in its kind, with quite a large group of students.
Understanding LLMs from the ground up is essential, especially as they dominate discussions in tech today. Beyond the allure of impressive demos, diving deeper into how they work can satisfy your curiosity, prepare you for job interviews, and help you stay ahead in this rapidly changing field.
And to achieve this, you need to start with basics.
Lectures
In this course we, Aarne Talman, Jussi Karlgren and me, focused on the foundation and applications:
- Week 1: introduction to LLMs, encoder-only, decoder-only, role of tokenizers, Transformer architecture
- Week 2: how to use LLMs, how to prompt them, and what is in-context learning (one well-known instance of which is RAG — see Week 5)
- Week 3: how to evaluate LLMs along various dimensions, like veracity, consistency, topical competence, common sense, creativity and so on
- Week 4: how to fine-tune LLMs, using various methods: supervised fine-tuning (SFT), instruction tuning, reinforcement learning for human feedback (RLHF), direct preference optimization (DPO), parameter-efficient fine-tuning (PEFT)
- Week-5: Retrieval Augmented Generation(RAG) — how to improve LLM’s output in a specific domain, for a specific topic, by giving it access to a dynamically changing information. We build a RAG application from first principles (without using any RAG framework) and use it to chat to PDFs. 📺 Recording
- Week 6: what are the use cases and applications of LLMs: from summarization and sentiment detection to talking to your car, employing (baby) AGI, and learning to ask complex math questions to tables inside documents. 📺 Recording
- Week 7: recap lecture, where each of us presented a summary of their lectures. 📺 Recording
Labs
In addition to studying the slides linked above, you can work on the lab assignments, that each lecture from Week 1 to Week 6 provides (see GitHub repository). You will learn, how to load an LLM and interact with it programmatically with a prompt, how to fine-tune and evaluate an LLM, how to build and optimize a RAG application for chatting with your PDF documents, how to query tabular data using natural language questions and how generate synthetic data with LLMs. On top of these, there is code for working with popular platforms like Hugging Face (for uploading your models) and Weights & Biases (for monitoring).
I hope this course will be useful for you and will unveil LLMs in their true light, while giving you practical tools for putting LLMs under your belt.