Chatbots such as the AI assistants you may have used are powered by large language models (LLMs). At heart, an LLM does one thing very well: predict the next piece of text.
Predicting the next word
Given "The capital of Nepal is", the most likely next word is "Kathmandu". A language model learns such patterns from a huge amount of text. Text is split into small pieces called tokens (words or parts of words). The model repeatedly picks a likely next token, building a reply one token at a time.
A toy version
This tiny program learns which word tends to follow which, from one short text. It is far simpler than a real model, but the idea of "predict the next word from patterns in text" is the same.
text = "i like tea i like books i like tea"
words = text.split()
followers = {}
for current, nxt in zip(words, words[1:]):
followers.setdefault(current, []).append(nxt)
def most_likely(word):
options = followers[word]
return max(set(options), key=options.count)
print(most_likely("i"))
print(most_likely("like"))
Output:
like
tea
Why chatbots can be wrong
- They predict plausible text, not verified facts, so they can state wrong things confidently. This is often called a hallucination.
- They only know what was in their training data, which may be out of date.
- They can reflect biases in the text they learned from.
Prompting: asking well
| Weak prompt | Better prompt |
|---|---|
| Tell me about history | Explain the unification of Nepal in 5 simple points for a Class 10 student |
| Fix my code | This Python function should return the average but returns 0. Here is the code and the error. What is wrong? |
| Write an essay | Write an outline for an essay on water pollution, with 4 headings, in simple English |
Good prompts say who it is for, what you want, the format, and any limits. You can also ask the AI to show its steps, and then check them yourself.
Use AI as a helper, not a judge. For exams, facts, health, money or law, always confirm with a reliable source or a teacher.
Think about it
- Ask an AI tool a question you already know the answer to. Is it fully correct?
- Rewrite one of your own questions to include the audience and the format.
- Why is it risky to copy an AI answer straight into homework?
Final lesson: using AI responsibly, and where to go next.

Comments
Loading comments…