A large language model (LLM) is a neural network trained on large amounts of data to model patterns in language. Generative LLMs use those patterns and the context they receive to produce text: an answer, a summary, a translation, code, or a structured response. They are a central component of many AI assistants.

Imagine asking an assistant to turn a long support conversation into a short handover. The LLM generates the wording. The application supplies the conversation, displays the result, and controls any access to customer records. That distinction helps explain both what the model contributes and what the surrounding system must provide.

LLMs are one approach within natural language processing (NLP), the broader field of working with human language. This article focuses on the generative language models commonly used in assistants. Language modeling also supports other tasks and architectures. Google’s introduction to language models

What makes a language model large?

“Large” refers to scale: substantial training data, computation, and many learned parameters, the numerical values that shape the model’s behavior. There is no universal parameter threshold separating a small language model from an LLM. The label is less useful for choosing a tool than measured performance on your task.

A model described as 8B has roughly eight billion parameters. That does not mean eight billion facts, documents, or words. Parameters collectively encode learned patterns; they are not individually labeled entries in a knowledge database. See AI model parameters for a worked storage example.

Parameter count also needs context. A dense model and a Mixture of Experts (MoE) model use their parameters differently. MoE can activate only selected expert components for a token, so total size and active computation can differ substantially. Read Mixture of Experts (MoE) explained.

Tokens and attention

A model does not receive ordinary text directly. A tokenizer turns it into token IDs. A token can represent a whole word, part of a word, punctuation, or another text unit. Token boundaries depend on the tokenizer and language, so a token count is not a word count. Those IDs are mapped to numerical representations that the network processes. Language models and tokens

Many LLMs use the transformer architecture. Its attention mechanism combines information from different token positions, helping the model represent relationships within the available context. Other layers transform those representations further. Attention is a mathematical operation; it does not independently check whether a statement is true. Attention Is All You Need

Many assistant models use a decoder-only transformer, which generates a continuation from the context so far. Encoder-only models are often used for tasks such as classification, while encoder-decoder models can generate outputs from a separately encoded input. These are useful distinctions, but you do not need to implement a transformer to use an LLM well. Hugging Face’s transformer overview

How an LLM generates a response

For a typical autoregressive text model, generation works as a repeating cycle. Autoregressive means that later output depends on earlier output.

  1. Assemble the context. The application provides instructions, the user’s message, and any included conversation history, documents, or tool results.
  2. Compute next-token scores. The model processes token representations through its layers and scores possible next tokens. These scores are called logits.
  3. Select a token. A decoding method chooses from those scores or a probability distribution derived from them.
  4. Continue or stop. The selected token becomes part of the context for the next step. Generation ends at an end-of-sequence token, an output limit, or another stopping condition.

The application converts generated token IDs back into readable text. Runtimes can cache intermediate calculations for efficiency; the cycle describes the logical process. Hugging Face’s text-generation guide

The text-generation cycle: read the context, score possible next tokens, select a token, append it, and repeat until a stopping condition is met.

Greedy decoding selects the highest-scoring next token. Sampling allows other candidates to be selected according to probabilities, which can produce different answers to the same prompt. Temperature adjusts how concentrated those probabilities are: lower values generally favor the more likely candidates, while higher values spread probability more widely. Available settings depend on the model and service. Decoding strategies and generation settings

A low temperature does not turn an answer into a verified fact. A model can consistently produce the same incorrect statement. Token prediction can support complex language and problem-solving behavior, but output quality still has to be evaluated.

How LLMs learn

Training changes learned parameters. Using a trained model to produce an output is inference. A common development process has two broad stages:

  • Pretraining: the model learns from a large, curated data mixture. For a causal language model, predicting the next token provides a training signal: compare its predictions with the actual continuation and adjust parameters to reduce error. The text supplies the targets, so people do not have to label every next token by hand.
  • Post-training: additional training improves instruction following, conversation, or particular skills. Methods can include supervised examples of desired answers and optimization using preferences or rewards. The exact recipe varies.

A base model may continue a piece of text without behaving like a helpful assistant. An instruction-tuned model has received additional training to respond to requests. The Llama 3 report provides a concrete example of pretraining followed by supervised fine-tuning and preference optimization. Llama 3 training report

Giving an existing model instructions or examples in a prompt normally changes its input, not its weights. Fine-tuning performs additional training and updates model or adapter parameters. These are different ways of influencing behavior. Prompting and fine-tuning

An ordinary chat does not automatically retrain the model in real time. A product may separately save preferences, retain history, or use eligible data in a later training process; those depend on its design and settings. Continue with inference versus training for the fuller distinction.

What are LLMs useful for?

One useful property is flexibility: a single instruction-tuned model can attempt many language tasks without a separately trained model for each one. Its usefulness depends on the task, inputs, and review required.

Use case A practical example What a good result must preserve
Writing and editing Turn rough notes into a customer email The intended meaning, confirmed facts, and appropriate tone
Summarization Create a support-case handover Key events, unresolved questions, and next actions
Extraction and classification Pull dates from messages or assign ticket topics Correct values, valid fields, and explicit missing information
Translation and explanation Explain instructions in another language or for a new audience Meaning, terminology, and important qualifications
Coding assistance Explain a function or suggest a small change Correct behavior, project conventions, and passing checks
Document question answering Answer from approved policy passages Evidence for each claim and a clear response when evidence is absent

These are candidate uses, not guarantees. An LLM can reduce drafting effort or help make information easier to use, but measure the time spent checking and correcting its work too. For exact calculations or record lookups, a calculator or database may provide the reliable operation that a language interface needs.

Context, knowledge, and memory

Learned knowledge is reflected in parameters established during training. It can be incomplete or outdated. A model does not acquire today’s information merely because you ask a question about today.

Context is the information available to the model for a particular generation. The context window limits how much it can work with at once, measured in tokens. In a typical decoder-only model, instructions, included history, documents, and generated output consume that budget. Services may also impose separate input and output limits.

An application’s stored conversation can be longer than what it actually sends to the model. It may summarize or omit older messages. A “memory” feature can save selected facts and supply them later without changing the underlying model’s weights.

A large context window is not a promise that every detail will be used correctly. The Lost in the Middle study found that information position affected performance in the models it tested. Use that as a reason to test your own document tasks, rather than assuming every model has the same weakness. Long-context research

Retrieval-augmented generation (RAG) supplies relevant external material to support generation. A support assistant could retrieve the current refund policy before drafting an answer. Retrieval can improve access to information, but the retrieved passage must be relevant and the answer must remain faithful to it. RAG research and our RAG explainer

Limits that matter in practice

LLMs can produce hallucinations: plausible statements, quotations, or references that are incorrect or unsupported. They can also reflect biases in data and perform unevenly across languages and tasks. Fluent wording does not establish accuracy or fairness. Google’s overview of LLM challenges

Some common failures become easier to spot when you connect them to a specific task:

  • A summary quietly removes an unresolved issue. Compare it with the source, including the exceptions.
  • A support response promises a refund without evidence of eligibility. Check policy and customer records before making the commitment.
  • Generated code looks sensible but calls a nonexistent function. Run the relevant checks and inspect its dependencies.
  • An answer contains a citation that does not support its claim. Open the source and verify the passage.

Longer prompts, more parameters, and more confident wording do not eliminate these problems. Give the model relevant evidence, define what to do when information is missing, and evaluate both ordinary cases and difficult ones. Use the AI MQM toolkit when you need a consistent way to record chatbot errors and improvements.

LLMs, generative AI, and agents

The terms describe different parts of an AI system:

Term How it relates to an LLM
Generative AI The broader category of systems that generate content. Language generation is one part; image, audio, and video generation may use other architectures.
Multimodal model A model designed to process or generate more than one kind of data. A language model can be part of such a system, but image or audio support must be explicitly provided.
Chatbot or assistant The application or user experience around models, instructions, state, and integrations.
AI agent A system that uses a model and a control process to select steps toward a goal, often through tools.
RAG A way of supplying retrieved evidence to generation. It does not require changing the model’s weights for every document.
MoE An architecture choice inside a model, where routing combines expert components. It is not a team of separate agents.

A model can generate a proposed tool call, but authorized application software must execute it. “I updated the ticket” is not proof that an update occurred; a successful tool result is needed. See AI model vs AI agent for examples.

Try a small, checkable task

Give an assistant these fictional notes and instructions:

Notes: The customer reported a duplicate charge. The payment team is investigating. No refund has been approved. The next update is due Thursday.

Task: Write a two-sentence customer update using only these notes. Preserve what is still uncertain. Do not invent a cause or promise a refund.

One acceptable answer would be:

Our payment team is investigating the duplicate charge you reported, and no refund has been approved yet. We will provide the next update on Thursday.

Check the issue, investigation status, refund status, and promised update against the notes. Then ask, “What caused the duplicate charge?” The available evidence does not establish a cause. An answer that invents a technical explanation fails this exercise, however convincing it sounds.

Try removing the refund sentence from the notes. The model should no longer assert either approval or non-approval. This tests whether it can distinguish missing information from a confirmed negative. The answer above is an illustrative target, not a recorded model result.

Choose by the task, not the label

Compare models on a small set of representative examples with clear acceptance criteria. Include cases where information is missing or contradictory. Record accuracy, omissions, response time, cost, and correction effort.

A hosted service and a locally run model offer different operating choices. Check the exact model’s capabilities, license, data handling, and hardware needs. Downloadable weights do not by themselves establish unrestricted use, and a local chat interface can still connect to remote services.

Smaller models can be useful for focused tasks when they meet the required quality. Quantization can reduce weight storage, while distillation uses a teacher’s signals to train a student. Both deserve evaluation on the intended workload. If you want to try running a model, continue with the Ollama guide.

Check your understanding

If you paste a new policy into a conversation, have you retrained the LLM?

Normally, no. You have supplied context for that interaction. The model can use it without changing its weights. Retaining the policy for future conversations requires an application feature such as storage and retrieval, or a separate training process.

Does lowering temperature make an answer factually correct?

No. It changes token selection during sampling. More predictable output can still contain errors, so important claims need evidence and checking.

An assistant says it issued a refund. What establishes that it actually happened?

A verified successful result from the authorized payment system. The LLM's generated sentence alone does not establish that any external action occurred.