You have used one if you have chatted with an AI assistant, asked a tool to summarize a document or watched code get autocompleted. The term gets used loosely, and that vagueness is a problem when you are trying to learn the field or pass a certification. This guide defines an LLM precisely, explains how one works without any math, covers the limits that matter in practice, and maps the vocabulary to what the Google Generative AI Leader exam and the AWS AI Practitioner (AIF-C01) exam expect you to know.
What is an LLM in plain English?
A large language model is a neural network trained on an enormous amount of text so that it becomes very good at one task: given some text, predict what comes next. Do that one token at a time, feeding each prediction back in, and the model can write an email, explain a concept, translate a paragraph or produce working code. The “large” refers to the volume of training data and the number of internal values the model learns (its parameters). The “language model” part means the model represents which sequences of words are likely.
Definition box
LLM: a machine learning model, typically a transformer, trained on large text datasets to generate and understand natural language.
Not to be confused with a chatbot (an application), a search engine (retrieves documents) or a database (stores and returns exact records).
Two clarifications save a lot of confusion. First, ChatGPT, Gemini, Claude and Copilot are products; the LLM is the engine inside. The product adds a chat interface, hidden instructions, safety filters and sometimes tools such as web search. Second, an LLM does not hold a tidy list of facts. Its knowledge is spread across billions of learned numbers, which is why it can explain photosynthesis fluently and still get a date or a citation wrong.
How do LLMs work?
Four ideas explain almost everything: tokens, embeddings, attention and next-token prediction.
Tokens: how text becomes numbers
Models do not read letters or words. A tokenizer splits text into tokens, which can be whole short words, parts of longer words, punctuation or spaces, and maps each to an integer ID. “Unbelievable” might become several tokens while “cat” is one. The exact split depends on the model's tokenizer, so there is no universal conversion, only rough rules of thumb. Tokens matter because the context window and usage pricing are both measured in them.
Embeddings: meaning as coordinates
Each token ID is converted to an embedding, a long list of numbers that places the token in a mathematical space. During training, tokens used in similar ways end up close together, so the vectors for “doctor” and “nurse” sit nearer than “doctor” and “bicycle”. Embeddings are how a model represents meaning numerically, and the same idea powers semantic search and the retrieval step in retrieval-augmented generation.
The transformer and attention
The transformer architecture was introduced in the 2017 paper “Attention Is All You Need” (Vaswani et al.). Its key mechanism is self-attention: for every token, the model computes how much to weigh every other token in the input when deciding what that token means in context. In “The trophy did not fit in the suitcase because it was too big”, attention helps link “it” to “trophy”. Stacks of attention layers, alternating with other neural network layers, build up an increasingly rich picture of the whole passage. Because attention processes all tokens in parallel rather than strictly one after another, transformers train efficiently on modern hardware, which is a major reason this design took over.
Generation: one token at a time
To answer, the model reads your prompt and produces a probability for every possible next token. It selects one (how it selects is influenced by temperature), appends it to the text, and repeats until it decides to stop. Everything an LLM does, from poetry to SQL, is this loop. This is also why output can wander: each choice conditions the next, so an early mistake can carry forward.
How is an LLM trained?
An LLM is typically trained in three stages: pretraining on a very large text corpus to learn language, fine-tuning on curated examples to follow instructions or specialize, and preference tuning such as RLHF to align responses with human preferences. Each stage solves a different problem, which is why exams test the names.
| Stage | What happens | What it gives the model |
|---|---|---|
| Pretraining | The model learns to predict the next token across a very large, broad text corpus (self-supervised, no human labels needed). | General language ability, world patterns, broad knowledge up to its training cutoff. |
| Fine-tuning | Further training on a smaller, curated dataset, such as instruction and answer pairs or domain examples. | Better instruction following, a specific style, format or domain specialization. |
| Preference tuning (RLHF) | Human raters compare responses; their preferences train a reward signal that steers the model toward preferred behavior. | Responses that are more helpful, polite and safer, closer to what people want. |
Reinforcement learning from human feedback (RLHF) is the best-known preference method, and the high-level idea is all you need: people rank outputs, the system learns what they prefer, and the model is nudged toward it. Variants exist, but the exam-level takeaway is that RLHF is about alignment with human preferences, not about adding facts. Also note the knowledge cutoff: a model only knows what was in its training data, so recent events and private company data are invisible unless you supply them in the prompt or through retrieval.
Practice this with exam-style questions
Free practice questions (30 per session, practice mode) on the official exam topics for both AI certifications covered here.
What are context windows and temperature?
The context window is the maximum number of tokens a model can handle in a single request, counting your prompt, any supplied documents, the conversation history and the answer it is writing. Content beyond the limit is not seen. Practical consequences: long chats lose their early turns, big documents must be split or summarized, and a larger window does not mean the model uses every part of it equally well.
Temperature is a setting that controls randomness when choosing the next token. Low values make the model favor its top choices, giving focused and more repeatable output, which suits extraction, classification and compliance wording. High values flatten the choices and increase variety, which suits brainstorming and creative writing but raises the chance of off-topic or inaccurate text. Related controls such as top-p and top-k limit which candidate tokens are considered. Services expose these under slightly different names, so check the documentation of the platform you use.
| Setting | Controls | Use it when |
|---|---|---|
| Low temperature | Less random token choice | You want consistent, factual-style output. |
| High temperature | More random, varied token choice | You want creative variety. |
| Context window size | How much text fits in one request | Deciding whether to chunk, summarize or retrieve. |
| Max output tokens | Upper limit on response length | Controlling cost and preventing runaway output. |
Why do LLMs hallucinate?
A hallucination is output that sounds confident and fluent but is false, unsupported or made up, such as a citation to a paper that does not exist. It happens because the training objective rewards producing plausible text, not verified text. The model has no internal step that checks a claim against reality, and when it lacks information it still has to output something. Gaps in training data, ambiguous prompts, questions about recent or private information, and requests for very specific details (numbers, quotes, citations) all raise the risk.
Mitigations are layered, and none is perfect:
- Grounding with RAG: supply trusted, current documents in the prompt and instruct the model to answer only from them.
- Clear prompts: specify the task, the allowed sources and what to say when the answer is unknown.
- Lower temperature for factual tasks.
- Citations and verification: require sources and check them, ideally automatically.
- Human review for high-stakes outputs such as medical, legal or financial content.
What are the limitations of LLMs?
LLMs can hallucinate, have a knowledge cutoff, reflect bias in their training data, and handle only a bounded amount of text per request. They are also inconsistent and weak at exact computation. The main limits:
- Hallucination: plausible but wrong output, as above.
- Knowledge cutoff: no awareness of events or data after training unless provided.
- Bias: models can reproduce or amplify biases present in training data.
- Context limits: only a bounded amount of text per request.
- Inconsistency: the same prompt can yield different answers, and small wording changes can change results.
- Weak at exact computation: arithmetic and precise logic can fail unless the model calls a calculator or code tool.
- Security risks: prompt injection (malicious instructions hidden in input) and leaking sensitive data if prompts are not handled carefully.
- Cost and latency: larger models and longer prompts cost more and respond more slowly.
LLM vs traditional ML vs generative AI vs foundation model: what is the difference?
The terms nest: AI contains machine learning, which contains deep learning; generative AI creates new content; a foundation model is a broadly trained model adaptable to many tasks; and an LLM is a foundation model specialized for language.
| Term | Meaning | Example |
|---|---|---|
| Artificial intelligence | Broad field of systems that perform tasks associated with human intelligence. | Everything below. |
| Machine learning | AI that learns patterns from data instead of following hand-written rules. | Spam filter, churn prediction. |
| Traditional (predictive) ML | Task-specific models that predict a label or number, trained per use case, often on structured data. | Fraud score, demand forecast. |
| Deep learning | ML using many-layered neural networks. | Image recognition, transformers. |
| Generative AI | Models that create new content: text, images, audio, video, code. | Image generators, chat assistants. |
| Foundation model | Large model trained on broad data and adaptable to many tasks. | A general text, image or multimodal model. |
| LLM | A foundation model specialized for language (text, often code). | The model behind a chat assistant. |
The practical difference from traditional ML: a traditional model is typically built and trained for one narrow prediction, while an LLM is a general model you steer with instructions in plain language. That is why you can use one LLM for summarizing, classification and drafting without retraining. The trade-off is that a purpose-built model is often cheaper, faster and more predictable for a single well-defined task.
What are the basics of prompt engineering?
Prompt engineering is writing inputs that reliably steer the model. You do not need tricks; clear structure does most of the work:
- State the role and task: “You are a support agent. Summarize this ticket in two sentences.”
- Give context and constraints: audience, tone, length, allowed sources, what to do when unsure.
- Show examples (few-shot): include one to three sample inputs and ideal outputs when format matters. Providing none is called zero-shot.
- Specify the output format: a table, bullet list or JSON with named fields.
- Break complex work into steps: ask for reasoning in stages, or chain several smaller prompts.
- Iterate: test on realistic inputs, adjust, and keep versions of prompts that work.
Weak prompt vs stronger prompt
Weak: “Tell me about our refund policy.”
Stronger: “Using only the policy text below, answer the customer's question in three bullet points at a ninth-grade reading level. If the policy does not cover it, reply ‘I don't know’. Policy: [text]. Question: [text].”
When should you use RAG or fine-tuning instead of just prompting?
Start with prompting, since it is the cheapest to try. When that is not enough, choose by what is missing:
| Approach | Best for | Watch out for |
|---|---|---|
| Prompt engineering | Fast iteration, formatting, tone, simple tasks. | Cannot add knowledge the model lacks. |
| RAG | Current or private knowledge, answers with source citations. | Retrieval quality and data permissions determine answer quality. |
| Fine-tuning | Consistent style, format or domain behavior at scale. | Needs quality data, costs more, slower to update facts. |
The headline rule: use RAG for knowledge and fine-tuning for behavior. Our full walkthrough is in retrieval-augmented generation explained.
Check yourself
1. Roughly what is a token?
A chunk of text, often a whole short word or a piece of a longer word, that the model reads and generates one at a time. Context limits and usage costs are measured in tokens, not characters or words.
2. A chatbot invents a policy that does not exist. What is this called, and what is the standard first mitigation?
Hallucination. The standard mitigation is grounding the answer in trusted company documents with retrieval-augmented generation, plus human review for high-stakes output.
3. Is every generative AI model an LLM?
No. LLMs are the language-focused type. Image, audio and video generators are also generative AI but use different model designs.
What are the responsible AI basics for LLMs?
Responsible AI for LLMs rests on fairness, privacy, transparency, safety and security, accountability with human oversight, and governance. These are a standard exam theme because capability without safeguards creates real harm. The recurring principles are:
- Fairness and bias mitigation: evaluate outputs across groups and use cases.
- Privacy and data protection: know what data goes into prompts, logs and training, and who can see it.
- Transparency and explainability: tell users when they are dealing with AI and document model limits.
- Safety and security: content filters, guardrails, defenses against prompt injection and misuse.
- Accountability and human oversight: a named owner, review for consequential decisions, and a way to contest outcomes.
- Governance: repeatable risk management. The NIST AI Risk Management Framework (AI RMF) organizes this into the functions Govern, Map, Measure and Manage.
How do LLM concepts appear on AI certification exams?
Honest framing first: neither exam asks you to build or train a model. Both test whether you can explain these ideas and apply them to a business scenario. Always confirm the current scope in the vendor's official exam guide, because domains and weightings are revised.
Google Cloud Generative AI Leader is aimed at business and technology leaders. Expect questions on what generative AI and foundation models are, what LLMs can and cannot do, how prompting and grounding improve results, hallucination and responsible AI, and matching Google Cloud's generative AI offerings to business needs. Our exam guide and cheat sheet go domain by domain; the official page is Google Cloud's Generative AI Leader page.
AWS Certified AI Practitioner (AIF-C01) is a foundational exam that covers AI and ML fundamentals, generative AI fundamentals, applications of foundation models, responsible AI, and security and governance. LLM concepts such as tokens, embeddings, context, temperature, RAG versus fine-tuning and hallucination fall squarely in that scope, framed around AWS services such as Amazon Bedrock. See the AIF-C01 exam guide and the official AWS Certified AI Practitioner page.
Not sure which to take? Compare them in Google Generative AI Leader vs AWS AI Practitioner, or read whether Gen AI Leader is worth it in 2026.
Exam traps to watch for:
- Choosing fine-tuning when the scenario is really about fresh or private knowledge (the answer is usually RAG).
- Treating an LLM as a database or a source of guaranteed truth.
- Confusing temperature (randomness) with context window (capacity).
- Assuming RLHF adds facts rather than aligning behavior.
- Picking “bigger model” as a fix for a governance, bias or data-privacy problem.
LLM glossary
| Term | Meaning |
|---|---|
| Token | Unit of text the model reads and writes; basis for limits and pricing. |
| Embedding | Numeric vector representing meaning of a token or passage. |
| Transformer | Neural network architecture built on self-attention. |
| Attention | Mechanism that weighs how relevant each token is to each other token. |
| Parameters | Learned numeric values inside the model. |
| Pretraining | Initial large-scale training on broad text. |
| Fine-tuning | Additional training on specific data to adapt behavior. |
| RLHF | Tuning with human preference feedback to align outputs. |
| Prompt | The input instructions and context given to the model. |
| Zero-shot / few-shot | Prompting with no examples / with a few examples. |
| Context window | Maximum tokens per request (input plus output). |
| Temperature | Setting that controls randomness of output. |
| Hallucination | Fluent but false or unsupported output. |
| Grounding | Tying answers to trusted source data. |
| RAG | Retrieving relevant documents and adding them to the prompt. |
| Guardrails | Controls that filter or constrain inputs and outputs. |
| Prompt injection | Attack that hides instructions in input to hijack model behavior. |
| Foundation model | Broadly trained model adaptable to many tasks. |
| Inference | Using a trained model to generate output. |
LLM practice questions with answers
Answer each one before you open it. For a larger bank mapped to the official exam topics, use the Gen AI Leader practice exam or the AWS AI Practitioner practice exam.
1. Which description best defines a large language model?
A model trained on very large amounts of text to predict and generate language, usually using the transformer architecture. It is not a database of facts, a search engine or a rules-based chatbot, and it does not look up answers: it generates text from learned patterns.
2. A team wants a support assistant that answers from the company's latest policy documents, which change weekly. Which approach fits best: prompting alone, RAG or fine-tuning?
RAG. Retrieval pulls the current documents into the prompt at request time, so answers stay up to date and can cite sources without retraining. Prompting alone cannot see documents the model was never given. Fine-tuning bakes in patterns and style, is slower to refresh and is a poor way to inject frequently changing facts.
3. A user pastes a very long contract and the model cannot process the whole contract in one request. What concept most directly explains the risk?
The context window. Input plus output must fit within the model's token limit, and content that does not fit is dropped or must be handled by chunking, summarizing or retrieval. Temperature controls randomness, not capacity, and fine-tuning does not change how much text fits in one request.
4. You need consistent, repeatable wording for a compliance summary. Which temperature setting is the better starting point?
A low temperature. Low values make the model favor its most likely tokens, giving more deterministic output. High temperature increases randomness and variety, which suits brainstorming but not compliance wording. Even at low temperature, exact repeatability is not guaranteed by every service.
5. What does RLHF add after pretraining?
It aligns the model with human preferences. Human raters compare or rank outputs, that feedback shapes a reward signal, and the model is tuned toward responses people judge more helpful and safer. It does not teach the model new factual knowledge from scratch, and it does not make hallucination impossible.
6. Which statement about hallucinations is correct?
They are fluent but incorrect or unsupported outputs that arise because the model generates plausible text rather than verifying facts. They can be reduced with grounding, clear prompts and human review, but not guaranteed away. Saying they only happen with old models, or that a larger model never hallucinates, is wrong.
7. Which is the best description of the relationship between a foundation model and an LLM?
An LLM is a kind of foundation model. A foundation model is a large model trained on broad data that can be adapted to many tasks; LLMs are the language-focused versions, while others handle images or multiple modalities. It is not true that they are unrelated, or that foundation models are always smaller.
8. A bank deploys an LLM to draft loan decisions. Which responsible-AI step matters most before launch?
Test for bias and error across groups, document limitations, and keep human oversight of consequential decisions, aligned with a framework such as the NIST AI RMF. Simply making the model larger, hiding that AI is involved or relying on the vendor's default settings does not address fairness, transparency or accountability.
Frequently asked questions
What does LLM stand for in AI?
LLM stands for large language model. It is a machine learning model, almost always built on the transformer architecture, that is trained on very large amounts of text so it can predict and generate language. "Large" refers to the amount of training data and the number of learned parameters, and "language model" means its core job is modelling which text is likely to come next.
Is ChatGPT an LLM?
ChatGPT is a chat product built on top of large language models, not an LLM itself. The LLM is the underlying model; the product adds a chat interface, instructions, safety layers and sometimes tools such as search. The same distinction applies to Gemini, Claude and Copilot: the brand name usually covers an application, while the LLM is the engine inside it.
What is the difference between an LLM and generative AI?
Generative AI is the broad category of AI that creates new content such as text, images, audio, video or code. An LLM is one type of generative AI model, specialized for language. Every LLM is generative AI, but not all generative AI is an LLM, because image and audio generators use other model types.
Why do LLMs hallucinate?
An LLM generates the most plausible continuation of text based on patterns learned in training. It has no built-in fact lookup or truth check, so when it lacks information it can still produce fluent, confident text that is wrong. Grounding the model in trusted data with retrieval-augmented generation, asking for citations and keeping a human reviewer in the loop reduce the problem but do not remove it.
What is a context window?
The context window is the maximum amount of text, measured in tokens, that a model can consider in one request. It includes your prompt, any documents or conversation history you supply, and the response being generated. Anything outside the window is invisible to the model, so long conversations or documents must be shortened, summarized or retrieved selectively.
Do LLMs actually understand language?
LLMs learn statistical patterns in language well enough to answer questions, summarize, translate and write code, but they are not reasoning from verified knowledge of the world. Whether that counts as understanding is debated. For practical and exam purposes, treat them as powerful pattern-based generators whose output must be checked.
Do I need to understand LLMs for Google Generative AI Leader or AWS AI Practitioner?
Yes, at a conceptual level. Both exams expect you to explain what foundation models and LLMs are, describe prompts, tokens and context, recognize hallucination and its mitigations, and choose between prompting, RAG and fine-tuning for a business scenario. Neither is a coding exam. Check each vendor's official exam guide for the current scope.
How we wrote and checked this
CertSharp is a practice-exam provider, so we have a commercial interest in exam preparation. This guide was written from the sources linked below, including the original transformer paper, the NIST AI Risk Management Framework and the official Google Cloud and AWS exam pages. We avoid quoting model names, context-window sizes or prices because they change quickly. Last reviewed on October 18, 2026. Exam scope is revised, so confirm it in the vendors' official exam guides.
Sources and further reading
- Vaswani et al., “Attention Is All You Need” (arXiv:1706.03762)
- AWS: What is a large language model?
- Amazon Bedrock User Guide: What is Amazon Bedrock?
- Amazon Bedrock: Prompt engineering guidelines
- Google Cloud: Generative AI on Vertex AI overview
- NIST AI Risk Management Framework
- Google Cloud Generative AI Leader certification page
- AWS Certified AI Practitioner certification page
Turn the concepts into exam points
30 free questions per session in practice mode, no credit card. The full 500-question bank and exam mode are $11.99 lifetime per certification, or $9.99/month Pro unlocks every CertSharp certification.