Introduction to Generative AI
NUMA DHAMANI MAGGIE ENGLER
Numa dedicates this book to her parents, Nazarali and Nadia, and her brother, Nihal.
Maggie dedicates this book to her husband, Joe.
Contents
Foreword
Preface
Acknowledgments
About this book
Introduction to Generative AI could not be more timely. We need a primer like this, addressing complex ideas at an accessible level. While I’m sure that not every prediction in this book will materialize exactly as described, you are sure to be exposed to both really useful information about how generative AI works right now and patterns of thinking honed through years of dedicated integrity work. Read this book.
—Sahar Massachi Cofounder and Executive Director of Integrity Institute
Preface
In a twist of fate, wild internet conspiracy theories brought the two of us together—we met developing natural language processing systems to measure and understand extremist content online. When large language models (LLMs) and other types of generative models came into global public consciousness, we realized that our field would be permanently changed. Content had never been cheaper to create and disseminate; at the same time, the need for our ability to classify content at scale had never been greater.
While writing this book, we received a memorable piece of reviewer feedback to the effect that, “The authors ought to clarify their position on generative AI. Are they for or against it?” Reader, we are regrettably unable to distill our positions on generative AI in a word, but instead, we’ve tried to express the nuanced implications of its development and usage throughout this book. To do this, we first build an understanding of how LLMs are trained, the data they are trained on, and the algorithms that contribute to their final output: text that is virtually indistinguishable from that written by a human.
These outputs, and those of other types of generative models, have many beneficial and malicious uses alike. Their capabilities are unlike any systems we’ve seen before, but flashy performances on benchmarks such as standardized tests can obscure their severe limitations, including bias, hallucinations, and unsafe generations. Their production also raises important questions about legal rights to content, the ethics of human-AI interaction, the economics of AI-assisted work, and so much more.
While we’ve attempted to stake out our own positions in this volume, citing research papers and real-world applications, we aren’t under any illusions that these problems are solved. Many questions remain, and answering them will be an iterative process that requires a whole-of-society response. It’s therefore our hope that this guide will encourage beginners, hobbyists, and experienced professionals alike to participate in the public conversation about generative AI. The field is still dominated by too few voices, leading to narrow conversations that neglect the perspectives of marginalized groups, wage workers, artists and creators, and myriad other cohorts affected by AI. An informed public is our greatest asset toward creating the future that we want with generative AI. We hope that you’ll join us in the effort to shape a world where AI helps rather than supplants people and the central focus remains on the human experience.
Acknowledgments
6. Accelerating productivity: Machine-augmented work
Using LLMs in the professional space
LLMs assisting doctors with administrative tasks
LLMs for legal research, discovery, and documentation
LLMs augmenting financial investing and bank customer service
LLMs as collaborators in creativity
LLMs as a programming sidekick
LLMs in daily life
Generative AI’s footprint on education
Detecting AI-generated text
How LLMs affect jobs and the economy
7. Making social connections with chatbots
Chatbots for social interaction
Why humans are turning to chatbots for relationship
The loneliness epidemic
Emotional attachment theory and chatbots
The good and bad of human-chatbot relationships
Charting a path for beneficial chatbot interaction
8. What’s next for AI and LLMs
Where are LLM developments headed?
Language: The universal interface
LLM agents unlock new possibilities
The personalization wave
Social and technical risks of LLMs
Data inputs and outputs
Data privacy
Adversarial attacks
Misuse
How society is affected
Using LLMs responsibly: Best practices
Curating datasets and standardizing documentation
Protecting data privacy
Explainability, transparency, and bias
Model training strategies for safety
Enhanced detection
Boundaries for user engagement and metrics
Humans in the loop
AI regulations: An ethics perspective
North America overview
EU overview
China overview
Corporate self-governance
Toward an AI governance framework
Broadening the horizon: Exploratory topics in AI
The quest for artificial general intelligence
AI sentience and consciousness?
How LLMs affect the environment
The game changer: Open source community
References
Index
We would like to express our heartfelt appreciation to Sahar Massachi, whose insightful and thought-provoking foreword sets the tone for this book. Your passion and commitment to integrity work inspires us, and your contribution to this project has made it all the more meaningful.
In addition, this book would not have been possible without the kind help and support of many of our friends and colleagues. In no particular order, we would like to thank David Sullivan, Erin McAuliffe, Natalija Bitiukova, Dr. Daniel Rogers, Edgar Markevicius, Sam Plank, Derek Slater, Dr. Steve Kramer, Ryan Williams, Bryan Jones, Dr. Faiz Jiwani, Reed Coke, Whitney Nelson, Rahim Makani, Alice Hunsberger, Karan Lala, Rebecca Ruppel, Michael Wharton, Dr. Atish Agarwala, Ron Green, Dr. Kenneth R. Fleischmann, and Stephen Straus. All of these people provided valuable feedback and diverse perspectives that helped shape the ideas presented in these pages.
Finally, we’d like to thank you, our reader. Thank you for picking this book off the bookshelf or purchasing it online. Thank you for reading about the nuanced implications of generative AI technology and contemplating how to balance innovation with responsibility. Thank you for participating in public dialogue about generative AI and encouraging others to do the same. Thank you for taking the ideas or lessons you may learn here and elsewhere to your colleagues and friends. Thank you for helping us get to a society that is informed and considerate about generative AI.
About this book
ChatGPT’s release on November 30, 2022, both captivated the imagination of millions of users and prompted caution from longtime tech observers about the dialogue agent’s shortcomings. In this book, we cover generative artificial intelligence at a high level with an emphasis on large language models (LLMs). We discuss the breakthrough of generative models, how generative models work, and both the promise and the risks that the technology poses. We also dive into the broader ethical, societal, and legal implications of this transformative technology. Finally, we recommend best practices for responsibly training and using LLMs based on our combined experience in building responsible technology, data security, and privacy. The book navigates the delicate and nuanced balance between the immense potential of generative AI technology and the need for responsible AI systems.
Who should read this book
We are hopeful that this book will not only be a resource for machine learning professionals but also for the general public. We can all play a role in mitigating risks from generative models while benefiting from and enjoying technological progress.
How this book is organized: A road map
In the chapters of this book, we frequently use the terms dialogue agent, chatbot, conversational agent, or conversational system interchangeably to refer to an AI system that is powered by a large language model (unless otherwise specified) and trained to engage in conversation with users. Here’s a brief description of what you’ll see in each chapter:
- Chapter 1 provides an introduction to large language models (LLMs). The chapter outlines how LLMs came to such preeminence in the field of NLP, their applications, and their limitations. It also briefly discusses notable conversational LLM models that were released in late 2022 and early 2023.
- Chapter 2 takes a deep dive into how LLMs are trained. This chapter discusses how characteristics inherent to the training of LLMs create both unique capabilities and potential vulnerabilities.
- Chapter 3 addresses mitigations for vulnerabilities that arise from training data. This chapter includes strategies for controlling unsafe generations and discusses data privacy considerations and regulations.
- Chapter 5 describes several types of misuse of LLMs, both purposeful malicious use and unintentional misuse. This chapter also provides recommendations to mitigate both intentional and accidental misuse through a combination of technical systems and user education.
- Chapter 6 illustrates the use of LLMs in personal, professional, and educational settings. The chapter also explores the detection of machine-generated content and considers the possible shifts that this technology will cause in education and the economy.
- Chapter 7 gives examples of LLMs used as social chatbots where the primary purpose is to build social connections with users. The chapter discusses the potential risks for human connection and provides recommendations for human-chatbot interaction.
- Chapter 8 highlights the risks and promises of LLMs introduced throughout the book and connects these ideas together. The chapter also identifies forthcoming areas of LLM development, covers the AI legal landscape, and suggests paths forward for a better, equitable future.
- Chapter 9 is an appendix of sorts, which serves as a valuable extension of the book with complementary topics. This chapter discusses artificial general intelligence (AGI) and AI sentience, the environmental impacts of LLMs, and the open source community.
This book should be read in the order it’s written as it builds on the ideas introduced in the previous chapters. In this book, chapter 8 serves as the conclusory chapter while chapter 9 discusses ideas that are supplemental to the concepts introduced in the first eight chapters.
liveBook discussion forums
If you’re interested in learning more about any particular ideas or concepts introduced in this book, we reference several research studies, books, and articles throughout—we hope that these will serve as valuable supplementary material.
Maggie Engler is an engineer and researcher currently working on safety for LLMs. She focuses on applying data science and machine learning to abuses in the online ecosystem and is a domain expert in cybersecurity and trust and safety. Maggie has built machine learning systems for malware and fraud detection, content moderation, and risk assessment. She has advised startups and nonprofits on data infrastructure and privacy, as well as conducted technical due diligence for venture capital firms. She is also a committed educator and communicator, teaching as an adjunct instructor at the University of Texas at Austin School of Information. Maggie is deeply invested in technology policy, and she works with civil society groups to advocate for responsible AI and data governance. She holds bachelor’s and master’s degrees in electrical engineering from Stanford University.