页面简介
Explore generative AI models: Unlock innovation in content creation, analysis, and beyond. Stay ahead with the latest advancements.
正文摘录
Generative AI Models, ExplainedGrammarlyUpdated on June 17, 2024Understanding AIWhen you think about generative AI models, you probably think about the large language models (LLMs) that have made such a splash in recent years. However, generative AI itself dates back many decades, and LLMs are just the latest evolution. And alongside LLMs, many different kinds of generative AI models are used for different generative AI tools and use cases, such as diffusion models that are used for image generation. In this article, we’ll explain what generative AI models are, how they’re developed, and provide a deeper dive into some of the most common generative AI models today—enough to give you a conceptual understanding of these models that will impress your friends and colleagues, without you needing to take a college course in machine learning (ML). What is a generative AI model? Generative AI models are a subset of artificial intelligence systems that specialize in creating new, original content that mirrors the characteristics of their training data. Through learning from patterns and relationships in data, these models can generate outputs like text, images, sounds, or videos that resemble the style, tone, and nuances of their source material. This capability positions generative AI at the heart of innovation, allowing for creative and dynamic applications across diverse fields by interpreting and transforming input data into novel creations. Work smarter with Grammarly The AI writing partner for anyone with work to do Get Grammarly How generative AI models work Generative AI models function by leveraging a sophisticated form of ML algorithm known as a neural network. A neural network comprises multiple layers of interconnected nodes, each represented by a snippet of computer code. These nodes perform minor, individual tasks but collectively contribute to making complex decisions, mirroring the neuron functionality in the human brain. To illustrate, consider a neural network tasked with distinguishing between images of pies and cakes. The network analyzes the image at a granular level, breaking it into pixels. At a very basic level, there will be different nodes in the network dedicated to understanding different pixels and groups of pixels. Maybe some will look at whether there are layers in the dessert, while others will determine if there’s frosting or a crust. The nodes each store information about the features of what pie vs. cake looks like, and whenever a new image comes into play, it’s processed through each and every node to output a final prediction. In the context of generative AI, this principle extends beyond simply recognition to the creation of new, original content. Instead of merely identifying features, generative models use neural networks to understand the underlying patterns and structures of the data they’re trained on. This process involves complex interactions and adjustments within the neural network, guided by algorithms designed to optimize the creativity and accuracy of the generated output. How are generative AI models developed? The development of generative AI models involves a series of complex and interrelated steps, typically carried out by teams of researchers and engineers. These models, such as GPT (generative pre-trained transformer) from OpenAI and other similar architectures, are designed to generate new content that mimics the distribution of the data they were trained on. Here’s a step-by-step breakdown of that process: 1 Data collection Data scientists and engineers first determine the goals and requirements of their project, which guides them to collect a wide and appropriate dataset. They often use public datasets, which offer vast quantities of text or images for their needs. For instance, the training of ChatGPT (GPT-3.5) involved processing 570GB of data, equivalent to 300 billion words from public internet sources, including nearly all of Wikipedia’s content. 2 Model selection Choosing the right model architecture is a critical step in developing generative AI systems. The decision is guided by the nature of the task at hand, the type of data available, the desired quality of the output, and computational constraints. Specific architectures, including VAEs, GANs, and transformer-based and diffusion models, will be discussed in more detail later in this article. At this stage, it’s important to understand that new models often start from a preexisting architecture framework. This approach leverages proven structures as a foundation, allowing for refinements and innovations tailored to the unique requirements of the project at hand. 3 Model training The chosen model is trained using the collected dataset from the first step. Training generative AI models often requires a large amount of computing power, using special hardware like GPUs (graphics processing units) and TPUs (tensor processing units). While the training approach varies based on the model architecture, all models go through a process called hyperparameter tuning. This is where data scientists adjust certain performance settings to achieve the best results. 4 Evaluation and fine-tuning Finally, model performance is evaluated or tested in the real world. Evaluating generative AI models is different from evaluating traditional ML models because generative AI creates an entirely new output, and the quality of this output tends to be subjective. Metrics differ based on what the model is creating, and evaluation techniques for generative AI typically include using human raters—and may employ the strategy of having generative AI models evaluate one another. Learnings from the evaluation stage are typically applied back into fine-tuning the model or even retraining it. After the model’s performance is validated, it’s ready for production. Types of generative AI models Building on our foundational knowledge of generative AI models and the neural networks that power them, we’re now set to dive into specific types of model architectures that have emerged since the early 2010s. We’ll explore each model’s unique strengths and weaknesses, as well as their practical applications. Here’s a brief overview of the models we’ll be discussing: Variational autoencoders (VAEs) are adept at learning complex data distributions and are often used for tasks like image generating and editing. Generative adversarial networks (GANs) are known for their ability to create highly realistic images and have become popular in a variety of creative applications. Diffusion models are a newer class of models that generate high-quality samples through a process of gradually adding and then removing noise. Language models excel at understanding and generating human language, making them useful for applications like chatbots and text completion. Transformer-based models were initially designed for natural language processing (NLP) tasks but have been adapted for use in generative models due to their powerful ability to handle sequential data. Let’s delve deeper into each of these architectures to understand how they work and where they can be best applied. VAEs VAEs were invented by Max Welling and Diederik P. Kingma in 2013. They rely on the fact that a neural network can encode the high-level concepts the model learns during the training step. This is sometimes referred to as a “compression” or “projection” of the raw data. If a model looks at an image of a cake, for example, it might turn that into an encoding containing all of the image’s features—sprinkles, frosting color, spongy layers, etc. This encoding looks like a set of numbers that makes sense to the model but not to humans. It can be decoded by yet another neural network to try to re-create the original image—though it will have some gaps because the encoding is a compression. This type of model, with the encoder and decoder pieces working together, is called an autoencoder. VAEs put a spin on the autoencoder idea to generate new outputs. When generating its encodings, a VAE uses probabilities instead of discrete numbers. After all, does whipped cream count as frosting? Sometimes yes; sometimes no. It turns out that if you train a neural network to create these probabilistic encodings and train another neural network to decode them, you can get some pretty interesting results. The decoder can sample points in the variational encoding “space” and create entirely new outputs that will still appear realistic because they have preserved the probabilistic relationships of the training data. Advantages and disadvantages VAEs use unsupervised learning, which means that the model learns on its own from raw data without requiring humans to label different features or outcomes. Such models are especially successful at creating content that deviates slightly from the original. Because of how they work with encodings, they can also be given specific instructions based on features of the training data: “Show me a dessert that represents the perfect midpoint between cake and pie.” That said, VAEs optimize for likely outcomes, so they are unlikely to excel at creating very original or groundbreaking content. One common complaint about VAEs is that they can produce noisy (i.e., blurry) images due to the fact that encoding and decoding involves compression, which introduces loss of information. Use cases VAEs work with all kinds of data, though they are primarily used to generate images, audio, and text. One interesting application is anomaly detection: In a dataset, VAEs can find the data points that deviate the most from the norm, because those points will have the highest reconstruction error—meaning they will be the furthest from the probabilities that the VAE has encoded. GANs GANs were developed by Ian Goodfellow in 2014. While neural networks had been able to generate images before that, the results tended to be blurry and unconvincing. The core question (and insight) behind GANs is this: What