AI Engineering, story 2The shop gives it a voice

HM Nayem asks about a jacket

1 of 12

The shop gives it a voice: AI Engineering, story 2

The same question gets a useless answer, then a great one. The model did not change. See what did.

The model reads a prompt the shop wrote: instructions, examples and room to think shape every answer.

The story, step by step

  1. HM Nayem asks about a jacket

    HM Nayem asks the shop's chat about a jacket it sells. In the last story the server passed the question straight to the model. Watch what comes back when it does only that.

  2. A stranger's answer

    The reply is polite and useless. The model has never heard of this shop or its jackets. All it saw was one sentence from a stranger.

  3. What the model actually saw

    Here is everything the model was sent. One sentence. No shop name, no product list, no hint of who is asking or why. It gave the best answer anyone could give from that.

  4. The shop writes instructions

    So the shop writes instructions, and its server places them in front of every question. This is called the system prompt. HM Nayem never sees it, but the model reads it first, every time.

  5. What good instructions cover

    Good instructions answer four questions for the model. Who are you? What do you know? How should you sound? What must you never do? Anything left out, the model fills in with a guess.

  6. Same question, new answer

    Same question, same model, a completely different answer. Nothing about the model changed. Only the text it was given.

  7. Show it what good looks like

    The shop wants shorter replies in one fixed style. Describing a style is hard. Showing it is easy. So the server adds a worked example, and the model copies the pattern.

  8. It copies the pattern

    The reply now has the same shape as the example: a direct answer, then one fact. Examples steer a model more reliably than any description.

  9. A question that needs working out

    Now HM Nayem asks something that needs a little arithmetic. Pushed to answer in its short style straight away, the model blurts out a guess. The guess is wrong.

  10. Why it guessed

    A model writes one token after another and cannot go back. In its short style, the very first word has to be Yes or No. So it must commit before doing any sums. That is close to a coin toss.

  11. Room to think

    So the server lets the model think before it answers. It works the sum out in private, then writes the reply. HM Nayem sees only the last part. Thinking costs a little time and a few extra tokens.

  12. The prompt HM Nayem never sees

    This is what really reaches the model with every message. HM Nayem wrote one line of it. The shop wrote the rest. Shaping this text is called prompt engineering.

The model answers the text it is given.

Ideas in this story