Large language model
Large language model (LLM) is a type of artificial intelligence model designed to process and generate human language by learning statistical and semantic patterns from large collections of text and other data. Large language models are typically based on Deep learning architectures and are trained to predict or generate sequences of tokens, enabling them to perform tasks such as text generation, summarization, translation, question answering, information extraction, classification, and code generation.
Large language models are commonly built using transformer architectures and may contain millions or billions of adjustable parameters. During training, a model learns relationships among words, tokens, concepts, and linguistic structures from large datasets. After training, the model can generate responses by estimating probable sequences of tokens given an input prompt or other context.
LLMs are a major component of Generative artificial intelligence and are used in applications including conversational assistants, search systems, content generation, software development, education, research, customer service, and information retrieval.
History
Large language models developed from earlier approaches to computational linguistics, statistical language modelling, and neural language modelling. Advances in Machine learning, Deep learning, computational hardware, training data, and neural network architectures enabled increasingly large models to learn complex patterns in natural language.
The introduction of the transformer architecture significantly accelerated the development of large-scale language models by enabling more efficient processing of relationships between tokens within a sequence.
Architecture
Modern large language models commonly use transformer-based neural network architectures.
A transformer processes sequences of tokens using mechanisms such as:
- self-attention;
- feed-forward neural networks;
- positional representations;
- normalization layers.
These components enable the model to identify relationships between different parts of an input sequence and generate contextually relevant outputs.
Training
Large language models are generally trained in multiple stages.
Pretraining
During pretraining, a model is exposed to a large dataset containing text and other forms of data. The model learns statistical relationships and representations by performing predictive tasks.
A common objective for an autoregressive language model is to predict the next token given the preceding tokens.
A simplified representation is:
where:
- xt = token being predicted;
- x1, x2, \ldots, xt-1 = preceding tokens.
Fine-tuning
A pretrained model may subsequently undergo fine-tuning using a more specialized dataset to improve its performance on particular tasks or domains.
Fine-tuning may adapt a general-purpose model for applications such as programming, legal analysis, scientific research, customer support, or document processing.
Alignment
Some large language models undergo additional training intended to make their outputs more useful, reliable, and consistent with specified behavioral requirements.
Methods may include supervised fine-tuning and Reinforcement learning from human feedback.
Inference
Inference is the process through which a trained language model generates an output from an input.
The model processes the input tokens and calculates probability distributions over possible subsequent tokens. A decoding procedure then selects tokens sequentially until the response is completed.
Capabilities
Large language models can perform a wide range of language and reasoning-related tasks, including:
- text generation;
- summarization;
- translation;
- question answering;
- classification;
- information extraction;
- text transformation;
- code generation;
- document analysis;
- conversational interaction.
Performance varies according to the model architecture, training data, context, prompting method, and task.
Applications
Large language models are used in:
- conversational artificial intelligence;
- search and information retrieval;
- software development;
- content generation;
- education;
- research assistance;
- customer service;
- document processing;
- language translation;
- business intelligence.
They may be integrated into software applications through application programming interfaces or deployed directly within computing environments.
Limitations
Large language models may generate inaccurate, incomplete, outdated, or misleading information. A model can produce a plausible response even when it lacks sufficient information to establish that the response is correct.
Other limitations may include:
- hallucination;
- sensitivity to input phrasing;
- limited contextual understanding;
- training-data limitations;
- computational costs;
- bias in training data;
- difficulty with certain forms of reasoning.
Consequently, outputs may require verification, particularly in high-stakes applications.
Relationship with generative artificial intelligence
Generative artificial intelligence is a broader category of artificial intelligence systems capable of generating new content.
Large language models constitute an important class of generative AI systems focused primarily on language and language-related tasks.
Relationship with natural language processing
Natural language processing is the broader field concerned with enabling computers to process, interpret, and generate human language.
Large language models represent one of the major approaches used in modern natural language processing.
Relationship with machine learning
Machine learning provides the statistical and computational methods used to train large language models.
LLMs are generally developed using deep neural networks trained on large datasets with substantial computational resources.
Importance
Large language models have become a major technology within modern artificial intelligence because they provide a general-purpose interface for processing and generating natural language. Their ability to perform multiple language-related tasks using a common model has enabled applications across research, software development, education, business, information retrieval, and human-computer interaction.