Self-supervised learning (pre-training) has led to the development of artifacts like Large Language Models (LLMs), which have revolutionized fields such as natural language processing (NLP). This course serves as an introduction to self-supervised learning within the context of natural language. Its objective is to provide a comprehensive overview of industry standards for pre-training, aligning, and deploying language models. The course is designed to equip you with a diverse set of skills essential for future success, whether you aim to conduct research using language models or apply them in industrial settings. PyTorch will be the primary programming language used in the class. The course will include instructor-led lectures, seven assignments involving both empirical and theoretical work, in-class quizzes, and a final project.

Note: The course is different from 601.771 (typically offered in fall semesters) which is focused on advanced topics in recent papers and is geared toward grad students that want to specialize in the latest developments in self-supervised models.

Prerequisites:

Suggestive prerequisites: Not a hard prerequisites but it is highly useful to have background in "Natural Language Processing" and "Machine Learning". You may gain such background by taking the following courses: "Machine Learning" (CS 475/675), OR "Machine Learning: Deep Learning" (CS 482/682), OR "Natural Language Processing" (CS 465/665), OR "Machine Translation" (CS 468/668).

Relevant Courses at Hopkins: This course has some overlap with "Natural Language Processing" (EN.601/665), and "Artificial Agents" (EN.601.470/670), though the courses have different focuses.

Logistics




Assignments

The homework offers you a chance to practice applying what you've learned. It is intended to complement lectures and office hours, which aim to provide intuition, motivation, and justification for the skills we want you to develop. However, the most effective way to build these skills is by attempting to solve the problems on your own. The process of practicing is far more valuable than simply being provided with the solution.

The course includes 7 weekly assignments leading up to spring break, designed to enhance both your theoretical knowledge and practical abilities. Each assignment consists of written questions and programming components (Python). Assignments will be posted on this website, and submissions should be uploaded to Gradescope.

Here is a tentative list of topics for the assignments:

# Topic
#1 Algebra, calculus, probability, optimization (gradient descent) recap, understanding softmax function, loss functions (cross-entropy, MSE, etc.), a machine learning problem (classification, evaluation),
#2 PyTorch introduction, automatic differentiation, computation graph, basic feedforward network and backpropagation
#3 Neural language model with feedforward network, evaluating language models, count-based models, decoding language models
#4 RNN-based LMs; Transformers
#5 Fine-tuning LMs, prompting language models, fine-tuning them, distributed training.
#6 Prompt engineering, in-context learning; Retrieval-augmented language models
#7 Alignment with instruction-tuning, alignment with [human] feedback

In-class Quizzes

There will be 3 in-class quizes. The midterm exams will be paper-based and during the usual class time. The exams will assess students' mastery of the topics discussed in the lectures and homework assignments. The exams also provide feedback to both the student and the instructor, and identify areas that need improvement to inform further learning and teaching. The quizzes will encompass all material from the start of the semester up to the topic specified by the instructor.


Class Project

The objective of the final project is to make use of what you have learned during this course to solve a hard problem.

The final project milestones include: (1) A project proposal, (2) A project midway report, (3) a final report, (4) a final project poster summarizing the technical aspects of the project. See the course calendar for the due dates.



Content Schedule

The current class schedule is below (subject to change):

Date Topic Content Events Deadlines
#1 - Tue Jan 21 Course introduction:
  • Course overview
  • Plan and expectations
PPTX, PDF HW1 to be released!
#2 - Thu Jan 23 Language modeling:
  • Definitions and history,
  • Counting and n-grams,
  • Measuring LM quality,
  • Language modeling as a learning problem
PPTX, PDF
#3 - Tue Jan 28 Feedforward networks:
  • Definitions
  • Brief history
  • Background (algebra + optimization)
  • Analytical Backprop
PPTX, PDF HW2 to be released! HW1 due
#4 - Thu Jan 30 Feedforward networks:
  • Algebra recap
  • Analytical backprop
  • Backprop in practice
PPTX, PDF
#5 - Tue Feb 4 Feedforward networks:
  • Backprop in practice
  • Practical tips
PPTX, PDF HW3 to be released! HW2 due
#6 - Thu Feb 6 Feeding text to neural networks:
  • Tokenization and subwords
  • Fixed-window MLP LMs
PPTX, PDF
#7 - Tue Feb 11 Recurrent Neural LMs:
  • Introducing RNNs
  • Training RNNs
  • RNNs for natural language and language modeling
  • RNNs: Pros and Cons
  • Sampling from LMs
  • Pre-training RNNs
  • Sampling from LMs
  • Bonus: Pre-training RNNs
PPTX, PDF HW4 to be released! HW3 due
#8 - Thu Feb 13 Quiz 1 - Topics: everything discussed up to this point.
#9 - Tue Feb 18 Transformer LMs:
  • Self-attention
  • Transformer LMs
  • Positional embeddings
PPTX, PDF HW5 to be released! HW4 due
#10 - Thu Feb 20 Transformer LMs:
  • Efficiency considerations
  • Architectural variants
  • Notable models
PPTX, PDF
#11 - Tue Feb 25 Transformer LMs:
  • Notable models
  • Training tips
PPTX, PDF
#12 - Thu Feb 27 Adapting LMs:
  • Adaption as fine-tuning
  • Parameter-efficient tuning
PPTX, PDF HW6 to be released! HW5 due
#13 - Tue Mar 4 Adapting LMs:
  • Adaption as in-context learning
  • ICL: Making sense of it
  • Prompt engineering
  • Multi-step prompting
  • Failures of ICL
PPTX, PDF
#14 - Thu Mar 6 Alignment of LMs:
  • Alignment: definitions
  • Instruction-tuning
PPTX, PDF HW7 released! HW6 due
#15 - Tue Mar 11 Introducing final projects:
  • Defining final projects
  • Tips for successful project
Alignment of LMs:
  • RLHF and variants
PPTX, PDF
PPTX, PDF
#16 - Thu Mar 13 Alignment of LMs:
  • Alignment: failures/open questions
  • Simplifying RLHF
  • Alignment with self-generated instructions
  • Value alignment
PPTX, PDF HW7 due
#17 - Tue Mar 18 No Class - Spring Break
#18 - Thu Mar 20 No Class - Spring Break
#19 - Tue Mar 25 Feeding lots of things to LMs
  • Delving into positional encoding
  • Length generalization
PPTX, PDF
#20 - Thu Mar 27 Quiz 2 - Topics: everything discussed up to this point.
#21 - Tue Apr 1 Feeding lots of things to LMs
  • Retrieval-augmentation
Connecting language to outside world:
  • Connecting vision and language
PPTX, PDF
PPTX, PDF
#22 - Thu Apr 3 Connecting language to outside world:
  • Connecting vision and language
  • Generative vision-language
PPTX, PDF
Apr 4 Project proposals deadline
#23 - Tue Apr 8 Connecting language to outside world:
  • Transformers for Audio/speech
  • LMs for coding
  • LMs and grounded actions
  • Open questions
PPTX, PDF
#24 - Thu Apr 10 Efficiency considerations:
  • Quantization
  • Distillation
  • Distributed training
PPTX, PDF
#25 - Tue Apr 15 Scaling LMs:
  • Thinking about computation cost
  • Optimal scaling
PPTX, PDF
#26 - Thu Apr 17 Scaling LMs:
  • Why we didn't scale earlier?
  • When scale does not help
  • Is scale all you need?
Social concerns about LMs:
  • Bias, fairness and toxic language
PPTX, PDF
PPTX PDF
Apr 20 Midway reports deadline
#27 - Tue Apr 22 Social concerns about LMs:
  • Hallucination
  • Truthfulness and veracity
  • Legal considerations and fair use
  • Reflections about future, dangers and misuses
PPTX PDF
#28 - Thu Apr 24 Quiz 3 - Topics: everything discussed in the class.
TBD Final project reports
TBD Final project poster session (Time: TBD)

Reference text

There is no required text. Though the following can be useful:


Relevant Resources

Here are several resources available for free:

Besides these resources, we will try our best to satisfy individual needs through discussion.


Code of Conduct

The strength of the university depends on academic and personal integrity. In this course, you must be honest and truthful, abiding by the Computer Science Academic Integrity Policy:

Cheating is wrong. Cheating hurts our community by undermining academic integrity, creating mistrust, and fostering unfair competition. The university will punish cheaters with failure on an assignment, failure in a course, permanent transcript notation, suspension, and/or expulsion. Offenses may be reported to medical, law or other professional or graduate schools when a cheater applies. Violations can include cheating on exams, plagiarism, reuse of assignments without permission, improper use of the Internet and electronic devices, unauthorized collaboration, alteration of graded assignments, forgery and falsification, lying, facilitating academic dishonesty, and unfair competition. Ignorance of these rules is not an excuse.

Academic honesty is required in all work you submit to be graded. Except where the instructor specifies group work, you must solve all homework and programming assignments without the help of others. For example, you must not look at anyone else’s solutions (including program code) to your homework problems. However, you may discuss assignment specifications (not solutions) with others to be sure you understand what is required by the assignment. If your instructor permits using fragments of source code from outside sources, such as your textbook or on-line resources, you must properly cite the source. Not citing it constitutes plagiarism. Similarly, your group projects must list everyone who participated.

In the above paragraph "outside sources" also include content that was produced by an AI assistant like ChatGPT. This follows either by treating the AI assistant as a person for the purposes of this policy (controversial) or acknowledging that the AI assistant was trained directly on people's original work. Thus, while you are not forbidden from using these tools, you should consider the above policy carefully and quote where appropriate. Assignments that are in large part quoted from an AI assistant are very unlikely to be evaluated positively. In addition, if a student's work is substantially identical to another student's work, that will be grounds for an investigation of plagiarism regardless of whether the prose was produced by an AI assistant.

Falsifying program output or results is prohibited. Your instructor is free to override parts of this policy for particular assignments. To protect yourself: (1) Ask the instructor if you are not sure what is permissible. (2) Seek help from the instructor, TA or CAs, as you are always encouraged to do, rather than from other students. (3) Cite any questionable sources of help you may have received.

Report any violations you witness to the instructor. You can find more information about university misconduct policies on the web for undergraduates and graduates students.

Johns Hopkins University is committed to equal opportunity for its faculty, staff, and students. To that end, the university does not discriminate on the basis of sex, gender, marital status, pregnancy, race, color, ethnicity, national origin, age, disability, religion, sexual orientation, gender identity or expression, veteran status, military status, immigration status or other legally protected characteristic. The University's Discrimination and Harassment Policy and Procedures provides information on how to report or file a complaint of discrimination or harassment based on any of the protected statuses listed in the earlier sentence, and the University’s prompt and equitable response to such complaints.