What is an LLM?
An LLM is a Large Language Model: a neural network trained on large amounts of text so it can process token sequences and generate useful language one token at a time.
By the end of this lesson, you will be able to:
- Explain what “Large Language Model” means.
- Describe the basic next-token prediction idea behind language models.
- Understand the relationship between tokens, parameters, training data, and an LLM.
- Recognize what LLMs are good at and where they need safeguards or additional systems.
- Make a real LLM API call from Python and inspect the generated response.
The simple definition
A Large Language Model (LLM) is a machine-learning model designed to work with language. It receives a sequence of tokens as input and predicts what token or tokens should come next.
The model contains a very large number of learned numerical values.
Text is converted into tokens before the model processes it.
Training adjusts parameters so the model becomes better at predicting token sequences.
Where does an LLM fit?
In the AI hierarchy you learned earlier, an LLM is a type of deep-learning model used for language tasks. Modern LLMs are typically built with neural-network architectures based on the Transformer family.
The key idea: predict the next token
Suppose the input is:
The model assigns probabilities to possible next tokens. A simplified view might look like this:
Key idea: Generation happens repeatedly. The selected token is added to the sequence, and the model predicts the next token again. A full answer is built step by step.
Tokens, parameters, and training data
Tokens
The pieces of text the model processes. A token can be a word, part of a word, punctuation, or another text fragment.
Parameters
Learned numerical values inside the neural network. Training adjusts them to capture useful patterns.
Training data
Large collections of examples used during training so the model can learn patterns in language and other content.
What can an LLM do?
The same basic language-generation capability can be used in many applications when the prompt and surrounding software are designed well.
Give the model a clear task, relevant context, and an output format that your application can use.
A fluent answer can still be wrong. LLM output needs evaluation, and high-impact applications need appropriate controls.
What an LLM is not
An LLM is a neural network with learned parameters. A database is a system designed to store and retrieve structured records.
No. An LLM can produce confident but incorrect output, often called a hallucination.
Be careful with this wording. LLMs can perform sophisticated language tasks, but that does not establish human consciousness or human-like understanding.
No. An application must provide data to the model through its input or connected tools. Access is a system-design and permission question.
Real example: ask an LLM from Python
Now move from the idea to a real API call. The application sends an instruction and receives generated text.
from openai import OpenAI
client = OpenAI(api_key=input("Enter your API key: "))
response = client.responses.create(
model="gpt-5.6-luna",
input="Explain what an LLM is in two simple sentences."
)
print(response.output_text)
An LLM is a neural-network model trained to work with language. It generates text by repeatedly predicting the next token based on the input context.What happened? Your Python program created a client, sent an input to the model, and printed the generated text. The application controls the instruction; the LLM generates the response.
Change the input, change the output
Try the same model with different instructions. This makes the input → model → output relationship concrete.
from openai import OpenAI
client = OpenAI(api_key=input("Enter your API key: "))
prompt = "Explain APIs to a 10-year-old using a restaurant analogy."
response = client.responses.create(
model="gpt-5.6-luna",
input=prompt
)
print(response.output_text)
An LLM is usually one component, not the whole application
A useful production mental model is to place the LLM inside a larger system.
This becomes especially important when an application needs private company knowledge, live information, databases, calculators, APIs, or business rules. Those capabilities are usually supplied by the surrounding system rather than magically appearing inside the model.
Mini-project: Build a simple LLM explainer
Build a tiny Python program that asks an LLM to explain any technical concept at a chosen level.
Check your understanding
Answer first, then reveal the explanation.
Which statement best describes an LLM?
30-second recap
- An LLM is a Large Language Model built to process and generate language.
- During generation, the model repeatedly predicts the next token from the current sequence.
- Tokens are inputs to the model; parameters are learned numerical values shaped during training.
- LLMs can generate, summarize, explain, transform, code, and power conversational applications.
- An LLM can be wrong, so useful applications need evaluation and appropriate safeguards.
- Production systems commonly combine an LLM with application logic, data, retrieval, tools, permissions, and validation.