Edexcel International Advanced Level Computer Science, point 6.2.3
Definition
A large language model (LLM) is an AI system trained on huge amounts of text, which learns the statistical patterns of language and uses them to understand and generate text. It is a neural network with billions of parameters. Examples include the models behind chatbots and writing assistants.
Function
LLMs can answer questions, summarise, translate, write and explain code, draft text and hold a conversation.
Operation (in outline)
- Training: the model reads vast amounts of text (books, websites, code) and learns to predict the next word (token) in a sequence. This is self-supervised learning (6.2.2), and it takes huge computing power.
- Prompt: a user gives a prompt (query).
- Generation: the model works out the most likely next token, adds it, and repeats to build up a response.
- Tuning: the model may be further trained with human feedback to make answers more helpful and safe.
An LLM doesn't "look up" facts in a database. It generates text that is likely to follow, based on patterns in its training data. That's why it can sound confident while being wrong.
Components of an LLM system
| Component | Role |
|---|---|
| Training data | The huge collection of text (and code) the model learns from |
| Model | A neural network with billions of parameters (numbers) that store the patterns it has learned |
| Training | Adjusting the parameters, over and over, so the model gets better at predicting the next token |
| Inference | Using the trained model to generate a response to each new prompt: the parameters are fixed, and the model predicts one token after another |
| Processing hardware (GPUs) | Graphics processing units carry out the huge number of calculations in parallel, which makes training possible and inference fast |
Benefits
- Fast, flexible help with writing, summarising, translating and coding.
- Natural language interface: anyone can use it by typing.
- Available at any time, and can personalise explanations.
- Boosts productivity and accessibility.
a. Context and query accuracy
The quality of the answer depends on the prompt and the context the model is given.
- Context window: an LLM can only use a limited amount of text at once (the conversation so far and the prompt). Anything outside it is ignored or forgotten, so a long conversation can lose earlier details.
- Ambiguous or vague queries give vague or wrong answers: "Tell me about Python" might mean the snake or the language.
- Missing context: if the user doesn't provide the needed details (the data, the constraints), the model fills the gaps with guesses.
- Wording matters: small changes in the prompt can change the answer. Clear, specific prompts with context give better results (prompt engineering).
- Hallucination: the model may produce plausible but false statements, invented references or incorrect calculations, with no warning.
- Not deterministic: the same prompt can give different answers.
Good practice: give relevant context, be specific, ask for sources, and check the answer.
b. Knowledge limitations
- Training cut-off: the model only knows about things in its training data, up to a date. It doesn't know about later events unless it's connected to search or other tools.
- Gaps and errors in the data: rare topics, niche or specialist areas, and some languages are less well covered, so answers there are weaker. Errors in the training data can be repeated.
- No real understanding: it works with patterns in text, not meaning or experience, so it can fail at reasoning, maths or logic, and at common sense.
- No access to private or live data unless it's given it (for example your company's documents).
- Can't verify its own claims.
- Copyright and ownership questions about training data and generated text.
c. Bias and subjectivity
- Bias from the training data: text written by people contains their biases (stereotypes, over-representation of some groups, cultures and languages), and the model can reproduce or even amplify them. For example, associating certain jobs with a gender.
- Bias from the people who tune it: choices about what is "helpful" or "safe" reflect the values of the designers and reviewers.
- Subjectivity: on opinions, politics, ethics or matters of taste, there is no single correct answer, and the model's response may favour one view or present opinion as fact.
- Unequal performance: it may work better for some languages, dialects or groups than others.
- Consequences: unfair treatment if used in hiring, lending or education, misinformation, and loss of trust.
Reducing the problem:
- Process the training data before training to find and remove explicitly biased material, so the model doesn't learn to reproduce it.
- Use diverse, balanced training data, and include the context of the data (its time, place and source), so the model doesn't judge by norms that don't fit the situation.
- Test the outputs for bias, use human review, be transparent about the model's limits, and treat outputs critically.
Using LLMs responsibly
- Check important facts against reliable sources.
- Don't share personal or confidential data, since inputs may be stored or used for training.
- Be open about AI use (for example in schoolwork or the project).
- Keep human judgement in decisions that affect people.
Worked example
Task: a travel agent asks an LLM, "What are the visa rules for visiting that country?" The answer describes rules that changed last month, and it cites a government web page that doesn't exist. Explain the LLM limitations involved, and what the agent should do.
- Knowledge limitation: the model's training data stops at a cut-off date, so it doesn't know about the recent change.
- Hallucination (accuracy): it generated a plausible-looking reference because it predicts likely text, not because it found a real page.
- Query issue: the question was vague ("that country", and visiting for what purpose?), so the model guessed.
- What to do: name the country and the purpose of the trip, check the rules on the official government site, and never pass on an unverified citation to a customer.
Exam tip: link each issue to the cause: accuracy problems come from how the model generates text (and from vague or missing context); knowledge limits come from the training cut-off and gaps; bias comes from the training data and design choices. Give a consequence and a way to reduce the risk.
Check yourself
What is a large language model?
An AI system trained on huge amounts of text that learns the patterns of language and uses them to understand and generate text.
Why might an LLM give a wrong answer to a vague question?
It has no clear context, so it guesses the meaning, and it generates the most likely text, not necessarily the correct answer.
What is a knowledge limitation of an LLM?
It only knows what was in its training data up to a cut-off date, so it may not know recent events, and it is weaker on rare or specialist topics.
How can bias get into an LLM's answers?
The training text contains human biases and unequal coverage, and design and tuning choices reflect the views of the people who made it.
What is an LLM's context window, and why does it matter?
The limited amount of text (the prompt and the conversation so far) the model can use at once. Anything outside it is ignored, so details from early in a long conversation can be lost.