What This Lab Is For

You will experience — personally and concretely — the gap between what you intend to say and what a model interprets from what you wrote. This gap is the core engineering challenge of the course. Everything from prompt engineering to agent design is ultimately about closing it.

No code. No API keys. No setup required.

The Function

This function will be displayed on the screen throughout the lab. Read it carefully before writing anything.

def mystery(items):
    if not items:
        return []
    pivot = items[0]
    smaller = [x for x in items[1:] if x <= pivot]
    larger  = [x for x in items[1:] if x > pivot]
    return mystery(smaller) + [pivot] + mystery(larger)

Before you write your prompt: form your own understanding of what this function does. What does it produce? What happens on an unusual input? What would a junior engineer need to know about it?

That understanding is your benchmark. It is what you are trying to get the model to produce.

Part 1 — Write Your First Prompt (10 minutes, individual)

Write a prompt asking the model to explain what this function does.

Write it the way you naturally would. Do not overthink it. Do not discuss with the person next to you — your instinct is the point.

Write it down and keep it. You will need it for your log entry at the end.

Then submit your prompt to the class document using the link on the screen. You can submit anonymously or with your name — your choice.

Part 2 — Observe (10 minutes)

The instructor will run three or four submitted prompts live on the projector.

For each output, ask yourself one question:

What did the model interpret differently from I intended?

Not: was this good or bad? Not: do you like it?

Specifically: what decision did the model make that the student did not make explicitly?

Things to watch for:

Every one of these is a decision the student implicitly delegated to the model. The model is not wrong — it made the most probable interpretation of what was written. The gap is between what was written and what was meant.

Part 3 — Revise Your Prompt (10 minutes, individual)

Write a second version of your prompt.

Rule: change only one thing.

Not a complete rewrite. Identify the single most important gap you observed — the decision the model made that you most disagreed with — and address that one thing explicitly.

If you are not sure what to change, ask yourself: what was the one thing in the output that most surprised or disappointed you? That is your one thing.

Some examples of what a one-thing change might look like:

These are not the right answers — they are examples. Your gap may be something completely different.

Part 4 — Observe Again (10 minutes)

The instructor will run the revised versions of the same prompts.

For each pair of outputs (original and revised), ask yourself:

Both outcomes are equally interesting. Closing one implicit decision often reveals another you had not noticed. That is not failure — that is how prompt engineering actually works. It is iterative, not a one-shot fix.

Part 5 — Prompt Engineering Log Entry (5 minutes)

Write your first prompt engineering log entry.

You will maintain this log all semester. It is an individual record of significant AI interactions and the engineering judgments you made about them — what you asked, what it produced, what you decided, and why.

Your first entry has four fields:

Submit your log entry as a text file, in the format [your-student-id]-lab-1.txt, to E3 under “Week 1 Lab” before the end of week (September 11th).

If You Finish Early

Try a third version of your prompt — one more one-thing change, based on what you observed in Part 4. Add a second observation to your log entry noting what happened.

If you have access to a model (Claude.ai, ChatGPT, Gemini, or anything else), try running your own prompts and add those observations to your log. You do not need API access — any web interface works.

Grading

This lab will not be graded. It is for you to get a sense of what might be coming in this semester, and get familiar with lab submissions.

← Back to Calendar