Praise for GPT-3
This book is a perfect starting point for practitioners and developers who want to understand the GPT-3 language model and learn how to build applications on the OpenAI API.
Peter Welinder, VP, Product and Partnerships, OpenAI
What is instantly compelling about this book is that a wide variety of technical backgrounds can read it and create world-class solutions using AI.
Noah Gift, Executive in Residence, Duke University, and Founder of Pragmatic AI Labs
If youre looking to use GPT-3 or any large language model to build your app or service, this book has everything you need. It dives deep into GPT-3 and its use cases will help you apply this knowledge to your product.
Daniel Erickson, Founder and CEO, Viable
The authors did a remarkable job of providing a deeper understanding of the technical and societal impact of GPT-3. After reading this book, you will feel confident discussing the state of art in artificial intelligence.
Bram Adams, OpenAI Developer Ambassador and Founder of Stenography
The book is awesome for beginners! It even has memes and includes a very necessary chapter on AI and ethics, but its real strength is the step-by-step procedures to work with GPT-3.
Ricardo Joseh Lima, Professor of Linguistics, Universidade do Estado do, Rio de Janeiro
A comprehensive deep dive into one of the keystone generative models in natural language processing, with a practical focus on how to use the OpenAI API and integrate it into your own applications. Beyond its technical value, I consider the perspectives provided in the last chapters regarding biases, privacy, and its role in the democratization of AI particularly insightful.
Raul Ramos-Pollan, Professor of AI, Universidad de Antioquia in Medelln, Colombia
GPT-3
by Sandra Kublik and Shubham Saboo
Copyright 2022 Sandra Kublik and Shubham Saboo. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.
- Acquisitions Editor: Nicole Butterfield
- Development Editor: Sarah Grey
- Production Editor: Elizabeth Faerm
- Copyeditor: Penelope Perkins
- Proofreader: Piper Editorial Consulting, LLC
- Indexer: nSight, Inc.
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Kate Dullea
Revision History for the First Edition
- 2022-07-08: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781098113629 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. GPT-3, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the authors and do not represent the publishers views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-098-11362-9
[LSI]
Dedication
From Sandra
To Rui,
For the endless encouragement and support.
From Shubham
To my mother, Gayatri,
Who never stopped believing in me.
Preface
GPT-3, or Generative Pre-trained Transformer 3, is a transformer-based large language model developed by OpenAI. It consists of a staggering 175 billion parameters. Anyone can access this large language model via the OpenAI API, a simple-to-use text-in, text-out user interface, without any technical prerequisites. This is the first time in history that an AI model as big as GPT-3 has been remotely hosted and made available to the general public with a simple API call. This new mode of access is called model-as-a-service. Because of this unprecedented access, many people, including the authors of this book, see GPT-3 as a first step toward democratizing artificial intelligence (AI).
With the introduction of GPT-3, it is easier than ever before to build AI applications. This book will show you how easy it is to get started with the OpenAI API. Also, well introduce you to innovative ways to leverage this tool for your use case. Well look at successful start-ups built on top of GPT-3 and corporations leveraging it in their product landscape, and examine problems and potential future trends in its development.
This book is intended for people from all backgrounds, not just technical professionals. It should be useful to you if you are:
A data professional looking to gain skills in AI
An entrepreneur who wants to build the next big thing in the AI space
A corporate leader who wants to upgrade their AI knowledge and use it to drive key decisions
A writer, podcaster, social media manager, or other language-based creator working with language who wants to leverage GPT-3s language capabilities for creative purposes
Anyone with an AI-based idea that once seemed technically impossible or too expensive to develop
The first part of the book covers the foundations of the OpenAI API. In the second part of the book, we explore the colorful ecosystem that has organically evolved around GPT-3.
provides a simple and fun recipe for your first GPT-3-powered application.
Then, moving the focus to the exciting AI ecosystem, in , we look to the future, walking you through the most exciting trends and possibilities arising as GPT-3 settles into the wider commercial ecosystem.
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Tip
This element signifies a tip or suggestion.
Note
This element signifies a general note.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://oreil.ly/gpt3-repo.
If you have a technical question or a problem using the code examples, please send email to .
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.