Skip to content

michellejm/LLMs-fall-23

Repository files navigation

Large Language Models and Chat GPT

Time: Mondays 6:30-8:30pm

Room: 5417

Instructor: Michelle McSweeney

Email: michelleamcsweeney@gmail.com

Course Site: https://github.com/michellejm/LLMs-fall-23

Slack: ask for invite

This syllabus is subject to change based on the goals of the individuals in the class and where the conversation takes us.

Description

Large language models (LLMs) such as ChatGPT and Bard have demonstrated an uncanny ability to interpret and generate text, and with that, the potential to revolutionize industries and reshape society. However, their complexity makes them difficult to understand, often hiding their implicit assumptions. This course introduces students to the development and use of LLMs in natural language processing (NLP), covering fundamental topics in probability, machine learning, and NLP that make LLMs possible. With this technical foundation in view, students will explore the social and ethical implications of LLMs, including privacy, bias, accountability, and their impact on creative production, education, and labor. By the end of the course, students will have a solid understanding of the basic technical foundations and will be able to contribute to conversations on the social and ethical implications of LLMs.

Note: An introductory level familiarity with Python is required.

Objectives

By the end of this course, you will be able to:

  • Build an n-gram model and explain their limitations
  • Explain the role of tokenization in NLP
  • Explain what a word vector is and understand how they are calculated
  • Fine tune a LLM for a specific task
  • Explain the basics of how a Neural Network works
  • Explain what a transformer model is and when to use them
  • Contextualize the role of reinforcement learning in modern LLM’s
  • Hold and justify your thoughts and opinions about:
    • Labor, production, creativity, and ownership of products created with LLM’s
    • The risk to privacy with LLM’s
    • The relative importance and implications of the biased responses and toxicity that LLM’s produce
    • The dangers and limitations related to hallucinations by LLM’s
    • The role of LLM’s in human relationships

Materials

There is no required textbook for this course, but a few rather helpful resources depending on what direction you want to take your final project.

Design of this course

This course takes 2 approaches to understanding the role of Large Language Models (llm’s): technical and social. The primary goal of this course is to equip you with the technical foundation necessary to have an informed yet critical opinion about the role of large language models in society and develop that opinion in conversation with your peers. These two parts are equally important.

Social

Every other week (S), we will discuss one area of social importance. The areas I’ve selected are significant, but not comprehensive (this selected topics may change before the start of the semester, survey depending).

Everyone will do the readings and participate in the discussion. The discussion will be lead by 3 students (everyone will lead one time). If it is your group’s week, you will work with your group to deep dive into a topic. Please use the Slack channel for your topic to discuss and post any additional readings/watchings/listenings you've found particularly insightful. There are assigned readings for everyone, but when it is “your” week, the expectation is that you will go beyond those readings and consume a variety of opinions about the topic at hand. The group work part of it is to have a conversation before the class session to discuss what you have found, what you have been thinking about, and the biggest questions and issues that are still unanswered. Pay particular attention to the assumptions you make in order to reach any opinions you hold.

After the class discussion, the “lab” is to write a 1-3 paragraph opinion about the topic. This opinion should be posted either on the CUNY Commons, a personal website, or your Github. The purpose of the post is to record your thoughts on the topic for both your future self and as part of a portfolio of work on LLM’s. While we often think of portfolios as showing technical skill, being able to demonstrate that you have an informed opinion on the social implications of LLM’s is just as important.

Technical

Every other week will cover a technical aspect of LLM’s. This is an extremely rapid pace, but should give you a good, high-level understanding of how these models work. We will not going into the math beyond probability. After each technical lesson, there is a lab. Except for the first one (on prompt engineering), all of the labs are designed to be completed in Python. The Jupyter Notebooks for them will be posted on Github.

It is possible to simply copy-paste the labs, though I don’t recommend this. At each step, be sure you understand why we are completing that step – even if you do not understand what the code itself does. Read the instructions and then manually copy the code into your own notebook. Test it to see what it does. Recommendations for testing code will be posted on Github.

The goal of the lab is to understand how LLM’s work and how to use them, not to make you a better programmer, so do worry about being able to write the code yourself. Likewise, do not worry about understanding the syntax (though if that is your interest, by all means, go for it).

Your code and short written summary of what you did should be posted either on the CUNY Commons, a personal website, or your Github.

Final Project

Your final project should incorporate both the technical and social aspects of LLM’s, though the balance is up to you. The shape of the project will depend on your goals for the course and your own portfolio.

All projects will have a proposal, a proof of concept, and a final presentation.

The proposal should contain:

  • A description of the product you will create. If this is a written paper, that’s easy enough. If it is an LLM-powered project, this will have to be more detailed.
  • A statement of the question or issue that this project addresses. What are the social implications/questions/challenges that you will explore. Even the most technical project will have social implications.
  • Identify what kind of language model you will be working with. I.e., a base model, fine tuned model, etc.
  • State how it will be made public (i.e., a website, conference, journal, etc.)
  • Timeline identifying each of the steps you have to complete by when.

We will discuss your proposal at the 1:1 meeting on November 13. These will be conducted via Zoom. In this meeting, we will agree on what is reasonable to create in one month and flag any outstanding issues.

The proof of concept is due November 27. This is simply the most bare bones version of your project. It might not work, it might have missing pieces, but you should have something beginning to resemble the project we agreed on. The purpose of this intermediate step is to be sure you are on the right path and to get feedback on this very rough draft.

The week of November 27 - December 4, you will work in groups of 3 to give peer feedback on your projects. This feedback can be delivered via video, or you can coordinate synchronous feedback sessions.

The format of the final presentations on December 11. The format will be decided by majority vote.

Technical Projects

Primarily technical projects that leverage LLM’s to solve a problem, answer a question, create a product, etc. will likely take the form of a website in some way. Such projects should also have a written component that addresses the potential social or political implications related to the project. The final artifact must be public facing in some way.

Some examples adopted from this Medium post:

  • A cover letter generator that takes user input and feeds it into a prompt template, which is then passed to the ChatGPT API, and the response returned to the user. This could be a Github repo with the necessary code, a few examples of what it can produce, and a ReadMe that explores the implications of having ChatGPT write cover letters. If you want to go above and beyond, possibly add a GUI wrapper to make it easy to use,
  • A personalized chatbot could be a Github repo with the code you used to fine tune the LLM, the training data, examples of what it can produce, and a ReadMe that explores the implications of creating customized Chatbots.
  • A podcast summarizer could be a Github repo with the code you used to prepare the transcripts and to analyze them, a few examples of what it can produce, and a ReadMe that explores the implications of such summaries – including the benefits and what can go wrong.
  • Etc.

Social Projects

Primarily social projects that explore a topic or question will likely take the form of a research paper (though alternative proposals are welcome!). As part of the exploration, they should engage in a systematic way with an LLM either to demonstrate behavior, validate claims, or otherwise support the arguments being made.

Some examples include:

  • Explore how toxicity does or does not have damaging effects on society. Write a paper bringing together current research and thinking about the effects of toxicity and use prompt engineering to systematically validate those claims or work through a series of toxicity prompts in different models. Make this paper public by publishing on a website or submitting to a conference.
  • Trace the history of bias in machine learning in a written paper that will either be published to a website or submitted to a conference/journal. Explore various dimensions of bias in one or more base models, or fine tune a model to be more or less biased.
  • Explore what authorship and/or copyright mean in a world where LLM’s are trained on large swaths of data from the internet. Generate writing in the style of a specific author as an example.
  • Etc.

Grading

Technical Labs 20%
Social Labs 20%
Leading discussion 10%
Final project, feedback, and presentation 50%

All grades are based on completion.

Schedule

Date Topic Lab (due following Sunday)
1 Aug 28 Introduction to course, N-grams Prompt Engineering ChatGPT
Sept 4 LABOR DAY - no class
2 (T) Sept 11 Tokenization & word vectors N-grams & Tokenization
3 (S) Sept 18 Bias & Toxicity Bias or Toxicity
Sept 25 YOM KIPPUR - no class
4 (T) Oct 2 Word Vectors & maybe Neural Networks Word vectors
Oct 9 INDIGENOUS PEOPLES DAY - no class
5 (T) Oct 10 Classes follow a Monday schedule - but we will not meet

None

None
6 (S) Oct 16 Privacy, copyright and intellectual property Privacy or Copyright
7 (T) Oct 23 Transformers & Attention BERT
8 (S) Oct 30 Labor & Creative production Labor or Creative Production
9 (T) Nov 6 Fine Tuning Fine Tuning

Project Idea due 11/12

10 Nov 13 1:1 Meetings via Zoom Project Proposal due 11/19
11 (S) Nov 20 Hallucinations & Misinformation Hallucinations or Misinformation
12 (T) Nov 27 Performance Evaluation Project
13 (S) Dec 4 Emergent Behaviors and Performance Project
14 Dec 11 Presentations Revisions
15 Dec 18 Final versions due

Readings

Please complete readings listed for each date before the class session. Some topics specify how many to read. For technical topics, they all cover the same things at various levels of math and detail. For social topics, there are a lot of voices raising a lot of good points, I’ve only scratched the surface here.

Coding System:

_Technical: Most math, typically the most in-depth and detailed explanation_

_Mid-level: Getting this right is hard, some of these will be more technical than others_

_Intuitive: Where possible, I’ve tried to find an intuitive explanation that has minimal math. _

_Canonical: Some articles are transformational or famous or becoming part of the canon - even if you don’t finish these, you should be aware of them._

August 28

September 11 (T) Tokenization and word vectors (and rest of n-grams)

September 18 (S) Bias and Toxicity Read three

October 2 (T) Word Vectors & Neural Networks

October 10 - No class meeting - only lab

October 16 (S) Privacy, copyright and intellectual property Read three

October 23 (T) Transformers and attention

October 30 (S) Labor & Creative production

November 6 (T) Fine Tuning (and RAG)

November 20 (S) Hallucinations and Misinformation

November 27 (T) Performance Evaluation

December 4 (S) Emergent behavior and performance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published