Book a free call

What Are Large Language Models (LLMs)?

A large language model is an AI system trained on huge amounts of text to predict the next word. Here is how LLMs work, what they can do and where they go wrong.

Hertiv engineering teamReviewed by a senior engineer
6 min read
What Are Large Language Models (LLMs)?
On this page

Short answer

A large language model is an AI system trained on huge amounts of text to predict the next word in a sequence. It generates text one token at a time, using patterns learned during training, and that simple job covers writing, summarising, translating, coding and answering questions.

What is a large language model?

A large language model, or LLM, is an AI system trained on huge amounts of text to predict the next word in a sequence. Given a prompt, it works out the most likely continuation, one token at a time, and that simple job turns out to cover writing, summarising, translating, coding and answering questions.

The word "large" refers to scale. An LLM has many adjustable values, called parameters, that are set during training, and it is trained on text drawn from books, websites, code and documents. The larger models in use today have tens or hundreds of billions of parameters, and that size is what lets them pick up grammar, facts, style and reasoning patterns from text alone.

An LLM does not look up answers in a database. It generates each word from patterns it learned during training, which is why it can write fluently about topics it was never directly taught, and also why it can state false things with confidence. For the wider picture, see what generative AI is.

How does an LLM learn language?

An LLM learns by reading text and guessing what comes next, billions of times over. During training it is shown a passage with the last word hidden, makes a prediction, and adjusts its parameters slightly based on how far off it was. Repeated at enormous scale, this teaches the model the structure of language.

Before training, text is split into tokens, which are pieces of words, such as "un", "break" and "able". A token is the unit the model reads and writes, and most words split into one or two tokens. The model keeps a running context, called the context window, of the tokens it has seen so far, and uses that context to choose the next token.

After this general training, most models go through a second stage in which they are tuned on examples of helpful answers, so they follow instructions and refuse unsafe requests. This tuning is what turns a raw text predictor into a chatbot or assistant that a business can put in front of users.

What is the transformer, and why does it matter?

Almost every LLM today is built on the transformer, an architecture introduced in the 2017 paper "Attention Is All You Need" by researchers at Google. Before it, language models read text one word at a time, which made long passages slow to train and hard to remember.

The transformer's key idea is self-attention: when the model reads a word, it looks back at every other word in the passage and weighs which ones matter for understanding it. That lets it connect a pronoun to a noun ten sentences earlier, or a verb to its subject across a long clause, in a single step.

Self-attention also lets training run in parallel across many examples, which is what made models with billions of parameters practical to train. Without the transformer, the LLM era would not have happened. For how LLMs differ from generative AI in general, see LLM vs generative AI.

What can LLMs do, and where do they fall short?

LLMs are strong at tasks where the answer can be built from patterns in text. They draft and rewrite, summarise long documents, translate between languages, write and explain code, and answer questions about topics covered in their training data. They are also useful as a first draft or a brainstorming partner.

TaskWhat an LLM does wellWhere it struggles
Drafting and editingFast first drafts in a given toneNeeds a human to check facts
SummarisingCondenses long documents quicklyMay drop a key detail
Writing codeBoilerplate and common patternsMay invent APIs that do not exist
Answering questionsWide general knowledgeCan invent plausible false answers
TranslatingFluent output in many languagesNuance and idiom can be lost
Data workExplains and formats resultsCannot be trusted to compute alone

The main weakness is hallucination: the model can produce confident, fluent text that is wrong, because it predicts likely words rather than checking facts. LLMs also have a knowledge cut-off, so they do not know events after their training data ends, and they can repeat biases present in the text they were trained on.

How do teams adapt an LLM to their own work?

Most teams do not train an LLM from scratch. Instead they adapt an existing model in one of three ways, and the choice depends on how much control and accuracy they need.

  • Prompting. Writing clear instructions and examples in the prompt itself. This is the fastest route and needs no training, but the model still relies on its general knowledge.
  • Retrieval. Connecting the model to a company's own documents, so it reads the relevant pages before answering. This keeps answers grounded in real sources and is the usual first step for support and search tools.
  • Fine-tuning. Training the model further on a smaller set of examples from the company's own work, so it learns a specific style, format or task. For the steps involved, see how to fine-tune an LLM.

Whichever route a team takes, the model needs evaluation: a fixed set of real cases with known good answers, run before every change. Without that, a prompt tweak or a model update can quietly make answers worse, and nobody will notice until a customer complains.

Example (hypothetical): a support team drafts replies

Example (hypothetical): a support team of ten people handles 800 customer emails a week. Each reply takes about 10 minutes to write, so the team spends 800 x 10 = 8,000 minutes, or about 133 hours, a week on replies.

The team adds an LLM that drafts each reply from the ticket and the help centre, and a human reviews every draft before it is sent. Drafting takes the model seconds, and review takes about 2 minutes per draft. Review time is 800 x 2 = 1,600 minutes, or about 27 hours, a week.

The saving is about 133 - 27 = 106 hours a week, but only if the drafts are good enough that review stays at 2 minutes. If the model invents policy details, reviewers slow down to check every claim, and the saving shrinks. That is why the team measures draft quality every week, not just speed. For the writing skill behind good prompts, see what prompt engineering is.

What are the common mistakes?

The most common mistakes with LLMs are treating their output as fact, skipping evaluation, and feeding them data they should not see.

  • Trusting the output. Fluent text is not checked text. Anything the model writes that matters should be verified against a source.
  • No evaluation set. Without fixed test cases, a team cannot tell whether a change helped or hurt.
  • Sending sensitive data. Prompts sent to an outside model may be logged or used for training, so customer and internal data needs rules before anyone pastes it in.
  • One model for every job. A small, cheap model often beats a large one on a narrow, well-defined task.
  • Ignoring cost. Long prompts and high volumes add up, so teams should watch the bill per task, not just per month.
  • No human in the loop. Letting a model act without review is fine for drafts and risky for anything that reaches a customer or moves money.

Key takeaways

  • An LLM predicts the next token, one at a time, from learned patterns
  • The transformer and self-attention made large models practical to train
  • LLMs are strong at drafting, summarising and code, weak at facts
  • Hallucination means every important answer needs checking
  • Prompting, retrieval and fine-tuning adapt a model to real work
  • Measure draft quality and cost per task, not just speed

Frequently asked questions

What does LLM stand for?

LLM stands for large language model. It is an AI system trained on huge amounts of text to predict the next word in a sequence, and that simple job lets it write, summarise, translate, code and answer questions.

How is an LLM different from a search engine?

A search engine finds documents that already exist, while an LLM generates new text from patterns it learned during training. The LLM can combine and rephrase ideas, but it can also invent facts, so its answers need checking.

What is a token in an LLM?

A token is a piece of a word, such as 'un' or 'break', and it is the unit an LLM reads and writes. Most words split into one or two tokens, and the model keeps a running context of the tokens it has seen so far.

What is the transformer in an LLM?

The transformer is the architecture behind almost every LLM, introduced in the 2017 paper 'Attention Is All You Need'. Its self-attention mechanism lets the model weigh which earlier words matter for each new word it generates.

Can an LLM be trusted with facts?

No, not on its own. An LLM predicts likely words rather than checking facts, so it can produce confident text that is wrong. Ground it in your own documents with retrieval, and have a person check anything important.

Do I need to train my own LLM?

Almost never. Most teams adapt an existing model with prompting, retrieval from their own documents, or fine-tuning on their own examples. Training a model from scratch costs far more than any of these routes.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning an LLM product and need help choosing the right approach? Talk to Hertiv.

A senior engineer replies within one business day. Or see our LLM Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call