liveBook · Manning

Generative modeling

As explained in Generative AI in Action

Generative AI is an artificial-intelligence approach that produces new content or processes rather than merely classifying or predicting properties of existing inputs.

Generative modeling is an AI approach that learns patterns from data and uses them to produce new outputs. Those outputs can include text, images, music, code, designs, or proposed processes. Unlike a system limited to classifying an input or choosing a predefined response, a generative model can produce an output that was not hard-coded. It does not understand its output as a human does; its quality and relevance depend partly on the data it learned from. section 1.2 section 1.3 section 1.6

A prompt specifies what to produce and supplies instructions or context. In enterprise applications, this makes generative modeling useful for tasks such as drafting marketing content, supporting customer-service chatbots, and generating code. Large language models can also perform related tasks such as extracting information from text. A capable model alone does not solve a business problem: it must be connected to the relevant data, applications, and workflow. section 1.6 section 1.4 section 1.7

From instructions to an email

To draft a launch email, a GPT-4 prompt supplies the subject, intended audience, requirements, background, and desired tone, then asks for a subject line and body. This illustrates how the same general-purpose model can be directed toward a particular communication task without hard-coding the finished email. section 1.3.2

Table 1.4 How generative AI differs from traditional AI
Area
Difference
Creation versus prediction
Traditional AI focuses on prediction or classification tasks, identifying what something is or forecasting what will happen next based on existing data. Generative AI creates new content and outputs that did not exist in the original data.
Hosting and inference
Relative to generative AI, traditional AI models are less complex and require fewer computing resources, allowing them to run on various hardware, from small edge devices to large cloud clusters and everything in between. This flexibility cloud-to-edge is a huge advantage for enterprises.
Generative models are large and complex; for the most part, they are available only on large cloud compute nodes via an API, which has other advantages, such as the knowledge of the world encoded in these foundational models being available to everyone. However, there are other constraints that one needs to consider.
Note: There is a growing set of smaller open-source models that can be run on-premises, but today, they are still more experimental and nascent. Many claim to be AI Quality (AIQ), similar to OpenAI’s models. Given the broad spectrum that generative AI covers, there is a new emerging set of benchmarks, such as Stanford’s Holistic Evaluation of Language Model (HELM), and Hugging Face recently published an Open LLM Leaderboard. We will cover these in depth later in the book when talking about evaluations and benchmarks.
Training method
Generative models require a different method of training (self-supervision and multitask learning), which is longer and much more expensive because of the massive scale of data, model sizes, and computing resources required. The costs and complexity of managing this are enormous, and we will touch on them later in the chapter.
Training dataset
Generative AI models are typically trained on large datasets of existing content, while traditional AI models are typically trained on smaller datasets of labeled data. For example, a generative AI model for image generation might be trained on a dataset of millions of images. In contrast, a discriminative AI model for image classification might be trained on a few thousand labeled image datasets.
Model complexity
Generative AI models are often more complex than other types because they need to learn the patterns and relationships in the data to generate new content similar to the existing content.
Adaptation approach
Traditional AI has no adaptive techniques other than labeling more data and going through a full ML loop of training, deploying, and evaluating. Generative AI, in contrast, has vast world knowledge. Sometimes, one needs to tailor it to specific needs and tasks or distill internal private and proprietary knowledge; this is done via adaptation. Various techniques can be used depending on what is needed.

Compare creation with prediction or classification, and consider the different hosting and inference demands before choosing an approach. section 1.6

For an enterprise pilot, turn the capability into a controlled application:

  • Choose a specific use case and success criteria; start small enough to evaluate and adapt. section 1.7 section 1.9
  • Prepare relevant, high-quality data, address privacy and legal requirements, and integrate the model with the applications users already need. section 1.9
  • Plan for prompt management, failure, cost, model choice, governance, and ongoing monitoring rather than treating an API response as a finished product. section 1.8 section 11.2

Generated output can be convincing but wrong, biased, offensive, or unsuitable for a high-stakes decision. Hallucinations are a particular concern when users expect factual answers. Review outputs and set safeguards appropriate to the use case; where decisions could affect life or safety, keep a human responsible for the final decision. section 1.4 section 1.5 section 13.0

How Generative AI in Action covers it

How deep it goes
Explains learned patterns, prompts, applications, and adoption considerations, while deferring detailed machine-learning and deep-learning mechanisms.
Examples
Uses GPT-4 email drafting and entity extraction, alongside enterprise chatbot and industry use cases.
What it assumes
Introduces machine learning and deep learning in plain terms rather than requiring their detailed mechanisms.
What you can do after
Evaluate/understand it for an enterprise use case, then plan a small pilot with data, integration, governance, and success criteria.
How it connects
Connects generative modeling to machine learning, deep learning, large language models, prompt engineering, enterprise integration, and responsible AI.

Also explained in

Compare how 29 books explain generative modeling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Generative AI in Action. The section links point to the parts of the book it draws on.