This repo has the coding examples for the language modeling course. The course is divided into 4 modules where we learn how to build:
- Auto-correct: how language models work
- Auto-complete: how large language models work
- Text summarizer: how to adapt a pre-trained model to a specific task
- Document question-answering: how to augment the memory of a language model
Note that while building these 4 tools, we learn the theory of how language models work and are trained. We start by training a small transformer model (auto-correct lesson) and then move to large language models APIs (from OpenAI) for the subsequent lessons for more advanced tasks. At late stages of the course (lesson 4 and 5), we work mostly with prompt engineering and how to combine language models with other tools. We recommend doing the lessons in sequence, since each lesson uses concepts of previous ones.
Table of contents:
- Introduction
- Requirements
- How language models work
- What will we build?
- Auto-correct
- Auto-complete
- Text summarizer
- Document question-answering
- Chatbot (TODO)
- Parsing unstructured data (TODO)
- Building a bot that can use tools: local or remote APIs (TODO)
- Auto-correct: how language models work
- Language modeling intro
- Tokenizers
- Completion
- Auto-correct
- Model training
- End-to-end code example
- Auto-complete: how large language models work
- Sub-words vocabulary
- Transformers
- Training large language models
- GPT and other pre-trained models
- Auto-complete
- Classification
- Text summarizer: how to adapt a pre-trained model to a specific task
- Few shot prompt
- Classification
- Summarization
- Prompt evaluation with hypothesis testing
- Fine-tuning
- Reinforcement learning with human feedback intro (TODO)
- Document question-answering: how to augment the memory of a language model
- In-memory question answering
- Summarization question answering
- Similarity search
- Embedding question answering
- LM chains and Langchain