Homework 3: Large language model (LLM) prompting and instruction tuning
Due 2025-11-07, 11:59pm. Instructions last updated 2025-11-03.
Learning objectives
After completing this assignment, students will be able to:
- Prompt LLMs programmatically with templates (parameterized)
- Prompt LLMs with zero-shot and few-shot prompting
- Engineer and test different prompts
- Implement instruction tuning of LLMs using Hugging Face tools
- Evaluate instruction-tuned LLMs against base models
Overview
In this assignment, you will explore different prompting techniques LLMs (Part 1). You will also instruction-tune an LLM (Part 2). Both of these parts will involve filling in template Jupyter notebooks onPitt’s CRCD through the class JupyterHub. You will need GPU resources for Part 2. You can use the Nvidia L4 GPU on the CRCD JupyterHub (teach cluster) like we use in class, or CRCD’s Open OnDemand Jupyter service. Use the class conda environment to load all necessary packages.
To get started, click on the class nbgitpuller link.
Part 1: LLM prompting
Please fill out the template notebook, hw3_template_part1.ipynb, from the class CRCD JupyterHub.
Part 2: Instruction tuning LLMs
Fill out hw3_template_part2.ipynb from the class CRCD JupyterHub.
Deliverables
- Your code: the Jupyter notebooks you modified from the templates for parts 1 and 2. Submit:
- your .ipynb files for parts 1 and 2
- a .html export of your notebooks from parts 1 and 2. To get a .html version, click File > Save and Export Notebook As… > HTML from within JupyterLab.
- A PDF report with answers to questions provided in the template notebooks. Please name your report
hw3_{your pitt email id}.pdf. No need to include @pitt.edu, just use the email ID before that part. For example:report_mmyoder_hw3.pdf. Please make only one PDF report, containing answers to part 1 and part 2. Make sure to include the following information:- answers to all the numbered questions in the templates
- any additional resources, references, or web pages you’ve consulted
- any person with whom you’ve discussed the assignment and describe the nature of your discussions
- any generative AI tool used, and how it was used
- any unresolved issues or problems
Please submit all of this material on Canvas. We will grade your report and may look over your code.
Acknowledgments
Part 1 of this assignment is based on a homework assignment designed by Mark Yatskar and provided by Lorraine Li.