A large language model (LLM) is a computational
model notable for its ability to achieve general-purpose language generation and other
natural language processing tasks such as
classification. Based on
language models, LLMs acquire these abilities by learning statistical relationships from vast amounts of text during a computationally intensive
self-supervised and
semi-supervised training process.[1] LLMs can be used for text generation, a form of
generative AI, by taking an input text and repeatedly predicting the next token or word.[2]
LLMs are
artificial neural networks that utilize the
transformer architecture, invented in 2017. The largest and most capable LLMs, as of June 2024[update], are built with a decoder-only transformer-based architecture, which enables efficient processing and generation of large-scale text data.
Historically, up to 2020,
fine-tuning was the primary method used to adapt a model for specific tasks. However, larger models such as
GPT-3 have demonstrated the ability to achieve similar results through
prompt engineering, which involves crafting specific input prompts to guide the model's responses.[3] These models acquire knowledge about syntax, semantics, and
ontologies[4] inherent in human language corpora, but they also inherit inaccuracies and
biases present in the data they are trained on.[5]
Before 2017, there were a few language models that were large compared to capacities then available. In the 1990s, the
IBM alignment models pioneered statistical language modelling. In the 2000s, as Internet use became prevalent, some researchers constructed Internet-scale language datasets ("web as corpus"[6]), upon which they trained statistical language models.[7][8] In 2009, in most language processing tasks, statistical language models dominated over symbolic language models, as they can usefully ingest large datasets.[9]
After neural networks became dominant in image processing around 2012, they were applied to language modelling as well. Google converted its translation service to
Neural Machine Translation in 2016. As it was before Transformers, it was done by seq2seq deep LSTM networks.
At the 2017
NeurIPS conference, Google researchers introduced the
transformer architecture in their landmark paper "
Attention Is All You Need". This paper's goal was to improve upon 2014
Seq2seq technology,[10] and was based mainly on the
attention mechanism developed by Bahdanau et al. in 2014.[11] The following year in 2018,
BERT was introduced and quickly became "ubiquitous".[12] Though the original transformer has both encoder and decoder blocks, BERT is an encoder-only model.
Although decoder-only
GPT-1 was introduced in 2018, it was
GPT-2 in 2019 that caught widespread attention because
OpenAI at first deemed it too powerful to release publicly, out of fear of malicious use.[13]GPT-3 in 2020 went a step further and as of 2024[update] is available only via
API with no offering of downloading the model to execute locally. But it was the 2022 consumer-facing browser-based
ChatGPT that captured the imaginations of the general population and caused some media hype and online buzz.[14] The 2023
GPT-4 was praised for its increased accuracy and as a "holy grail" for its
multimodal capabilities.[15] OpenAI did not reveal high-level architecture and the number of
parameters of GPT-4.
Competing language models have for the most part been attempting to equal the GPT series, at least in terms of number of parameters.[16]
Since 2022,
source-available models have been gaining popularity, especially at first with
BLOOM and
LLaMA, though both have restrictions on the field of use.
Mistral AI's models Mistral 7B and Mixtral 8x7b have the more permissive
Apache License. As of June 2024[update], The Instruction fine tuned variant of the Llama 3 70 billion parameter model is the most powerful open LLM according to the LMSYS Chatbot Arena Leaderboard, being more powerful than GPT-3.5 but not as powerful as GPT-4.[17]
As of 2024, the largest and most capable models are all based on the Transformer architecture. Some recent implementations are based on other architectures, such as
recurrent neural network variants and
Mamba (a
state space model).[18][19][20]
Because
machine learning algorithms process numbers rather than text, the text must be converted to numbers. In the first step, a vocabulary is decided upon, then integer indexes are arbitrarily but uniquely assigned to each vocabulary entry, and finally, an
embedding is associated to the integer index. Algorithms include
byte-pair encoding and
WordPiece.
Probabilistic tokenization also
compresses the datasets. Because LLMs generally require input to be an
array that is not
jagged, the shorter texts must be "padded" until they match the length of the longest one. How many tokens are, on average, needed per word depends on the language of the dataset.[21][22]
BPE
Using a modification of byte-pair encoding, in the first step, all unique characters (including blanks and
punctuation marks) are treated as an initial set of
n-grams (i.e. initial set of uni-grams). Successively the most frequent pair of adjacent characters is merged into a bi-gram and all instances of the pair are replaced by it. All occurrences of adjacent pairs of (previously merged) n-grams that most frequently occur together are then again merged into even lengthier n-gram repeatedly until a vocabulary of prescribed size is obtained (in case of
GPT-3, the size is 50257).[23] Token vocabulary consists of
integers, spanning from zero up to the size of the token vocabulary. New words can always be interpreted as combinations of the tokens and the initial-set uni-grams.[24]
A token vocabulary based on the frequencies extracted from mainly English corpora uses as few tokens as possible for an average English word. An average word in another language encoded by such an English-optimized tokenizer is however split into suboptimal amount of tokens. GPT-2 tokenizer can use up to 15 times more tokens per word for some languages, for example for the
Shan language from
Myanmar. Even more widespread languages such as Portuguese and German have "a premium of 50%" compared to English.[25]
For example, here is how tokenizer used by GPT-3 (Legacy) split the following sentence tokenizer: texts -> series of numerical "tokens".
In the context of training LLMs, datasets are typically cleaned by removing toxic passages from the dataset, discarding low-quality data, and de-duplication.[26] Cleaned datasets can increase training efficiency and lead to improved downstream performance.[27][28] A trained LLM can be used to clean datasets for training a further LLM.[29]
With the increasing proportion of LLM-generated content on the web, data cleaning in the future may include filtering out such content. LLM-generated content can pose a problem if the content is similar to human text (making filtering difficult) but of lower quality (degrading performance of models trained on it).[30]
Training of largest language models might need more linguistic data than naturally available, or that the naturally occurring data is of insufficient quality. In these cases, synthetic data might be used. The Microsoft's Phi series of LLMs is trained on textbook-like data generated by another LLM.[31]
Using "self-instruct" approaches, LLMs have been able to
bootstrap correct responses, replacing any naive responses, starting from human-generated corrections of a few cases. For example, in the instruction "Write an essay about the main themes represented in Hamlet," an initial naive completion might be "If you submit the essay after March 17, your grade will be reduced by 10% for each day of delay," based on the frequency of this textual sequence in the corpus.[33]
The largest LLM may be too expensive to train and use directly. For such models,
mixture of experts (MoE) can be applied, a line of research pursued by Google researchers since 2017 to train models reaching up to 1 trillion parameters.[34][35][36]
Prompt engineering, attention mechanism, and context window
Most results previously achievable only by (costly) fine-tuning, can be achieved through
prompt engineering, although limited to the scope of a single conversation (more precisely, limited to the scope of a context window).[37]
In order to find out which tokens are relevant to each other within the scope of the context window, the attention mechanism calculates "soft" weights for each token, more precisely for its embedding, by using multiple attention heads, each with its own "relevance" for calculating its own soft weights. For example, the small (i.e. 117M parameter sized)
GPT-2 model has had twelve attention heads and a context window of only 1k token.[39] In its medium version it has 345M parameters and contains 24 layers, each with 12 attention heads. For the training with gradient descent a batch size of 512 was utilized.[24]
The largest models, such as Google's
Gemini 1.5, presented in February 2024, can have a context window sized up to 1 million (context window of 10 million was also "successfully tested").[40] Other models with large context windows includes Anthropic's Claude 2.1, with a context window of up to 200k tokens.[41] Note that this maximum refers to the number of input tokens and that the maximum number of output tokens differs from the input and is often smaller. For example, the GPT-4 Turbo model has a maximum output of 4096 tokens.[42]
Length of a conversation that the model can take into account when generating its next answer is limited by the size of a context window, as well. If the length of a conversation, for example with
Chat-GPT, is longer than its context window, only the parts inside the context window are taken into account when generating the next answer, or the model needs to apply some algorithm to summarize the too distant parts of conversation.
The shortcomings of making a context window larger include higher computational cost and possibly diluting the focus on local context, while making it smaller can cause a model to miss an important long-range dependency. Balancing them are a matter of experimentation and domain-specific considerations.
A model may be pre-trained either to predict how the segment continues, or what is missing in the segment, given a segment from its training dataset.[43] It can be either
autoregressive (i.e. predicting how the segment continues, the way
GPTs do it): for example given a segment "I like to eat", the model predicts "ice cream", or "sushi".
"
masked" (i.e. filling in the parts missing from the segment, the way "BERT"[44] does it): for example, given a segment "I like to [__] [__] cream", the model predicts that "eat" and "ice" are missing.
Models may be trained on auxiliary tasks which test their understanding of the data distribution, such as Next Sentence Prediction (NSP), in which pairs of sentences are presented and the model must predict whether they appear consecutively in the training corpus.[44] During training,
regularization loss is also used to stabilize training. However regularization loss is usually not used during
testing and evaluation.
Training cost
Advances in software and hardware have reduced the cost substantially since 2020, such that in 2023 training of a 12-billion-parameter LLM computational cost is 72,300
A100-GPU-hours, while in 2020 the cost of training a 1.5-billion-parameter LLM (which was two orders of magnitude smaller than the state of the art in 2020) was between $80 thousand and $1.6 million.[45][46][47] Since 2020, large sums were invested in increasingly large models. For example, training of the GPT-2 (i.e. a 1.5-billion-parameters model) in 2019 cost $50,000, while training of the PaLM (i.e. a 540-billion-parameters model) in 2022 cost $8 million, and Megatron-Turing NLG 530B (in 2021) cost around $11 million.[48]
For Transformer-based LLM, training cost is much higher than inference cost. It costs 6
FLOPs per parameter to train on one token, whereas it costs 1 to 2 FLOPs per parameter to infer on one token.[49]
Tool use
There are certain tasks that, in principle, cannot be solved by any LLM, at least not without the use of external tools or additional software. An example of such a task is responding to the user's input '354 * 139 = ', provided that the LLM has not already encountered a continuation of this calculation in its training corpus. In such cases, the LLM needs to resort to running program code that calculates the result, which can then be included in its response. Another example is 'What is the time now? It is ', where a separate program interpreter would need to execute a code to get system time on the computer, so LLM could include it in its reply.[50][51] This basic strategy can be sophisticated with multiple attempts of generated programs, and other sampling strategies.[52]
Generally, in order to get an LLM to use tools, one must finetune it for tool-use. If the number of tools is finite, then finetuning may be done just once. If the number of tools can grow arbitrarily, as with online
API services, then the LLM can be fine-tuned to be able to read API documentation and call API correctly.[53][54]
A simpler form of tool use is Retrieval Augmented Generation: augment an LLM with
document retrieval, sometimes using a
vector database. Given a query, a document retriever is called to retrieve the most relevant (usually measured by first encoding the query and the documents into vectors, then finding the documents with vectors closest in Euclidean norm to the query vector). The LLM then generates an output based on both the query and the retrieved documents.[55]
Agency
An LLM is a language model, which is not an agent as it has no goal, but it can be used as a component of an
intelligent agent.[56] Researchers have described several methods for such integrations.[citation needed]
The ReAct ("Reason + Act") method constructs an
agent out of an LLM, using the LLM as a planner. The LLM is prompted to "think out loud". Specifically, the language model is prompted with a textual description of the environment, a goal, a list of possible actions, and a record of the actions and observations so far. It generates one or more thoughts before generating an action, which is then executed in the environment.[57] The linguistic description of the environment given to the LLM planner can even be the LaTeX code of a paper describing the environment.[58]
In the DEPS ("Describe, Explain, Plan and Select") method, an LLM is first connected to the visual world via image descriptions, then it is prompted to produce plans for complex tasks and behaviors based on its pretrained knowledge and environmental feedback it receives.[59]
The Reflexion method[60] constructs an agent that learns over multiple episodes. At the end of each episode, the LLM is given the record of the episode, and prompted to think up "lessons learned", which would help it perform better at a subsequent episode. These "lessons learned" are given to the agent in the subsequent episodes.[citation needed]
Monte Carlo tree search can use an LLM as rollout heuristic. When a programmatic world model is not available, an LLM can also be prompted with a description of the environment to act as world model.[61]
For open-ended exploration, an LLM can be used to score observations for their "interestingness", which can be used as a reward signal to guide a normal (non-LLM) reinforcement learning agent.[62] Alternatively, it can
propose increasingly difficult tasks for
curriculum learning.[63] Instead of outputting individual actions, an LLM planner can also construct "skills", or
functions for complex action sequences. The skills can be stored and later invoked, allowing increasing levels of abstraction in planning.[63]
LLM-powered agents can keep a long-term memory of its previous contexts, and the memory can be retrieved in the same way as Retrieval Augmented Generation. Multiple such agents can interact socially.[64]
Compression
Typically, LLM are trained with single- or half-precision floating point numbers (float32 and float16). One float16 has 16 bits, or 2 bytes, and so one billion parameters require 2 gigabytes. The largest models typically have 100 billion parameters, requiring 200 gigabytes to load, which places them outside the range of most consumer electronics.[65]
Post-training
quantization[66] aims to decrease the space requirement by lowering precision of the parameters of a trained model, while preserving most of its performance.[67][68] The simplest form of quantization simply truncates all numbers to a given number of bits. It can be improved by using a different quantization
codebook per layer. Further improvement can be done by applying
different precisions to different parameters, with higher precision for particularly important parameters ("outlier weights").[69]
While quantized models are typically frozen, and only pre-quantized models are fine-tuned, quantized models can still be fine-tuned.[70]
Multimodality means "having several modalities", and a
"modality" refers to a type of input or output, such as video, image, audio, text,
proprioception, etc.[71] There have been many AI models trained specifically to ingest one modality and output another modality, such as
AlexNet for image to label,[72]visual question answering for image-text to text,[73] and
speech recognition for speech to text.
A common method to create multimodal models out of an LLM is to "tokenize" the output of a trained encoder. Concretely, one can construct an LLM that can understand images as follows: take a trained LLM, and take a trained image encoder . Make a small multilayered perceptron , so that for any image , the post-processed vector has the same dimensions as an encoded token. That is an "image token". Then, one can interleave text tokens and image tokens. The compound model is then fine-tuned on an image-text dataset. This basic construction can be applied with more sophistication to improve the model. The image encoder may be frozen to improve stability.[74]
Flamingo demonstrated the effectiveness of the tokenization method, finetuning a pair of pretrained language model and image encoder to perform better on visual question answering than models trained from scratch.[75]Google PaLM model was fine-tuned into a multimodal model PaLM-E using the tokenization method, and applied to robotic control.[76]LLaMA models have also been turned multimodal using the tokenization method, to allow image inputs,[77] and video inputs.[78]
GPT-4 can use both text and image as inputs[79] (although the vision component was not released to the public until GPT-4V[80]);
Google DeepMind's
Gemini is also multimodal.[81]
The following four hyper-parameters characterize an LLM:
cost of (pre-)training (),
size of the
artificial neural network itself, such as number of parameters (i.e. amount of neurons in its layers, amount of weights between them and biases),
size of its (pre-)training dataset (i.e. number of tokens in corpus, ),
is the average negative log-likelihood loss per token (
nats/token), achieved by the trained LLM on the test dataset.
and the statistical hyper-parameters are
, meaning that it costs 6 FLOPs per parameter to train on one token. Note that training cost is much higher than inference cost, where it costs 1 to 2 FLOPs per parameter to infer on one token.[49]
Emergent abilities
Performance of bigger models on various tasks, when plotted on a log-log scale, appears as a linear extrapolation of performance achieved by smaller models. However, this linearity may be punctuated by "
break(s)"[83] in the scaling law, where the slope of the line changes abruptly, and where larger models acquire "emergent abilities".[37][84] They arise from the complex interaction of the model's components and are not explicitly programmed or designed.[2]
The most intriguing among emergent abilities is
in-context learning from example demonstrations.[85] In-context learning is involved in tasks, such as:
reported arithmetics, decoding the
International Phonetic Alphabet, unscrambling a word's letters, disambiguate word in context,[37][86][87] converting spatial words,
cardinal directions (for example, replying "northeast" upon [0, 0, 1; 0, 0, 0; 0, 0, 0]), color terms represented in text.[88]
chain-of-thought prompting: Model outputs are improved by chain-of-thought prompting only when model size exceeds 62B. Smaller models perform better when prompted to answer immediately, without chain of thought.[89]
identifying offensive content in paragraphs of
Hinglish (a combination of Hindi and English), and generating a similar English equivalent of
Kiswahili proverbs.[90]
Schaeffer et. al. argue that the emergent abilities are not unpredictably acquired, but predictably acquired according to a
smooth scaling law. The authors considered a toy statistical model of an LLM solving multiple-choice questions, and showed that this statistical model, modified to account for other types of tasks, applies to these tasks as well.[91]
Let be the number of parameter count, and be the performance of the model.
When , then is an exponential curve (before it hits the plateau at one), which looks like emergence.
When , then the plot is a straight line (before it hits the plateau at zero), which does not look like emergence.
When , then is a step-function, which looks like emergence.
Interpretation
Large language models by themselves are "
black boxes", and it is not clear how they can perform linguistic tasks. There are several methods for understanding how LLM work.
Mechanistic interpretability aims to
reverse-engineer LLM by discovering symbolic algorithms that approximate the inference performed by LLM. One example is Othello-GPT, where a small Transformer is trained to predict legal
Othello moves. It is found that there is a linear representation of Othello board, and modifying the representation changes the predicted legal Othello moves in the correct way.[92][93] In another example, a small Transformer is trained on
Karel programs. Similar to the Othello-GPT example, there is a linear representation of Karel program semantics, and modifying the representation changes output in the correct way. The model also generates correct programs that are on average shorter than those in the training set.[94]
NLP researchers were evenly split when asked, in a 2022 survey, whether (untuned) LLMs "could (ever) understand natural language in some nontrivial sense".[96] Proponents of "LLM understanding" believe that some LLM abilities, such as mathematical reasoning, imply an ability to
"understand" certain concepts. A Microsoft team argued in 2023 that GPT-4 "can solve novel and difficult tasks that span mathematics, coding, vision, medicine, law, psychology and more" and that GPT-4 "could reasonably be viewed as an early (yet still incomplete) version of an
artificial general intelligence system": "Can one reasonably say that a system that passes exams for software engineering candidates is not really intelligent?"[97][98] Some researchers characterize LLMs as "alien intelligence".[99][100] For example, Conjecture CEO Connor Leahy considers untuned LLMs to be like inscrutable alien "
Shoggoths", and believes that RLHF tuning creates a "smiling facade" obscuring the inner workings of the LLM: "If you don't push it too far, the smiley face stays on. But then you give it [an unexpected] prompt, and suddenly you see this massive underbelly of insanity, of weird thought processes and clearly non-human understanding."[101][102]
In contrast, some proponents of the "LLMs lack understanding" school believe that existing LLMs are "simply remixing and recombining existing writing",[100] a phenomenon known as
stochastic parrot, or they point to the deficits existing LLMs continue to have in prediction skills, reasoning skills, agency, and explainability.[96] For example, GPT-4 has natural deficits in planning and in real-time learning.[98] Generative LLMs have been observed to confidently assert claims of fact which do not seem to be
justified by their
training data, a phenomenon which has been termed "
hallucination".[103] Specifically, hallucinations in the context of LLMs correspond to the generation of text or responses that seem syntactically sound, fluent, and natural but are factually incorrect, nonsensical, or unfaithful to the provided source input.[104] Neuroscientist
Terrence Sejnowski has argued that "The diverging opinions of experts on the intelligence of LLMs suggests that our old ideas based on natural intelligence are inadequate".[96]
The matter of LLM's exhibiting intelligence or understanding has two main aspects – the first is how to model thought and language in a computer system, and the second is how to enable the computer system to generate human like language.[96] These aspects of language as a model of
cognition have been developed in the field of
cognitive linguistics. American linguist
George Lakoff presented Neural Theory of Language (NTL)[105] as a
computational basis for using language as a model of learning tasks and understanding.
The NTL Model outlines how specific neural structures of the human brain shape the nature of thought and language and in turn what are the computational properties of such neural systems that can be applied to model thought and language in a computer system. After a framework for modeling language in a computer systems was established, the focus shifted to establishing frameworks for computer systems to generate language with acceptable grammar. In his 2014 book titled The Language Myth: Why Language Is Not An Instinct, British cognitive linguist and digital communication technologist
Vyvyan Evans mapped out the role of
probabilistic context-free grammar (PCFG) in enabling
NLP to model cognitive patterns and generate human like language.[106][107]
Evaluation
Perplexity
The most commonly used measure of a language model's performance is its
perplexity on a given text corpus. Perplexity is a measure of how well a model is able to predict the contents of a dataset; the higher the likelihood the model assigns to the dataset, the lower the perplexity. Mathematically, perplexity is defined as the exponential of the average negative log likelihood per token:
here is the number of tokens in the text corpus, and "context for token " depends on the specific type of LLM used. If the LLM is autoregressive, then "context for token " is the segment of text appearing before token . If the LLM is masked, then "context for token " is the segment of text surrounding token .
Because language models may
overfit to their training data, models are usually evaluated by their perplexity on a
test set of unseen data.[44] This presents particular challenges for the evaluation of large language models. As they are trained on increasingly large corpora of text largely scraped from the web, it becomes increasingly likely that models' training data inadvertently includes portions of any given test set.[3]
BPW, BPC, and BPT
In
information theory, the concept of
entropy is intricately linked to perplexity, a relationship notably established by
Claude Shannon.[108] This relationship is mathematically expressed as .
Entropy, in this context, is commonly quantified in terms of bits per word (BPW) or bits per character (BPC), which hinges on whether the language model utilizes word-based or character-based tokenization.
Notably, in the case of larger language models that predominantly employ sub-word tokenization, bits per token (BPT) emerges as a seemingly more appropriate measure. However, due to the variance in tokenization methods across different Large Language Models (LLMs), BPT does not serve as a reliable metric for comparative analysis among diverse models. To convert BPT into BPW, one can multiply it by the average number of tokens per word.
In the evaluation and comparison of language models,
cross-entropy is generally the preferred metric over entropy. The underlying principle is that a lower BPW is indicative of a model's enhanced capability for compression. This, in turn, reflects the model's proficiency in making accurate predictions.
Task-specific datasets and benchmarks
A large number of testing datasets and benchmarks have also been developed to evaluate the capabilities of language models on more specific downstream tasks. Tests may be designed to evaluate a variety of capabilities, including general knowledge, commonsense reasoning, and mathematical problem-solving.
One broad category of evaluation dataset is question answering datasets, consisting of pairs of questions and correct answers, for example, ("Have the San Jose Sharks won the Stanley Cup?", "No").[109] A question answering task is considered "open book" if the model's prompt includes text from which the expected answer can be derived (for example, the previous question could be adjoined with some text which includes the sentence "The Sharks have advanced to the Stanley Cup finals once, losing to the Pittsburgh Penguins in 2016."[109]). Otherwise, the task is considered "closed book", and the model must draw on knowledge retained during training.[110] Some examples of commonly used question answering datasets include TruthfulQA, Web Questions, TriviaQA, and SQuAD.[110]
Evaluation datasets may also take the form of text completion, having the model select the most likely word or sentence to complete a prompt, for example: "Alice was friends with Bob. Alice went to visit her friend, ____".[3]
Some composite benchmarks have also been developed which combine a diversity of different evaluation datasets and tasks. Examples include GLUE, SuperGLUE,
MMLU, BIG-bench, and HELM.[108][110] OpenAI has released tools for running composite benchmarks, but noted that the eval results are sensitive to the prompting method.[111][112]
It was previously standard to report results on a heldout portion of an evaluation dataset after doing supervised fine-tuning on the remainder. It is now more common to evaluate a pre-trained model directly through prompting techniques, though researchers vary in the details of how they formulate prompts for particular tasks, particularly with respect to how many examples of solved tasks are adjoined to the prompt (i.e. the value of n in n-shot prompting).
Adversarially constructed evaluations
Because of the rapid pace of improvement of large language models, evaluation benchmarks have suffered from short lifespans, with state of the art models quickly "saturating" existing benchmarks, exceeding the performance of human annotators, leading to efforts to replace or augment the benchmark with more challenging tasks.[113] In addition, there are cases of "shortcut learning" wherein AIs sometimes "cheat" on multiple-choice tests by using statistical correlations in superficial test question wording in order to guess the correct responses, without necessarily understanding the actual question being asked.[96]
Some datasets have been constructed adversarially, focusing on particular problems on which extant language models seem to have unusually poor performance compared to humans. One example is the TruthfulQA dataset, a question answering dataset consisting of 817 questions which language models are susceptible to answering incorrectly by mimicking falsehoods to which they were repeatedly exposed during training. For example, an LLM may answer "No" to the question "Can you teach an old dog new tricks?" because of its exposure to the English idiom you can't teach an old dog new tricks, even though this is not literally true.[114]
Another example of an adversarial evaluation dataset is Swag and its successor, HellaSwag, collections of problems in which one of multiple options must be selected to complete a text passage. The incorrect completions were generated by sampling from a language model and filtering with a set of classifiers. The resulting problems are trivial for humans but at the time the datasets were created state of the art language models had poor accuracy on them. For example:
We see a fitness center sign. We then see a man talking to the camera and sitting and laying on a exercise ball. The man...
a) demonstrates how to increase efficient exercise work by running up and down balls.
b) moves all his arms and legs and builds up a lot of muscle.
c) then plays the ball and we see a graphics and hedge trimming demonstration.
d) performs sit ups while on the ball and talking.[115]
BERT selects b) as the most likely completion, though the correct answer is d).[115]
Wider impact
In 2023, Nature Biomedical Engineering wrote that "it is no longer possible to accurately distinguish" human-written text from text created by large language models, and that "It is all but certain that general-purpose large language models will rapidly proliferate... It is a rather safe bet that they will change many industries over time."[116]Goldman Sachs suggested in 2023 that generative language AI could increase global GDP by 7% in the next ten years, and could expose to automation 300 million jobs globally.[117][118]
Memorization is an emergent behavior in LLMs in which long strings of text are occasionally output verbatim from training data, contrary to typical behavior of traditional artificial neural nets. Evaluations of controlled LLM output measure the amount memorized from training data (focused on GPT-2-series models) as variously over 1% for exact duplicates[119] or up to about 7%.[120]
Security
Some commenters expressed concern over accidental or deliberate creation of misinformation, or other forms of misuse.[121] For example, the availability of large language models could reduce the skill-level required to commit bioterrorism; biosecurity researcher Kevin Esvelt has suggested that LLM creators should exclude from their training data papers on creating or enhancing pathogens.[122]
A study by researchers at Google and several universities, including
Cornell University and
University of California, Berkeley, showed that there are potential security risks in language models such as
ChatGPT. In their study, they examined and confirmed the possibility that questioners could get, from ChatGPT, the training data that the AI model used. For example, when asking ChatGPT 3.5 turbo to repeat the word "poem" forever, the AI model will say "poem" hundreds of times and then diverge, deviating from the standard dialogue style and spitting out nonsense phrases, thus spitting out the training data as it is. The researchers have seen more than 10,000 examples of the AI model exposing their training data in a similar method. The researchers said that it was hard to tell if the AI model was actually safe or not.[123]
The potential presence of "sleeper agents" within LLM models is another emerging security concern. These are hidden functionalities built into the model that remain dormant until triggered by a specific event or condition. Upon activation, the LLM deviates from its expected behavior to make insecure actions.[124]
While LLMs have shown remarkable capabilities in generating human-like text, they are susceptible to inheriting and amplifying biases present in their training data. This can manifest in skewed representations or unfair treatment of different demographics, such as those based on race, gender, language, and cultural groups.[125] Since English data is overrepresented in current large language models' training data, it may also downplay non-English views.[126]
Stereotyping
AI models can reinforce a wide range of stereotypes, including those based on gender, ethnicity, age, nationality, religion, or occupation. This can lead to outputs that unfairly generalize or caricature groups of people, sometimes in harmful or derogatory ways.[127]
Notably, gender bias refers to the tendency of these models to produce outputs that are unfairly prejudiced towards one gender over another. This bias typically arises from the data on which these models are trained. Large language models often assign roles and characteristics based on traditional gender norms.[125] For example, it might associate nurses or secretaries predominantly with women and engineers or CEOs with men.[128]
Political bias
Political bias refers to the tendency of algorithms to systematically favor certain political viewpoints, ideologies, or outcomes over others. Language models may also exhibit political biases. Since the training data includes a wide range of political opinions and coverage, the models might generate responses that lean towards particular political ideologies or viewpoints, depending on the prevalence of those views in the data.[129]
The first of
a series of free GPT-3 alternatives released by EleutherAI. GPT-Neo outperformed an equivalent-size GPT-3 model on some benchmarks, but was significantly worse than the largest GPT-3.[151]
38.5B tokens from webpages filtered for mathematical content and from papers submitted to the arXiv preprint server[171]
Proprietary
For solving "mathematical and scientific questions using step-by-step reasoning".[172] Based on PaLM model, further trained on mathematical and scientific data.
^This is the date that documentation describing the model's architecture was first released.
^In many cases, researchers release or report on multiple versions of a model having different sizes. In these cases, the size of the largest model is listed here.
^This is the license of the pre-trained model weights. In almost all cases the training code itself is open-source or can be easily replicated.
^The smaller models including 66B are publicly available, while the 175B model is available on request.
^Facebook's license and distribution scheme restricted access to approved researchers, but the model weights were leaked and became widely available.
^As stated in Technical report: "Given both the competitive landscape and the safety implications of large-scale models like GPT-4, this report contains no further details about the architecture (including model size), hardware, training compute, dataset construction, training method ..."[181]
^Gu, Albert; Dao, Tri (2023-12-01), Mamba: Linear-Time Sequence Modeling with Selective State Spaces,
arXiv:2312.00752
^Yennie Jun (2023-05-03).
"All languages are NOT created (tokenized) equal". Language models cost much more in some languages than others. Archived from
the original on 2023-08-17. Retrieved 2023-08-17. In other words, to express the same sentiment, some languages require up to 10 times more tokens.
^Petrov, Aleksandar; Emanuele La Malfa; Torr, Philip H. S.; Bibi, Adel (2023). "Language Model Tokenizers Introduce Unfairness Between Languages".
arXiv:2305.15425 [
cs.CL].
^Dodge, Jesse; Sap, Maarten; Marasović, Ana; Agnew, William; Ilharco, Gabriel; Groeneveld, Dirk; Mitchell, Margaret; Gardner, Matt (2021). "Documenting Large Webtext Corpora: A Case Study on the Colossal Clean Crawled Corpus".
arXiv:2104.08758 [
cs.CL].
^Li, Yuanzhi; Bubeck, Sébastien; Eldan, Ronen; Del Giorno, Allie; Gunasekar, Suriya; Lee, Yin Tat (2023-09-11), Textbooks Are All You Need II: phi-1.5 technical report,
arXiv:2309.05463
^Lin, Zhenghao; Gou, Zhibin; Gong, Yeyun; Liu, Xiao; Shen, Yelong; Xu, Ruochen; Lin, Chen; Yang, Yujiu; Jiao, Jian (2024-04-11). "Rho-1: Not All Tokens Are What You Need".
arXiv:2404.07965 [
cs.CL].
^Brown, Tom B.; et al. (2020). "Language Models are Few-Shot Learners".
arXiv:2005.14165 [
cs.CL].
^Abdin, Marah; Jacobs, Sam Ade; Awan, Ammar Ahmad; Aneja, Jyoti; Awadallah, Ahmed; Awadalla, Hany; Bach, Nguyen; Bahree, Amit; Bakhtiari, Arash (2024-04-23). "Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone".
arXiv:2404.14219 [
cs.CL].
^Sharir, Or; Peleg, Barak; Shoham, Yoav (2020). "The Cost of Training NLP Models: A Concise Overview".
arXiv:2004.08900 [
cs.CL].
^Biderman, Stella; Schoelkopf, Hailey; Anthony, Quentin; Bradley, Herbie; Khan, Mohammad Aflah; Purohit, Shivanshu; Prashanth, USVSN Sai (April 2023). "Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling".
arXiv:2304.01373 [
cs.CL].
^Maslej, Nestor; Fattorini, Loredana; Brynjolfsson, Erik; Etchemendy, John; Ligett, Katrina; Lyons, Terah; Manyika, James; Ngo, Helen; Niebles, Juan Carlos (2023-10-05), Artificial Intelligence Index Report 2023,
arXiv:2310.03715
^
abSection 2.1 and Table 1,
Kaplan, Jared; McCandlish, Sam; Henighan, Tom; Brown, Tom B.; Chess, Benjamin; Child, Rewon; Gray, Scott; Radford, Alec; Wu, Jeffrey; Amodei, Dario (2020). "Scaling Laws for Neural Language Models".
arXiv:2001.08361 [
cs.LG].
^Paranjape, Bhargavi; Lundberg, Scott; Singh, Sameer; Hajishirzi, Hannaneh; Zettlemoyer, Luke; Tulio Ribeiro, Marco (2023-03-01). "ART: Automatic multi-step reasoning and tool-use for large language models".
arXiv:2303.09014 [
cs.CL].
^Liang, Yaobo; Wu, Chenfei; Song, Ting; Wu, Wenshan; Xia, Yan; Liu, Yu; Ou, Yang; Lu, Shuai; Ji, Lei; Mao, Shaoguang; Wang, Yun; Shou, Linjun; Gong, Ming; Duan, Nan (2023-03-01). "TaskMatrix.AI: Completing Tasks by Connecting Foundation Models with Millions of APIs".
arXiv:2303.16434 [
cs.AI].
^Patil, Shishir G.; Zhang, Tianjun; Wang, Xin; Gonzalez, Joseph E. (2023-05-01). "Gorilla: Large Language Model Connected with Massive APIs".
arXiv:2305.15334 [
cs.CL].
^Hao, Shibo; Gu, Yi; Ma, Haodi; Jiahua Hong, Joshua; Wang, Zhen; Zhe Wang, Daisy; Hu, Zhiting (2023-05-01). "Reasoning with Language Model is Planning with World Model".
arXiv:2305.14992 [
cs.CL].
^Zhang, Jenny; Lehman, Joel; Stanley, Kenneth; Clune, Jeff (2 June 2023). "OMNI: Open-endedness via Models of human Notions of Interestingness".
arXiv:2306.01711 [
cs.AI].
^Nagel, Markus; Amjad, Rana Ali; Baalen, Mart Van; Louizos, Christos; Blankevoort, Tijmen (2020-11-21).
"Up or Down? Adaptive Rounding for Post-Training Quantization". Proceedings of the 37th International Conference on Machine Learning. PMLR: 7197–7206.
^Polino, Antonio; Pascanu, Razvan; Alistarh, Dan (2018-02-01). "Model compression via distillation and quantization".
arXiv:1802.05668 [
cs.NE].
^Frantar, Elias; Ashkboos, Saleh; Hoefler, Torsten; Alistarh, Dan (2022-10-01). "GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers".
arXiv:2210.17323 [
cs.LG].
^Dettmers, Tim; Pagnoni, Artidoro;
Holtzman, Ari; Zettlemoyer, Luke (2023-05-01). "QLoRA: Efficient Finetuning of Quantized LLMs".
arXiv:2305.14314 [
cs.LG].
^Kiros, Ryan; Salakhutdinov, Ruslan; Zemel, Rich (2014-06-18).
"Multimodal Neural Language Models". Proceedings of the 31st International Conference on Machine Learning. PMLR: 595–603.
^Li, Junnan; Li, Dongxu; Savarese, Silvio; Hoi, Steven (2023-01-01). "BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models".
arXiv:2301.12597 [
cs.CV].
^Alayrac, Jean-Baptiste; Donahue, Jeff; Luc, Pauline; Miech, Antoine; Barr, Iain; Hasson, Yana; Lenc, Karel; Mensch, Arthur; Millican, Katherine; Reynolds, Malcolm; Ring, Roman; Rutherford, Eliza; Cabi, Serkan; Han, Tengda; Gong, Zhitao (2022-12-06).
"Flamingo: a Visual Language Model for Few-Shot Learning". Advances in Neural Information Processing Systems. 35: 23716–23736.
arXiv:2204.14198.
^Driess, Danny; Xia, Fei; Sajjadi, Mehdi S. M.; Lynch, Corey; Chowdhery, Aakanksha; Ichter, Brian; Wahid, Ayzaan; Tompson, Jonathan; Vuong, Quan; Yu, Tianhe; Huang, Wenlong; Chebotar, Yevgen; Sermanet, Pierre; Duckworth, Daniel; Levine, Sergey (2023-03-01). "PaLM-E: An Embodied Multimodal Language Model".
arXiv:2303.03378 [
cs.LG].
^Zhang, Hang; Li, Xin; Bing, Lidong (2023-06-01). "Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding".
arXiv:2306.02858 [
cs.CL].
^Hahn, Michael; Goyal, Navin (2023-03-14). "A Theory of Emergent In-Context Learning as Implicit Structure Induction".
arXiv:2303.07971 [
cs.LG].
^Pilehvar, Mohammad Taher; Camacho-Collados, Jose (June 2019).
"Proceedings of the 2019 Conference of the North". Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). Minneapolis, Minnesota: Association for Computational Linguistics: 1267–1273.
doi:
10.18653/v1/N19-1128.
S2CID102353817.
^Schaeffer, Rylan; Miranda, Brando; Koyejo, Sanmi (2023-04-01). "Are Emergent Abilities of Large Language Models a Mirage?".
arXiv:2304.15004 [
cs.AI].
^Li, Kenneth; Hopkins, Aspen K.; Bau, David; Viégas, Fernanda; Pfister, Hanspeter; Wattenberg, Martin (2022-10-01). "Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Task".
arXiv:2210.13382 [
cs.LG].
^Varshney, Neeraj; Yao, Wenlin; Zhang, Hongming; Chen, Jianshu; Yu, Dong (2023). "A Stitch in Time Saves Nine: Detecting and Mitigating Hallucinations of LLMs by Validating Low-Confidence Generation".
arXiv:2307.03987 [
cs.CL].
^Lakoff, George (1999). Philosophy in the Flesh: The Embodied Mind and Its Challenge to Western Philosophy; Appendix: The Neural Theory of Language Paradigm. New York Basic Books. pp. 569–583.
ISBN978-0-465-05674-3.
^Evans, Vyvyan. (2014). The Language Myth. Cambridge University Press.
ISBN978-1-107-04396-1.
^Friston, Karl J. (2022). Active Inference: The Free Energy Principle in Mind, Brain, and Behavior; Chapter 4 The Generative Models of Active Inference. The MIT Press.
ISBN978-0-262-36997-8.
^Srivastava, Aarohi; et al. (2022). "Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language models".
arXiv:2206.04615 [
cs.CL].
^Lin, Stephanie; Hilton, Jacob; Evans, Owain (2021). "TruthfulQA: Measuring How Models Mimic Human Falsehoods".
arXiv:2109.07958 [
cs.CL].
^
abZellers, Rowan; Holtzman, Ari; Bisk, Yonatan; Farhadi, Ali; Choi, Yejin (2019). "HellaSwag: Can a Machine Really Finish Your Sentence?".
arXiv:1905.07830 [
cs.CL].
^Luo, Queenie; Puett, Michael J.; Smith, Michael D. (2023-03-28). "A Perspectival Mirror of the Elephant: Investigating Language Bias on Google, ChatGPT, Wikipedia, and YouTube".
arXiv:2303.16281v2 [
cs.CY].
^Cheng, Myra; Durmus, Esin; Jurafsky, Dan (2023-05-29), Marked Personas: Using Natural Language Prompts to Measure Stereotypes in Language Models,
arXiv:2305.18189
^
abDevlin, Jacob; Chang, Ming-Wei; Lee, Kenton; Toutanova, Kristina (11 October 2018). "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding".
arXiv:1810.04805v2 [
cs.CL].
^Patel, Ajay; Li, Bryan; Rasooli, Mohammad Sadegh; Constant, Noah; Raffel, Colin; Callison-Burch, Chris (2022). "Bidirectional Language Models Are Also Few-shot Learners".
arXiv:2209.14500 [
cs.LG].
^
abAskell, Amanda; Bai, Yuntao; Chen, Anna; et al. (9 December 2021). "A General Language Assistant as a Laboratory for Alignment".
arXiv:2112.00861 [
cs.CL].
^Bai, Yuntao; Kadavath, Saurav; Kundu, Sandipan; et al. (15 December 2022). "Constitutional AI: Harmlessness from AI Feedback".
arXiv:2212.08073 [
cs.CL].
^
abcHoffmann, Jordan; Borgeaud, Sebastian; Mensch, Arthur; et al. (29 March 2022). "Training Compute-Optimal Large Language Models".
arXiv:2203.15556 [
cs.CL].
^Black, Sidney; Biderman, Stella; Hallahan, Eric; et al. (2022-05-01).
GPT-NeoX-20B: An Open-Source Autoregressive Language Model. Proceedings of BigScience Episode #5 – Workshop on Challenges & Perspectives in Creating Large Language Models. Vol. Proceedings of BigScience Episode #5 – Workshop on Challenges & Perspectives in Creating Large Language Models. pp. 95–136. Retrieved 2022-12-19.
^Taylor, Ross; Kardas, Marcin; Cucurull, Guillem; Scialom, Thomas; Hartshorn, Anthony; Saravia, Elvis; Poulton, Andrew; Kerkez, Viktor; Stojnic, Robert (16 November 2022). "Galactica: A Large Language Model for Science".
arXiv:2211.09085 [
cs.CL].
^"Our next-generation model: Gemini 1.5". Google. 15 February 2024. Retrieved 16 February 2024. This means 1.5 Pro can process vast amounts of information in one go — including 1 hour of video, 11 hours of audio, codebases with over 30,000 lines of code or over 700,000 words. In our research, we've also successfully tested up to 10 million tokens.