AI fundamentals: generative AI, LLMs and RAG explained
AI fundamentals are the core ideas behind modern AI software. Generative AI creates new text, images, audio or code from patterns learned in training data. Large language models (LLMs) are the generative models that work with text, and retrieval-augmented generation (RAG) connects them to your own documents. This guide explains each idea in plain language so you can judge AI tools with confidence.
Most AI products on the market are built from a small set of shared building blocks. A chatbot, a writing assistant, a coding tool and a customer-support agent may look different, but underneath they usually combine a foundation model, a prompt, some way of supplying context, and limits on cost and accuracy. Once you understand those parts, product pages and pricing tables become much easier to read.
This section starts with definitions: what a large language model is, how text is split into tokens, what a context window limits, and why models sometimes produce confident but wrong answers, known as hallucinations. It then covers the techniques vendors use to make models more useful, such as retrieval-augmented generation, embeddings, vector databases and fine-tuning.
Every explanation is written for people choosing or using AI software, not for researchers. Where a concept comes from a specific paper, the glossary entry links to the primary source, so you can check the original rather than rely on a summary.
What you will learn
- What generative AI and large language models are, and how they produce output
- How tokens and context windows shape what a model can read, remember and cost
- Why hallucinations happen and how retrieval-augmented generation reduces them
- When fine-tuning is worth it compared with better prompts or retrieval
- How open-weight, reasoning and multimodal models differ from standard chat models
Beginner lessons
What is artificial intelligence (AI)?
Artificial intelligence (AI) is the field of building computer systems that do tasks which normally need human intelligence, such as…
What is machine learning?
Machine learning (ML) is a branch of artificial intelligence in which computers learn to perform a task from examples instead of being…
What is deep learning?
Deep learning is a type of machine learning that uses neural networks with many layers to learn directly from raw data such as pixels…
What is a neural network?
A neural network is a computer model made of many simple connected units, called artificial neurons, arranged in layers. Each connection…
What is generative AI?
Generative AI is artificial intelligence that creates new content, such as text, images, audio, video or code, in response to a prompt. It…
What is a large language model (LLM)?
A large language model (LLM) is an AI model trained on huge amounts of text to predict which word fragment, or token, comes next…
What is ChatGPT and how does it work?
ChatGPT is an AI chat assistant made by OpenAI and launched on 30 November 2022. You type a question or instruction, and it replies in…
What is an AI chatbot?
An AI chatbot is software that holds a conversation with you in text or voice and uses artificial intelligence to understand your message…
What is a token in AI?
A token is a small piece of text, such as a word, part of a word, a punctuation mark or a space, that a language model reads and writes…
What is a context window?
A context window is the maximum amount of text, measured in tokens, that a language model can consider at one time. It holds your…
What are parameters in an LLM?
Parameters are the numbers inside a large language model that it learns during training. Each one is a tiny adjustable weight that shapes…
What is temperature in AI models?
Temperature is a setting that controls how much randomness an AI model uses when it picks each next word. At a low temperature the model…
What is an AI hallucination?
An AI hallucination is when an AI model produces information that sounds confident and plausible but is false, made up or not supported by…
What is RAG (retrieval-augmented generation)?
RAG, short for retrieval-augmented generation, is a way of making an AI model look things up before it answers. The system first searches…
What is fine-tuning?
Fine-tuning is extra training that adapts an existing AI model to a specific job. You take a model that has already learned general…
What is multimodal AI?
Multimodal AI is AI that can understand or create more than one kind of data, such as text, images, audio and video, in a single system…
What is computer vision?
Computer vision is the field of AI that lets computers interpret images and video: recognising objects, reading text, spotting faces and…
What is natural language processing (NLP)?
Natural language processing (NLP) is the branch of AI that lets computers work with human language: reading, interpreting, translating…
What is AGI and how is it different from AI?
AGI, or artificial general intelligence, is a hypothetical AI that could learn and perform almost any intellectual task a person can…
What is open-source AI?
Open-source AI is AI whose building blocks are published so anyone can use, study, modify and share them. For a model, that means the…
Is AI bad for the environment?
AI does have an environmental cost, mainly the electricity and water used by data centres to train and run models, plus the emissions from…
Is AI safe to use?
AI is generally safe for everyday tasks if you treat it as a capable but fallible assistant. The main risks are confident wrong answers…
Key terms
- Large language model (LLM)
A large language model (LLM) is an AI model trained on very large amounts of text to predict the next token in a sequence. That simple objective…
- Generative AI
Generative AI is a type of artificial intelligence that creates new content, such as text, images, audio, video or code, based on patterns learned…
- Retrieval-augmented generation (RAG)
Retrieval-augmented generation (RAG) is a technique that gives a language model relevant information from an external source, such as company…
- Token
A token is the basic unit of text a language model reads and writes. Tokenizers split text into tokens, which can be whole words, parts of words…
- Context window
A context window is the maximum amount of text, measured in tokens, that a language model can take into account at one time. It includes the system…
- Hallucination
In AI, a hallucination is output that sounds plausible but is false, unsupported by the model's sources or entirely made up, such as an invented…
- Embedding
An embedding is a list of numbers (a vector) that represents the meaning of a piece of data, such as a word, sentence, image or document. Items with…
- Vector database
A vector database stores embeddings, the numerical representations of text, images or other data, and finds the stored items most similar to a query…
- Fine-tuning
Fine-tuning is the process of further training an existing AI model on a smaller, task-specific dataset so it adapts its behaviour, style or format…
- Multimodal AI
Multimodal AI refers to models that can understand or generate more than one type of data, such as text, images, audio and video, within a single…
- Foundation model
A foundation model is a large AI model trained on broad data at scale that can be adapted to many different tasks, such as writing, coding, image…
- Inference
Inference is the stage where a trained AI model is used to produce output: it takes an input, such as a prompt or an image, and generates a…
- Transformer
The transformer is a neural network architecture, introduced in the 2017 paper "Attention Is All You Need", that processes sequences using a…
- Reasoning model
A reasoning model is a language model trained to work through a problem in intermediate steps before giving its final answer, a process often called…
- Open-weight model
An open-weight model is an AI model whose trained parameters (weights) are published for anyone to download, run and often fine-tune on their own…
Explore Mindber
Further reading
- Best AI Models, Ranked — June 2026 Leaderboard for Text, Coding, Agents, Image & Video (With Sources)
The best AI model in June 2026 depends on the job: Claude Fable 5 leads capability, GPT-5.5 coding agents, Gemini 3.1 Pro value. Ranked, with sources.
- Claude Fable 5: What It Is, How to Use It, and the Prompts That Exploit It
Anthropic's first public Mythos-class model, explained with sources: pricing, safeguards, benchmarks, access methods, real use cases, and copy-paste prompts.
- Opus 4.8 Cost Calculator: When It Beats Sonnet & GPT-5.5
Opus 4.8 API cost calculator vs Sonnet 4.6, Haiku 4.5, GPT-5.5. Break-even workloads, smart-routing saves ~32%, per-model cache rates. Any currency.
Frequently asked questions
What is the difference between AI, machine learning and generative AI?
Artificial intelligence is the broad field of making computers perform tasks that normally need human judgement. Machine learning is the main way modern AI is built: systems learn patterns from data instead of following hand-written rules. Generative AI is a branch of machine learning whose models create new content, such as text, images, audio or code, rather than only classifying or predicting.
Is ChatGPT a large language model?
ChatGPT is an application built on top of large language models. The LLM is the underlying model that predicts text; ChatGPT adds a chat interface, conversation history, safety systems, file handling and other tools around it. The same distinction applies to most AI assistants: the product you use and the model inside it are separate, and a product can switch models over time.
Do I need to know how to code to understand AI fundamentals?
No. The concepts in this section, such as tokens, context windows, retrieval and fine-tuning, can be understood without programming. Knowing them helps you compare products, estimate costs and spot unrealistic marketing claims. Coding becomes useful only if you want to call model APIs directly or build your own AI applications.
Why do AI models give different answers to the same question?
Most language models generate text by sampling from a probability distribution over possible next tokens, so the same prompt can produce different wording or even different conclusions. Settings such as temperature control how much randomness is allowed. Differences in model version, system prompt, retrieved context and conversation history also change the result, which is why important answers should be checked.
Last updated