How GPT Works you own this product

'); $(document.body).append('
loading reading lists ...
'); function adjustReadingListIcon(isInReadingList){ $readingListToggle.toggleClass("fa-plus", !isInReadingList); $readingListToggle.toggleClass("fa-check", isInReadingList); var tooltipMessage = isInReadingList ? "edit in reading lists" : "add to reading list"; $readingListToggle.attr("title", tooltipMessage); $readingListToggle.attr("data-original-title", tooltipMessage); } $.ajax({ url: "/readingList/isInReadingList", data: { productId: 3208 } }).done(function (data) { adjustReadingListIcon(data && data.hasProductInReadingList); }).catch(function(e){ console.log(e); adjustReadingListIcon(false); }); $readingListToggle.on("click", function(){ if(codePromise == null){ showToast() } loadCode().then(function(store){ store.requestReadingListSpecificationForProduct({ id: window.readingListsServerVars.externalId, manningId: window.readingListsServerVars.productId, title: window.readingListsServerVars.title }); ReadingLists.ReactDOM.render( ReadingLists.React.createElement(ReadingLists.ManningOnlineReadingListModal, { store: store, }), document.getElementById("reading-lists-modal") ); }).catch(function(e){ console.log("Error loading code reading list code"); }); }); var codePromise var readingListStore function loadCode(){ if(codePromise) { return codePromise } return codePromise = new Promise(function (resolve, reject){ $.getScript(window.readingListsServerVars.libraryLocation).done(function(){ hideToast() readingListStore = new ReadingLists.ReadingListStore( new ReadingLists.ReadingListProvider( new ReadingLists.ReadingListWebProvider( ReadingLists.SourceApp.marketplace, getDeploymentType() ) ) ); readingListStore.onReadingListChange(handleChange); readingListStore.onReadingListModalChange(handleChange); resolve(readingListStore); }).catch(function(){ hideToast(); console.log("Error downloading reading lists source"); $readingListToggle.css("display", "none"); reject(); }); }); } function handleChange(){ if(readingListStore != null) { adjustReadingListIcon(readingListStore.isInAtLeastOneReadingList({ id: window.readingListsServerVars.externalId, manningId: window.readingListsServerVars.productId })); } } var $readingListToast = $("#reading-list-toast"); function showToast(){ $readingListToast.css("display", "flex"); setTimeout(function(){ $readingListToast.addClass("shown"); }, 16); } function hideToast(){ $readingListToast.removeClass("shown"); setTimeout(function(){ $readingListToast.css("display", "none"); }, 150); } function getDeploymentType(){ switch(window.readingListsServerVars.deploymentType){ case "development": case "test": return ReadingLists.DeploymentType.dev; case "qa": return ReadingLists.DeploymentType.qa; case "production": return ReadingLists.DeploymentType.prod; case "docker": return ReadingLists.DeploymentType.docker; default: console.error("Unknown deployment environment, defaulting to production"); return ReadingLists.DeploymentType.prod; } } }); } });
Edward Raff, Drew Farris and Stella Biderman for Booz Allen Hamilton
  • MEAP began March 2024
  • Publication in Summer 2025 (estimated)
  • ISBN 9781633437081
  • 200 pages (estimated)
  • printed in black & white

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Look inside
Learn how large language models like GPT and Gemini work under the hood in plain English.

How GPT Works translates years of expert research on Large Language Models into a readable, focused introduction to working with these amazing systems. It explains clearly how LLMs function, introduces the optimization techniques to fine tune them, and shows how to create pipelines and processes to ensure your AI applications are efficient and error-free.

In How GPT Works you will learn how to:

  • Test and evaluate LLMs
  • Use human feedback, supervised fine tuning, and Retrieval augmented generation (RAG)
  • Reducing the risk of bad outputs, high-stakes errors, and automation bias
  • Human-computer interaction systems
  • Combine LLMs with traditional ML

How GPT Works is written by some of the best machine learning researchers at Booz Allen Hamilton, including researcher Stella Biderman, Director of AI/ML Research Drew Farris, and Director of Emerging AI Edward Raff. In clear and simple terms, these experts lay out the foundational concepts of LLMs, the technology’s opportunities and limitations, and best practices for incorporating AI into your organization.

about the book

How GPT Works is an introduction to LLMs that explores OpenAI’s GPT models. The book takes you inside ChatGPT, showing how a prompt becomes text output. In clear, plain language, this illuminating book shows you when and why LLMs make errors, and how you can account for inaccuracies in your AI solutions. Once you know how LLMs work, you’ll be ready to start exploring the bigger questions of AI, such as how LLMs “think” differently that humans, how to best design LLM-powered systems that work well with human operators, and what ethical, legal, and security issues can—and will—arise from AI automation.

about the reader

Includes examples in Python. No knowledge of ML or AI systems is required.

about the authors

Edward Raff is a Director of Emerging AI at Booz Allen Hamilton, where he leads the machine learning research team. He has worked in healthcare, natural language processing, computer vision, and cyber security, among fundamental AI/ML research. The author of Inside Deep Learning Dr. Raff has over 100 published research articles at the top artificial intelligence conferences. He is the author of the Java Statistical Analysis Tool library, a Senior Member of the Association for the Advancement of Artificial Intelligence, and twice chaired the Conference on Applied Machine Learning and Information Technology and the AI for Cyber Security workshop. Dr. Raff's work has been deployed and used by anti-virus companies all over the world.

Drew Farris is a Director of AI/ML Research at Booz Allen Hamilton. He works with clients to build information retrieval, machine learning and large scale data management systems and has co-authored Booz Allen's Field Guide to Data Science, Machine Intelligence Primer and Manning Publications' Taming Text, the 2013 Jolt Award-winning book on computational text processing. He is a member of the Apache Software Foundation and has contributed to a number of open source projects including Apache Accumulo, Lucene, Mahout and Solr.

Stella Biderman is a machine learning researcher at Booz Allen Hamilton and the executive director of the non-profit research center EleutherAI. She is a leading advocate for open source artificial intelligence and has trained many of the world's most powerful open source artificial intelligence algorithms. She has a master's degree in computer science from the Georgia Institute of Technology and degrees in Mathematics and Philosophy from the University of Chicago.

choose your plan

team

monthly
annual
$49.99
$399.99
only $33.33 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • How GPT Works ebook for free

choose your plan

team

monthly
annual
$49.99
$399.99
only $33.33 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • How GPT Works ebook for free

You can see this entire book for free. Click anywhere in the table of contents to start reading detailed TOC'; var tocServerVars = { productId: 3208, getTocUrl: "/ajax/getTocHtml" } var tocStatusResolved = false; $(document).ready(loadTocIfVisible); function loadTocIfVisible(){ if(tocStatusResolved) { return; } if($('.toc-loading-container').isInViewport()){ window.removeEventListener("scroll", loadTocIfVisible); $(window).off("scroll", loadTocIfVisible); loadToc(); } } try { window.addEventListener("scroll", loadTocIfVisible, { passive: true}); } catch(e){ $(window).on("scroll", loadTocIfVisible); } function loadToc(){ tocStatusResolved = true; window.TocProvider.getToc(function (tocHtml) { var $tocLoadingContainer = $('.toc-loading-container'); $tocLoadingContainer.closest(".table-of-contents").prepend(titleHtml); $tocLoadingContainer.replaceWith(tocHtml); initializeToc(); }, function(){ $('.toc-loading-container').remove() }); } window.TocProvider = { toc: "", getToc: function(success, failure){ if(this.toc) { success && success(this.toc); return; } $.ajax({ url: tocServerVars.getTocUrl, data: { id: tocServerVars.productId } }).done(function(data){ if(data && data.tocHtml){ this.toc = data.tocHtml; success && success(this.toc); } else { failure && failure(); } }).fail(function(error){ failure && failure(); }); } }; } catch (e) {} })(); function initializeToc(){ // Append this only when children of their sectionbody siblings exist (appendices generally aren't expandable) $(".sectionbody *").children("*").parents(".sectionbody").siblings("h2").wrapInner("").append(controllo); $(".toc h2 > .chap-link, .toc h1, .toc h3, .toc h4").each(function() { $(this).html($(this).html().replace(/^(\b\w[0-9A-Z]{0,1}\b\.?)+\s/gi, "$&")); }); $(".sectionbody").addClass("hidden-toc"); $("body").on("click", ".toc-expando", function(e) { e.stopPropagation(); $(this).removeClass("toc-expando").addClass("toc-retracto").closest(".sect1").find(".sectionbody").removeClass("hidden-toc").addClass("shown-toc"); }); $("body").on("click", ".toc-retracto", function(e) { e.stopPropagation(); $(this).removeClass("toc-retracto").addClass("toc-expando").closest(".sect1").find(".sectionbody").removeClass("shown-toc").addClass("hidden-toc"); }); $("body").on("click", ".available h2", function() { $(this).find(".toc-controllo").click(); }); $("body").on("click", "#show-hide", function() { if ($("#show-hide").hasClass("hide-full-toc")) { $(".table-of-contents .sect2, .table-of-contents .sect3").removeClass("shown-toc").addClass("hidden-toc"); $("#show-hide").removeClass("hide-full-toc").html(" detailed TOC"); $(".table-of-contents .body").removeClass("full-toc"); $(".toc-retracto").click(); } else { $(".table-of-contents .sect2, .table-of-contents .sect3").addClass("shown-toc").removeClass("hidden-toc"); $("#show-hide").addClass("hide-full-toc").html(" detailed TOC"); $(".table-of-contents .body").addClass("full-toc"); $(".toc-expando").click(); } }); var wrapTocWithLink = function(tocElement, livebookUrl, chapterNumber) { var urlParams = "?origin=product-toc"; $(tocElement).children(".chap-link").wrap(""); if (!$(tocElement).children().length) { $(tocElement).html("" + $(tocElement).text() + ""); } $(tocElement).parent().prepend('Read in liveBook'); $(tocElement).parent().children("div[class*='sectionbody']").each(function(j, sectionsParent) { $(sectionsParent).children().each(function(k, sectionParent) { $(sectionParent).children("h3").each(function(l, section) { //wrap section in an a tag linking to livebook section k + 1 var sectionUrl = livebookUrl + "/section-" + chapterNumber + "-" + (k + 1); $(section).wrap(""); }); $(sectionParent).children("div[class='sect3']").each(function(m, subsectionParent) { $(subsectionParent).children("h4").each(function(n, subsection) { //wrap section in an a tag linking to livebook subsection m + 1 var subsectionUrl = livebookUrl + "/section-" + chapterNumber + "-" + (k + 1) + "-" + (m + 1); $(subsection).wrap(""); }); }); }); }); }; var $availableChapters = $("h2[id*='chapter_id_']").filter(function(i, chapter) { return $(chapter).parent().hasClass('available'); }); // All elements containing an '_' filtering out those starting by chapter_id_ and not having their parent the class available. var $availableNonChapterElements = $("h2[id*='_']").filter(function(i, element) { return !element.id.match(/^chapter_id_/) && $(element).parent().hasClass('available'); }); $availableChapters.each(function(i, chapter) { var chapterNumber = chapter.id.split(/_/).pop(); var livebookUrl = "https://livebook.manning.com/book/how-gpt-works/chapter-" + chapterNumber; wrapTocWithLink(chapter, livebookUrl, chapterNumber); }); var isSingleAppendix = $("h2[id*='_']").filter(function(i, element) { return !element.id.match(/^chapter_id_/) ; }).length === 1; $availableNonChapterElements.each(function(i, appendix) { var appendixGroups = appendix.textContent.match(/[aA]ppendix (\w)/); // i.e "Appendix A: Installation => ['Appendix A', 'A', index:0, input: 'Appendix A: Installation'] var section = isSingleAppendix ? 'a' : appendixGroups && appendixGroups.length === 2 && appendixGroups[1].toLowerCase(); var appendixPathName = isSingleAppendix ? 'appendix' : 'appendix-' + section; var livebookUrl = "https://livebook.manning.com/book/how-gpt-works/" + appendixPathName; wrapTocWithLink(appendix, livebookUrl, section); }); var $availableMiscElements = $("h2[id='foreword'], h2[id='preface'], h2[id='epilogue']").filter(function(i, element) { return $(element).parent().hasClass('available'); }); $availableMiscElements.each(function(i, miscElement){ var livebookUrl = "https://livebook.manning.com/book/how-gpt-works/" + $(miscElement).attr("id"); wrapTocWithLink(miscElement, livebookUrl, ""); }); $(".available h2, .available h3").attr("data-toggle", "tooltip"); $(".available h2, .available h3").attr("data-placement", "left"); $(".available h2, .available h3").attr("title", "Available"); $('[data-toggle="tooltip"]').tooltip(); } var addToWishlistUrl = "/wishList/addItemFromPage" + "?"; var removeFromWishlistUrl = "/wishList/removeItemFromPage" + "?"; $("body").on("click", ".wishlist-login", function() { localStorage.removeItem('dynamicloadcache'); }); $("body").on("click", ".wishlist-toggle.wishlist-add, .wishlist-toggle.wishlist-remove", function() { var productId = $(this).data("product-id"); var url = addToWishlistUrl; if ($(this).hasClass("wishlist-remove")) { url = removeFromWishlistUrl; $(".wishlist-container").removeClass("on-wishlist"); } else { $(".wishlist-container").addClass("on-wishlist"); } $.ajax({ type: "GET", url: url + "id=" + productId, timeout: 3000, dataType: "json", headers: { 'accept': "application/json" } }); }); $(document).trigger('activity-product-browse', {productId: '3208'}); })(jQuery); }

RECENTLY VIEWED