Applied Generative AI for Beginners: Practical Knowledge on Diffusion Models, ChatGPT, and Other LLMs

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This book provides a deep dive into the world of generative AI, covering everything from the basics of neural networks to the intricacies of large language models like ChatGPT and Google Bard. It serves as a one-stop resource for anyone interested in understanding and applying this transformative technology and is particularly aimed at those just getting started with generative AI.

Applied Generative AI for Beginners is structured around detailed chapters that will guide you from foundational knowledge to practical implementation. It starts with an introduction to generative AI and its current landscape, followed by an exploration of how the evolution of neural networks led to the development of large language models. The book then delves into specific architectures like ChatGPT and Google Bard, offering hands-on demonstrations for implementation using tools like Sklearn. You’ll also gain insight into the strategic aspects of implementing generative AI in an enterprise setting, with the authors covering crucial topics such as LLMOps, technology stack selection, and in-context learning. The latter part of the book explores generative AI for images and provides industry-specific use cases, making it a comprehensive guide for practical application in various domains.

Whether you're a data scientist looking to implement advanced models, a business leader aiming to leverage AI for enterprise growth, or an academic interested in cutting-edge advancements, this book offers a concise yet thorough guide to mastering generative AI, balancing theoretical knowledge with practical insights.

What You Will Learn

  • Gain a solid understanding of generative AI, starting from the basics of neural networks and progressing to complex architectures like ChatGPT and Google Bard
  • Implement large language models using Sklearn, complete with code examples and best practices for real-world application
  • Learn how to integrate LLM’s in enterprises, including aspects like LLMOps and technology stack selection
  • Understand how generative AI can be applied across various industries, from healthcare and marketing to legal compliance through detailed use cases and actionable insights

Who This Book Is For

Data scientists, AI practitioners, Researchers and software engineers interested in generative AI and LLMs.

Author(s): Akshay Kulkarni; Adarsha Shivananda; Anoosh Kulkarni; Dilip Gudivada
Edition: 1
Publisher: Apress
Year: 2023

Language: English
Commentary: Publisher ePUB | Published: 22 November 2023
Pages: xvi, 212
City: Berkeley, CA
Tags: Artificial Intelligence; Machine Learning; ChatGPT; Natural Language Programming; Generative AI; Python; Responsible AI; Data Engineering

Table of Contents
About the Authors
About the Technical Reviewer
Introduction
Chapter 1: Introduction to Generative AI
So, What Is Generative AI?
Components of AI
Domains of Generative AI
Text Generation
Image Generation
Audio Generation
Video Generation
Generating Images
Generating Text
Generative AI: Current Players and Their Models
Generative AI Applications
Conclusion
Chapter 2: Evolution of Neural Networks to Large Language Models
Natural Language Processing
Tokenization
N-grams
Language Representation and Embeddings
Word2Vec
GloVe (Global Vectors for Word Representation)
Probabilistic Models
Neural Network–Based Language Models
Recurrent Neural Networks (RNNs)
Long Short-Term Memory (LSTM)
Gated Recurrent Unit (GRU)
Encoder-Decoder Networks
Sequence-to-Sequence Models
Encoder
Decoder
Attention Mechanism
Training Sequence-to-Sequence Models
Challenges of Sequence-to-Sequence Models
Transformer
Large Language Models (LLMs)
Conclusion
Chapter 3: LLMs and Transformers
The Power of Language Models
Transformer Architecture
Motivation for Transformer
Architecture
Encoder-Decoder Architecture
Encoder
Decoder
Attention
Inputs
Calculating Attention Scores
Calculating Attention Weights
Weighted Sum
Scaled Dot-Product Attention
Input and Matrices
Dot Product and Scaling
Softmax and Attention Weights
Matrix Formulation and Efficiency
Multi-Head Attention
Input and Linear Projections
Multiple Attention Heads
Scaled Dot-Product Attention per Head
Concatenation and Linear Projection
Model’s Flexibility
Position-wise Feed-Forward Networks
Position Encoding
Interpretation
Advantages and Limitations of Transformer Architecture
Advantages
Limitations
Conclusion
Chapter 4: The ChatGPT Architecture: An In-Depth Exploration of OpenAI’s Conversational Language Model
The Evolution of GPT Models
The Transformer Architecture: A Recap
Architecture of ChatGPT
Pre-training and Fine-Tuning in ChatGPT
Pre-training: Learning Language Patterns
Fine-Tuning: Adapting to Specific Tasks
Continuous Learning and Iterative Improvement
Contextual Embeddings in ChatGPT
Response Generation in ChatGPT
Handling Biases and Ethical Considerations
Addressing Biases in Language Models
OpenAI’s Efforts to Mitigate Biases
Strengths and Limitations
Strengths of ChatGPT
Limitations of ChatGPT
Conclusion
Chapter 5: Google Bard and Beyond
The Transformer Architecture
Elevating Transformer: The Genius of Google Bard
Google Bard’s Text and Code Fusion
Self-Supervised Learning
Strengths and Weaknesses of Google Bard
Strengths
Weaknesses
Difference Between ChatGPT and Google Bard
Claude 2
Key Features of Claude 2
Comparing Claude 2 to Other AI Chatbots
The Human-Centered Design Philosophy of Claude
Exploring Claude’s AI Conversation Proficiencies
Constitutional AI
Claude 2 vs. GPT 3.5
Other Large Language Models
Falcon AI
LLaMa 2
Dolly 2
Conclusion
Chapter 6: Implement LLMs Using Sklearn
Install Scikit-LLM and Setup
Obtain an OpenAI API Key
Zero-Shot GPTClassifier
What If You Find Yourself Without Labeled Data?
Multilabel Zero-Shot Text Classification
Implementation
What If You Find Yourself Without Labeled Data?
Implementation
Text Vectorization
Implementation
Text Summarization
Implementation
Conclusion
Chapter 7: LLMs for Enterprise and LLMOps
Private Generalized LLM API
Design Strategy to Enable LLMs for Enterprise: In-Context Learning
Data Preprocessing/Embedding
Prompt Construction/Retrieval
Fine-Tuning
Technology Stack
Gen AI/LLM Testbed
Data Sources
Data Processing
Leveraging Embeddings for Enterprise LLMs
Vector Databases: Accelerating Enterprise LLMs with Semantic Search
LLM APIs: Empowering Enterprise Language Capabilities
LLMOps
What Is LLMOps?
Why LLMOps?
What Is an LLMOps Platform?
Technology Components LLMOps
Monitoring Generative AI Models
Proprietary Generative AI Models
Open Source Models with Permissive Licenses
Playground for Model Selection
Evaluation Metrics
Validating LLM Outputs
Challenges Faced When Deploying LLMs
Implementation
Using the OpenAI API with Python
Using the OpenAI API with Python
Prerequisites
Installation
Initializing the Environment and Setting API Key
Test the Environment
Data Preparation: Loading PDF Data
Embeddings and VectorDB Using LangChain and Chroma
Utilizing OpenAI API
Leveraging Azure OpenAI Service
Conclusion
Chapter 8: Diffusion Model and Generative AI for Images
Variational Autoencoders (VAEs)
Generative Adversarial Networks (GANs)
Diffusion Models
Types of Diffusion Models
Architecture
The Technology Behind DALL-E 2
Top Part: CLIP Training Process
Bottom Part: Text-to-Image Generation Process
The Technology Behind Stable Diffusion
Latent Diffusion Model (LDM)
Benefits and Significance
The Technology Behind Midjourney
Generative Adversarial Networks (GANs)
Text-to-Image Synthesis with GANs
Conditional GANs
Training Process
Loss Functions and Optimization
Attention Mechanisms
Data Augmentation and Preprocessing
Benefits and Applications
Comparison Between DALL-E 2, Stable Diffusion, and Midjourney
Applications
Conclusion
Chapter 9: ChatGPT Use Cases
Business and Customer Service
Content Creation and Marketing
Software Development and Tech Support
Data Entry and Analysis
Healthcare and Medical Information
Market Research and Analysis
Creative Writing and Storytelling
Education and Learning
Legal and Compliance
HR and Recruitment
Personal Assistant and Productivity
Examples
Conclusion
Index