Large Language Model (LLM)
A large language model (LLM) is a transformer trained on vast text to predict the next token, which lets it answer, summarize, translate, and write code.
A large language model (LLM) is a neural network, almost always a transformer, with billions of parameters trained on trillions of tokens of text to predict the next token in a sequence. That single objective, applied at scale, produces models that answer questions, summarize documents, translate, write code, and call software tools. OpenAI's GPT, Anthropic's Claude, and Google's Gemini are LLM families offered through APIs, and Meta's Llama, Alibaba's Qwen, DeepSeek, Mistral, and OpenAI's gpt-oss publish open weights. The transformer architecture came from the 2017 paper Attention Is All You Need, GPT-3 showed in 2020 that a 175-billion-parameter model could learn tasks from examples in its prompt, and ChatGPT brought LLMs to a mass audience in November 2022.
How LLMs Work#
An LLM first runs tokenization to turn text into token IDs and looks up an embedding vector for each one. The vectors pass through a stack of identical blocks, each combining causal self-attention, which lets every token draw information from the tokens before it, with a feed-forward layer that transforms each token separately. The last block produces a softmax probability for every token in the vocabulary, the model picks one, appends it, and repeats, which is how text generation works:
Size is measured in parameters, and many recent models are sparse. In a mixture of experts (MoE), a router sends each token through a few of many feed-forward experts, so DeepSeek-V3 has 671 billion parameters but uses 37 billion per token. The amount of text a model can read at once, its context window, has grown from GPT-3's 2,048 tokens to a million tokens or more in several current models, and serving those long inputs depends on a KV cache that stores the attention keys and values of every earlier token.
How LLMs Are Trained#
Pretraining is self-supervised learning: the model predicts each next token of web pages, books, and code, with no human labels. Scaling laws predict how loss falls with more parameters, data, and compute, and DeepMind's Chinchilla study found that compute-optimal training uses about 20 tokens per parameter. Models now train far beyond that ratio; Meta pretrained Llama 3 on about 15 trillion tokens. Post-training turns the resulting base model into an assistant. Instruction tuning teaches it to follow requests, and reinforcement learning from human feedback (RLHF) or direct preference optimization aligns its answers with human preferences; OpenAI's InstructGPT results showed labelers preferred a 1.3-billion-parameter tuned model over the 175-billion-parameter GPT-3. Reasoning models such as OpenAI's o1 and DeepSeek-R1 add large-scale reinforcement learning, in DeepSeek-R1's case reinforcement learning with verifiable rewards on math and coding problems with checkable answers, which trains them to write out long chains of reasoning before answering. Teams then adapt a model to their own domain with fine-tuning, often through LoRA, or leave the weights unchanged and supply knowledge through retrieval-augmented generation (RAG).
Applications#
LLMs power chatbots and assistants, agentic coding tools that edit and test whole repositories, search and document question answering, and AI agents that plan multi-step tasks through function calling. Adding an image encoder turns an LLM into a vision-language model (VLM) that answers questions about photos, charts, and video frames. Major LLM families read images as well, and the Ultralytics VLM Leaderboard compares how accurately models such as GPT-6.1 Sol, Claude Opus 5.5, and Gemini 4 Argon detect objects in real-world datasets. The Ultralytics LLM interface sends text or images to OpenAI-compatible models from OpenAI, DeepSeek, Kimi, Z.AI, OpenRouter, or a local server, so a YOLO26 pipeline can call an LLM only when a detection needs explaining, such as describing a scene once a person appears.
LLM vs. Related Terms#
- Natural language processing (NLP): The field of computing with human language. LLMs are its dominant model type today.
- Generative AI: Any model that creates new content, including image, audio, and video generators.
- Foundation model: The broader category, named by Stanford researchers in 2021, of large models pretrained on broad data and adapted to many tasks. It includes vision foundation models as well as LLMs.
- Small language model (SLM): A language model compact enough for phones, laptops, or cheap serving, typically with a few billion parameters or fewer.
Limitations#
LLMs produce fluent text whether or not it is true, so hallucinations remain the main risk in factual work, and a model knows nothing after its training cutoff unless retrieval or tools supply it. Training data passes its biases to the model, and instructions hidden in web pages or documents can hijack an agent through prompt injection. Accuracy also falls as contexts grow very long, an effect called context rot. Serving LLMs also takes a lot of memory: a 70-billion-parameter model needs about 140 GB for its weights at 16 bits and about 35 GB at 4 bits, which is why model quantization formats such as GGUF let such models run on a single workstation.










