beginner8 min · 9 steps

How AI Prompting Works: From Words to Understanding

Discover what an AI actually does when it reads your prompt, then steer it with better instructions, context, data, and format.

Step 1 of 9

1The black box

📝
Your prompt

You type: 'Explain gravity like I'm five.'

The AI only sees numbers. Every word becomes a token ID.

It doesn't 'understand' gravity. It predicts the most likely next word, then the next, then the next.

Prompting steers those predictions. Let's see how.

Text outline of this lesson
  1. The black box

    You type: 'Explain gravity like I'm five.'

    The AI only sees numbers. Every word becomes a token ID.

    It doesn't 'understand' gravity. It predicts the most likely next word, then the next, then the next.

    Prompting steers those predictions. Let's see how.

  2. Make a prediction

    Poll: How do you think an AI 'understands' your prompt?

  3. Steer with temperature

    Interactive: AI creativity (temperature)

  4. Anatomy of a prompt

    Exercise: Sort these prompt parts into their roles.

    Strong prompts separate what to do, who it's for, the raw material, and how to shape the answer. Each piece steers the model's word predictions.

  5. Words become numbers

    Run this tiny simulation to see how a prompt becomes numbers (tokens). The model never sees raw text—only IDs.

  6. Check your understanding

    Quiz: What does a large language model actually do when it receives your prompt?

    LLMs are next-token predictors trained on vast text. They don't consult an answer database or understand like humans. They calculate probabilities for what should come next, based on patterns learned during training—like super-powered autocomplete.

  7. Choose your path

    Want to see quick prompt tips before wrapping up?

  8. Three quick tips

    Three quick prompt tips 1. Be specific: 'Summarize in two bullets' works better than 'Summarize this.' 2. Add context: Tell the AI who the audience is (a child, a CEO, a coder). 3. Set the format: Ask for a table, list, or code block. Small changes steer the model's predictions in useful ways.

  9. Takeaway

    Takeaway AI doesn't 'understand' your prompt like a person. It predicts the most likely next word, again and again. Good prompting gives the model clear patterns—instruction, context, input, and format—so those predictions land where you want them.

How AI Prompting Works: From Words to Understanding · xus.me