Home > Books

๐Ÿค–๐Ÿ—๏ธ AI Engineering: Building Applications with Foundation Models

๐Ÿ›’ AI Engineering: Building Applications with Foundation Models. As an Amazon Associate I earn from qualifying purchases.

๐Ÿ“๐Ÿ’ Human Notes

  • ๐Ÿง  2 Theories for hallucination
      1. ๐Ÿ˜ตโ€๐Ÿ’ซ Canโ€™t differentiate between data given and data generated
      • ๐Ÿ‘จโ€๐Ÿ”ฌ Ortega et. al
      • ๐Ÿคฅ self delusion
      • โ„๏ธ snowballing hallucinations based on initial wrong assumptions
      • ๐Ÿ›ก๏ธ mitigation
        • ๐Ÿ‹๏ธ reinforcement learning - differentiation about user provided prompts and tokens generated by model
        • ๐Ÿ‘จโ€๐Ÿซ supervised learning - include factual and counterfactual signals in training data
      1. ๐Ÿ™…โ€โ™‚๏ธ mismatch between model and labeler internal knowledge
      • โ“ if labelers answer questions based on facts unknown by model, models learn to hallucinate
      • ๐Ÿ“ if labelers state assumltions
    • ๐Ÿค” John Schulman believes that models know when they know something
      • โœ… verification - ask model to verify itโ€™s output
        • ๐Ÿ—ฃ๏ธ prompt mitigations
          • ๐Ÿ’ฏ answer as truthfully as possible
          • ๐Ÿคท say idk if you donโ€™t know
          • โœ๏ธ ask for concise responses
      • ๐Ÿ‹๏ธ reinforcement learning - punish hallucinations
        • ๐Ÿค– RLHF might make hallucinations worse, but humans might prefer this. ๐Ÿง‘โ€๐Ÿ’ป
  • ๐Ÿค– Prompt engineering best practices
    • โœ๏ธ write clear, explicit, unambiguous instructions
    • ๐ŸŽญ ask the model to adopt a persona
    • ๐Ÿ’ก provide examples
    • ๐Ÿ“Œ specify the ๐Ÿ“ค output format
      • ๐Ÿ“ e.g. no preambles
    • ๐ŸŒ provide sufficient context
    • ๐Ÿง  to restrict model knowledge to context
      • โ— โ€œanswer using the only provided contextโ€
      • ๐Ÿ“š cite your sources
    • ๐Ÿงฉ break complex tasks into simpler subtasks
    • ๐Ÿง  Let it think
    • ๐Ÿ”— Chain of Thought (COT)
      • ๐Ÿค” โ€œThink step by stepโ€
      • ๐Ÿ—ฃ๏ธ โ€œExplain your decisionโ€
    • ๐Ÿ”Ž Self Critique
      • โœ… โ€œCheck your workโ€
    • ๐Ÿ”„ Iterate
    • 2๏ธโƒฃ Version your prompts
    • ๐Ÿ“ Evaluate prompt engineering tools
  • ๐Ÿ“š RAG
    • ๐Ÿ”‘ Keyword vs โžก๏ธ vector search
  • ๐Ÿค– Agents
    • ๐Ÿงฐ tool use
    • ๐Ÿ—บ๏ธ planning
    • โš ๏ธ failure modes
    • โœ… evaluation
  • ๐Ÿง  Memory
    • ๐Ÿง  Model contains internal knowledge
    • ๐ŸชŸ Context window ~ โŒ› short term memory
    • ๐Ÿ’พ External storage ~ ๐Ÿ“† long term memory

๐Ÿ“š Book Report: AI Engineering: Building Applications with Foundation Models

AI Engineering: Building Applications with Foundation Models by Chip Huyen ๐Ÿ‘จโ€๐Ÿ’ป serves as a comprehensive guide to the evolving field of AI engineering. โš™๏ธ It focuses on the practical application of large-scale, pre-trained models to build real-world applications. ๐ŸŒ The book is lauded for its systematic, end-to-end approach, guiding readers from the initial idea๐Ÿ’ก to deployment and monitoring. ๐Ÿ“Š A key theme is the shift from traditional machine learning, where models are often built from scratch, to a new paradigm that leverages the power of foundation models. ๐Ÿš€ This makes AI application development more accessible and product-focused. ๐ŸŽฏ

๐Ÿ”‘ Key Topics Discussed

  • ๐Ÿง  Fundamentals of Foundation Models: The book introduces core concepts like masked language models, autoregressive language models, and self-supervision. ๐Ÿค– It explains the architecture of these models and the parameters that differentiate them. ๐Ÿงฎ The importance of data quality and quantity for training these models is also a significant point of discussion. ๐Ÿ“ˆ
  • ๐Ÿ“Š Model Evaluation: A substantial portion of the book is dedicated to evaluating different AI models. โš–๏ธ It presents various metrics and even explores using AI for the evaluation process itself, with the goal of selecting models based on objective criteria. โœ…
  • ๐Ÿ’ป AI Implementation: The text delves into practical implementation strategies. ๐Ÿ‘จโ€๐Ÿ’ป โ€œPrompt engineeringโ€ is covered as a method to influence model output without altering the model itself. ๐Ÿ—ฃ๏ธ Other techniques discussed include few-shot learning and prompt decomposition. โœ‚๏ธ
  • โš™๏ธ Fine-Tuning and Optimization: For more specialized tasks, the book explains the process of โ€œfine-tuning,โ€ which involves adjusting a modelโ€™s internal parameters to enhance its performance on a specific job. ๐ŸŽฏ It also covers dataset engineering and inference optimization to improve the efficiency of AI systems. โšก
  • ๐Ÿ—๏ธ System Architecture: The final chapters tie everything together by illustrating the architecture of an AI system. ๐Ÿงฉ Huyen explains how to integrate the various components and collect user feedback for continuous improvement. ๐Ÿ‘‚

๐ŸŽฏ Target Audience

This book is primarily aimed at a technical audience, including AI engineers, software developers, and machine learning practitioners. ๐Ÿง‘โ€๐Ÿ’ผ While the content can be challenging for those without a technical background, it provides immense value for professionals actively building AI applications. ๐Ÿ› ๏ธ The emphasis on practical application and real-world use cases makes it a valuable resource for anyone looking to move from AI prototypes to production-ready systems. ๐Ÿญ

๐Ÿ’ก Noteworthy Aspects

A distinguishing feature of this book is its intentional lack of extensive code snippets. ๐Ÿšซ The author, Chip Huyen, focuses on providing a lasting conceptual framework that transcends specific and rapidly evolving APIs and tools. ๐Ÿ› ๏ธ This approach emphasizes a product-oriented mindset in AI engineering, a perspective often overlooked in more technically focused literature. ๐Ÿ“š

๐Ÿง‘โ€๐Ÿ’ป Similar Reads (Focus on AI/ML Engineering)

๐Ÿ” Contrasting Perspectives (Broader AI Topics)

  • ๐Ÿฅ The AI Revolution in Medicine: GPT-4 and Beyond by Peter Lee, Carey Goldberg, and Isaac Kohane: This book offers a contrasting perspective by focusing on the application of large language models in a specific domain, healthcare, highlighting the unique challenges and opportunities. โš•๏ธ
  • ๐ŸŒ The Age of AI: And Our Human Future by Henry A. Kissinger, Eric Schmidt, and Daniel Huttenlocher: This work provides a high-level, strategic perspective on the societal and geopolitical implications of artificial intelligence, moving beyond the technical details of engineering. ๐ŸŒ
  • ๐Ÿค–โš ๏ธ๐Ÿ“ˆ Superintelligence: Paths, Dangers, Strategies by Nick Bostrom: This book delves into the philosophical and existential questions surrounding advanced artificial intelligence, offering a stark contrast to the practical, application-focused nature of โ€œAI Engineering.โ€ ๐Ÿคฏ

๐ŸŽจ Creative Connections (Adjacent & Inspiring Reads)

  • ๐Ÿฆโ€๐Ÿ”ฅ๐Ÿ’ป The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win by Gene Kim, Kevin Behr, and George Spafford: While a work of fiction, this bookโ€™s narrative about improving IT processes and fostering collaboration holds valuable lessons for managing complex AI engineering projects. ๐Ÿค
  • ๐Ÿค”๐Ÿ‡๐Ÿข Thinking, Fast and Slow by Daniel Kahneman: Understanding the cognitive biases and mental shortcuts inherent in human thinking can provide valuable insights for designing more effective and user-friendly AI systems. ๐Ÿ’ก
  • ๐ŸŒŸ The Master Algorithm: How the Quest for the Ultimate Learning Machine Will Remake Our World by Pedro Domingos: This book explores the different paradigms of machine learning and the quest for a single, universal learning algorithm, offering a broader context for the development of foundation models. ๐Ÿ”ญ

๐Ÿ’ฌ Gemini Prompt (gemini-2.5-pro)

Write a markdown-formatted (start headings at level H2) book report, followed by a plethora of additional similar, contrasting, and creatively related book recommendations on AI Engineering: Building Applications with Foundation Models. Be thorough in content discussed but concise and economical with your language. Structure the report with section headings and bulleted lists to avoid long blocks of text.

๐Ÿฆ Tweet