BeginnerAbout 13 min

    Prompt Engineering

    Read the full article on Substack

    6 min read.

    Toggle prompting techniques — system role, few-shot, chain-of-thought, output constraints — on a real task and watch the constructed prompt and the model's answer get sharper.

    Think of it this way: A prompt is like a work order for a brilliant but literal contractor: state who they are, show two examples of what "done" looks like, describe the job, ask them to think it through, and specify the exact format to hand back. Vague orders get vague work.

    Prompt
    task23 tokens
    Classify the sentiment of this review: "The pasta was undercooked and the waiter was rude."
    Reply

    This review seems fairly negative overall, though tone can be subjective and depends on context…

    About 23 prompt tokens. Code would have to guess the label from free text.

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Assemble a production prompt

    Sequence

    Order the sections of a well-structured prompt, top to bottom.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Quiz

    21 questions
    Question 1 of 21
    Score: 0

    A model given a strict JSON-format constraint returns perfectly valid JSON that is factually wrong. What does this demonstrate?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going