Professional Documents
Culture Documents
Generative AI and LLMs For Dummies
Generative AI and LLMs For Dummies
by David Baum
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Generative AI and LLMs For Dummies®, Snowflake Special Edition
Published by
John Wiley & Sons, Inc.
111 River St.
Hoboken, NJ 07030-5774
www.wiley.com
Copyright © 2024 by John Wiley & Sons, Inc., Hoboken, New Jersey
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
the prior written permission of the Publisher. Requests to the Publisher for permission should be
addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ
07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, For Dummies, the Dummies Man logo, The Dummies Way, Dummies.com,
Making Everything Easier, and related trade dress are trademarks or registered trademarks of John
Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be
used without written permission. Snowflake and the Snowflake logo are trademarks or registered
trademarks of Snowflake Inc. All other trademarks are the property of their respective owners.
John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
For general information on our other products and services, or how to create a custom For Dummies
book for your business or organization, please contact our Business Development Department in
the U.S. at 877-409-4177, contact [email protected], or visit www.wiley.com/go/custompub.
For information about licensing the For Dummies brand for products or services, contact
BrandedRights&[email protected].
ISBN 978-1-394-23842-2 (pbk); ISBN 978-1-394-23843-9 (ebk)
Publisher’s Acknowledgments
Some of the people who helped bring this book to market include the following:
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Table of Contents
INTRODUCTION................................................................................................ 1
About This Book.................................................................................... 1
Icons Used in This Book........................................................................ 2
Beyond the Book................................................................................... 2
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Implementing LLM Applications........................................................ 26
Deploying apps into containers................................................... 26
Allocating specialized hardware................................................... 27
Integrating apps and data............................................................ 27
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Introduction
G
enerative AI (gen AI) and large language models (LLMs)
are revolutionizing our personal and professional lives.
From supercharged digital assistants that manage our
email to seemingly omniscient chatbots that can communicate
with enterprise data across industries, languages, and specialties,
these technologies are driving a new era of convenience, produc-
tivity, and connectivity.
Both in the public sphere of the Internet and within the realm
of private enterprise, the transformative potential of this rapidly
evolving field is reshaping the way people live, work, and interact.
Introduction 1
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
In the pages that follow, you learn about the importance of gen AI
applications that are secure, resilient, easy to manage, and that
can integrate with your existing technology ecosystem. You also
discover the importance of standardizing on a modern data plat-
form to unlock the full potential of your data. Prepare to embark
on a transformative journey that will shape the way your business
operates.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Reviewing the history of AI
Chapter 1
Introducing Gen AI and
the Role of Data
T
raditional AI, often referred to as machine learning (ML),
has primarily focused on analytic tasks like classification
and prediction. Generative AI (gen AI) goes a step further
with its ability to create new, original content. This creative
breakthrough has the potential to transform nearly every indus-
try, enhancing human creativity and pushing the boundaries of
what machines can accomplish. This chapter puts gen AI in a his-
torical context, defines key terms, and introduces the data foun-
dation that organizations need to succeed with gen AI initiatives.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
of these unique technologies, it is helpful to place them in their
historical context.
During the first two decades of the 21st century, deep learning
revolutionized the AI landscape with its capability to handle large
amounts of data and execute complex tasks. As a type of neural
network, deep learning employs multiple layers of interconnected
neurons, allowing for more sophisticated learning and represen-
tation of data. This breakthrough led to significant advancements
in computer vision, speech recognition, and natural language
processing (NLP), launching the era of general-purpose AI bots
such as Siri and Alexa. Convolutional neural networks (CNNs) proved
themselves to be particularly successful at computer vision tasks,
while recurrent neural networks (RNNs) excelled in sequential data
processing, such as language modeling. These technologies laid
the foundation for gen AI.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
In the field of AI, language models are powerful software systems
designed to understand, generate, and manipulate human lan-
guage. Some models handle images and other media along with
text. These are often referred to as multimodal language models.
Accelerating AI functions
Another important factor in the evolution of AI is the advent of
accelerated hardware systems known as graphics processing units
(GPUs). Although central processing units (CPUs) are designed for
general-purpose computing tasks, GPUs, initially developed for
graphics rendering, are specialized processors that have proven to
be adept at ML tasks due to their unique architecture.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
matrix operations. GPUs can perform these computations much
faster than CPUs, accelerating training and inference times and
enhancing the overall performance of ML algorithms. Refer to
Cloud Data Science For Dummies (Wiley) by David Baum for addi-
tional information on these concepts. Figure 1-1 summarizes
AI progress.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
CAST A WIDE DATA NET
To maximize the potential of your gen AI endeavors, cast a wide net to
utilize the three basic types of data sources:
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» LLMs as logical reasoning engines: Within the field of AI,
natural language understanding (NLU) focuses on compre-
hending the intricate meaning in human communication.
LLMs can unravel the underlying meaning in textual data,
such as product reviews, social media posts, and customer
surveys. This makes them valuable for sentiment analysis
and other complex reasoning tasks that involve extracting
meaningful insights from text and providing a deeper
understanding of human language.
»» LLMs as translation engines: LLMs have transformed text
translation between languages, making it easier for people
to communicate across linguistic barriers. By leveraging this
understanding, LLMs can accurately convert text from one
language to another, ensuring effective and reliable transla-
tion. This breakthrough in language processing has greatly
enhanced accessibility and global communication, allowing
individuals and businesses to connect, collaborate, and
understand each other more easily, regardless of language
differences.
»» LLMs for text retrieval, summarization, and search: LLMs
are pretrained on vast amounts of text data, allowing them
to grasp the nuances of language and comprehend the
meaning of text. They can search through large databases
or the Internet in general to locate relevant information
based on user-defined queries. LLMs can also generate
concise summaries while maintaining the essence of the
original information. For example, a tech company might use
an LLM to optimize content for search engines by suggesting
relevant keywords, giving visibility into common search
queries associated with the topic, and ensuring crawlability.
Gen AI models, and hence the decisions made from those models,
are only as good as the data that supports them. The more data
these models ingest and the more situations they encounter, the
smarter and more comprehensive they become.
Pretrained models
There’s a rapidly growing market for creating and customiz-
ing gen AI foundation models in many different industries and
domains. This has given rise to a surge of LLMs that have been
pretrained on data sets with millions or even billions of records,
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
allowing them to accomplish specific tasks. For example, as
explained by SiliconAngle’s “Nvidia debuts new AI tools for bio-
molecular research and text processing,” MegaMolBART (part of
the NVIDIA BioNeMo service and framework) can understand the
language of chemistry and learn the relationships between atoms
in real-world molecules, giving researchers a powerful tool for
faster drug discovery. Pharmaceutical companies can fine-tune
these foundation models using their own proprietary data. Train-
ing these commercial foundation models is an immense effort
that costs tens of millions of dollars. Fortunately, businesses that
use them don’t have to repeat that massive process to adapt an
LLM to their needs; they can adapt an existing foundation model
for a fraction of that amount.
Gen AI systems learn from data; the more data they can access,
the more capable they become. But how do you ensure that your
business users, software developers, and data scientists can easily
access a secure, consistent, governed data set — without adding
onerous constraints that inhibit innovation? Enterprises need to
be able to leverage gen AI technology in an easy, straightforward
manner. They also need to uphold essential data security, gov-
ernance, and regulatory issues — not only for their data but also
for the models that learn from the data and extract information
from it.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
workgroups can access easily and securely. This allows you to
centralize data governance and democratize access to gen AI ini-
tiatives across your organization while minimizing complexity
and optimizing costs.
Data is your core differentiator in the age of gen AI. The best way
to harness and protect enterprise data for gen AI initiatives is
to consolidate disparate sources into a cloud data platform that
provides strong security and governance for data and the models
customized with that data. Data can be structured tabular data;
semistructured data from IoT devices, weblogs, and other sources;
or unstructured data, such as image files and PDF documents.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Categorizing and classifying LLMs
Chapter 2
Understanding Large
Language Models
L
arge language models (LLMs) are widely known for their
ability to generate written text, computer code, and other
content, as well as for their astonishing ability to respond to
queries in humanlike ways. However, the utility of these AI sys-
tems extends beyond explaining concepts and summarizing text.
Today’s LLMs have the potential to revolutionize how enterprises
acquire, handle, and analyze information, opening up new ave-
nues for exploration and inquiry. This chapter defines the various
types of LLMs and discusses their applicability to the enterprise.
Categorizing LLMs
General-purpose LLMs handle a wide range of tasks and under-
stand a broad spectrum of languages — both natural languages
and computer languages. They are trained by scraping massive
amounts of data from the Internet, as well as by ingesting data
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
from private data sources that are relevant to the purpose of the
model. This allows LLMs to generate contextually related feed-
back on just about any topic.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
SIZING UP THE CONTENDERS
As the software industry steps up research and development into
LLMs, several prominent offerings have emerged in this highly
competitive sector:
Those listed in the sidebar and other language models are becom-
ing progressively more relevant to the business world. According
to a June 1, 2023, press release from Bloomberg Intelligence, the
gen AI market is poised to explode, growing to $1.3 trillion over
the next 10 years from a market size of just $40 billion in 2022 —
a compound annual growth of 42 percent.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Using task-specific and
domain-specific LLMs
Bing and Bard are examples of applications developed utiliz-
ing their respective foundation LLMs. These applications have a
user interface and have undergone additional specialized training,
enhancing their capabilities for specific tasks. For example, Bard
offers chatbot access to Google’s full suite of products — includ-
ing YouTube, Google Drive, Google Flights, and others — to assist
users in a wide variety of tasks. Google users can link their personal
Gmail, Google Docs, and other account data to allow Bard to analyze
and manage their personal information. For example, you can ask
Bard to plan an upcoming trip based on suggestions from a recent
email string, complete with flight options. You can also ask Bard to
summarize meeting notes you have logged in the files and folders
of your Google Drive hierarchy.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
FIGURE 2-1: A gen AI’s encoder and decoder work together to produce
accurate outputs.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
fine-tune input parameters as you instruct the LLM to generate
relevant outputs specific to your private data.
FIGURE 2-2: A word can be identified by the group of words that are used
with it frequently. This is the basis for creating vector embeddings.
Make sure that your data platform includes vector search func-
tionality that can handle essential gen AI tasks that help you
contextualize LLMs with your data, such as retrieval-augmented
generation (RAG), in-context learning (ICL), and vector similar-
ity search (VSS). For more information on these concepts, see
Chapter 3.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Identifying developer tools
and frameworks
The capability of LLMs to process and interpret vast amounts of
text, audio, video, and other forms of content have made them
an indispensable part of many data science workflows. Although
nontechnical users can interact with LLMs with little or no train-
ing, data science teams use established software frameworks to
interact with LLMs and create gen AI applications. Popular frame-
works that assist with text classification, sentiment analysis, text
generation, and other gen AI tasks include the following:
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
All gen AI project stakeholders should take care to protect sensi-
tive data as it is accessed, shared, and exchanged with LLMs and
gen AI applications. When you conduct these projects within a
cloud data platform, you can uphold data security, data privacy,
and data governance without imposing intrusive restrictions on
the workforce.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Defining the scope of the project
Chapter 3
LLM App Project
Lifecycle
T
he generative AI (gen AI) project lifecycle guides you
through the process of selecting, adapting, and implement-
ing large language models (LLMs) as you create AI applica-
tions. This chapter describes the major steps including defining
the use case, selecting an LLM, and guiding the use and
customization of the model for the project. It also covers the key
considerations in model customization steps.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Next, determine what proprietary data you will use to custom-
ize or contextualize the model effectively. Many foundation LLMs
contain massive amounts of information learned from the Inter-
net, which gives the models their knowledge of language as well
as many aspects of the world around us. More than likely, you
have a project in mind that requires specific domain knowledge
or access to internal information. For example, to create product
descriptions for an e-commerce system, you might begin with
public data that describes the general types of products, supple-
mented by internal data that identifies the unique aspects of your
products.
Defining the use case sets the foundation for clarifying the
business problem and or the goal to be achieved. It will help define
data and user experience requirements.
FIGURE 3-1: The gen AI project lifecycle and its players at a glance.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Comparing small and large
language models
The parameters in a language model refer to the trainable vari-
ables. More parameters mean more knowledge is part of the
model out of the box, but bigger isn’t always better. Smaller LLMs
have fewer parameters and thus consume less compute resources
and are faster to fine-tune and deploy. They’re well suited for
running very specific tasks in a more cost-effective way. LLMs
have a higher number of parameters (typically 10 billion or more)
and can learn more nuanced language patterns, and provide more
accurate and contextually relevant outputs for a wider range of
scenarios. However, they require more resources to train and
adapt to your needs.
• Task alignment: Choose an LLM that aligns to the task, such as GPT
for conversational applications or BioBERT for biomedical research.
• Training data: Evaluate whether the LLM has been trained on
data that matches the domain or context of the project.
• Model size and complexity: Models with tens of billions of
parameters provide higher-quality outputs but require more
computational resources.
• Adapting and tuning: Determine if the chosen LLM can be
effectively contextualized with prompts or fine-tuning.
• Ecosystem and support: Investigate the availability of resources,
tools, and community support surrounding the LLM.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Adapting LLMs to Your Use Case
This list highlights various techniques that you can use to tailor
the LLM to meet your specific needs:
Engineering prompts
LLMs are sophisticated predictive models that anticipate the next
word in a sequence based on the context provided to them as part
of a process referred to as a completion. Carefully constructed
prompts help these models deliver tailored content, yielding
better completions. LLM performance is influenced not only by
the training data but also by the context provided by these user
inputs — the prompts.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» Zero-shot prompting is the default; you simply issue a question
and rely on the LLM’s pretrained information to answer it.
»» With one-shot prompting, you include an example of the
desired output to help the model understand the desired
output. For instance, assume you’re writing a travel brochure
and you want the AI model to describe a vibrant public
market in an exotic city. Even with limited exposure to this
particular scenario, a model can generate a creative descrip-
tion that matches the tone of voice, vibrant use of adjectives,
and structure that has already proven successful in your
marketing content.
»» Few-shot prompting takes it a step further by providing multiple
examples to more clearly teach the LLM the desired output
structure and language.
ICL allows users to give context to the model using private data,
enhancing its performance in specific domains. This is a simple
way to help language models understand and generate text that’s
contextually relevant to specific tasks, scenarios, and domains.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
associated with gen AI systems, such as limited knowledge of
arcane subjects, a failure to recognize facts and events that took
place after the model was trained, and lack of insight into any
proprietary data.
1. Select the pretrained LLM that is most germane to the use case.
2. Identify data sets related to the use case to refine the LLM.
Teach the model how to respond based on a training data set
that includes examples of prompts as well as the data the model
needs to answer or complete the prompt. In this process, the
model weights are adjusted to get better at generating responses
to the new set of prompts.
3. Evaluate the fine-tuned LLM to verify results meet requirements.
You can adjust the learning rate, batch size, and other factors to
improve outcomes.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
By applying fine-tuning techniques, you can adapt a model to
specific needs and use cases. You can also rapidly build custom-
ized solutions by building on top of an existing foundation model
rather than training a new model from scratch.
Reinforcement learning
Reinforcement learning from human feedback (RLHF) is a form of
fine-tuning that you can use to guide the learning process and
further enhance the performance and behavior of your model,
with the goal of improving its responses over time. Many creators
of large language systems use this technique to teach their chat-
bots to carry on realistic conversations — such as to engage in
dialogue rather than just provide one-off responses.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
A vector database is important because it enables efficient storage,
retrieval, and manipulation of vector embeddings. By assigning a
unique key to each vector, the database allows for quick and direct
access to the content at a discrete level. This capability is par-
ticularly valuable in applications like RAG, where rapid retrieval
and matching of vectors allow the model to discover semantically
related text, such as a product that’s similar to one that a cus-
tomer searched for previously.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Some data platforms also allow you to use data, applications, and
models from third-party providers, instantly available as native
apps within an associated marketplace.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
learning (ML) model. And in the same platform, teams can col-
laborate in executing all related tasks such as data preparation,
data engineering, analytics, and other important workloads (see
Figure 3-2).
FIGURE 3-2: A cloud data platform that supports many data types and spans
public clouds can unite the work of data analysts, data scientists, and data
engineers.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Understanding semantic caching, feature
injection, and context retrieval
»» Orchestrating AI agents
Chapter 4
Bringing LLM Apps
into Production
A
s you progress beyond using a model out of the box with-
out any customization and begin incorporating custom
data into your language models, you will most likely need
to assess your data processing needs. This chapter discusses the
challenges of bringing large language model (LLM) apps into pro-
duction, including building data pipelines, improving model
accuracy, calculating costs, orchestrating external data sources,
developing user interfaces, and calling external functions.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
By integrating your gen AI initiatives into your existing data
infrastructure, you can often avoid building data pipelines and
other foundational services (for more on this, see Chapter 1).
A cloud data platform provides scalable GPU-infrastructure and
vector search functionality as well as flexibility to reuse and
adapt existing data pipelines developed for other downstream
processes — such as business intelligence, analytics, and machine
learning (ML) — without causing bottlenecks.
Semantic caching
Semantic caching involves temporarily storing semantic represen-
tations or embeddings of data. By employing semantic caching
techniques, AI systems can provide more precise, meaningful,
and efficient responses. For example, let’s say that you have a
chatbot that needs to generate responses to user queries. Before
the bot goes live, it can precompute the semantic representations
of a large set of possible user queries and store them in a cache.
These representations capture the underlying meaning or intent
of the queries. When a user interacts with the chatbot, instead of
processing the query from scratch, the system can retrieve the
precomputed semantic representation from the cache. This sig-
nificantly reduces the computational overhead and speeds up the
response generation process.
Feature injection
Feature injection refers to the process of incorporating additional
information or features into the AI model. Although feature engi-
neering is a general practice in data science, feature injection is
a specialized technique used to enhance the performance and
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
reasoning capabilities of AI models. Features can improve the
model’s ability to handle specific tasks. By injecting relevant fea-
tures, the model can capture and leverage important patterns in
the data, leading to improved performance.
Context retrieval
Context retrieval involves retrieving relevant contextual informa-
tion to enhance the understanding of AI models. By considering
the surrounding context, such as previous interactions or user
history, AI systems can generate more accurate and personal-
ized completions. For example, a customer support system might
use context retrieval to provide personal assistance. If a customer
has previously interacted with the support system and mentioned
a specific issue or order number, the system can retrieve that
context to better understand the customer’s current inquiry or
concern. Retrieval-augmented generation (RAG), a type of in-
context learning (ICL), is also important in this context. See
Chapter 3 for additional information.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» Access: The model can be hosted either on private servers
or cloud platforms. Hosting in the cloud offers benefits such
as scalability, easy deployment, and maintenance. However,
this choice raises data security and governance concerns,
emphasizing the need for proper measures to protect
sensitive data and ensure compliance with relevant regula-
tions. A cloud data platform can alleviate these concerns.
»» Consumption: LLMs can be accessed via APIs and software
functions, enabling programmatic integration. They can also
be accessed through application-specific interfaces, making
them accessible to a broader range of users. The choice of
access method depends on the specific use case, target
audience, and the level of flexibility desired.
Reducing latency
Latency refers to the time it takes the LLM to make predictions
once it receives input data. This is an important consideration
for gen AI projects that require real-time responses. For exam-
ple, if you’re creating a customer support chatbot, low latency
is crucial to provide quick and efficient responses to customer
inquiries, enabling real-time interactions. As described through-
out this book, keeping the processing close to the data is a key strat-
egy for reducing the latency of gen AI applications in a production
environment. It also allows you to reduce the amount of data that
needs to be transferred between the compute resources and the
storage layer, improving performance while reducing costs and
data security risks.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Calculating costs
The cost of using a cloud data platform is typically based on three
interrelated metrics: data transfer volume, data storage con-
sumption, and compute resources. The best data platforms sepa-
rate these three services to give administrators complete control
over usage. Your data platform should make it easy to track the
consumption of all cloud services. This includes built-in resource
monitoring and management features that provide transparency
into usage and billing, ideally with granular chargeback capabili-
ties to tie usage to individual budgets, departments, and work-
groups. Data administrators can set guardrails to make sure no
individual or workgroup spends more than expected. For exam-
ple, they can set time-out periods for each type of workload, along
with auto suspend and auto resume features to automatically start
and stop resource accounting when the platform isn’t processing
data. They may also set limits at a granular level, such as deter-
mining how long a training model can run before it is terminated.
Make sure that the pricing model for your cloud data plat-
form matches the value you obtain from it. Paying for a set
amount of storage and computing power, commonly known as
subscription-based pricing, can cause you to incur significant costs
and requires regular management. To ensure that you don’t pay
for more capacity than you need, your cloud data platform should
offer usage-based pricing with billing in per-second increments.
»» Web apps are the most common type of front end for gen AI
apps because they’re relatively easy to develop and can be
accessed from any device with a web browser.
»» Mobile apps tailored to specific devices, such as tablets and
smartphones, offer a more immersive and engaging
experience for users. They can take advantage of the unique
aspects of each platform and can cache data for offline use.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» Chat interfaces are used in gen AI apps when the app
needs to converse with the user, such as to answer
questions or assist with certain tasks.
»» Desktop apps are useful for gen AI apps that require a lot of
processing power, or that need to access local resources.
»» Command-line interfaces (CLIs) are sometimes used for gen
AI apps that are accessed by developers and data scientists,
such as to empower software engineers to generate code.
Simplifying Development
and Deployment
A complete data platform includes the necessary primitives for
building and deploying gen AI applications without requiring
developers to move data or application code to an external system.
This accelerates the process of building web apps, chatbots, and
other front-end user interfaces. Look for a platform that offers
a user-friendly environment for working with Python and other
popular coding languages, characterized by the following essen-
tial capabilities:
Orchestrating AI Agents
LLMs have brought a wide variety of tools, techniques, and
frameworks to the task of building AI-powered applications. New
developer tools are emerging under the umbrella of LLMOps,
short for LLM operations.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Among LLMOps tools, orchestration frameworks can be used to
coordinate AI agents and other components to accomplish specific
goals. AI agents are simply individual instances of language mod-
els that are responsible for performing specific tasks, such as text
summarization, language translation, and sentiment analysis.
They’re coordinated and managed within an orchestration sys-
tem to complete complex language processing tasks. This process,
known as orchestration, involves organizing agents, coordinating
the input/output of various models, and managing the flow of data
and information among agents. For example, in an e-commerce
scenario, a chatbot interacting with a customer might use
AI agents to retrieve order details from a database, generate a
request for a return label using a shipping partner’s API, confirm
the customer’s information, and initiate the return process by
sending a shipping label.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
All gen AI applications must perform the basic function of pass-
ing input to the LLM and returning the results or completions.
This is often done through an orchestration library that simplifies
access to external data sources and connects to APIs within other
applications.
ORCHESTRATING AI PROJECTS
Orchestration libraries simplify access to external data sources and
connect to APIs within other applications in a number of ways,
including:
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
IN THIS CHAPTER
»» Mitigating data privacy concerns
Chapter 5
Reviewing Security and
Ethical Considerations
A
lthough large language models (LLMs) can process text
and create content on just about any subject, it is crucial
for businesses to consider issues of intellectual property,
data privacy, and potential content misuse. Generative AI (gen AI)
applications are trained on massive data sets of text and code,
which may include sensitive or legally protected information. If
this data isn’t properly protected, it could be leaked to third par-
ties or accessed by unauthorized individuals.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Reiterating the Importance
of Security and Governance
Gen AI is a powerful technology with the potential to revolution-
ize many enterprise business functions. Enterprises must pay
attention to the data privacy risks associated with this technology
and take steps to mitigate these risks:
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
MITIGATING DATA PRIVACY
CONCERNS
Pay attention to these data privacy concerns when developing,
deploying, and using gen AI applications:
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Alleviating Biases
One important ethical consideration involves being alert to the
inherent model biases that may be present in the training data,
which may cause LLMs to generate outputs that are discrimina-
tory or unfair. For example, if a historical data set contains biases
against certain demographics, such as race or gender, an LLM
trained on this data may inadvertently perpetuate those biases. If
a marketing team asks an LLM to generate content for a customer
of a specific gender, it’s important to keep in mind what kind of
bias the model may have as it creates that content, even if there is
no explicit intent to discriminate.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Contending with Hallucinations
As demonstrated throughout this book, LLMs have an uncanny
capability to engage in dialogue, answer questions, provide expla-
nations, generate creative text, and assist with various language-
related tasks. However, it’s important to note that while LLMs
often exhibit impressive capabilities, they may occasionally pro-
duce incorrect or nonsensical responses. They are also known
to hallucinate, meaning that they may generate content that is
fictional or erroneous.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Observing Copyright Laws
In September 2023, John Grisham, Jodi Picoult, Jonathan Franzen,
George R.R. Martin, and 13 other authors joined the Authors Guild
in filing a class action suit against OpenAI, alleging that the com-
pany’s GPT technology is illegally using the writers’ copyrighted
works. The complaint called the usage of these works by LLMs a
“flagrant and harmful” copyright infringement, claiming that their
books were misused in the training of its artificial intelligences.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
Chapter 6
Five Steps to
Generative AI
F ollowing the steps in this chapter will help ensure you reap
positive new levels of productivity.
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
»» Access large language model (LLM) app stack primitives that
help teams build custom solutions without integrations of
multiple platforms
»» Capability for those without AI expertise to bring gen AI to
their daily workflows with UI-driven experiences
»» Access to structured/semistructured/unstructured data, both
internal and from third parties, via a marketplace
»» Native support for popular AI frameworks, tools, and
programming languages
These materials are © 2024 John Wiley & Sons, Inc. Any dissemination, distribution, or unauthorized use is strictly prohibited.
WILEY END USER LICENSE AGREEMENT
Go to www.wiley.com/go/eula to access Wiley’s ebook EULA.