AI Engineering, story 4Fill in the form

HM Nayem wants to return a jacket

1 of 11

Fill in the form: AI Engineering, story 4

HM Nayem writes one friendly sentence asking to return a jacket. Watch it become a form that software can act on.

The model picks words by weighted chance, so code asks for a fixed shape, checks it, and retries.

The story, step by step

  1. HM Nayem wants to return a jacket

    HM Nayem writes to the shop the way anyone would: one friendly sentence. But this message is not for a person. It has to end up in the shop's returns system.

  2. Software wants a form

    The returns system cannot read sentences. It needs a form: an order number, an item, and a reason picked from a fixed list. Something has to turn those words into fields.

  3. A language software can read

    Programs pass data to each other in strict formats. The most common is called JSON: names on the left, values on the right, wrapped in braces. If one bracket or one value is off, the program receiving it gives up.

  4. Ask the model for the form

    So the server asks the model to do the reading. Its instructions say exactly what shape to reply in: a small block of structured text called JSON, with three named fields.

  5. How it chooses each word

    Remember, a model writes by guessing the next token. Each guess is a set of odds, and it rolls weighted dice. Usually the most likely token wins. Not always.

  6. Sometimes the dice land badly

    This time an unlikely token wins, and the reason comes back as a phrase instead of one of the allowed values. It reads fine to a person. The returns system would reject it.

  7. Check, then ask again

    Good code never trusts the reply. The server checks every field against the rules. When one fails, it sends the model its own answer back with the error, and asks again.

  8. Dial one: temperature

    Every model call has a setting called temperature. Turned up, unlikely tokens get more of a chance, which suits creative writing. Turned down to zero, the model takes the likeliest token every time. For filling in forms, zero is what you want.

  9. Dial two: a shape it must follow

    Many providers go further. The server hands over the exact shape it needs, and the model is only allowed to pick tokens that fit it. A reason outside the list becomes impossible, not just unlikely.

  10. A form the system accepts

    The second reply passes every check. The server hands it to the returns system, which finally has what it needs. HM Nayem's sentence has become data.

  11. Now at real speed

    Read, check, retry, file. A model turning messy human words into clean data that software can act on is behind a huge share of real AI products.

That is how words become data.

Ideas in this story