Large language model
Written by Gemini 4 Argon from Google Search 16 of 24 paragraphs cited
Contents
A large language model (LLM) is a machine learning model, typically built on a deep neural network architecture, that is trained on vast quantities of text data to process, understand, and generate natural and formal languages.123 Operating primarily by predicting the statistically most probable next unit of text in a given sequence, these models acquire broad representations of syntax, semantics, factual knowledge, and reasoning patterns.4 Because a single pre-trained model can be adapted to perform translation, summarization, question answering, software development, and complex analysis without task-specific reprogramming, large language models have become the foundational technology of modern generative artificial intelligence.
The development of large language models accelerated after 2017 with the introduction of the transformer architecture, which enabled parallel processing of massive text corpora across specialized computing clusters.56 Models containing billions or trillions of adjustable parameters—such as OpenAI's GPT series, Google's Gemini, Anthropic's Claude, Meta's Llama, and DeepSeek's R1—demonstrate emergent capabilities that smaller statistical models lack.78 Despite their widespread integration into consumer chatbots, enterprise software, and scientific workflows, large language models present persistent technical and societal challenges, including the fabrication of plausible falsehoods known as hallucinations, substantial energy consumption, security vulnerabilities, and legal disputes over the use of copyrighted training materials.9
History and evolution
Before the emergence of neural language models, natural language processing relied on symbolic rules and statistical n-gram models, which estimated word probabilities based on short preceding sequences. In the 2010s, researchers adopted recurrent neural networks (RNNs) and long short-term memory (LSTM) networks, alongside distributed word representations that mapped vocabulary into continuous vector spaces.10 Although systems such as ELMo (Embeddings from Language Models) demonstrated the value of contextualized representations, sequential architectures processed text word by word, creating computational bottlenecks and struggling to retain context across long passages.
A foundational shift occurred in 2017 when researchers at Google Brain published the paper "Attention Is All You Need," introducing the transformer architecture. By replacing recurrence with self-attention mechanisms, transformers could evaluate relationships between all words in a sequence simultaneously, allowing training to scale efficiently across graphics processing units (GPUs).11 In 2018, two influential transformer-based models established the paradigm of generative pre-training followed by task-specific fine-tuning. Google released BERT (Bidirectional Encoder Representations from Transformers), a 340-million-parameter model that analyzed context in both directions and became a standard for search and classification tasks. That same year, OpenAI introduced GPT-1, demonstrating that a decoder-only transformer trained to predict the next word on diverse, unlabeled text could transfer its learning to varied downstream benchmarks.
Between 2019 and 2022, researchers focused on expanding parameter counts and training datasets. OpenAI's GPT-2 in 2019 (1.5 billion parameters) and GPT-3 in 2020 (175 billion parameters) showed that scale alone unlocked "in-context learning," enabling a model to solve new tasks from a few examples provided in the prompt without updating its internal weights. Other organizations trained competing foundation models, including Google's 540-billion-parameter PaLM and DeepMind's Gopher and Chinchilla. The release of OpenAI's ChatGPT in November 2022, which paired a GPT-3.5 model with alignment techniques to follow conversational instructions, brought large language models to mass public adoption and triggered intense commercial competition.1
From 2023 onward, the field expanded beyond pure text generation toward native multimodality, open-weight ecosystems, and deliberate reasoning.1213 Models such as GPT-4 and GPT-4o integrated text, audio, and visual processing, while Meta's Llama series, Mistral, and Alibaba's Qwen established a robust ecosystem of openly available model weights. In late 2024 and early 2025, the launch of OpenAI's o1 and o3 series alongside Chinese laboratory DeepSeek's open-source DeepSeek-R1 shifted industry focus toward models trained via reinforcement learning to perform extended, step-by-step reasoning before producing an answer. By 2025 and 2026, hybrid systems such as Anthropic's Claude 3.7 Sonnet and subsequent frontier releases combined rapid conversational responses with controllable test-time compute and autonomous tool execution.14
Architecture and representation
Large language models do not process raw text directly as characters or whole words; instead, incoming text first passes through a preprocessor called a tokenizer.1516 Most contemporary models rely on subword tokenization algorithms such as Byte-Pair Encoding (BPE), WordPiece, or SentencePiece.17 In Byte-Pair Encoding, the algorithm begins with individual characters or bytes and iteratively merges the most frequently co-occurring pairs in a training corpus until a fixed vocabulary size is reached. Consequently, common words remain intact as single tokens, while rarer or complex words are split into meaningful roots, prefixes, and suffixes.18 In English, a token corresponds on average to roughly four characters or three-quarters of a word, and each token is assigned a unique integer identifier that maps to a high-dimensional numerical vector known as an embedding.
Once converted into token embeddings and combined with positional encodings—such as Rotary Position Embeddings (RoPE) or ALiBi—that indicate word order, the sequence enters a stack of transformer layers. Each layer contains two primary components: a multi-head self-attention mechanism and a feed-forward neural network. The self-attention mechanism calculates mathematical compatibility scores between every pair of tokens within the model's context window, allowing the representation of an ambiguous word, such as "bank," to dynamically incorporate information from surrounding words that clarify whether it refers to a financial institution or a river.19 Hardware-aware algorithms such as FlashAttention and Grouped-Query Attention have been widely adopted to reduce the memory bandwidth required to compute attention across context windows spanning hundreds of thousands or millions of tokens.
To continue increasing model capacity without incurring a proportional rise in computational cost for every generated token, many large language models replace standard dense feed-forward networks with a Mixture of Experts (MoE) architecture. Pioneered in models such as Google's Switch Transformer and GShard, an MoE layer divides the feed-forward network into numerous specialized sub-networks, or "experts," controlled by a learned routing mechanism. During processing, the router selects only a small subset of experts to activate for each individual token. This sparse conditional computation allows a model to store vast knowledge across hundreds of billions of total parameters while keeping inference speed and energy expenditure comparable to a much smaller dense model.
Training and scaling laws
Constructing a large language model occurs in distinct phases, beginning with self-supervised pre-training. During pre-training, the model's parameters are initialized randomly and exposed to trillions of tokens collected from web crawls, digitized books, academic repositories, encyclopedias, and source code.20 The training pipeline must extensively filter this raw corpus to remove duplicate documents, spam, personally identifiable information, and toxic material.21 As the model processes batches of text across thousands of interconnected accelerators using distributed frameworks like Megatron-LM, ZeRO, or Fully Sharded Data Parallel (FSDP), it repeatedly attempts to predict the next token in a sequence.10 The difference between its predicted probability distribution and the actual next token is measured via cross-entropy loss, and optimization algorithms adjust the model's weights to minimize this error.22
The relationship between model size, dataset volume, computational budget, and pre-training cross-entropy loss is governed by empirical power-law relationships known as neural scaling laws.2324 In 2020, Jared Kaplan and colleagues at OpenAI published scaling laws suggesting that model performance depended primarily on parameter count, leading to the training of massive models like the 175-billion-parameter GPT-3 on roughly 300 billion tokens, a ratio of about 1.7 tokens per parameter.2526 In 2022, Jordan Hoffmann and researchers at DeepMind revised this understanding with the "Chinchilla" scaling laws, demonstrating that earlier models were significantly undertrained relative to their size. For compute-optimal training, the Chinchilla findings showed that model parameters and training tokens should be scaled in equal proportions, requiring roughly 20 tokens per parameter. Because high-quality human-written text on the public internet is finite, developers increasingly supplement pre-training corpora with synthetic data generated and curated by existing models.27
Post-training and alignment
A base model resulting from pre-training is strictly a document completion engine; when prompted with a question, it may respond with additional questions or plausible-sounding internet commentary rather than a helpful answer. To transform a base model into an interactive assistant, developers apply post-training and alignment techniques. The first step is Supervised Fine-Tuning (SFT), in which the model is trained on a curated dataset of high-quality instruction-and-response pairs written by human annotators or synthesized by stronger models.
Following SFT, models undergo preference alignment, most commonly through Reinforcement Learning from Human Feedback (RLHF).28 In the classical RLHF pipeline, human evaluators rank multiple model outputs for the same prompt based on helpfulness, truthfulness, and harmlessness.29 These rankings are used to train a separate reward model that acts as a numerical proxy for human preferences, and an online reinforcement learning algorithm optimizes the language model to maximize the predicted reward. Because maintaining a separate reward model is computationally complex and susceptible to "reward hacking"—where the generator exploits flaws in the proxy model causing true output quality to degrade—many developers also utilize Direct Alignment Algorithms such as Direct Preference Optimization (DPO), which optimize policy weights directly on preference data. For mathematical, scientific, and coding tasks with objectively checkable solutions, post-training increasingly replaces human preference proxies with reinforcement learning against automated verification functions, allowing models to autonomously discover multi-step reasoning strategies.
Inference, reasoning, and extensibility
When a trained model generates text—a phase called inference—it operates autoregressively: it processes the user's input prompt, outputs a probability distribution over its entire vocabulary for the next token, selects one token via sampling strategies, appends that token to the input sequence, and repeats the process until a stop condition is met. Because inference requires loading billions of parameters from memory for every generated token, engineers employ optimization techniques to reduce latency and hardware costs. Quantization methods, such as GPTQ and QLoRA, compress model weights from 16-bit floating-point numbers to 8-bit or 4-bit integers with minimal loss in accuracy, while memory management systems like PagedAttention and decoding techniques like speculative decoding accelerate throughput.
User interaction with a model is shaped by prompt engineering and test-time compute scaling. Researchers discovered in 2022 that instructing a model to "think step by step"—a technique termed chain-of-thought prompting—significantly improved accuracy on logic and arithmetic problems by allowing intermediate computations to be represented as explicit tokens in the context window. Reasoning-focused models internalize this mechanism natively. Instead of emitting an immediate response, models such as OpenAI's o1 and o3, DeepSeek-R1, and Anthropic's extended-thinking systems allocate additional test-time compute to generate thousands of internal reasoning tokens, exploring multiple solution paths, backtracking from errors, and verifying intermediate steps before presenting a final answer.
To overcome the limitation that a model's internal knowledge is frozen at the end of its training run, large language models are frequently integrated into external software harnesses. Retrieval-Augmented Generation (RAG) connects an LLM to an external knowledge base or live search index. When a user submits a query, the system splits reference documents into smaller chunks, retrieves the passages most relevant to the query using vector embeddings, and inserts those passages into the model's context window so its response is grounded in verifiable data. Furthermore, modern models are trained for tool use and agency, enabling them to format structured calls to application programming interfaces (APIs), execute code in sandboxed interpreters, query databases, and coordinate multi-model workflows—such as pairing one model for initial synthesis with a second model to audit citations and factual accuracy.
Evaluation and capabilities
Evaluating the capabilities of large language models requires standardized benchmarks because pre-training loss alone does not reliably predict downstream task accuracy. As models have grown in scale, they have exhibited what researchers term "emergent abilities"—capabilities that remain near random chance in smaller models but appear sharply once parameter counts and training compute cross certain thresholds, though some researchers contend this sharpness is partly an artifact of evaluation metrics.
Academic and industry leaderboards assess models across diverse domains.30 General knowledge and multitask reasoning are commonly tested using Measuring Massive Multitask Language Understanding (MMLU) and comprehensive frameworks such as Stanford's Holistic Evaluation of Language Models (HELM) and Beyond the Imitation Game (BIG-bench). Mathematical problem-solving is evaluated on datasets like GSM8K, reading comprehension on DROP, and software engineering proficiency on coding benchmarks such as HumanEval. As frontier models saturated many static benchmarks, researchers introduced harder evaluations for abstract reasoning and fluid intelligence, such as the ARC-AGI benchmark, where OpenAI's o3 model achieved an 87.5% score in early 2025, alongside complex deep-research benchmarks like DRACO.
Beyond natural human languages, large language models demonstrate strong proficiency in formal and symbolic systems. Because training corpora include vast repositories of computer source code, models can translate between programming languages, debug software, and autonomously author complex applications through specialized interfaces such as GitHub Copilot and Claude Code. Their pattern-recognition capabilities have also been applied to non-linguistic sequences, including mathematical equations, chemical signaling, musical notation, and genetic sequences.
Limitations, risks, and controversies
Hallucinations and reliability
A persistent limitation of large language models is hallucination: the generation of plausible, grammatically fluent, and confident statements that are factually incorrect or entirely fabricated.31 Because language models are probabilistic engines designed to predict the statistically most likely continuation of text rather than retrieve verified facts from a structured database, they frequently guess when confronted with ambiguous prompts, obscure topics, or gaps in their training data. Research published in 2025 by computer scientists including Adam Tauman Kalai argued that hallucinations originate as natural statistical errors in classification during pre-training and persist because standard benchmark evaluations grade models strictly on accuracy, rewarding lucky guesses while penalizing models that abstain or express uncertainty.
While document-summarization benchmarks such as the Vectara HHEM leaderboard recorded declining hallucination rates for basic recall tasks by mid-2026—reaching 3.3% for Gemini 2.5 Flash, 5% for Mistral, and 7% for GPT-5.4—error rates remain high in specialized domains requiring strict factual verification. A 2024 study by Stanford University researchers testing state-of-the-art models on over 200,000 legal queries found hallucination rates ranging from 69% to 88%, leading to numerous incidents in which lawyers were sanctioned by courts for submitting briefs containing fabricated case precedents.32 Similarly, a 2026 academic study in the Southern Economic Journal evaluating GPT-4o, DeepSeek-V3, and web-enabled GPT-5.1 demonstrated that even models equipped with live web search continue to fabricate non-existent scholarly citations.33 In medicine, evaluations of domain-specific models have noted that roughly one in six responses contained incorrect information or faulty retrieval capable of causing clinical harm if deployed without human oversight.34
Bias, security, and alignment mechanics
Because pre-training datasets reflect the contents of the internet, large language models can inherit and amplify societal biases, stereotypes, and toxic language. Conversely, attempts to mitigate these harms through synthetic data curation or post-training alignment can introduce new distortions, as models trained on their own outputs risk amplifying internal errors. Furthermore, safety guardrails designed to make models refuse harmful requests can be bypassed through adversarial prompting or direct manipulation of the model's weights.35 A 2024 study investigating 13 language models demonstrated that refusal behavior is mediated largely by a single linear direction within a model's internal activation space. Using a technique known in the open-weight community as "abliteration," developers can mathematically project out this refusal vector to create uncensored models without retraining, illustrating the fragility of post-training safety filters.
Copyright and environmental impact
The construction and deployment of large language models have sparked major legal and environmental controversies. Authors, artists, and news organizations—most notably The New York Times in its lawsuit against OpenAI and Microsoft—have sued AI developers for copyright infringement, arguing that training commercial models on millions of copyrighted works without permission or compensation is unlawful and creates substitutional outputs that undermine original publishers.36 AI companies have defended the practice under the legal doctrine of fair use, contending that model training is highly transformative because it extracts statistical relationships rather than storing expressive copies. In 2025, a landmark summary judgment ruling by the U.S. District Court for the Northern District of California in Bartz v. Anthropic PBC held that training LLMs on lawfully acquired books constituted protected fair use, though the court ruled that retaining pirated books in an internal library remained actionable infringement.
Finally, the computational scale of training and serving large language models requires substantial electrical power and cooling water across global data centers. While semiconductor manufacturers and data center operators have introduced more efficient accelerators and outside-air cooling systems to curb power consumption, the rapid proliferation of reasoning models that expend extensive compute during inference continues to drive rising energy demand. At the same time, industry dynamics have shifted as laboratories examine the limits of brute-force scaling; a March 2026 survey indicated that 76% of artificial intelligence researchers believed returns from simply scaling pre-training compute and data had begun to plateau, steering research toward architectural efficiency, autonomous self-improvement, and hybrid verification systems.
References
36 sources- 1
History of LLMs: Complete Timeline & Evolution (1950-2026) toloka.aiFeb 19, 2026
- 2
Large language model - Wikipedia en.wikipedia.org
- 3
Large Language Models: What You Need to Know in 2026 | HatchWorks AI hatchworks.comDec 2, 2024
- 4
Confidently Wrong: Hallucinations Revisited - The Information Difference informationdifference.comJul 15, 2026
- 6
The evolution of llm architectures from transformers to mor pub.towardsai.net
- 7
Llm history medium.com
- 8
The AI Model Distillation Paradox lawfaremedia.orgOct 8, 2026
- 10
A History of Large Language Models gregorygundersen.comOct 1, 2025
- 11
Evolution of LLMs goyalpramod.github.ioJun 21, 2025
- 12
The Best Large Language Models (LLMs) in 2026 zapier.comJan 30, 2024
- 15
AI Tokens Explained: How LLMs Actually Read Text | Contrive contrivesol.comOct 8, 2026
- 17
What Is an AI Tokenizer? How LLMs Read Text (2026) taskade.comJan 1, 2024
- 18
Tokenization in LLMs Explained for the Data Lakehouse datalakehousehub.comJan 1, 2026
- 19
Large language models viso.ai
- 20
Copyright Law in 2025 bakerdonelson.comFeb 10, 2026
- 21
Chinchilla data-optimal scaling laws: In plain English lifearchitect.ai
- 22
Neural Scaling Laws: Kaplan & Chinchilla memx.appJun 3, 2026
- 23
RL Scaling Laws for LLMs cameronrwolfe.substack.comApr 20, 2026
- 24
Scaling laws: compute, parameters, tokens, and LLM loss zeroentropy.dev
- 26
ICML Poster Scaling Inference-Efficient Language Models icml.ccMay 8, 2025
- 27
The Future of Large Language Models aimultiple.comJun 25, 2026
- 28
Paper Conference proceedings.neurips.cc
- 30
Why Language Models Hallucinate arxiv.orgSep 4, 2025
- 31
Why language models hallucinate openai.com
- 33
Paper Published on Persistent LLM Hallucinations economistwritingeveryday.comOct 17, 2026
- 34
AI Risks: Ethical and Environmental Concerns americancentury.comMar 17, 2025
