3.6 Prompting and getting good outputs

Week 3
Pick a depth · ✨ generates it for this lecture

Prompting and getting good outputs

With generative models, the input you provide is called a prompt, and because the model produces whatever plausibly continues your prompt, how you ask dramatically changes what you get. Prompting is a practical skill, not magic, and a few principles cover most of it.

Be specific and give context

A vague prompt yields a vague, generic answer, because many continuations are plausible and the model averages over them. The more you constrain — the audience, the format, the length, the tone, the relevant facts — the more the model's output narrows toward what you actually want. "Write about dogs" invites a shapeless essay; "Write a 100-word friendly paragraph for first-time owners on house-training a puppy" gets a usable one.

Show examples

Including a few examples of the input-output pattern you want, called few-shot prompting, steers the model powerfully. If you want data formatted a certain way, showing two or three correctly formatted examples is often more effective than describing the format in words. The model recognizes and continues the pattern.

State the role and the steps

Telling the model who to be ("You are a careful editor") and asking it to work step by step often improves results on complex tasks, because it nudges the generation toward the right style and a more deliberate process rather than a rushed first guess.

Iterate

Prompting is rarely one-shot. Treat the first output as a draft: see where it falls short, refine the prompt or ask for revisions, and converge. The conversation itself is part of the technique.

A worked example

Prompt A: "Give me feedback on my essay." The model has no essay, no criteria, no audience — it returns generic platitudes. Prompt B: "Here is my 300-word college application essay [text]. You are an admissions reader. Point out the three weakest sentences and suggest a sharper version of each, keeping my voice." The second prompt supplies the content, a role, a clear task, and a format — and gets specific, actionable output. Same model; the difference is entirely in the asking.

Tip: highlight any passage above to ask the tutor about it, or to generate practice problems specifically on what you selected.
Ask the tutor for an explanation, a worked example, or a hint. Highlight a passage on the left to ground the question in that text.