AI Book Tutorial menu

What AI Really Is Today

When people say "AI" in 2026, they usually mean large language models: programs that read and write text, and increasingly see images and hear audio.

AI Is a Big Family

"Artificial intelligence" is an old and wide field. Today most of the attention is on one member of the family:

KindWhat it doesExample
Classic machine learningLearns patterns from tables of dataPredicting house prices, catching card fraud
Computer visionUnderstands pictures and videoReading number plates, checking X-rays
Large language models (LLMs)Read and write language and codeModels like ChatGPT, Gemini and Claude
Generative media modelsCreate images, audio and videoMaking a poster or a voice-over

For the full family tree, read What is AI? in the AI Tutorial.

A Language Model, in One Sentence

A large language model is a program that, given some text, predicts what text should come next, one small piece at a time.

That sounds simple, but when a model learns from a huge amount of text, "predicting the next piece" well requires learning grammar, facts, styles, reasoning patterns and code.

Here is a tiny toy version. It counts which word comes after each word in a small text:

Example

python
from collections import Counter, defaultdict

text = ("the shop opens at nine . the shop closes at ten . "
        "the bus comes at nine . the shop sells books .")
words = text.split()

next_words = defaultdict(Counter)
for current, nxt in zip(words, words[1:]):
    next_words[current][nxt] += 1

for word in ["the", "shop", "at"]:
    print(word, "->", next_words[word].most_common(2))
Output
the -> [('shop', 3), ('bus', 1)]
shop -> [('opens', 1), ('closes', 1)]
at -> [('nine', 2), ('ten', 1)]

After "the", our toy model has seen "shop" three times, so it would guess "shop". Now let it write a sentence by picking next words again and again:

Example

python
from collections import Counter, defaultdict
import random

text = ("the shop opens at nine . the shop closes at ten . "
        "the bus comes at nine . the shop sells books .")
words = text.split()
next_words = defaultdict(Counter)
for current, nxt in zip(words, words[1:]):
    next_words[current][nxt] += 1

random.seed(1)
word, sentence = "the", ["the"]
while word != "." and len(sentence) < 10:
    options = next_words[word]
    word = random.choices(list(options), weights=options.values())[0]
    sentence.append(word)
print(" ".join(sentence))
Output
the shop sells books .

A real LLM does not count words like this. It uses a neural network with billions of numbers and looks at the whole text so far, not only the last word. But the loop is the same: predict a piece, add it, repeat. How LLMs Generate Text explains this loop in more detail.

Assistants, Tools and Agents

In 2026 you will meet LLMs in three main forms:

  • Chat assistants: you type, it answers. Models like ChatGPT, Gemini and Claude in an app or website.
  • AI inside other apps: writing help in email, summaries in meeting software, code suggestions in an editor.
  • Agents: the model is allowed to use tools (search, run code, edit files, call APIs) in a loop to finish a bigger task. See the AI Agents Tutorial.

Most modern models are multimodal: they can read images and documents, and many can listen and speak.

What Today's AI Is Good At

  • Drafting, rewriting, summarising and translating text
  • Explaining topics at different levels, from a Class 8 student to an expert
  • Writing, explaining and fixing code
  • Pulling information out of messy text into a clean format
  • Brainstorming ideas and options

Where It Still Fails

  • It can be confidently wrong. It may invent facts, names, prices or references. This is called hallucination (Part 4).
  • It does not know your private data unless you give it to the model.
  • Its knowledge stops at a date unless it is connected to search.
  • It is not a calculator or a database. Exact maths and exact records belong in normal code, which the model can call as a tool.
  • It has no real understanding of consequences. A human must stay responsible for important decisions.

A good mental model: an LLM is a very fast, well-read assistant that sometimes makes things up. Use it for first drafts and ideas, and check anything important.

Exercise

Exercise

At its core, what does a large language model do?

Learn AI Book with a teacher

Join the AI & Prompt Engineering course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp