This assignment is due on Thursday, August 6, 2026 before 11:59PM.
You can download the materials for this assignment here:
Homework 10: Large Language Models [110 points]
In this homework, you will use an online LLM playground, an API, and a locally downloaded LLM to better understand the current state-of-the-art in (reasonably small-sized) large language models that have been trained using deep neural networks.
We’ll get you started by introducing you to the three different tools and introducing the notion of prompt design. Then we’ll show how to fine-tune the models to perform specific tasks.
Getting Started
This assignment is done entirely within a Python notebook file homework10.ipynb, which contains all the question instructions, example code, and places for you to fill in your work.
The first two sections of this assignment should be completable on any computer with Internet access, but we recommend that you complete the last section on Google CoLab with T4 GPU, or run the notebook on any other server with a modern CUDA-supporting GPU and at least 16GB GPU RAM.
To run the notebook on CoLab, you need to upload the file to your own Google Drive storage, and download the file when you’re done working with it. If you need help running the notebook on another platform, ask the course staff.
You will also need (free) accounts on three major platforms:
- Nvidia NIM, which gives API access to a wide range of modern large neural language models. As of July 2026, this is a free service, although it is noticeably rate-limited.
- There are a good number of other LLM API providers both paid and free, including but not limited to major names with proprietary models such as OpenAI, Anthropic, or DeepSeek, as well as general-purpose API providers that provide cloud compute for a wider range of more open-access models such as Nvidia’s service.
- You can find a public compilation of free or trial-credit LLM inference resources here.
- HuggingFace, which hosts a model hub where we will be downloading fully pretrained open-access model weights from and uploading our finetuned models to.
- HuggingFace maintains a wide range of LLM (and other types of modern large neural networks) support tools as well. Feel free to explore their website to see what other services there are.
- Weights and Biases, which is a tool for logging and visualizing model training behavior over time.
We have noted in the past that there’s been at least some additional verification requirements for Nvidia accounts created using Penn emails. Try creating an account using a non-Penn email if this happens.
What to submit
Please submit your completed Python Notebook to Gradescope. The notebook has multiple text and code blocks marked TODO that you will need to complete.
Grading criteria
The main body of this assignment (100 points) is graded based on reasonable completion and implementation of all the “TODO / implement your own” sections, as well as by reasonable performance metrics on the final fine-tuning and parsing task.
The final section of this assignment (10 points) is the assignment feedback and reflections section. Same guidelines apply here as for all previous assignments.
It is not graded on style, although we still strongly recommend following PEP 8 style guidelines and writing clear comments as appropriate.
Recommended readings
| HuggingFace Transformers documentation |
| Language Models are Few-Shot Learners - Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, Dario Amodei. NeurIPS 2020. |
| Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing - Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, Graham Neubig. arXiv 2022. |
| Multitask Prompted Training Enables Zero-Shot Task Generalization - Victor Sanh, Albert Webson, Colin Raffel, Stephen H. Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, Manan Dey, M Saiful Bari, Canwen Xu, Urmish Thakker, Shanya Sharma Sharma, Eliza Szczechla, Taewoon Kim, Gunjan Chhablani, Nihal Nayak, Debajyoti Datta, Jonathan Chang, Mike Tian-Jian Jiang, Han Wang, Matteo Manica, Sheng Shen, Zheng Xin Yong, Harshit Pandey, Rachel Bawden, Thomas Wang, Trishala Neeraj, Jos Rozen, Abheesht Sharma, Andrea Santilli, Thibault Fevry, Jason Alan Fries, Ryan Teehan, Tali Bers, Stella Biderman, Leo Gao, Thomas Wolf, Alexander M. Rush. arXiv 2022. |
| Truth, Lies, and Automation: How Language Models Could Change Disinformation - Ben Buchanan, Andrew Lohn, Micah Musser, Katerina Sedova. arXiv 2021. |