Welcome! This repository contains course materials for the Dartmouth undergraduate course on large language models and chatbots (conversational agents). The syllabus may be found here. Feel free to follow along with the course materials (whether you are officially enrolled in the course or just visiting!), submit comments and suggestions, etc. An outline of the course materials, including links to lecture and discussion videos and assignments may be found here.
Learn by doing with our collection of 15 interactive web demonstrations that bring NLP concepts to life! Each demo runs entirely in your browser with no installation required.
🌐 Explore all demos: https://contextlab.github.io/llm-course/demos/
- ELIZA Chatbot - Chat with the groundbreaking 1966 pattern-matching therapist and experience the ELIZA effect firsthand
- Embeddings Visualization - Explore word embeddings in interactive 3D space, rotate and zoom to discover semantic relationships
- Transformer Explorer - Step through the transformer architecture layer by layer with real-time visualizations of attention, feedforward networks, and residual connections
- Tokenization Explorer - Compare BPE, WordPiece, and SentencePiece algorithms side-by-side
- Attention Mechanism - Watch attention weights update in real-time as you modify input sequences
Our complete collection covers: ELIZA, tokenization, embeddings, attention mechanisms, transformer architecture, GPT playground, RAG systems, topic modeling, sentiment analysis, POS tagging, word analogies, semantic search, BERT masked language modeling, embeddings comparison, and chatbot evolution. Browse the demo collection to explore them all!
For developers contributing to this repository, we have a comprehensive test suite covering all 15 demos:
# Install dependencies
npm install
# Run all tests
npm test
# Run specific demo tests
npm run test:demo01 # ELIZA
npm run test:demo02 # Tokenization
# ... etc for demos 01-15The test suite includes 1,500+ tests covering unit tests, integration tests, and regression tests to ensure all demos function correctly. CI/CD runs automatically on all pull requests.
This course is taught as an Open Course, meaning that the course is designed from the ground up to be shareable and freely accessible to anyone. All code for this course is written in Python and most of the material is organized in Jupyter notebooks.
Feel free to follow along with this course, do the assignments, post questions and/or issues to this repository or Discord, suggest changes, etc. However, I won't formally evaluate your submitted work unless you are a Dartmouth student who is currently enrolled.
If you are a course instructor teaching overlapping material, feel free to borrow any materials used in this course! If you directly copy (or "draw heavy inspiration from") the materials, I would appreciate a citation (e.g., a pointer to this repository). I'd also love to hear from you about how you're using this resource!
This course is a continually evolving work in progress. I plan to update the material to keep the syllabus fresh and relevant. By the same token, although my goal is 100% accuracy and currency, it's unlikely that I'll achieve that goal. You should participate with the understanding that this material will likely have occasional mistakes, ommissions, errors, etc. Given this fact, one way to approach the course is to maintain an open yet critical view of the material. If you think there's a mistake, I encourage you to bring it to my attention!
We will use the following tools in this course:
- GitHub: used to download code and data, collaborate with other students, and submit course assignments
- Google Colaboratory: a Google resource we will use to write code, download data, and run analyses
- Discord: used to coordinate all course communication. Use this link to join our class server:
- Start by creating a free GitHub account if you don't already have one. (If you already have an account, you may use it for this course.)
- Next, sign into the course's Discord workspace. You can ask questions and get help with all aspects of the course via our Discord community. You'll need to create a (free) Discord account.
- If you don't already have one, create a Google account. (If you already have an account, you may use it for this course.) Make sure you can sign into Colaboratory using this link.
