Week 02 — Prompting & Reasoning

Material Where
HTML chapter Read online
Lab Open in Colab · W2_lab_prompting.ipynb download
Homework Open in Colab · W2_hw_prompting.ipynb download — collected via the LMS; due date on the LMS
Papers Chain-of-Thought Prompting (Wei et al., 2022) (PDF) · Self-Consistency (Wang et al., 2022) (PDF) — first student presentations
Student presentation slides Chain-of-Thought · Self-Consistency

All chapters: reading index

This week

Use one marker-count problem to compare a direct answer, a worked solution, and a prompt with worked examples. Define reasoning, chain-of-thought prompting, zero-shot and few-shot prompts, and in-context learning as they become needed. Then aggregate illustrative solutions with self-consistency, examine why agreement can still be wrong, and compare added computation with obtaining missing evidence.

Lab

W2_lab_prompting.ipynb — the same model on the same problems under two prompts (answer only, worked solution first), the silent-thinking and answer-first controls, a code-graded eval improved from a baseline through a format fix to your own chain-of-thought prompt, few-shot email classification, self-consistency by majority vote, and the hallucination limit. In-class practice; nothing from the lab is submitted.

Click Open in Colab in the table above. Save your own copy first (File → Save a copy in Drive), paste your API key into the setup cell, and run top to bottom. Prerequisite: your own API key — follow the API Setup Guide.

Homework

W2_hw_prompting.ipynb — four assignments in the lab’s structure with new tasks: chain-of-thought by instruction, an exemplar that pins an output format, your own chain-of-thought prompt with a five-sample vote, and few-shot chain-of-thought exemplars on a Roman-numeral evalset. Each assignment has one fill-in block and a fixed check cell; the completion cell must print HOMEWORK COMPLETE. Run the notebook top to bottom, download it (File → Download → Download .ipynb), and upload the file to the LMS by the due date shown there. Grading reads the saved outputs.

Presentations

Chain-of-Thought (Wei et al., 2022) and Self-Consistency (Wang et al., 2022) — the first student presentations. See the presentation guide.