Meta AI

Current_research In the February 23, 2022, live event Inside the Lab: Building for the Metaverse with AI, the Meta AI team discussed the major advancements in research and development in artificial intelligence.  One such tool is the BuilderBot, which allows users to generate virtual worlds by using voice commands.  Other tools include the No Language Left Behind, a system capable of automatic translation between written languages, and a Universal Speech Translator, a system capable of instantaneous speech-to-speech translation.  Meta AI's computer vision research aims to extract information about the environment from digital images and videos.  One example of computer vision technology developed by AI is panoptic segmentation, which recognizes objects in the foreground but also classifies the scenes in the background.  Meta AI seeks to improve Visual Question Answering technology, in which a machine answers human user questions about images using cycle-consistency, having the machine generate a question in addition to the answer to address linguistic variations in the questions.  Artificial intelligence communication requires a machine to understand natural language and to generate language that is natural.  Meta AI seeks to improve these technologies to improve safe communication regardless of what language the user might speak.  Thus, a central task involves the generalization of natural language processing (NLP) technology to other languages.  As such, Meta AI actively works on unsupervised machine translation.  Meta AI seeks to improve natural-language interfaces by developing aspects of chitchat dialogue such as repetition, specificity, response-relatedness and question-asking, incorporating personality into image captioning, and generating creativity-based language.  In 2018, Meta AI launched the open-source PyText, a modeling framework focused on NLP systems.  In 2023, Meta AI announced and open sourced LLaMA (Large Language Model Meta AI), a 65B parameter large language model.  Facebook and Instagram uses Meta AI research in ranking & recommendations in their newsfeeds, ads, and search results.  Meta AI has also introduced ReAgent, a toolset that generates decisions and evaluates user feedback.  Machine learning and AI depend on the development of novel algorithms, software and hardware technologies.  As such, Meta AI's systems research teams studies computer languages, compilers, and hardware applications.  Meta AI studies the mathematical and theoretical foundations of artificial intelligence.  Meta AI has publications in learning theory, optimization, and signal processing.  The MTIA v1 is Meta's first-generation AI training and inference accelerator, developed specifically for Meta's recommendation workloads.  It was fabricated using TSMC's 7 nm process technology and operates at a frequency of 800 MHz.  In terms of processing power, the accelerator provides 102.4 TOPS at INT8 precision and 51.2 TFLOPS at FP16 precision, while maintaining a thermal design power (TDP) of 25 W.  The accelerator is structured around a grid of 64 processing elements (PEs), arranged in an 8x8 configuration, and it is furnished with on-chip and off-chip memory resources along with the necessary interconnects.  Each PE houses two processor cores (one with a vector extension) and several fixed-function units optimized for tasks such as matrix multiplication, accumulation, data movement, and nonlinear function calculation.


Meta AI

Current_research The processor cores utilize the RISC-V open instruction set architecture (ISA), with extensive customization to perform the required compute and control tasks.  The accelerator's memory subsystem uses LPDDR5 for off-chip DRAM resources and can be scaled up to 128 GB.  Additionally, it possesses 128 MB of on-chip SRAM that is shared amongst all the PEs for faster access to frequently used data and instructions.  The design encourages parallelism and data reuse, offering thread and data-level parallelism (TLP and DLP), instruction-level parallelism (ILP), and memory-level parallelism (MLP).  MTIA accelerators are mounted on compact dual M.2 boards, enabling easier integration into a server.  The boards connect to the host CPU via PCIe Gen4 x8 links and have a power consumption as low as 35 W.  The servers hosting these accelerators utilize the Yosemite V3 server specification from the Open Compute Project.  Each server houses 12 accelerators, interconnected through a hierarchy of PCIe switches, allowing workloads to be distributed across multiple accelerators and executed concurrently.


Generative model

Deep_generative_models With the rise of deep learning, a new family of methods, called deep generative models (DGMs),is formed through the combination of generative models and deep neural networks. An increase in the scale of the neural networks is typically accompanied by an increase in the scale of the training data, both of which are required for good performance. Popular DGMs include variational autoencoders (VAEs), generative adversarial networks (GANs), and auto-regressive models. Recently, there has been a trend to build very large deep generative models. For example, GPT-3, and its precursor GPT-2, are auto-regressive neural language models that contain billions of parameters, BigGAN and VQ-VAE which are used for image generation that can have hundreds of millions of parameters, and Jukebox is a very large generative model for musical audio that contains billions of parameters.


Generative model

Types Types of generative models are: Gaussian mixture model (and other types of mixture model) Hidden Markov model Probabilistic context-free grammar Bayesian network (e.g. Naive bayes, Autoregressive model) Averaged one-dependence estimators Latent Dirichlet allocation Boltzmann machine (e.g. Restricted Boltzmann machine, Deep belief network) Variational autoencoder Generative analysis Generative adversarial network Flow-based generative model Energy based model Diffusion modelIf the observed data are truly sampled from the generative model, then fitting the parameters of the generative model to maximize the data likelihood is a common method. However, since most statistical models are only approximations to the true distribution, if the model's application is to infer about a subset of variables conditional on known values of others, then it can be argued that the approximation makes more assumptions than are necessary to solve the problem at hand. In such cases, it can be more accurate to model the conditional density functions directly using a discriminative model (see below), although application-specific details will ultimately dictate which approach is most suitable in any particular case. k-nearest neighbors algorithm Logistic regression Support Vector Machines Decision Tree Learning Random Forest Maximum-entropy Markov models Conditional random fields


Hugging Face

Hugging Face Hugging Face, Inc. is a French-American company that develops tools for building applications using machine learning, based in New York City. It is most notable for its transformers library built for natural language processing applications and its platform that allows users to share machine learning models and datasets and showcase their work in a space.


Hugging Face

History The company was founded in 2016 by French entrepreneurs Cl��ment Delangue, Julien Chaumond, and Thomas Wolf in New York City, originally as a company that developed a chatbot app targeted at teenagers. After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning. In March 2021, Hugging Face raised US$40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters. On December 21, 2021, the company announced its acquisition of Gradio, a software library used to make interactive browser demos of machine learning models. On May 5, 2022, the company announced its Series C funding round led by Coatue and Sequoia. The company received a $2 billion valuation. On May 13, 2022, the company introduced its Student Ambassador Program to help fulfill its mission to teach machine learning to 5 million people by 2023. On May 26, 2022, the company announced a partnership with Graphcore to optimize its Transformers library for the Graphcore IPU. On August 3, 2022, the company announced the Private Hub, an enterprise version of its public Hugging Face Hub that supports SaaS or on-premises deployment. In February 2023, the company announced partnership with Amazon Web Services (AWS) which would allow Hugging Face's products available to AWS customers to use them as the building blocks for their custom applications. The company also said the next generation of BLOOM will be run on Trainium, a proprietary machine learning chip created by AWS. In August 2023, the company announced that it raised $235 million in a Series D funding, at a $4.5 billion valuation. The funding was led by Salesforce, and notable participation came from Google, Amazon, Nvidia, AMD, Intel, IBM, and Qualcomm.


Hugging Face

Services_and_technologies The Transformers library is a Python package that contains open-source implementations of transformer models for text, image, and audio tasks. It is compatible with the PyTorch, TensorFlow and JAX deep learning libraries and includes implementations of notable models like BERT and GPT-2. The library was originally called "pytorch-pretrained-bert" which was then renamed to "pytorch-transformers" and finally "transformers." The Hugging Face Hub is a platform (centralized web service) for hosting: Git-based code repositories, with features similar to GitHub, including discussions and pull requests for projects. models, also with Git-based version control; datasets, mainly in text, images, and audio; web applications ("spaces" and "widgets"), intended for small-scale demos of machine learning applications.In addition to Transformers and the Hugging Face Hub, the Hugging Face ecosystem contains libraries for other tasks, such as dataset processing ("Datasets"), model evaluation ("Evaluate"), simulation ("Simulate"), machine learning demos ("Gradio").


MLOps

Architecture Machine Learning systems can be categorized in eight different categories: data collection, data processing, feature engineering, data labeling, model design, model training and optimization, endpoint deployment, and endpoint monitoring. Each step in the machine learning lifecycle is built in its own system, but requires interconnection. These are the minimum systems that enterprises need to scale machine learning within their organization.


Multi-task learning

Software_package The Multi-Task Learning via StructurAl Regularization (MALSAR) Matlab package implements the following multi-task learning algorithms: Mean-Regularized Multi-Task Learning Multi-Task Learning with Joint Feature Selection Robust Multi-Task Feature Learning Trace-Norm Regularized Multi-Task Learning Alternating Structural Optimization Incoherent Low-Rank and Sparse Learning Robust Low-Rank Multi-Task Learning Clustered Multi-Task Learning Multi-Task Learning with Graph Structures


Overfitting

Machine_learning Usually a learning algorithm is trained using some set of "training data": exemplary situations for which the desired output is known.  The goal is that the algorithm will also perform well on predicting the output when fed "validation data" that was not encountered during its training.  Overfitting is the use of models or procedures that violate Occam's razor, for example by including more adjustable parameters than are ultimately optimal, or by using a more complicated approach than is ultimately optimal.  For an example where there are too many adjustable parameters, consider a dataset where training data for y can be adequately predicted by a linear function of two independent variables.  Such a function requires only three parameters (the intercept and two slopes).  Replacing this simple function with a new, more complex quadratic function, or with a new, more complex linear function on more than two independent variables, carries a risk: Occam's razor implies that any given complex function is a priori less probable than any given simple function.  If the new, more complicated function is selected instead of the simple function, and if there was not a large enough gain in training-data fit to offset the complexity increase, then the new complex function "overfits" the data, and the complex overfitted function will likely perform worse than the simpler function on validation data outside the training dataset, even though the complex function performed as well, or perhaps even better, on the training dataset.  When comparing different types of models, complexity cannot be measured solely by counting how many parameters exist in each model; the expressivity of each parameter must be considered as well.  For example, it is nontrivial to directly compare the complexity of a neural net (which can track curvilinear relationships) with m parameters to a regression model with n parameters.  Overfitting is especially likely in cases where learning was performed too long or where training examples are rare, causing the learner to adjust to very specific random features of the training data that have no causal relation to the target function.  In this process of overfitting, the performance on the training examples still increases while the performance on unseen data becomes worse.  As a simple example, consider a database of retail purchases that includes the item bought, the purchaser, and the date and time of purchase.  It's easy to construct a model that will fit the training set perfectly by using the date and time of purchase to predict the other attributes, but this model will not generalize at all to new data, because those past times will never occur again.  Generally, a learning algorithm is said to overfit relative to a simpler one if it is more accurate in fitting known data (hindsight) but less accurate in predicting new data (foresight).  One can intuitively understand overfitting from the fact that information from all past experience can be divided into two groups: information that is relevant for the future, and irrelevant information ("noise").


Overfitting

Machine_learning Everything else being equal, the more difficult a criterion is to predict (i. e. , the higher its uncertainty), the more noise exists in past information that needs to be ignored.  The problem is determining which part to ignore.  A learning algorithm that can reduce the risk of fitting noise is called "robust. " The most obvious consequence of overfitting is poor performance on the validation dataset.  Other negative consequences include: A function that is overfitted is likely to request more information about each item in the validation dataset than does the optimal function; gathering this additional unneeded data can be expensive or error-prone, especially if each individual piece of information must be gathered by human observation and manual data-entry.  A more complex, overfitted function is likely to be less portable than a simple one.  At one extreme, a one-variable linear regression is so portable that, if necessary, it could even be done by hand.  At the other extreme are models that can be reproduced only by exactly duplicating the original modeler's entire setup, making reuse or scientific reproduction difficult.  It may be possible to reconstruct details of individual training instances from an overfitted machine learning model's training set.  This may be undesirable if, for example, the training data includes sensitive personally identifiable information (PII).  This phenomenon also presents problems in the area of artificial intelligence and copyright, with the developers of some generative deep learning models such as Stable Diffusion and GitHub Copilot being sued for copyright infringement because these models have been found to be capable of reproducing certain copyrighted items from their training data. The optimal function usually needs verification on bigger or completely new datasets.  There are, however, methods like minimum spanning tree or life-time of correlation that applies the dependence between correlation coefficients and time-series (window width).  Whenever the window width is big enough, the correlation coefficients are stable and don't depend on the window width size anymore.  Therefore, a correlation matrix can be created by calculating a coefficient of correlation between investigated variables.  This matrix can be represented topologically as a complex network where direct and indirect influences between variables are visualized.  Dropout regularisation can also improve robustness and therefore reduce over-fitting by probabilistically removing inputs to a layer.


Semi-supervised learning

Semi-supervised learning Weak supervision, also called semi-supervised learning, is a paradigm in machine learning, the relevance and notability of which increased with the advent of large language models due to large amount of data required to train them. It is characterized by using a combination of a small amount of human-labeled data (exclusively used in more expensive and time-consuming supervised learning paradigm), followed by a large amount of unlabeled data (used exclusively in unsupervised learning paradigm). In other words, the desired output values are provided only for a subset of the training data. The remaining data is unlabeled or imprecisely labeled. Intuitively, it can be seen as an exam and labeled data as sample problems that the teacher solves for the class as an aid in solving another set of problems. In the transductive setting, these unsolved problems act as exam questions. In the inductive setting, they become practice problems of the sort that will make up the exam. Technically, it could be viewed as performing clustering and then labeling the clusters with the labeled data, pushing the decision boundary away from high-density regions, or learning an underlying one-dimensional manifold where the data reside.


Artificial neural networks

History The simplest kind of feedforward neural network (FNN) is a linear network, which consists of a single layer of output nodes; the inputs are fed directly to the outputs via a series of weights.  The sum of the products of the weights and the inputs is calculated in each node.  The mean squared errors between these calculated outputs and the given target values are minimized by creating an adjustment to the weights.  This technique has been known for over two centuries as the method of least squares or linear regression.  It was used as a means of finding a good rough linear fit to a set of points by Legendre (1805) and Gauss (1795) for the prediction of planetary movement.  Wilhelm Lenz and Ernst Ising created and analyzed the Ising model (1925) which is essentially a non-learning artificial recurrent neural network (RNN) consisting of neuron-like threshold elements.  In 1972, Shun'ichi Amari made this architecture adaptive.  His learning RNN was popularised by John Hopfield in 1982.  Warren McCulloch and Walter Pitts (1943) also considered a non-learning computational model for neural networks.  In the late 1940s, D.  O.  Hebb created a learning hypothesis based on the mechanism of neural plasticity that became known as Hebbian learning.  Farley and Wesley A.  Clark (1954) first used computational machines, then called "calculators", to simulate a Hebbian network.  In 1958, psychologist Frank Rosenblatt invented the perceptron, the first implemented artificial neural network, funded by the United States Office of Naval Research.  Some say that research stagnated following Minsky and Papert (1969), who discovered that basic perceptrons were incapable of processing the exclusive-or circuit and that computers lacked sufficient power to process useful neural networks.  However, by the time this book came out, methods for training multilayer perceptrons (MLPs) were already known.  The first deep learning MLP was published by Alexey Grigorevich Ivakhnenko and Valentin Lapa in 1965, as the Group Method of Data Handling.  The first deep learning MLP trained by stochastic gradient descent was published in 1967 by Shun'ichi Amari.  In computer experiments conducted by Amari's student Saito, a five layer MLP with two modifiable layers learned useful internal representations to classify non-linearily separable pattern classes.  Self-organizing maps (SOMs) were described by Teuvo Kohonen in 1982.  SOMs are neurophysiologically inspired neural networks that learn low-dimensional representations of high-dimensional data while preserving the topological structure of the data.  They are trained using competitive learning.  The convolutional neural network (CNN) architecture with convolutional layers and downsampling layers was introduced by Kunihiko Fukushima in 1980.  He called it the neocognitron.  In 1969, he also introduced the ReLU (rectified linear unit) activation function.  The rectifier has become the most popular activation function for CNNs and deep neural networks in general.  CNNs have become an essential tool for computer vision.  The backpropagation algorithm is an efficient application of the Leibniz chain rule (1673) to networks of differentiable nodes.  It is also known as the reverse mode of automatic differentiation or reverse accumulation, due to Seppo Linnainmaa (1970).


Artificial neural networks

History The term "back-propagating errors" was introduced in 1962 by Frank Rosenblatt, but he did not have an implementation of this procedure, although Henry J.  Kelley and Bryson had dynamic programming based continuous precursors of backpropagation already in 1960���61 in the context of control theory.  In 1973, Dreyfus used backpropagation to adapt parameters of controllers in proportion to error gradients.  In 1982, Paul Werbos applied backpropagation to MLPs in the way that has become standard.  In 1986 Rumelhart, Hinton and Williams showed that backpropagation learned interesting internal representations of words as feature vectors when trained to predict the next word in a sequence.  The time delay neural network (TDNN) of Alex Waibel (1987) combined convolutions and weight sharing and backpropagation.  In 1988, Wei Zhang et al.  applied backpropagation to a CNN (a simplified Neocognitron with convolutional interconnections between the image feature layers and the last fully connected layer) for alphabet recognition.  In 1989, Yann LeCun et al.  trained a CNN to recognize handwritten ZIP codes on mail.  In 1992, max-pooling for CNNs was introduced by Juan Weng et al.  to help with least-shift invariance and tolerance to deformation to aid 3D object recognition.  LeNet-5 (1998), a 7-level CNN by Yann LeCun et al. , that classifies digits, was applied by several banks to recognize hand-written numbers on checks digitized in 32x32 pixel images.  From 1988 onward, the use of neural networks transformed the field of protein structure prediction, in particular when the first cascading networks were trained on profiles (matrices) produced by multiple sequence alignments.  In the 1980s, backpropagation did not work well for deep FNNs and RNNs.  To overcome this problem, Juergen Schmidhuber (1992) proposed a hierarchy of RNNs pre-trained one level at a time by self-supervised learning.  It uses predictive coding to learn internal representations at multiple self-organizing time scales.  This can substantially facilitate downstream deep learning.  The RNN hierarchy can be collapsed into a single RNN, by distilling a higher level chunker network into a lower level automatizer network.  In 1993, a chunker solved a deep learning task whose depth exceeded 1000.  In 1992, Juergen Schmidhuber also published an alternative to RNNs which is now called a linear Transformer or a Transformer with linearized self-attention (save for a normalization operator).  It learns internal spotlights of attention: a slow feedforward neural network learns by gradient descent to control the fast weights of another neural network through outer products of self-generated activation patterns FROM and TO (which are now called key and value for self-attention).  This fast weight attention mapping is applied to a query pattern.  The modern Transformer was introduced by Ashish Vaswani et al.  in their 2017 paper "Attention Is All You Need. " It combines this with a softmax operator and a projection matrix.  Transformers have increasingly become the model of choice for natural language processing.  Many modern large language models such as ChatGPT, GPT-4, and BERT use it.  Transformers are also increasingly being used in computer vision.


Artificial neural networks

History In 1991, Juergen Schmidhuber also published adversarial neural networks that contest with each other in the form of a zero-sum game, where one network's gain is the other network's loss.  The first network is a generative model that models a probability distribution over output patterns.  The second network learns by gradient descent to predict the reactions of the environment to these patterns.  This was called "artificial curiosity. " In 2014, this principle was used in a generative adversarial network (GAN) by Ian Goodfellow et al.  Here the environmental reaction is 1 or 0 depending on whether the first network's output is in a given set.  This can be used to create realistic deepfakes.  Excellent image quality is achieved by Nvidia's StyleGAN (2018) based on the Progressive GAN by Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen.  Here the GAN generator is grown from small to large scale in a pyramidal fashion.  Sepp Hochreiter's diploma thesis (1991) was called "one of the most important documents in the history of machine learning" by his supervisor Juergen Schmidhuber.  Hochreiter identified and analyzed the vanishing gradient problem and proposed recurrent residual connections to solve it.  This led to the deep learning method called long short-term memory (LSTM), published in Neural Computation (1997).  LSTM recurrent neural networks can learn "very deep learning" tasks with long credit assignment paths that require memories of events that happened thousands of discrete time steps before.  The "vanilla LSTM" with forget gate was introduced in 1999 by Felix Gers, Schmidhuber and Fred Cummins.  LSTM has become the most cited neural network of the 20th century.  In 2015, Rupesh Kumar Srivastava, Klaus Greff, and Schmidhuber used the LSTM principle to create the Highway network, a feedforward neural network with hundreds of layers, much deeper than previous networks.  7 months later, Kaiming He, Xiangyu Zhang; Shaoqing Ren, and Jian Sun won the ImageNet 2015 competition with an open-gated or gateless Highway network variant called Residual neural network.  This has become the most cited neural network of the 21st century.  The development of metal���oxide���semiconductor (MOS) very-large-scale integration (VLSI), in the form of complementary MOS (CMOS) technology, enabled increasing MOS transistor counts in digital electronics.  This provided more processing power for the development of practical artificial neural networks in the 1980s.  Neural networks' early successes included predicting the stock market and in 1995 a (mostly) self-driving car.  Geoffrey Hinton et al.  (2006) proposed learning a high-level representation using successive layers of binary or real-valued latent variables with a restricted Boltzmann machine to model each layer.  In 2012, Ng and Dean created a network that learned to recognize higher-level concepts, such as cats, only from watching unlabeled images.  Unsupervised pre-training and increased computing power from GPUs and distributed computing allowed the use of larger networks, particularly in image and visual recognition problems, which became known as "deep learning".  Ciresan and colleagues (2010) showed that despite the vanishing gradient problem, GPUs make backpropagation feasible for many-layered feedforward neural networks.


Artificial neural networks

History Between 2009 and 2012, ANNs began winning prizes in image recognition contests, approaching human level performance on various tasks, initially in pattern recognition and handwriting recognition.  For example, the bi-directional and multi-dimensional long short-term memory (LSTM) of Graves et al.  won three competitions in connected handwriting recognition in 2009 without any prior knowledge about the three languages to be learned.  Ciresan and colleagues built the first pattern recognizers to achieve human-competitive/superhuman performance on benchmarks such as traffic sign recognition (IJCNN 2012).


Artificial neural network


History of artificial neural networks

Transformers_and_their_variants Many modern large language models such as ChatGPT, GPT-4, and BERT use a feedforward neural network called Transformer by Ashish Vaswani et. al. in their 2017 paper "Attention Is All You Need." Transformers have increasingly become the model of choice for natural language processing problems, replacing recurrent neural networks (RNNs) such as long short-term memory (LSTM). Basic ideas for this go back a long way: in 1992, Juergen Schmidhuber published the Transformer with "linearized self-attention" (save for a normalization operator), which is also called the "linear Transformer." He advertised it as an "alternative to RNNs" that can learn "internal spotlights of attention," and experimentally applied it to problems of variable binding. Here a slow feedforward neural network learns by gradient descent to control the fast weights of another neural network through outer products of self-generated activation patterns called "FROM" and "TO" which in Transformer terminology are called "key" and "value" for "self-attention." This fast weight "attention mapping" is applied to queries. The 2017 Transformer combines this with a softmax operator and a projection matrix. Transformers are also increasingly being used in computer vision.


Deep learning

Deep learning Deep learning is part of a broader family of machine learning methods, which is based on artificial neural networks with representation learning. The adjective "deep" in deep learning refers to the use of multiple layers in the network. Methods used can be either supervised, semi-supervised or unsupervised. Deep-learning architectures such as deep neural networks, deep belief networks, deep reinforcement learning, recurrent neural networks, convolutional neural networks and transformers have been applied to fields including computer vision, speech recognition, natural language processing, machine translation, bioinformatics, drug design, medical image analysis, climate science, material inspection and board game programs, where they have produced results comparable to and in some cases surpassing human expert performance. Artificial neural networks (ANNs) were inspired by information processing and distributed communication nodes in biological systems. ANNs have various differences from biological brains. Specifically, artificial neural networks tend to be static and symbolic, while the biological brain of most living organisms is dynamic (plastic) and analog.


Deep learning

Overview Most modern deep learning models are based on multi-layered artificial neural networks such as convolutional neural networks and transformers, although they can also include propositional formulas or latent variables organized layer-wise in deep generative models such as the nodes in deep belief networks and deep Boltzmann machines. In deep learning, each level learns to transform its input data into a slightly more abstract and composite representation. In an image recognition application, the raw input may be a matrix of pixels; the first representational layer may abstract the pixels and encode edges; the second layer may compose and encode arrangements of edges; the third layer may encode a nose and eyes; and the fourth layer may recognize that the image contains a face. Importantly, a deep learning process can learn which features to optimally place in which level on its own. This does not eliminate the need for hand-tuning; for example, varying numbers of layers and layer sizes can provide different degrees of abstraction. The word "deep" in "deep learning" refers to the number of layers through which the data is transformed. More precisely, deep learning systems have a substantial credit assignment path (CAP) depth. The CAP is the chain of transformations from input to output. CAPs describe potentially causal connections between input and output. For a feedforward neural network, the depth of the CAPs is that of the network and is the number of hidden layers plus one (as the output layer is also parameterized). For recurrent neural networks, in which a signal may propagate through a layer more than once, the CAP depth is potentially unlimited. No universally agreed-upon threshold of depth divides shallow learning from deep learning, but most researchers agree that deep learning involves CAP depth higher than 2. CAP of depth 2 has been shown to be a universal approximator in the sense that it can emulate any function. Beyond that, more layers do not add to the function approximator ability of the network. Deep models (CAP > 2) are able to extract better features than shallow models and hence, extra layers help in learning the features effectively. Deep learning architectures can be constructed with a greedy layer-by-layer method. Deep learning helps to disentangle these abstractions and pick out which features improve performance. For supervised learning tasks, deep learning methods eliminate feature engineering, by translating the data into compact intermediate representations akin to principal components, and derive layered structures that remove redundancy in representation. Deep learning algorithms can be applied to unsupervised learning tasks. This is an important benefit because unlabeled data are more abundant than the labeled data. Examples of deep structures that can be trained in an unsupervised manner are deep belief networks.


Deep learning

History There are two types of neural networks: feedforward neural networks (FNNs) and recurrent neural networks (RNNs).  RNNs have cycles in their connectivity structure, FNNs don't.  In the 1920s, Wilhelm Lenz and Ernst Ising created and analyzed the Ising model which is essentially a non-learning RNN architecture consisting of neuron-like threshold elements.  In 1972, Shun'ichi Amari made this architecture adaptive.  His learning RNN was popularised by John Hopfield in 1982.  RNNs have become central for speech recognition and language processing.  Charles Tappert writes that Frank Rosenblatt developed and explored all of the basic ingredients of the deep learning systems of today, referring to Rosenblatt's 1962 book which introduced a multilayer perceptron (MLP) with 3 layers: an input layer, a hidden layer with randomized weights that did not learn, and an output layer.  However, since only the output layer had learning connections, this was not yet deep learning.  It was what later was called an extreme learning machine.  The first general, working learning algorithm for supervised, deep, feedforward, multilayer perceptrons was published by Alexey Ivakhnenko and Lapa in 1967.  A 1971 paper described a deep network with eight layers trained by the group method of data handling.  The first deep learning multilayer perceptron trained by stochastic gradient descent was published in 1967 by Shun'ichi Amari.  In computer experiments conducted by Amari's student Saito, a five layer MLP with two modifiable layers learned internal representations to classify non-linearily separable pattern classes.  In 1987 Matthew Brand reported that wide 12-layer nonlinear perceptrons could be fully end-to-end trained to reproduce logic functions of nontrivial circuit depth via gradient descent on small batches of random input/output samples, but concluded that training time on contemporary hardware (sub-megaflop computers) made the technique impractical, and proposed using fixed random early layers as an input hash for a single modifiable layer.  Instead, subsequent developments in hardware and hyperparameter tunings have made end-to-end stochastic gradient descent the currently dominant training technique.  In 1970, Seppo Linnainmaa published the reverse mode of automatic differentiation of discrete connected networks of nested differentiable functions.  This became known as backpropagation.  It is an efficient application of the chain rule derived by Gottfried Wilhelm Leibniz in 1673 to networks of differentiable nodes.  The terminology "back-propagating errors" was actually introduced in 1962 by Rosenblatt, but he did not know how to implement this, although Henry J.  Kelley had a continuous precursor of backpropagation already in 1960 in the context of control theory.  In 1982, Paul Werbos applied backpropagation to MLPs in the way that has become standard.  In 1985, David E.  Rumelhart et al.  published an experimental analysis of the technique.  Deep learning architectures for convolutional neural networks (CNNs) with convolutional layers and downsampling layers began with the Neocognitron introduced by Kunihiko Fukushima in 1980.  In 1969, he also introduced the ReLU (rectified linear unit) activation function.  The rectifier has become the most popular activation function for CNNs and deep learning in general.  CNNs have become an essential tool for computer vision.


Deep learning

History The term Deep Learning was introduced to the machine learning community by Rina Dechter in 1986, and to artificial neural networks by Igor Aizenberg and colleagues in 2000, in the context of Boolean threshold neurons.  In 1988, Wei Zhang et al.  applied the backpropagation algorithm to a convolutional neural network (a simplified Neocognitron with convolutional interconnections between the image feature layers and the last fully connected layer) for alphabet recognition.  They also proposed an implementation of the CNN with an optical computing system.  In 1989, Yann LeCun et al.  applied backpropagation to a CNN with the purpose of recognizing handwritten ZIP codes on mail.  While the algorithm worked, training required 3 days.  Subsequently, Wei Zhang, et al.  modified their model by removing the last fully connected layer and applied it for medical image object segmentation in 1991 and breast cancer detection in mammograms in 1994.  LeNet-5 (1998), a 7-level CNN by Yann LeCun et al. , that classifies digits, was applied by several banks to recognize hand-written numbers on checks digitized in 32x32 pixel images.  In the 1980s, backpropagation did not work well for deep learning with long credit assignment paths.  To overcome this problem, J��rgen Schmidhuber (1992) proposed a hierarchy of RNNs pre-trained one level at a time by self-supervised learning.  It uses predictive coding to learn internal representations at multiple self-organizing time scales.  This can substantially facilitate downstream deep learning.  The RNN hierarchy can be collapsed into a single RNN, by distilling a higher level chunker network into a lower level automatizer network.  In 1993, a chunker solved a deep learning task whose depth exceeded 1000.  In 1992, J��rgen Schmidhuber also published an alternative to RNNs which is now called a linear Transformer or a Transformer with linearized self-attention (save for a normalization operator).  It learns internal spotlights of attention: a slow feedforward neural network learns by gradient descent to control the fast weights of another neural network through outer products of self-generated activation patterns FROM and TO (which are now called key and value for self-attention).  This fast weight attention mapping is applied to a query pattern.  The modern Transformer was introduced by Ashish Vaswani et.  al.  in their 2017 paper "Attention Is All You Need".  It combines this with a softmax operator and a projection matrix.  Transformers have increasingly become the model of choice for natural language processing.  Many modern large language models such as ChatGPT, GPT-4, and BERT use it.  Transformers are also increasingly being used in computer vision.  In 1991, J��rgen Schmidhuber also published adversarial neural networks that contest with each other in the form of a zero-sum game, where one network's gain is the other network's loss.  The first network is a generative model that models a probability distribution over output patterns.  The second network learns by gradient descent to predict the reactions of the environment to these patterns.  This was called "artificial curiosity".  In 2014, this principle was used in a generative adversarial network (GAN) by Ian Goodfellow et al.


Deep learning

History Here the environmental reaction is 1 or 0 depending on whether the first network's output is in a given set.  This can be used to create realistic deepfakes.  Excellent image quality is achieved by Nvidia's StyleGAN (2018) based on the Progressive GAN by Tero Karras et.  al.  Here the GAN generator is grown from small to large scale in a pyramidal fashion.  Sepp Hochreiter's diploma thesis (1991) was called "one of the most important documents in the history of machine learning" by his supervisor Schmidhuber.  It not only tested the neural history compressor, but also identified and analyzed the vanishing gradient problem.  Hochreiter proposed recurrent residual connections to solve this problem.  This led to the deep learning method called long short-term memory (LSTM), published in 1997.  LSTM recurrent neural networks can learn "very deep learning" tasks with long credit assignment paths that require memories of events that happened thousands of discrete time steps before.  The "vanilla LSTM" with forget gate was introduced in 1999 by Felix Gers, Schmidhuber and Fred Cummins.  LSTM has become the most cited neural network of the 20th century.  In 2015, Rupesh Kumar Srivastava, Klaus Greff, and Schmidhuber used LSTM principles to create the Highway network, a feedforward neural network with hundreds of layers, much deeper than previous networks.  7 months later, Kaiming He, Xiangyu Zhang; Shaoqing Ren, and Jian Sun won the ImageNet 2015 competition with an open-gated or gateless Highway network variant called Residual neural network.  This has become the most cited neural network of the 21st century.  In 1994, Andr�� de Carvalho, together with Mike Fairhurst and David Bisset, published experimental results of a multi-layer boolean neural network, also known as a weightless neural network, composed of a 3-layers self-organising feature extraction neural network module (SOFT) followed by a multi-layer classification neural network module (GSN), which were independently trained.  Each layer in the feature extraction module extracted features with growing complexity regarding the previous layer.  In 1995, Brendan Frey demonstrated that it was possible to train (over two days) a network containing six fully connected layers and several hundred hidden units using the wake-sleep algorithm, co-developed with Peter Dayan and Hinton.  Since 1997, Sven Behnke extended the feed-forward hierarchical convolutional approach in the Neural Abstraction Pyramid by lateral and backward connections in order to flexibly incorporate context into decisions and iteratively resolve local ambiguities.  Simpler models that use task-specific handcrafted features such as Gabor filters and support vector machines (SVMs) were a popular choice in the 1990s and 2000s, because of artificial neural network's (ANN) computational cost and a lack of understanding of how the brain wires its biological networks.  Both shallow and deep learning (e. g. , recurrent nets) of ANNs for speech recognition have been explored for many years.  These methods never outperformed non-uniform internal-handcrafting Gaussian mixture model/Hidden Markov model (GMM-HMM) technology based on generative models of speech trained discriminatively.  Key difficulties have been analyzed, including gradient diminishing and weak temporal correlation structure in neural predictive models.


Deep learning

History Additional difficulties were the lack of training data and limited computing power.  Most speech recognition researchers moved away from neural nets to pursue generative modeling.  An exception was at SRI International in the late 1990s.  Funded by the US government's NSA and DARPA, SRI studied deep neural networks in speech and speaker recognition.  The speaker recognition team led by Larry Heck reported significant success with deep neural networks in speech processing in the 1998 National Institute of Standards and Technology Speaker Recognition evaluation.  The SRI deep neural network was then deployed in the Nuance Verifier, representing the first major industrial application of deep learning.  The principle of elevating "raw" features over hand-crafted optimization was first explored successfully in the architecture of deep autoencoder on the "raw" spectrogram or linear filter-bank features in the late 1990s, showing its superiority over the Mel-Cepstral features that contain stages of fixed transformation from spectrograms.  The raw features of speech, waveforms, later produced excellent larger-scale results.  Speech recognition was taken over by LSTM.  In 2003, LSTM started to become competitive with traditional speech recognizers on certain tasks.  In 2006, Alex Graves, Santiago Fern��ndez, Faustino Gomez, and Schmidhuber combined it with connectionist temporal classification (CTC) in stacks of LSTM RNNs.  In 2015, Google's speech recognition reportedly experienced a dramatic performance jump of 49% through CTC-trained LSTM, which they made available through Google Voice Search.  The impact of deep learning in industry began in the early 2000s, when CNNs already processed an estimated 10% to 20% of all the checks written in the US, according to Yann LeCun.  Industrial applications of deep learning to large-scale speech recognition started around 2010.  In 2006, publications by Geoff Hinton, Ruslan Salakhutdinov, Osindero and Teh showed how a many-layered feedforward neural network could be effectively pre-trained one layer at a time, treating each layer in turn as an unsupervised restricted Boltzmann machine, then fine-tuning it using supervised backpropagation.  The papers referred to learning for deep belief nets.  The 2009 NIPS Workshop on Deep Learning for Speech Recognition was motivated by the limitations of deep generative models of speech, and the possibility that given more capable hardware and large-scale data sets that deep neural nets (DNN) might become practical.  It was believed that pre-training DNNs using generative models of deep belief nets (DBN) would overcome the main difficulties of neural nets.  However, it was discovered that replacing pre-training with large amounts of training data for straightforward backpropagation when using DNNs with large, context-dependent output layers produced error rates dramatically lower than then-state-of-the-art Gaussian mixture model (GMM)/Hidden Markov Model (HMM) and also than more-advanced generative model-based systems.  The nature of the recognition errors produced by the two types of systems was characteristically different, offering technical insights into how to integrate deep learning into the existing highly efficient, run-time speech decoding system deployed by all major speech recognition systems.  Analysis around 2009���2010, contrasting the GMM (and other generative speech models) vs.  DNN models, stimulated early industrial investment in deep learning for speech recognition.


Deep learning

History That analysis was done with comparable performance (less than 1.5% in error rate) between discriminative DNNs and generative models.  In 2010, researchers extended deep learning from TIMIT to large vocabulary speech recognition, by adopting large output layers of the DNN based on context-dependent HMM states constructed by decision trees.  Deep learning is part of state-of-the-art systems in various disciplines, particularly computer vision and automatic speech recognition (ASR).  Results on commonly used evaluation sets such as TIMIT (ASR) and MNIST (image classification), as well as a range of large-vocabulary speech recognition tasks have steadily improved.  Convolutional neural networks (CNNs) were superseded for ASR by CTC for LSTM.  but are more successful in computer vision.  Advances in hardware have driven renewed interest in deep learning.  In 2009, Nvidia was involved in what was called the "big bang" of deep learning, "as deep-learning neural networks were trained with Nvidia graphics processing units (GPUs)".  That year, Andrew Ng determined that GPUs could increase the speed of deep-learning systems by about 100 times.  In particular, GPUs are well-suited for the matrix/vector computations involved in machine learning.  GPUs speed up training algorithms by orders of magnitude, reducing running times from weeks to days.  Further, specialized hardware and algorithm optimizations can be used for efficient processing of deep learning models.  In the late 2000s, deep learning started to outperform other methods in machine learning competitions.  In 2009, a long short-term memory trained by connectionist temporal classification (Alex Graves, Santiago Fern��ndez, Faustino Gomez, and J��rgen Schmidhuber, 2006) was the first RNN to win pattern recognition contests, winning three competitions in connected handwriting recognition.  Google later used CTC-trained LSTM for speech recognition on the smartphone.  Significant impacts in image or object recognition were felt from 2011 to 2012.  Although CNNs trained by backpropagation had been around for decades, and GPU implementations of NNs for years, including CNNs, faster implementations of CNNs on GPUs were needed to progress on computer vision.  In 2011, the DanNet by Dan Ciresan, Ueli Meier, Jonathan Masci, Luca Maria Gambardella, and J��rgen Schmidhuber achieved for the first time superhuman performance in a visual pattern recognition contest, outperforming traditional methods by a factor of 3.  Also in 2011, DanNet won the ICDAR Chinese handwriting contest, and in May 2012, it won the ISBI image segmentation contest.  Until 2011, CNNs did not play a major role at computer vision conferences, but in June 2012, a paper by Ciresan et al.  at the leading conference CVPR showed how max-pooling CNNs on GPU can dramatically improve many vision benchmark records.  In September 2012, DanNet also won the ICPR contest on analysis of large medical images for cancer detection, and in the following year also the MICCAI Grand Challenge on the same topic.  In October 2012, the similar AlexNet by Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton won the large-scale ImageNet competition by a significant margin over shallow machine learning methods.


Deep learning

History The VGG-16 network by Karen Simonyan and Andrew Zisserman further reduced the error rate and won the ImageNet 2014 competition, following a similar trend in large-scale speech recognition.  Image classification was then extended to the more challenging task of generating descriptions (captions) for images, often as a combination of CNNs and LSTMs.  In 2012, a team led by George E.  Dahl won the "Merck Molecular Activity Challenge" using multi-task deep neural networks to predict the biomolecular target of one drug.  In 2014, Sepp Hochreiter's group used deep learning to detect off-target and toxic effects of environmental chemicals in nutrients, household products and drugs and won the "Tox21 Data Challenge" of NIH, FDA and NCATS.  In 2016, Roger Parloff mentioned a "deep learning revolution" that has transformed the AI industry.  In March 2019, Yoshua Bengio, Geoffrey Hinton and Yann LeCun were awarded the Turing Award for conceptual and engineering breakthroughs that have made deep neural networks a critical component of computing.


Deep learning

Hardware Since the 2010s, advances in both machine learning algorithms and computer hardware have led to more efficient methods for training deep neural networks that contain many layers of non-linear hidden units and a very large output layer. By 2019, graphic processing units (GPUs), often with AI-specific enhancements, had displaced CPUs as the dominant method of training large-scale commercial cloud AI. OpenAI estimated the hardware computation used in the largest deep learning projects from AlexNet (2012) to AlphaZero (2017), and found a 300,000-fold increase in the amount of computation required, with a doubling-time trendline of 3.4 months. Special electronic circuits called deep learning processors were designed to speed up deep learning algorithms. Deep learning processors include neural processing units (NPUs) in Huawei cellphones and cloud computing servers such as tensor processing units (TPU) in the Google Cloud Platform. Cerebras Systems has also built a dedicated system to handle large deep learning models, the CS-2, based on the largest processor in the industry, the second-generation Wafer Scale Engine (WSE-2). Atomically thin semiconductors are considered promising for energy-efficient deep learning hardware where the same basic device structure is used for both logic operations and data storage. In 2020, Marega et al. published experiments with a large-area active channel material for developing logic-in-memory devices and circuits based on floating-gate field-effect transistors (FGFETs). In 2021, J. Feldmann et al. proposed an integrated photonic hardware accelerator for parallel convolutional processing. The authors identify two key advantages of integrated photonics over its electronic counterparts: (1) massively parallel data transfer through wavelength division multiplexing in conjunction with frequency combs, and (2) extremely high data modulation speeds. Their system can execute trillions of multiply-accumulate operations per second, indicating the potential of integrated photonics in data-heavy AI applications.


Deep learning

Applications Large-scale automatic speech recognition is the first and most convincing successful case of deep learning.  LSTM RNNs can learn "Very Deep Learning" tasks that involve multi-second intervals containing speech events separated by thousands of discrete time steps, where one time step corresponds to about 10 ms.  LSTM with forget gates is competitive with traditional speech recognizers on certain tasks.  The initial success in speech recognition was based on small-scale recognition tasks based on TIMIT.  The data set contains 630 speakers from eight major dialects of American English, where each speaker reads 10 sentences.  Its small size lets many configurations be tried.  More importantly, the TIMIT task concerns phone-sequence recognition, which, unlike word-sequence recognition, allows weak phone bigram language models.  This lets the strength of the acoustic modeling aspects of speech recognition be more easily analyzed.  The error rates listed below, including these early results and measured as percent phone error rates (PER), have been summarized since 1991.  The debut of DNNs for speaker recognition in the late 1990s and speech recognition around 2009-2011 and of LSTM around 2003���2007, accelerated progress in eight major areas: Scale-up/out and accelerated DNN training and decoding Sequence discriminative training Feature processing by deep models with solid understanding of the underlying mechanisms Adaptation of DNNs and related deep models Multi-task and transfer learning by DNNs and related deep models CNNs and how to design them to best exploit domain knowledge of speech RNN and its rich LSTM variants Other types of deep models including tensor-based models and integrated deep generative/discriminative models. All major commercial speech recognition systems (e. g. , Microsoft Cortana, Xbox, Skype Translator, Amazon Alexa, Google Now, Apple Siri, Baidu and iFlyTek voice search, and a range of Nuance speech products, etc. ) are based on deep learning.  A common evaluation set for image classification is the MNIST database data set.  MNIST is composed of handwritten digits and includes 60,000 training examples and 10,000 test examples.  As with TIMIT, its small size lets users test multiple configurations.  A comprehensive list of results on this set is available.  Deep learning-based image recognition has become "superhuman", producing more accurate results than human contestants.  This first occurred in 2011 in recognition of traffic signs, and in 2014, with recognition of human faces.  Deep learning-trained vehicles now interpret 360�� camera views.  Another example is Facial Dysmorphology Novel Analysis (FDNA) used to analyze cases of human malformation connected to a large database of genetic syndromes.  Closely related to the progress that has been made in image recognition is the increasing application of deep learning techniques to various visual art tasks.  DNNs have proven themselves capable, for example, of identifying the style period of a given painting Neural Style Transfer ��� capturing the style of a given artwork and applying it in a visually pleasing manner to an arbitrary photograph or video generating striking imagery based on random visual input fields. Neural networks have been used for implementing language models since the early 2000s.


Deep learning

Applications LSTM helped to improve machine translation and language modeling.  Other key techniques in this field are negative sampling and word embedding.  Word embedding, such as word2vec, can be thought of as a representational layer in a deep learning architecture that transforms an atomic word into a positional representation of the word relative to other words in the dataset; the position is represented as a point in a vector space.  Using word embedding as an RNN input layer allows the network to parse sentences and phrases using an effective compositional vector grammar.  A compositional vector grammar can be thought of as probabilistic context free grammar (PCFG) implemented by an RNN.  Recursive auto-encoders built atop word embeddings can assess sentence similarity and detect paraphrasing.  Deep neural architectures provide the best results for constituency parsing, sentiment analysis, information retrieval, spoken language understanding, machine translation, contextual entity linking, writing style recognition, named-entity recognition (token classification), text classification, and others.  Recent developments generalize word embedding to sentence embedding.  Google Translate (GT) uses a large end-to-end long short-term memory (LSTM) network.  Google Neural Machine Translation (GNMT) uses an example-based machine translation method in which the system "learns from millions of examples".  It translates "whole sentences at a time, rather than pieces".  Google Translate supports over one hundred languages.  The network encodes the "semantics of the sentence rather than simply memorizing phrase-to-phrase translations".  GT uses English as an intermediate between most language pairs.  A large percentage of candidate drugs fail to win regulatory approval.  These failures are caused by insufficient efficacy (on-target effect), undesired interactions (off-target effects), or unanticipated toxic effects.  Research has explored use of deep learning to predict the biomolecular targets, off-targets, and toxic effects of environmental chemicals in nutrients, household products and drugs.  AtomNet is a deep learning system for structure-based rational drug design.  AtomNet was used to predict novel candidate biomolecules for disease targets such as the Ebola virus and multiple sclerosis.  In 2017 graph neural networks were used for the first time to predict various properties of molecules in a large toxicology data set.  In 2019, generative neural networks were used to produce molecules that were validated experimentally all the way into mice.  Deep reinforcement learning has been used to approximate the value of possible direct marketing actions, defined in terms of RFM variables.  The estimated value function was shown to have a natural interpretation as customer lifetime value.  Recommendation systems have used deep learning to extract meaningful features for a latent factor model for content-based music and journal recommendations.  Multi-view deep learning has been applied for learning user preferences from multiple domains.  The model uses a hybrid collaborative and content-based approach and enhances recommendations in multiple tasks.  An autoencoder ANN was used in bioinformatics, to predict gene ontology annotations and gene-function relationships.  In medical informatics, deep learning was used to predict sleep quality based on data from wearables and predictions of health complications from electronic health record data.


Deep learning

Applications Deep learning has been shown to produce competitive results in medical application such as cancer cell classification, lesion detection, organ segmentation and image enhancement.  Modern deep learning tools demonstrate the high accuracy of detecting various diseases and the helpfulness of their use by specialists to improve the diagnosis efficiency.  Finding the appropriate mobile audience for mobile advertising is always challenging, since many data points must be considered and analyzed before a target segment can be created and used in ad serving by any ad server.  Deep learning has been used to interpret large, many-dimensioned advertising datasets.  Many data points are collected during the request/serve/click internet advertising cycle.  This information can form the basis of machine learning to improve ad selection.  Deep learning has been successfully applied to inverse problems such as denoising, super-resolution, inpainting, and film colorization.  These applications include learning methods such as "Shrinkage Fields for Effective Image Restoration" which trains on an image dataset, and Deep Image Prior, which trains on the image that needs restoration.  Deep learning is being successfully applied to financial fraud detection, tax evasion detection, and anti-money laundering.  The United States Department of Defense applied deep learning to train robots in new tasks through observation.  Physics informed neural networks have been used to solve partial differential equations in both forward and inverse problems in a data driven manner.  One example is the reconstructing fluid flow governed by the Navier-Stokes equations.  Using physics informed neural networks does not require the often expensive mesh generation that conventional CFD methods relies on.  Image reconstruction is the reconstruction of the underlying images from the image-related measurements.  Several works showed the better and superior performance of the deep learning methods compared to analytical methods for various applications, e. g. , spectral imaging and ultrasound imaging.  An epigenetic clock is a biochemical test that can be used to measure age.  Galkin et al.  used deep neural networks to train an epigenetic aging clock of unprecedented accuracy using >6,000 blood samples.  The clock uses information from 1000 CpG sites and predicts people with certain conditions older than healthy controls: IBD, frontotemporal dementia, ovarian cancer, obesity.  The aging clock was planned to be released for public use in 2021 by an Insilico Medicine spinoff company Deep Longevity.


Multimodal learning

Application Multimodal deep Boltzmann machines are successfully used in classification and missing data retrieval. The classification accuracy of multimodal deep Boltzmann machine outperforms support vector machines, latent Dirichlet allocation and deep belief network, when models are tested on data with both image-text modalities or with single modality.[citation needed] Multimodal deep Boltzmann machine is also able to predict missing modalities given the observed ones with reasonably good precision.[citation needed] Self Supervised Learning brings a more interesting and powerful model for multimodality. OpenAI developed CLIP and DALL-E models that revolutionized multimodality. Multimodal deep learning is used for cancer screening ��� at least one system under development integrates such different types of data.


Deep reinforcement learning

History Along with rising interest in neural networks beginning in the mid 1980s, interest grew in deep reinforcement learning, where a neural network is used in reinforcement learning to represent policies or value functions.  Because in such a system, the entire decision making process from sensors to motors in a robot or agent involves a single neural network, it is also sometimes called end-to-end reinforcement learning.  One of the first successful applications of reinforcement learning with neural networks was TD-Gammon, a computer program developed in 1992 for playing backgammon.  Four inputs were used for the number of pieces of a given color at a given location on the board, totaling 198 input signals.  With zero knowledge built in, the network learned to play the game at an intermediate level by self-play and TD( �� {\displaystyle \lambda } ).  Seminal textbooks by Sutton and Barto on reinforcement learning, Bertsekas and Tsitiklis on neuro-dynamic programming, and others advanced knowledge and interest in the field.  Katsunari Shibata's group showed that various functions emerge in this framework, including image recognition, color constancy, sensor motion (active recognition), hand-eye coordination and hand reaching movement, explanation of brain activities, knowledge transfer, memory, selective attention, prediction, and exploration.  Starting around 2012, the so called Deep learning revolution led to an increased interest in using deep neural networks as function approximators across a variety of domains.  This led to a renewed interest in researchers using deep neural networks to learn the policy, value, and/or Q functions present in existing reinforcement learning algorithms.  Beginning around 2013, DeepMind showed impressive learning results using deep RL to play Atari video games.  The computer player a neural network trained using a deep RL algorithm, a deep version of Q-learning they termed deep Q-networks (DQN), with the game score as the reward.  They used a deep convolutional neural network to process 4 frames RGB pixels (84x84) as inputs.  All 49 games were learned using the same network architecture and with minimal prior knowledge, outperforming competing methods on almost all the games and performing at a level comparable or superior to a professional human game tester.  Deep reinforcement learning reached another milestone in 2015 when AlphaGo, a computer program trained with deep RL to play Go, became the first computer Go program to beat a human professional Go player without handicap on a full-sized 19��19 board.  In a subsequent project in 2017, AlphaZero improved performance on Go while also demonstrating they could use the same algorithm to learn to play chess and shogi at a level competitive or superior to existing computer programs for those games, and again improved in 2019 with MuZero.  Separately, another milestone was achieved by researchers from Carnegie Mellon University in 2019 developing Pluribus, a computer program to play poker that was the first to beat professionals at multiplayer games of no-limit Texas hold 'em.  OpenAI Five, a program for playing five-on-five Dota 2 beat the previous world champions in a demonstration match in 2019.


Deep reinforcement learning

History Deep reinforcement learning has also been applied to many domains beyond games.  In robotics, it has been used to let robots perform simple household tasks and solve a Rubik's cube with a robot hand.  Deep RL has also found sustainability applications, used to reduce energy consumption at data centers.  Deep RL for autonomous driving is an active area of research in academia and industry.  Loon explored deep RL for autonomously navigating their high-altitude balloons.


PyTorch

PyTorch PyTorch is a machine learning framework based on the Torch library, used for applications such as computer vision and natural language processing, originally developed by Meta AI and now part of the Linux Foundation umbrella. It is free and open-source software released under the modified BSD license. Although the Python interface is more polished and the primary focus of development, PyTorch also has a C++ interface. A number of pieces of deep learning software are built on top of PyTorch, including Tesla Autopilot, Uber's Pyro, Hugging Face's Transformers, PyTorch Lightning, and Catalyst. PyTorch provides two high-level features: Tensor computing (like NumPy) with strong acceleration via graphics processing units (GPU) Deep neural networks built on a tape-based automatic differentiation system


TensorFlow

Applications GE Healthcare used TensorFlow to increase the speed and accuracy of MRIs in identifying specific body parts. Google used TensorFlow to create DermAssist, a free mobile application that allows users to take pictures of their skin and identify potential health complications. Sinovation Ventures used TensorFlow to identify and classify eye diseases from optical coherence tomography (OCT) scans. Twitter implemented TensorFlow to rank tweets by importance for a given user, and changed their platform to show tweets in order of this ranking. Previously, tweets were simply shown in reverse chronological order. The photo sharing app VSCO used TensorFlow to help suggest custom filters for photos. Google officially released RankBrain on October 26, 2015, backed by TensorFlow. InSpace, a virtual learning platform, used TensorFlow to filter out toxic chat messages in classrooms. Liulishuo, an online English learning platform, utilized TensorFlow to create an adaptive curriculum for each student. TensorFlow was used to accurately assess a student's current abilities, and also helped decide the best future content to show based on those capabilities. The e-commerce platform Carousell used TensorFlow to provide personalized recommendations for customers. The cosmetics company ModiFace used TensorFlow to create an augmented reality experience for customers to test various shades of make-up on their face. TensorFlow is the foundation for the automated image-captioning software DeepDream.


Long short-term memory

Training An RNN using LSTM units can be trained in a supervised fashion on a set of training sequences, using an optimization algorithm like gradient descent combined with backpropagation through time to compute the gradients needed during the optimization process, in order to change each weight of the LSTM network in proportion to the derivative of the error (at the output layer of the LSTM network) with respect to corresponding weight. A problem with using gradient descent for standard RNNs is that error gradients vanish exponentially quickly with the size of the time lag between important events. This is due to lim n ��� ��� W n = 0 {\displaystyle \lim _{n\to \infty }W^{n}=0} if the spectral radius of W {\displaystyle W} is smaller than 1. However, with LSTM units, when error values are back-propagated from the output layer, the error remains in the LSTM unit's cell. This "error carousel" continuously feeds error back to each of the LSTM unit's gates, until they learn to cut off the value. Many applications use stacks of LSTM RNNs and train them by connectionist temporal classification (CTC) to find an RNN weight matrix that maximizes the probability of the label sequences in a training set, given the corresponding input sequences. CTC achieves both alignment and recognition. Sometimes, it can be advantageous to train (parts of) an LSTM by neuroevolution or by policy gradient methods, especially when there is no "teacher" (that is, training labels). There have been several successful stories of training, in a non-supervised fashion, RNNs with LSTM units. In 2018, Bill Gates called it a "huge milestone in advancing artificial intelligence" when bots developed by OpenAI were able to beat humans in the game of Dota 2. OpenAI Five consists of five independent but coordinated neural networks. Each network is trained by a policy gradient method without supervising teacher and contains a single-layer, 1024-unit Long-Short-Term-Memory that sees the current game state and emits actions through several possible action heads. In 2018, OpenAI also trained a similar LSTM by policy gradients to control a human-like robot hand that manipulates physical objects with unprecedented dexterity. In 2019, DeepMind's program AlphaStar used a deep LSTM core to excel at the complex video game Starcraft II. This was viewed as significant progress towards Artificial General Intelligence.


Long short-term memory

Timeline_of_development 1991: Sepp Hochreiter analyzed the vanishing gradient problem and developed principles of the method in his German diploma thesis.  1995: "Long Short-Term Memory (LSTM)" is published in a technical report by Sepp Hochreiter and J��rgen Schmidhuber.  1996: LSTM is published at NIPS'1996, a peer-reviewed conference.  1997: The main LSTM paper is published in the journal Neural Computation.  By introducing Constant Error Carousel (CEC) units, LSTM deals with the vanishing gradient problem.  The initial version of LSTM block included cells, input and output gates.  1999: Felix Gers, J��rgen Schmidhuber, and Fred Cummins introduced the forget gate (also called "keep gate") into the LSTM architecture, enabling the LSTM to reset its own state.  2000: Gers, Schmidhuber, and Cummins added peephole connections (connections from the cell to the gates) into the architecture.  Additionally, the output activation function was omitted.  2001: Gers and Schmidhuber trained LSTM to learn languages unlearnable by traditional models such as Hidden Markov Models.  Hochreiter et al.  used LSTM for meta-learning (i. e.  learning a learning algorithm).  2004: First successful application of LSTM to speech Alex Graves et al.  2005: First publication (Graves and Schmidhuber) of LSTM with full backpropagation through time and of bi-directional LSTM.  2005: Daan Wierstra, Faustino Gomez, and Schmidhuber trained LSTM by neuroevolution without a teacher.  2006: Graves, Fernandez, Gomez, and Schmidhuber introduce a new error function for LSTM: Connectionist Temporal Classification (CTC) for simultaneous alignment and recognition of sequences.  CTC-trained LSTM led to breakthroughs in speech recognition.  Mayer et al.  trained LSTM to control robots.  2007: Wierstra, Foerster, Peters, and Schmidhuber trained LSTM by policy gradients for reinforcement learning without a teacher.  Hochreiter, Heuesel, and Obermayr applied LSTM to protein homology detection the field of biology.  2009: An LSTM trained by CTC won the ICDAR connected handwriting recognition competition.  Three such models were submitted by a team led by Alex Graves.  One was the most accurate model in the competition and another was the fastest.  This was the first time an RNN won international competitions.  2009: Justin Bayer et al.  introduced neural architecture search for LSTM.  2013: Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton used LSTM networks as a major component of a network that achieved a record 17.7% phoneme error rate on the classic TIMIT natural speech dataset.  2014: Kyunghyun Cho et al.  put forward a simplified variant of the forget gate LSTM called Gated recurrent unit (GRU).  2015: Google started using an LSTM trained by CTC for speech recognition on Google Voice.  According to the official blog post, the new model cut transcription errors by 49%.  2015: Rupesh Kumar Srivastava, Klaus Greff, and Schmidhuber used LSTM principles to create the Highway network, a feedforward neural network with hundreds of layers, much deeper than previous networks.  7 months later, Kaiming He, Xiangyu Zhang; Shaoqing Ren, and Jian Sun won the ImageNet 2015 competition with an open-gated or gateless Highway network variant called Residual neural network.  This has become the most cited neural network of the 21st century.


Long short-term memory

Timeline_of_development 2016: Google started using an LSTM to suggest messages in the Allo conversation app.  In the same year, Google released the Google Neural Machine Translation system for Google Translate which used LSTMs to reduce translation errors by 60%.  Apple announced in its Worldwide Developers Conference that it would start using the LSTM for quicktype in the iPhone and for Siri.  Amazon released Polly, which generates the voices behind Alexa, using a bidirectional LSTM for the text-to-speech technology.  2017: Facebook performed some 4.5 billion automatic translations every day using long short-term memory networks.  Researchers from Michigan State University, IBM Research, and Cornell University published a study in the Knowledge Discovery and Data Mining (KDD) conference.  Their Time-Aware LSTM (T-LSTM) performs better on certain data sets than standard LSTM.  Microsoft reported reaching 94.9% recognition accuracy on the Switchboard corpus, incorporating a vocabulary of 165,000 words.  The approach used "dialog session-based long-short-term memory".  2018: OpenAI used LSTM trained by policy gradients to beat humans in the complex video game of Dota 2, and to control a human-like robot hand that manipulates physical objects with unprecedented dexterity.  2019: DeepMind used LSTM trained by policy gradients to excel at the complex video game of Starcraft II.  2021: According to Google Scholar, in 2021, LSTM was cited over 16,000 times within a single year.  This reflects applications of LSTM in many different fields including healthcare.


Transformer (machine learning model)

Transformer (machine learning model) A transformer is a deep learning architecture that relies on the parallel multi-head attention mechanism. The modern transformer was proposed in the 2017 paper titled 'Attention Is All You Need' by Ashish Vaswani et al., Google Brain team. It is notable for requiring less training time than previous recurrent neural architectures, such as long short-term memory (LSTM), and its later variation has been prevalently adopted for training large language models on large (language) datasets, such as the Wikipedia corpus and Common Crawl, by virtue of the parallelized processing of input sequence. Input text is split into n-grams encoded as tokens and each token is converted into a vector via looking up from a word embedding table. At each layer, each token is then contextualized within the scope of the context window with other (unmasked) tokens via a parallel multi-head attention mechanism allowing the signal for key tokens to be amplified and less important tokens to be diminished. Though the transformer paper was published in 2017, the softmax-based attention mechanism was proposed earlier in 2014 by Bahdanau, Cho, and Bengio for machine translation, and the Fast Weight Controller, similar to a transformer, was proposed in 1992 by Schmidhuber. This architecture is now used not only in natural language processing and computer vision, but also in audio and multi-modal processing. It has also led to the development of pre-trained systems, such as generative pre-trained transformers (GPTs) and BERT (Bidirectional Encoder Representations from Transformers).


Transformer (machine learning model)

Timeline In 1990, Elman network, using a recurrent network, encoded each word in a training set as a vector, called a word embedding, and the whole vocabulary as a vector database, allowing it to perform such tasks as sequence-prediction that are beyond the power of a simple multilayer perceptron.  A shortcoming of the static embeddings was that they didn't differentiate between multiple meanings of same-spelt words.  In 1992, the Fast Weight Controller was published by J��rgen Schmidhuber It learns to answer queries by programming the attention weights of another neural network through outer products of key vectors and value vectors called FROM and TO.  The Fast Weight Controller was later shown to be closely related to the Linear Transformer.  The terminology "learning internal spotlights of attention" was introduced in 1993.  An advantage of the fast linear transformers is that their computational complexity grows linearly with sequence length, while modern transformers scale quadratically. In 1993, the IBM alignment models were used for statistical machine translation. In 1997, a precursor of large language model, using recurrent neural networks, such as long short-term memory, was proposed. In 2001, one-billion-word large text corpus, scraped from the Internet, referred to as "very very large" at the time, was used for word disambiguation. In 2012, AlexNet demonstrated the effectiveness of large neural networks for image recognition, encouraging large artificial neural networks approach instead of older, statistical approaches. In 2014, a 380M-parameter seq2seq model for machine translation using two LSTMs networks was proposed by Sutskever at al.  The architecture consists of two parts.  The encoder is an LSTM that takes in a sequence of tokens and turns it into a vector.  The decoder is another LSTM that converts the vector into a sequence of tokens. In 2014, gating proved to be useful in a 130M-parameter seq2seq model, which used a simplified gated recurrent units (GRUs).  Bahdanau et al showed that GRUs are neither better nor worse than gated LSTMs. In 2014, Bahdanau et al.  improved the previous seq2seq model by using an "additive" kind of attention mechanism in-between two LSTM networks.  It was, however, not yet the parallelizable (scaled "dot product") kind of attention, later proposed in the 2017 transformer paper.  In 2015, the relative performance of Global and Local (widowed) attention model architectures were assessed by Luong et al, a mixed attention architecture found to improve on the translations offered by Bahdanau's architecture, while the use of a local attention architecture reduced translation time.  In 2016, Google Translate gradually replaced the older statistical machine translation approach with the newer neural-networks-based approach that included a seq2seq model combined by LSTM and the "additive" kind of attention mechanism.  They achieved a higher level of performance than the statistical approach, which took ten years to develop, in only nine months. In 2017, the original (100M-sized) encoder-decoder transformer model with a faster (parallelizable or decomposable) attention mechanism was proposed in the "Attention is all you need" paper.


Transformer (machine learning model)

Timeline As the model had difficulties converging, it was suggested that the learning rate should be linearly scaled up from 0 to maximal value for the first part of the training (i. e.  2% of the total number of training steps).  The intent of the transformer model is to take a seq2seq model and remove its recurrent neural networks, but preserve its additive attention mechanism. In 2018, in the ELMo paper, an entire sentence was processed before an embedding vector was assigning to each word in the sentence.  A bi-directional LSTM was used to calculate such, deep contextualized embeddings for each word, improving upon the line of research from bag of words and word2vec. In 2018, an encoder-only transformer was used in the (more than 1B-sized) BERT model, improving upon ELMo. In 2020, vision transformer and speech-processing convolution-augmented transformer outperformed recurrent neural networks, previously used for vision and speech. In 2020, difficulties with converging the original transformer were solved by normalizing layers before (instead of after) multiheaded attention by Xiong et al. In 2023, uni-directional ("autoregressive") transformers were being used in the (more than 100B-sized) GPT-3 and other OpenAI GPT models. Before transformers, predecessors of attention mechanism were added to gated RNNs, such as LSTMs and gated recurrent units (GRUs), which processed datasets sequentially.  Dependency on previous token computations prevented them from being able to parallelize the attention mechanism.  In 1992, fast weight controller was proposed as an alternative to RNNs that can learn "internal spotlights of attention".  In theory, the information from one token can propagate arbitrarily far down the sequence, but in practice the vanishing gradient problem leaves the model's state at the end of a long sentence without precise, extractable information about preceding tokens.  The performance of old models was enhanced by adding an attention mechanism, which allowed a model to access any preceding point along the sequence.  The attention layer weighs all previous states according to a learned measure of relevance, providing relevant information about far-away tokens.  This proved to be especially useful in language translation, where far-away context can be essential for the meaning of a word in a sentence.  The state vector has been accessible only after the last English word was processed while, for example, translating it from French by a LSTM model.  Although in theory such a vector retains the information about the whole original sentence, in practice the information is poorly preserved.  If an attention mechanism is added, the decoder is given access to the state vectors of every input word, not just the last, and can learn attention weights that dictate how much to attend to each input state vector.  The augmentation of seq2seq models with the attention mechanism was first implemented in the context of machine translation by Bahdanau, Cho, and Bengio in 2014.  In 2016, highly parallelizable decomposable attention was successfully combined with a feedforward network.


Transformer (machine learning model)

Timeline This indicated that attention mechanisms were powerful in themselves and that sequential recurrent processing of data was not necessary to achieve the quality gains of RNNs with attention.  Soon Jakob Uszkoreit from Google Research also proposed replacing RNNs with self-attention and started the effort to evaluate that idea.  Transformers, using an attention mechanism, processing all tokens simultaneously, calculated "soft" weights between them in successive layers.  Since the attention mechanism only uses information about other tokens from lower layers, it can be computed for all tokens in parallel, which leads to improved training speed.


Transformer (machine learning model)

Training The plain transformer architecture had difficulty converging. In the original paper the authors recommended using learning rate warmup. That is, the learning rate should linearly scale up from 0 to maximal value for the first part of the training (usually recommended to be 2% of the total number of training steps), before decaying again. A 2020 paper found that using layer normalization before (instead of after) multiheaded attention and feedforward layers stabilizes training, not requiring learning rate warmup. Transformers typically undergo self-supervised learning involving unsupervised pretraining followed by supervised fine-tuning. Pretraining is typically done on a larger dataset than fine-tuning, due to the limited availability of labeled training data. Tasks for pretraining and fine-tuning commonly include: language modeling next-sentence prediction question answering reading comprehension sentiment analysis paraphrasing


Transformer (machine learning model)

Applications The transformer has had great success in natural language processing (NLP), for example the tasks of machine translation and time series prediction. Many large language models such as GPT-2, GPT-3, GPT-4, Claude, BERT, XLNet, RoBERTa and ChatGPT demonstrate the ability of transformers to perform a wide variety of such NLP-related tasks, and have the potential to find real-world applications. These may include: machine translation document summarization document generation named entity recognition (NER) biological sequence analysis writing computer code based on requirements expressed in natural language. video understanding.In addition to the NLP applications, it has also been successful in other fields, such as computer vision, or the protein folding applications (such as AlphaFold).


Transformer (machine learning model)

Implementations The transformer model has been implemented in standard deep learning frameworks such as TensorFlow and PyTorch. Transformers is a library produced by Hugging Face that supplies transformer-based architectures and pretrained models.


Transformer (machine learning model)

Architecture All transformers have the same primary components: Tokenizers, which convert text into tokens.  A single embedding layer, which convert tokens and positions of the tokens into vector representations.  Transformer layers, which carry out repeated transformations on the vector representations, extracting more and more linguistic information.  These consist of alternating attention and feedforward layers.  (optional) Un-embedding layer, which converts the final vector representations back to a probability distribution over the tokens. Transformer layers can be one of two types, encoder and decoder.  In the original paper both of them were used, while later models included only one type of them.  BERT is an example of encoder-only model; GPT are decoder-only models.  The input text is parsed into tokens by a tokenizer, most often a byte pair encoding tokenizer, and each token is converted into a vector via looking up from a word embedding table.  Then, positional information of the token is added to the word embedding.  Like earlier seq2seq models, the original transformer model used an encoder/decoder architecture.  The encoder consists of encoding layers that process the input tokens iteratively one layer after another, while the decoder consists of decoding layers that iteratively process the encoder's output as well as the decoder output's tokens so far.  The function of each encoder layer is to generate contextualized token representations, where each representation corresponds to a token that "mixes" information from other input tokens via self-attention mechanism.  Each decoder layer contains two attention sublayers: (1) cross-attention for incorporating the output of encoder (contextualized input token representations), and (2) self-attention for "mixing" information among the input tokens to the decoder (i. e. , the tokens generated so far during inference time).  Both the encoder and decoder layers have a feed-forward neural network for additional processing of the outputs and contain residual connections and layer normalization steps.  The transformer building blocks are scaled dot-product attention units.  For each attention unit, the transformer model learns three weight matrices: the query weights W Q {\displaystyle W_{Q}} , the key weights W K {\displaystyle W_{K}} , and the value weights W V {\displaystyle W_{V}} .  For each token i {\displaystyle i} , the input token representation x i {\displaystyle x_{i}} is multiplied with each of the three weight matrices to produce a query vector q i = x i W Q {\displaystyle q_{i}=x_{i}W_{Q}} , a key vector k i = x i W K {\displaystyle k_{i}=x_{i}W_{K}} , and a value vector v i = x i W V {\displaystyle v_{i}=x_{i}W_{V}} .  Attention weights are calculated using the query and key vectors: the attention weight a i j {\displaystyle a_{ij}} from token i {\displaystyle i} to token j {\displaystyle j} is the dot product between q i {\displaystyle q_{i}} and k j {\displaystyle k_{j}} .  The attention weights are divided by the square root of the dimension of the key vectors, d k {\displaystyle {\sqrt {d_{k}}}} , which stabilizes gradients during training, and passed through a softmax which normalizes the weights.


Transformer (machine learning model)

Architecture The fact that W Q {\displaystyle W_{Q}} and W K {\displaystyle W_{K}} are different matrices allows attention to be non-symmetric: if token i {\displaystyle i} attends to token j {\displaystyle j} (i. e.  q i ��� k j {\displaystyle q_{i}\cdot k_{j}} is large), this does not necessarily mean that token j {\displaystyle j} will attend to token i {\displaystyle i} (i. e.  q j ��� k i {\displaystyle q_{j}\cdot k_{i}} could be small).  The output of the attention unit for token i {\displaystyle i} is the weighted sum of the value vectors of all tokens, weighted by a i j {\displaystyle a_{ij}} , the attention from token i {\displaystyle i} to each token.  The attention calculation for all tokens can be expressed as one large matrix calculation using the softmax function, which is useful for training due to computational matrix operation optimizations that quickly compute matrix operations.  The matrices Q {\displaystyle Q} , K {\displaystyle K} and V {\displaystyle V} are defined as the matrices where the i {\displaystyle i} th rows are vectors q i {\displaystyle q_{i}} , k i {\displaystyle k_{i}} , and v i {\displaystyle v_{i}} respectively.  Then we can represent the attention as where softmax is taken over the horizontal axis.  One set of ( W Q , W K , W V ) {\displaystyle \left(W_{Q},W_{K},W_{V}\right)} matrices is called an attention head, and each layer in a transformer model has multiple attention heads.  While each attention head attends to the tokens that are relevant to each token, multiple attention heads allow the model to do this for different definitions of "relevance".  In addition, the influence field representing relevance can become progressively dilated in successive layers.  Many transformer attention heads encode relevance relations that are meaningful to humans.  For example, some attention heads can attend mostly to the next word, while others mainly attend from verbs to their direct objects.  The computations for each attention head can be performed in parallel, which allows for fast processing.  The outputs for the attention layer are concatenated to pass into the feed-forward neural network layers.  Concretely, let the multiple attention heads be indexed by i {\displaystyle i} , then we haveIt may be necessary to cut out attention links between some word-pairs.  For example, the decoder for token position t {\displaystyle t} should not have access to token position t + 1 {\displaystyle t+1} .  This may be accomplished before the softmax stage by adding a mask matrix M {\displaystyle M} that is ��� ��� {\displaystyle -\infty } at entries where the attention link must be cut, and 0 {\displaystyle 0} at other places:Each encoder consists of two major components: a self-attention mechanism and a feed-forward neural network.  The self-attention mechanism accepts input encodings from the previous encoder and weights their relevance to each other to generate output encodings.  The feed-forward neural network further processes each output encoding individually.  These output encodings are then passed to the next encoder as its input, as well as to the decoders.


Transformer (machine learning model)

Architecture The first encoder takes positional information and embeddings of the input sequence as its input, rather than encodings.  The positional information is necessary for the transformer to make use of the order of the sequence, because no other part of the transformer makes use of this.  The encoder is bidirectional.  Attention can be placed on tokens before and after the current token.  Tokens are used instead of words to account for polysemy.  A positional encoding is a fixed-size vector representation that encapsulates the relative positions of tokens within a target sequence: it provides the transformer model with information about where the words are in the input sequence.  The positional encoding is defined as a function of type f : R ��� R d ; d ��� Z , d > 0 {\displaystyle f:\mathbb {R} \to \mathbb {R} ^{d};d\in \mathbb {Z} ,d>0} , where d {\displaystyle d} is a positive even integer.  The full positional encoding ��� as defined in the original paper ��� is given by the equation:Here, N {\displaystyle N} is a free parameter that should be significantly larger than the biggest k {\displaystyle k} that would be input into the positional encoding function.  In the original paper, the authors chose N = 10000 {\displaystyle N=10000} .  The function is in a simpler form when written as a complex function of type f : R ��� C d / 2 {\displaystyle f:\mathbb {R} \to \mathbb {C} ^{d/2}} The main reason the authors chose this as the positional encoding function is that it allows one to perform shifts as linear transformations:By taking a linear sum, any convolution can also be implemented as linear transformations:In typical implementations, all operations are done over the real numbers, not the complex numbers, but since complex multiplication can be implemented as real 2-by-2 matrix multiplication, this is a mere notational difference.  Each decoder consists of three major components: a self-attention mechanism, an attention mechanism over the encodings, and a feed-forward neural network.  The decoder functions in a similar fashion to the encoder, but an additional attention mechanism is inserted which instead draws relevant information from the encodings generated by the encoders.  This mechanism can also be called the encoder-decoder attention.  Like the first encoder, the first decoder takes positional information and embeddings of the output sequence as its input, rather than encodings.  The transformer must not use the current or future output to predict an output, so the output sequence must be partially masked to prevent this reverse information flow.  This allows for autoregressive text generation.  For all attention heads, attention can't be placed on following tokens.  The last decoder is followed by a final linear transformation and softmax layer, to produce the output probabilities over the vocabulary.  All members of OpenAI's GPT series have a decoder-only architecture.  In large language model, the terminology is somewhat different than the terminology used in the original Transformer paper: "encoder only": full encoder, full decoder. "encoder-decoder": full encoder, autoregressive decoder.  "decoder only": autoregressive encoder, autoregressive decoder.


Transformer (machine learning model)

Architecture Here "autoregressive" means that a mask is inserted in the attention head to zero out all attention from one token to all tokens following it, as described in the "masked attention" section.  Generally, Transformer-based language models are of two types: causal (or "autoregressive") and masked.  The GPT series is causal.  BERT is masked.