Photo by chansu shin on Unsplash

On this page

This page is an overview of the core ideas behind today’s AI. Each section answers one question a newcomer usually has, in an order where each concept builds on the one before. Product names and model versions change every few months; these concepts stay the same.

AI, machine learning, deep learning, and generative AI

These four terms are often used as if they meant the same thing. They are nested, each one a part of the one before.

Diagram 1
flowchart TB
  subgraph ai["Artificial intelligence: machines doing tasks that need intelligence"]
    subgraph ml["Machine learning: learning rules from data"]
      subgraph dl["Deep learning: neural networks with many layers"]
        genai["Generative AI: producing new text, images, audio, and code"]
      end
    end
  end
  • Artificial intelligence is the whole field. It includes old rule-based systems that did not learn at all.
  • Machine learning is the part of AI where a system learns its behavior from examples instead of following written rules.
  • Deep learning is machine learning with large neural networks of many layers. It drives almost all recent progress.
  • Generative AI is deep learning that produces new content instead of only classifying or predicting. Chat assistants and image generators belong here.

Data, training, and inference

Every machine learning system has two phases.

Training is the learning phase. The system processes a large amount of data and adjusts itself until its outputs match the examples well. For large models, training takes weeks or months on thousands of specialized chips and costs millions of dollars. It happens once per model version.

Inference is the use phase. The finished model receives new input and produces an output. Each time you send a message to a chat assistant, the model runs inference. It does not learn from your message while answering it.

The quality of a model depends heavily on its training data. A model learns the patterns, the gaps, and the biases of that data.

How a model learns

There are three basic ways a model can learn.

  • Supervised learning uses examples with the correct answer attached: photos labeled “cat” or “dog”, emails labeled “spam” or “not spam”. The model learns to predict the label.
  • Unsupervised learning uses data without labels and finds structure on its own, such as groups of similar customers. Large language models use a variant called self-supervised learning: the next word in a text is the label, so any text becomes training data without manual labeling.
  • Reinforcement learning lets the model act and gives it a reward or a penalty for the result. It learns which actions lead to high rewards. AlphaGo learned Go this way, and language models are refined with it after their initial training.

Neural networks and parameters

A neural network is a large chain of simple calculations, organized in layers. Each connection between calculations has a weight: a number that says how strongly one value influences the next. These numbers are the parameters of the model.

Training adjusts the parameters. The model makes a prediction, measures how wrong it was, and shifts every parameter a tiny amount in the direction that would have reduced the error. Repeated billions of times, this turns random numbers into a model that has learned something.

Large language models have billions to trillions of parameters. Parameter count is a rough indicator of capacity, not of quality. A smaller model trained on better data can beat a larger one.

Models, foundation models, and fine-tuning

A model is the result of training: the architecture plus the learned parameters, stored in files that can be several hundred gigabytes. Running a model means loading those parameters and computing an output from an input.

A foundation model is a large model trained on broad data so it can be used for many tasks. Training it from scratch is called pre-training. Only a few organizations can afford it.

Fine-tuning continues training a pre-trained model on a smaller, specific dataset, such as medical texts or a company’s support tickets. It is much cheaper than pre-training and adapts the model’s style or specialty. Chat assistants are foundation models fine-tuned to follow instructions and hold a conversation. How large language models are built follows these stages in order.

Large language models and tokens

A large language model (LLM) is a neural network trained to predict the next piece of text. Given “The capital of France is”, it assigns a high probability to “Paris”. Producing an answer means repeating that step: predict the next piece, add it to the text, predict again. Translation, summaries, and code all come from this single skill applied at a very large scale.

Models do not read words or letters. They read tokens: frequent words, parts of words, or punctuation. In English, a token is on average about four characters, or roughly three quarters of a word. Tokens matter in practice for two reasons. API prices are charged per token, for both input and output. And every model has a limit on how many tokens it can handle at once.

Prompts, context, and sampling

A prompt is the input you give the model. In chat applications it often has several parts: a system prompt with standing instructions from the application, the conversation so far, attached documents, and your latest message.

The context window is the maximum number of tokens the model can consider at once, input and output together. Current models handle from tens of thousands to over a million tokens. Everything outside the context window does not exist for the model. A chat assistant does not remember earlier conversations unless the application puts them back into the context.

When the model picks the next token, it chooses from a probability distribution. Temperature controls how adventurous that choice is. A low temperature almost always picks the most likely token and gives focused, repeatable answers. A higher temperature allows less likely tokens and gives more varied, creative output. This is why the same question can get different answers. Prompting fundamentals covers how to write prompts that work.

Embeddings and retrieval

An embedding turns a piece of text into a list of numbers that represents its meaning. Texts with similar meaning get similar numbers, even when they use different words. “How do I reset my password” and “I forgot my login” end up close together.

Embeddings power semantic search, and they enable retrieval-augmented generation (RAG). A RAG system searches a document collection for passages relevant to a question, adds them to the prompt, and asks the model to answer from those passages. The model then works with current or private information it was never trained on, and the answer can cite its sources. Retrieval-augmented generation explained goes through the steps.

Hallucinations and other limits

A language model produces plausible text, not verified facts. When it has no reliable answer, it can still produce a fluent one: an invented quote, a non-existent function, or a wrong date. This is called a hallucination, and it is a property of how these models work, not a rare bug.

Other limits to keep in mind:

  • Knowledge cutoff. A model knows nothing that happened after its training data was collected, unless the application gives it search or documents.
  • Bias. A model reflects the biases of its training data, including stereotypes and the dominance of some languages and viewpoints.
  • No real memory. A model starts each conversation from the same parameters. What looks like memory is text the application stored and put back into the context.
  • Weak exact computation. Models predict text; long arithmetic and exact counting are better done by code the model can call.

Reasoning models and multimodality

Reasoning models are trained to work through a problem step by step before giving the final answer, producing an internal chain of thought. They are slower and use more tokens, but they are much better at math, logic, planning, and complex code. Many models let the application choose how much reasoning effort to spend.

Multimodal models handle more than text. They can read images, screenshots, PDFs, and audio, and some generate images, speech, or video. A single model can describe a photo, read a chart, or answer a spoken question.

Open weights and closed models

A closed model is available only through the provider’s applications and API. You send data to the provider and pay per use. The parameters stay secret.

An open-weight model publishes its parameters for download, under a license that sets the terms of use. You can run it on your own hardware, keep data in-house, and fine-tune it. “Open weights” is not the same as open source: the training data and code are often not published. Running a large open model needs powerful GPUs, so many people still use them through a hosting provider.

Open-weight versus closed models compares the two in detail, and Foundation Model Providers lists which providers publish weights.

Alignment and safety

A model fresh from pre-training predicts text; it does not follow instructions well and will continue harmful text as easily as helpful text. Alignment is the work of making a model helpful, honest, and harmless.

The best-known method is reinforcement learning from human feedback (RLHF). People rate or rank model answers, a second model learns those preferences, and the language model is trained to produce answers that score well. Variants use written principles or AI-generated feedback instead of human ratings for part of the work.

Safety also covers misuse, such as help with cyberattacks or dangerous chemistry, and prompt injection, where text hidden in a document or web page gives the model instructions the user never wrote. These risks grow when models can act on their own, which Agentic AI covers. AI safety and risks gives the wider picture.

Check your understanding

Question 1 of 10

0 of 10 checked

  1. 1. How do AI, machine learning, deep learning, and generative AI relate?

Search articles

Type a word to search published articles.

Open the search page