ml-systems

Machine Learning for Computer Systems

View the Project on GitHub noise-lab/ml-systems

You are helping create an exam for the course Machine Learning for Computer Systems. Students may run this same prompt to generate practice exams; the instructor runs it to draft the real one.

Parameters (ask if not given)

  1. Exam type: midterm, final, or combined. The nine-week offering has a midterm and a final; the three-week offering has one combined exam (see generate-combined.md). The nine-week offering has typically run in Autumn and the three-week one in September, but either may move to another part of the year; go by the offering’s length, not the season.
  2. Term agenda file: docs/agenda/<term>.md (e.g. docs/agenda/2026-summer.md). The agenda index is docs/agenda.md.
  3. Meeting range to cover (e.g. Meetings 1–8 for a midterm, 1–12 for a combined exam). If the term has a page under docs/terms/, read it: it lists lectures that were skipped or merged and are therefore out of scope.
  4. Length: pages (default 4 for a midterm, 6 for a final or combined exam) and total points (default 50; combined exam 75). Design for ~30–40 minutes of work per 50 points.
  5. Output directory. Instructor: /Users/feamster/Dropbox/Tmp/exams/ml-systems/<type>/<YYYY>/ (cloud-backed, outside the public repo — never commit exam files before the exam is given). Students: any directory of your own; nothing here is secret.
  6. Past exams to imitate (read each one’s rubric.yaml, grading-notes.md, and analysis.md first where present; skip questions they mark ambiguous): 2–3 most recent under docs/midterm/<YYYY>/ and docs/final/<YYYY>/ (each has questions.tex, instructions.tex, exam.tex, feamster.sty, and usually a Makefile). For a combined exam, read one midterm and one final. Imitate exams of the same kind: nine-week midterms and finals are consistent with each other; the three-week combined exam differs in length and layout.

Task

Create an exam that:

  1. Covers the material in the chosen meeting range of the agenda, in proportion to time spent, and nothing outside it. The agenda is the authority on scope, not the topic lists in these prompts or the past exams.
  2. Avoids everything the agenda rules out. Anything the agenda marks “will not be asked”, “not exam material”, “not covered”, or skipped, and anything a later meeting says will not be on this exam, is out of scope even if a past exam asked about it.
  3. Fits on exactly the requested number of pages (printed double-sided and stapled) and totals exactly the requested points. No question may split across a page and no section heading may be orphaned: wrap every \prob … \eprob in \par\noindent\begin{minipage}{\linewidth} … \end{minipage}\par, and put each section heading inside the minipage of its first question. A minipage cannot break, so no \Needspace guessing is needed. Then grow the boxes until every page is full: render at 72 dpi, measure the free space above the footer on each page, and add it to that page’s boxes. Students never complain that a box is too big; the Autumn 2026 midterm survey asked for boxes about twice as large and a longer exam.
  4. Mixes multiple choice (“select all that apply”, 3–4 pts), yes/no with explanation (3–4 pts; ask “Why or why not?” in the same numbered question, with the box directly under the yes/no; never a separate “Explain” item; state the claim positively, no double negatives), and short answer (2–5 pts, generous answer boxes). A question that asks for two or more distinct things gets (a), (b) labels with each part’s instruction written next to its own box, not folded into the stem. A question asking for N named items (the four parts of a threat model; subject, verb, object; three metrics) gets a grid of small labeled boxes, one per item. “Identify which is which” questions are matching: name the categories in the stem, letter the items in the figure or list, and give a small box per category for the letter.
  5. Includes at least one question about each assignment due in the range and several about the hands-on activities the agenda records for the range (what the code did, why, what the result showed). Hands-ons vary by term; use the agenda, not a fixed list.
  6. Uses specific examples from class: the agenda records the analogies and discussions the instructor used (e.g. husky/wolf spurious correlation, the acknowledgment-packet problem, Netflix segment download rate, the “always says no” 99.9%-accurate classifier, ephemeral routes for spam). Where the agenda says “this would be a good exam question” or carries a Midterm flag / Final flag, it is: cover every such flag in the range.
  7. Tests understanding, not memorization, and is not tricky.
  8. Ends with a 3-point section headed Course Feedback (interest, difficulty, one like, one suggestion), so students know it is about the course, not the exam. Give the free-text box whatever space is left on the last page.

Steps

  1. Read the agenda file for the meeting range and the term page (if any).
  2. Read the past exams to learn the LaTeX conventions and the point/format mix.
  3. List the key concepts and exam flags per meeting; drop anything the term page marks as skipped and anything the agenda says will not be asked.
  4. Write questions.tex (with solutions), instructions.tex, exam.tex, a Makefile, and a README.md; copy feamster.sty and the Makefile from the most recent past exam of the same kind (e.g. the last nine-week offering’s midterm).
  5. Build both exam.pdf and exam-solution.pdf; verify page count, point total, and layout; iterate until they match.

LaTeX conventions (from feamster.sty)

Pre-copy review (required before the copier)

Run two independent reviews of the built PDFs, one on the answer key and one reading the exam as a student would, and fold both into the source before printing. Each reviewer checks every item for:

Record what the review changed in the exam’s README.md. The Autumn 2026 midterm’s in-class debrief also asked for randomized option positions (already required above) and noted that one rubric item expected an alternative the question had not asked for: the key must only reward what the stem asks.

Drafting and checking with several agents (instructor’s run)

When the instructor drafts the real exam, the work is split across independent agents so that no one who wrote a question also checks it. The orchestrator (the session the instructor is talking to) runs the pipeline and folds the results back into the source; it never edits a question on its own judgment while a check is still open.

  1. Drafter. One agent reads the agenda range, the term page, the past exams with their rubric.yaml, grading-notes.md and analysis.md, writes scope.md (per meeting: in, out and why, which flag each question covers), then the LaTeX, builds both PDFs, validates pages and points, randomizes and writes out the key, and hands back the key table. It does not review itself.
  2. Four checkers, in parallel, each given only the built PDFs (student and solution versions), the agenda, and scope.md, never the drafter’s reasoning:
    • Key checker: for every item, is the keyed answer uniquely right, and could a prepared student defend another option? Proposes widening the key (accept X) rather than arguing later. Also checks the key for visible patterns (column, row, position, yes/no runs).
    • Student reader: reads the student PDF cold, as a student would, and flags two readings, terms never used in class, double negatives, stems that reveal what the question pretends is hidden, a form of answer the stem does not state, boxes too small for the answer asked, and anything that would take longer than the exam’s time budget.
    • Scope and coverage checker: maps every question to the agenda; flags anything outside the range or inside an agenda statement of “will not be asked” or “not covered”; checks that every exam flag in the range is covered, that each assignment in the range has a question only a student who did it can answer, and that every question about a hands-on matches what the agenda says the hands-on actually did.
    • Question-type mix: before the exam is final, tabulate the question types against the most recent exam of the same kind (select-all, yes/no with explanation, matching, labeled small boxes, free answer boxes, drawings; counts per type and points per type), and show the table to the instructor with the key table. The purpose is to see at a glance whether the draft drifted toward free-answer questions (more grading) or toward bubbles (less understanding tested); the instructor decides whether to convert anything. Grids of one-word boxes count as short answer but grade like bubbles. The Autumn 2026 ML final kept 12 free boxes like its midterm and traded three select-alls for a matching item and six grid questions; the instructor kept it.
    • Cold solver: answers the student PDF with no access to the key, then the orchestrator compares its answers with the key. Every disagreement is treated as a possibly ambiguous question until the key checker and the student reader have looked at it.
  3. Fold-in. The orchestrator collects the four reports, decides each item (fix the stem, widen the key, replace the question, or keep with a note), sends the agreed changes back to the drafter to apply, rebuilds, re-runs the validation, and repeats the key checker and the cold solver on any question that changed.
  4. Record. README.md lists what each checker found and what changed. Disagreements the instructor should rule on are listed at the top of the report to the instructor, with the key table.

This replaces the “two independent reviews” above with four when agents are available; the two-review minimum still holds when they are not.

Validation

make all
pdfinfo exam.pdf | grep Pages          # must equal the requested page count
grep -o '\\prob{[0-9]*}' questions.tex | tr -dc '0-9\n' | awk '{s+=$1} END {print s}'   # must equal the point total

Open the PDF page by page: no question split across a page, no orphaned heading, no overlapping text, answer boxes start on a new line, multiple-choice options don’t spill across columns. Open exam-solution.pdf too and look at where the filled bubbles and circled yes/no answers fall: no column, row or position should stand out. Too long: remove page breaks between sections, shrink boxes, merge questions. Too short: enlarge boxes.

Instructor-only