Introduction to Generative AI, Second Edition....1
brief contents....5
contents....6
foreword....13
preface....15
acknowledgments....17
about this book....19
Who should read this book....20
How this book is organized: A road map....20
liveBook discussion forums....22
Other online resources....22
about the authors....23
about the cover illustration....25
1 Large language models: The foundation of generative AI....26
The evolution of natural language processing....28
The birth of LLMs....32
The explosion of LLMs....34
What are LLMs used for?....36
Language modeling....36
Question answering....38
Coding....39
Content generation....40
Logical reasoning....42
Other natural language tasks....43
Where do LLMs fall short?....44
Training data and bias....44
Limitations in controlling machine outputs....47
Sustainability of LLMs....49
Major players in generative AI....50
OpenAI....51
Google....53
Meta....54
Microsoft ....55
Anthropic....56
Other notable players....57
Conclusion....59
2 Training large language models: Learning at scale....61
How are LLMs trained?....62
Exploring open web data collection....63
Demystifying autoregression and bidirectional token prediction....65
Training multimodal LLMs....66
Transferring knowledge for efficient models....69
Mixture of Experts and sparse models....71
Reasoning models....73
Techniques for post-training LLMs....76
Supervised fine-tuning....77
Reinforcement learning from human feedback....78
Direct preference optimization....79
Reinforcement learning from AI feedback....80
Emergent properties of LLMs....81
Learning with a few examples....82
Is emergence an illusion?....85
Conclusion....86
3 Data privacy and safety: Technical ....88
What’s in the training data?....89
Encoding bias....89
Linguistic diversity....94
Sensitive information....97
Safety-focused improvements for LLM generations....102
Post-processing detection algorithms....103
Content filtering or conditional pretraining....105
Safety post-training....106
Machine unlearning....109
Navigating user privacy and commercial risks....111
Inadvertent data leakage....111
Best practices when interacting with LLMs....114
Data protection and privacy in the age of AI....114
International standards and data protection laws....115
Are generative AI systems GDPR-compliant?....119
Privacy regulations in academia....122
Corporate policies....123
Governing data in an AI-driven world....125
Conclusion....128
4 AI and the creative economy: Innovation and intellectual property....130
The rise of synthetic media....131
Techniques for creating synthetic media....132
The opportunities and risks of synthetic media....137
Detecting synthetic media....139
Transforming creative workflows....144
Marketing and media applications....145
Visual and digital art....148
Filmmaking....149
Music....150
Intellectual property in the LLM era....152
Copyright law and fair use....153
Open source and licenses ....161
Creator’s rights and data licensing ....164
Conclusion....166
5 Misuse and adversarial attacks: Challenges and responsible testing....168
Intentional misuse....169
Cybersecurity and social engineering....170
Illicit and harmful applications....177
Adversarial narratives....185
Political manipulation and electioneering....194
Hallucinations....199
Why do LLMs hallucinate?....199
Misuse of LLMs in the professional world....207
Red teaming LLMs....214
Conclusion....219
6 Machine-augmented work: Productivity, education, and economy....222
Using LLMs in the professional space....223
LLMs assisting doctors with administrative tasks....223
LLMs for legal research, discovery, and documentation....225
LLMs augmenting financial investing and bank customer service....229
LLMs as a programming partner....232
LLMs in daily life....236
Generative AI in education....243
Detecting machine-generated text....249
Generative AI and the labor market....255
Conclusion....260
7 Prompt engineering: Strategies for guiding and evaluating LLMs....262
What is prompt engineering?....263
Prompting techniques and frameworks....269
Overview of common prompting techniques....270
Structuring prompts to guide model behavior....271
Prompting frameworks for structured output....277
Evolving practices in prompt engineering....279
Evaluating AI-generated outputs....283
Identifying evaluation metrics....283
Assembling evaluation datasets....284
Scoring model responses....286
Prompting vs. post-training....291
Conclusion....293
8 AI agents: The rise of autonomous AI systems....295
What is an AI agent?....296
How are AI agents being used?....297
Personal assistants....298
Enterprise workflows....300
Research and discovery....302
Software development....303
Cybersecurity....307
Physical environments....308
Multi-agent systems....309
Toward agentic collaboration....310
How are AI agents trained and enabled?....311
Agent architectures....315
Retrieval-augmented generation....317
Model Context Protocol....320
GUI-native agents....322
Evaluating agents....324
Risks and considerations unique to agents....326
Autonomy and misalignment....327
Memory and state persistence....328
Tool access and real-world consequences....329
Emergent behaviors in multi-agent systems....330
Security and adversarial risks....332
Human factors and decision delegation....333
Evaluation, monitoring, and oversight....334
The road ahead....336
The future of AI agents....336
Conclusion....339
9 Human connections: The social role of chatbots....341
The rise of human–chatbot relationships....342
Why humans are turning to chatbots for relationships....349
The loneliness epidemic....349
Emotional attachment in human–chatbot relationships....352
The benefits and risks of human–chatbot relationships....356
Toward healthier human–chatbot relationships....365
Conclusion....372
10 The future of responsible AI: Risks, practices, and policy....374
Where are LLM developments headed?....375
Language as the universal interface....376
From tools to agentic systems....378
The rise of personalized AI....380
On the horizon....382
Sociotechnical risks of generative AI....384
Bias, toxicity, and representational harms....384
Hallucinations and fabrications....385
Autonomy and emergent agentic risks....387
Misuse across domains....387
Dependency, emotional harm, and relationship risks....388
Labor and economic disruption....389
A holistic view of harm....389
Best practices for responsible AI development and use....390
Curating datasets and standardizing documentation....391
Protecting data privacy....393
Explainability, transparency, and bias....395
Design interventions and architectures....398
Model training strategies for safety....401
Red teaming and evaluation....404
Detecting and tracing synthetic media....405
Platform responsibility and user safeguards....408
Humans in the loop....410
Education and digital literacy....412
Toward responsible generative AI....413
AI regulations in practice....414
The United States....414
The European Union....419
China....424
Corporate self-governance....427
Toward an AI governance framework....430
Conclusion....433
11 Frontiers of AI: Open questions and global trends....435
The quest for artificial general intelligence....436
AI sentience and consciousness....445
The carbon footprint of LLMs....451
The open source movement ....458
Global investment in AI....466
Conclusion....470
references....472
index....503
Get a free eBook (PDF or ePub) from Manning as well as access to the online liveBook format (and its AI assistant that will answer your questions in any language) when you purchase the print book.
AI tools like ChatGPT and Gemini, automated coding tools like Cursor and Copilot, and countless LLM-powered agents have become a part of daily life. They’ve also spawned a storm of misinformation, hype, and doomsaying that makes it tough to understand exactly what Generative AI actually is and what it can really do. This book delivers a clear, well-written survey of generative AI fundamentals along with the techniques and strategies you need to use AI safely and effectively.
It guides you from your first eye-opening interaction with tools like ChatGPT to how AI tools can transform your personal and professional life safely and responsibly. AI moves fast—and so this second edition has been completely revised to reflect the latest developments in the field.
Generative AI tools like ChatGPT, Gemini, and Claude can draft emails, generate marketing copy, and prototype product designs. They can also produce poetry, realistic images or videos, and even generate computer code. But how do they do all that? This accessible book reveals how generative AI works in plain, jargon-free language, so you can use it safely and effectively.
Introduction to Generative AI, Second Edition is a completely revised and updated guide to the capabilities, risks, and limitations of generative AI. You’ll understand the latest innovations in AI, AI agents, multimodal training, reasoning models, retrieval-augmented generation (RAG), and more. Along the way, you’ll explore how AI is impacting the world, with an expert-level look at AI in industry, education, and society.
No technical experience required.