Course Information
| Item | Details |
|---|---|
| Meeting times | MWF 10:10--11:15 |
| X-hour | Th 12:15--1:05 |
| Classroom | Moore 302 |
| Instructor | Dr. Jeremy R. Manning |
| jeremy@dartmouth.edu | |
| Office location | 349 Moore Hall |
| Office hours | By appointment |
Course Description
Recent advancements in Artificial Intelligence (AI) have led to the development of powerful large language models (LLMs) capable of generating human-like text. These models have revolutionized the way we think about language, cognition, and intelligence. This course introduces students to the various approaches used in building, studying, and using conversational agents. We will use readings, discussions, and hands-on demonstrations to explore historical approaches, current approaches, and hints about the "next generation" of these models.
We will investigate what these models can and cannot do from various cognitive, philosophical, computational, and ethical perspectives. A special focus will be on which aspects of human cognition, experiences, minds, and language these models can vs. cannot capture.
Course Goals
This course is intended to train students to:
- Explore a variety of approaches to constructing conversational agents, including string manipulation models, rules-based (decision tree) models, and transformer-based models. Students will implement and train these models, largely from scratch, to gain a deep understanding of how they work.
- Understand different classic and modern approaches to text embeddings (LSA, LDA, word2vec, USE, BERT, etc.) and dimensionality reduction (PCA, UMAP). Students will use these approaches to carry out analyses of text corpora.
- Gain a general understanding of computational linguistic text analyses including part of speech tagging, sentiment analysis, etc. Again, students will implement and apply these tools to text data.
- Explore the psychological and cognitive applications of LLMs, such as modeling thought processes, language comprehension, and social cognition
- Critically assess the abilities and limitations of conversational agents in replicating human-like reasoning and understanding
- Discuss the philosophical and ethical implications of AI, including questions around consciousness, agency, and the future of AI
- Develop and implement experiments using LLMs to explore research questions in psychology and cognitive science
Pre-Requisites
Students must have prior experience with Python programming in order to enroll in this course. Prior coursework on statistics or probability (e.g., PSYC 10, AP Stats, or similar) is also highly recommended. An online statistics course is fine as a stand-in, but I will expect you to know about hypothesis testing, probability distributions, and have some intuitions about how to design and interpret statistical analysis before you start this course. Additional prior coursework and/or experience with linguistics, linear algebra, statistics, machine learning, artificial intelligence, data science, philosophy of mind, and/or creative writing will all be useful, but are not required.
Course Materials
We will use a variety of freely available online materials and research papers, which will be provided throughout the course. You will also need an internet-enabled computer or tablet capable of displaying and outputting graphics and running a standard web browser (e.g., Chrome or Firefox).
Format and Overview
This course follows an experiential learning model. Students will engage with lecture materials through hands-on programming exercises, experiments with models and tools, and group discussions. Problem sets will deepen your understanding of the course material, and small projects will allow you to apply concepts to real-world research problems in the relevant domains.
Classes will include:
- Lectures: Foundational topics, discussions on implementing and leveraging conversational agents, text embeddings, and text analysis.
- Hands-on Labs: Experimenting with conversational agents, designing simple conversational agents, and conducting research using these models.
- Problem Sets and Projects: Bi-weekly problem sets to apply what you've learned. These will typically take the form of small-scale "research" projects.
Platforms and Tools
- Google Colaboratory: For developing and running Python code.
- Hugging Face Models: We will use pre-trained models available through Hugging Face's model hub.
- GitHub: Used for managing and sharing code, data, and project work.
- Discord: To facilitate discussions outside of class, share ideas, and collaborate on projects.
Grading
Grades will be based on the following components:
- Problem Sets (75%): A total of 4 required problem sets designed to reinforce key concepts (each is worth 18.75% of the final course grade). An optional 5th problem set (Assignment 5) is available for extra credit.
- Final Project (25%): You will carry out a larger scale (relative to the problem sets) "research" project on a topic of your choosing. This will include:
- Python code, organized as a Colaboratory notebook
- A "presentation" to the class (also submitted as a YouTube video), along with an in-class discussion of your project
- A brief (2--5 page) writeup of the main approach and key findings or takeaways
Grading Scale: A (93–100), A- (90–92), B+ (87–89), B (83–86), B- (80–82), C+ (77–79), C (73–76), C- (70–72), D (60–69), E (0–59). All grades will be rounded to the nearest integer (e.g., a 92.5 average will result in a final grade of "A", whereas a 92.4999 average will result in a final grade of "A-"). Out of fairness to all students in the course, there will be no "negotiations" about grading-- e.g., your grade will be determined solely by the numerical average of your assignment scores.
Late Policy
Problem sets will receive a 10% deduction for each week late, rounded up to the nearest whole week (e.g., from a grading standpoint submitting an assignment 1 minute late is the same as submitting it 1 day late, is the same as submitting it 6 days late).
Your final project must be submitted on time in order to receive credit for it.
I strongly encourage you to submit your assignments before the last possible moment to avoid grading penalties, unexpected circumstances (e.g., illness, emergencies, etc.).
Academic Honor Principle
Students are expected to adhere to Dartmouth's Academic Honor Principle. You are encouraged to collaborate and discuss ideas with classmates, but all submitted work must be your own (aside from the final projects, which will be completed in small groups). If you're unsure about what constitutes a violation, please ask for clarification.
Use of Generative AI
Given that this is a course about the technologies used to make modern generative AIs like ChatGPT, Claude, Llama, Gemini, etc., you will be using these models extensively in class and in your assignments. There are just two "rules" about using GenAI:
- Most importantly, you are responsible for the content of your assignments, whether written by you "from scratch" or with the help of a GenAI agent.
- Second, you are bound by the Academic Honor Principle to acknowledge any use of GenAI in your work. This can be done by either using a brief comment in your code, by explicitly citing the tools you use, or by adding a note to the relevant section(s) of your assignment. Each situation is unique, but you need to make it clear exactly what work is your own vs. produced by GenAI. You must also include a chat history (including any prompts you used) as an addendum to your assignment(s).
Scheduling Conflicts
Attendance is expected for all classes unless previously arranged. A critical part of the course is the in-class discussions and demos, and those will only work if you are physically present in class. If you anticipate any conflicts due to religious observances or other commitments, please inform the instructor by Week 2 to make appropriate arrangements.
Student Needs
We strive to create an inclusive learning environment where all students feel supported and engaged. If you require any accommodations, please contact the Student Accessibility Services office, or discuss your needs with the instructor privately.
Course Schedule
Note: Classes meet MWF 10:10--11:15. X-hours (Th 12:15--1:05) in the first four weeks will be used to make up for instructor absence February 23--27 (no classes that week).
| Week | Dates | Topics | Assignments |
|---|---|---|---|
| 1 | Jan 5--9 | Introduction, Pattern Matching, ELIZA | Assignment 1 released (Jan 9) |
| 2 | Jan 12--16 | Data Cleaning, Tokenization, Text Classification | Assignment 2 released (Jan 16) |
| 3 | Jan 19--23 | POS Tagging, Vibe Coding, Classical Embeddings | Assignment 1 due (Jan 19), Assignment 3 released (Jan 23) |
| 4 | Jan 26--30 | Word Embeddings, Contextual Embeddings, Dimensionality Reduction | Assignment 2 due (Jan 26) |
| 5 | Feb 2--6 | Attention Mechanisms, Transformer Architecture | Assignment 3 due (Feb 6), Assignment 4 released (Feb 6) |
| 6 | Feb 9--13 | BERT Deep Dive, Encoder Models | |
| 7 | Feb 16--20 | GPT Architecture, Scaling Up, Implementation | Assignment 4 due (Feb 16), Final Project released (Feb 16), Assignment 5 available (optional/extra credit) |
| 8 | Feb 23--27 | No classes (instructor away) | Work on Final Project |
| 9 | Mar 2--6 | RAG, Mixture of Experts, Ethics | |
| 10 | Mar 9 | Final Project Presentations | Final Project due (Mar 9, 11:59 PM EST) |
| Finals | Mar 13 |
Detailed Schedule
Week 1: Introduction & String Manipulation (January 5--9)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Jan 5 | Lecture 1 | Course Introduction, Is ChatGPT Conscious? | HTML, PDF | Fedorenko et al. (2024), Lupyan et al. (2020) |
| Wed Jan 7 | Lecture 2 | Pattern Matching & ELIZA | HTML, PDF | Weizenbaum (1966) |
| Thu Jan 8 | Lecture 3 | ELIZA Implementation | HTML, PDF | |
| Fri Jan 9 | Lecture 4 | Rules-Based Chatbots | HTML, PDF | Colby et al. (1971), Assignment 1 Released |
Week 2: Computational Linguistics (January 12--16)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Jan 12 | Lecture 5 | Data Cleaning & Preprocessing | HTML, PDF | |
| Wed Jan 14 | Lecture 6 | Tokenization | HTML, PDF | Sennrich et al. (2016), Kudo & Richardson (2018) |
| Thu Jan 15 | Lecture 7 | Text Classification Workshop | HTML, PDF | |
| Fri Jan 16 | Lecture 7 (continued) | Text Classification Workshop | HTML, PDF | Assignment 2 Released |
Week 3: Vibe Coding & Classical Embeddings (January 19--23)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Jan 19 | -- | Martin Luther King Jr. Day (No Class) | -- | Assignment 1 Due (Jan 19, 11:59 PM EST) |
| Wed Jan 21 | Lecture 8 | POS Tagging & Sentiment Analysis | HTML, PDF | Linzen et al. (2016) |
| Thu Jan 22 | Lecture 9 | Vibe Coding Tips & Tricks | HTML, PDF | OpenCode, oh-my-opencode, spec-kit, GitHub Copilot for Students, Google Gemini for Students |
| Fri Jan 23 | Lecture 10 | Classical Embeddings (LSA, LDA) | HTML, PDF | Deerwester et al. (1990), Blei et al. (2003), Assignment 3 Released |
Week 4: Word Embeddings & Modern Methods (January 26--30)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Jan 26 | Lecture 11 | Word Embeddings (Word2Vec, GloVe, FastText) | HTML, PDF | Mikolov et al. (2013), Pennington et al. (2014), Bojanowski et al. (2017), Assignment 2 Due (Jan 26, 11:59 PM EST) |
| Wed Jan 28 | Lecture 12 | Contextual Embeddings | HTML, PDF | Peters et al. (2018), Cer et al. (2018) |
| Thu Jan 29 | Lecture 13 | Dimensionality Reduction | HTML, PDF | McInnes & Healy (2018) |
| Fri Jan 30 | Lecture 14 | Cognitive Models of Semantic Representation | HTML, PDF | Anderson et al. (2016) |
Week 5: Transformer Architecture (February 2--6)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Feb 2 | Lecture 15 | Transformer Architecture | HTML, PDF | Vaswani et al. (2017), The Animated Transformer |
| Wed Feb 4 | Lecture 16 | Training Transformers | HTML, PDF | Kaplan et al. (2020) |
| Fri Feb 6 | Lecture 17 | Retrieval Augmented Generation (RAG) | HTML, PDF | Lewis et al. (2020), Assignment 3 Due, Assignment 4 Released |
Week 6: Encoder Models (February 9--13)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Feb 9 | Lecture 18 | BERT Deep Dive | HTML, PDF | Devlin et al. (2019) |
| Wed Feb 11 | Lecture 19 | BERT Variants | HTML, PDF | Liu et al. (2019), Sanh et al. (2019) |
| Fri Feb 13 | Lecture 20 | Applications of Encoder Models | HTML, PDF |
Week 7: Decoder Models & GPT (February 16--20)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Feb 16 | Lecture 21 | GPT Architecture | HTML, PDF | Radford et al. (2018), Radford et al. (2019), Assignment 4 Due (Feb 16, 11:59 PM EST), Final Project Released, Assignment 5 Available (Optional/Extra Credit) |
| Wed Feb 18 | Lecture 22 | Scaling Up to GPT-3 and Beyond | HTML, PDF | Brown et al. (2020), OpenAI (2023) |
| Fri Feb 20 | Lecture 23 | Implementing GPT from Scratch | HTML, PDF | Let's build GPT (Karpathy) |
Week 8: No Classes (February 23--27)
Instructor away February 23--27. No classes this week. Use this time to work on your final project.
Week 9: Advanced Topics (March 2--6)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Mar 2 | Lecture 24 | Agents and Tool Use | HTML, PDF | Yao et al. (2023), Schick et al. (2023) |
| Wed Mar 4 | Lecture 25 | Mixture of Experts & Efficiency | HTML, PDF | Fedus et al. (2022), Jiang et al. (2024) |
| Fri Mar 6 | Lecture 26 | Ethics, Bias, and Safety | HTML, PDF | Bender et al. (2021) |
Week 10: Final Project Presentations (March 9)
| Day | Lecture | Topics | Slides | Materials |
|---|---|---|---|---|
| Mon Mar 9 | Lecture 27 | Final Project Presentations & Wrap-up | -- | Last day of classes, Final Project Due (Mar 9, 11:59 PM EST) |
Final Exam Period (March 13--17)
No additional submissions required. Final project materials were due March 9.