A large language model (LLM) is a neural network trained on very large amounts of text to predict the next piece of text. That single skill, applied at scale, lets it answer questions, draft documents, summarise, translate, write code and decide which tool to call next. An LLM does not look facts up by default. It produces the most likely continuation of what it was given, which is why the input you give it matters as much as the model you pick.
How a Large Language Model Works
Almost every LLM in production today is built on the transformer architecture, introduced in the 2017 paper Attention Is All You Need, which replaced recurrent layers with attention and made training on huge corpora practical on parallel hardware.
The life of a model has three stages:
- Pre-training. Text is split into tokens (word pieces). The model reads an enormous corpus of them and learns to predict the next one. This is where general language ability and broad world knowledge come from.
- Post-training. The raw model is tuned to follow instructions and to refuse harmful requests. A widely used recipe combines supervised examples with reinforcement learning from human feedback, described in OpenAI’s InstructGPT paper, where a much smaller tuned model was preferred by human raters over a far larger untuned one.
- Inference. At run time the model receives a prompt inside its context window, generates one token at a time and stops at a limit or an end marker. Cost and latency scale with the number of tokens in and out.
Modern LLMs are usually multi-modal (they also read images, audio or files) and support function calling, so the model can ask your code to run a query or an API call and then continue with the result.
Strengths and Limits
LLMs are good at language-shaped work: reading messy documents, extracting fields, rewriting text for a different reader, classifying requests, writing first drafts of code and choosing the next step in a workflow.
They are weak where precision is the whole point:
- Hallucination. The model can state something false in the same confident tone as something true. See AI hallucination.
- Arithmetic and money. Token prediction is not a calculator. Totals, prices and metrics belong in tested code.
- Stale knowledge. Training data has a cut-off. Anything that changes (prices, policies, stock) must be supplied at run time, usually through retrieval-augmented generation.
- Non-determinism. The same prompt can give different answers. Systems need validation, structured outputs and evaluation, not hope.
- Security. Text inside a document or web page can try to redirect the model.
Choosing an LLM
There is no single best model. Teams choose along a few axes:
| Question | What it decides |
|---|---|
| How hard is the reasoning? | Frontier model, reasoning model or a small language model |
| Where may the data go? | Hosted API, regional cloud deployment or self-hosted open-weight model |
| How many calls per day? | Price per token, caching and model routing |
| How fast must it answer? | Model size, streaming and latency budget |
The honest way to decide is an evaluation set built from your own real inputs, run against two or three candidates. Public leaderboards rank models on someone else’s tasks. Model versions also change every few months, so the architecture should let you swap the model without rewriting the product.
Related Terms
An LLM is one kind of foundation model. Wrapped in a loop that plans, calls tools and checks results, it becomes an AI agent. Running it in production with monitoring, versioned prompts and cost control is LLMOps.
In Practice
An LLM is one component of a system, and the design decides what it is trusted with. The model reads, drafts and chooses the next step; figures come from a database or from code, and the model puts them into words. The model version, prompt and settings are pinned and logged with each request, so a change in behavior can be traced to a change in configuration, or to a vendor update behind an unchanged model name.
Our generative AI development services and LLMOps services cover this end to end, from model selection to monitoring. If the main question is which model and vendor to commit to, start with generative AI consulting.