Preface xix
Part 1: Introduction 1
1 Introduction: Overview of Generative AI and Multifaceted Applications, Significance, and Potential of LLMs 3
K. Mukheja, S. Mittal, C. Monga and S. Annam
1.1 Introduction to Generative AI and LLM 4
1.2 Applications of Generative AI 6
1.2.1 Medical 6
1.2.2 Education 7
1.2.3 Finance 7
1.3 Detail Case Study-Rise of Chatbots 9
1.3.1 Empowering Chatbots with Large Language Models 10
1.3.2 Chatbots in Medical and Healthcare Education 10
1.3.3 Chatbots in Finance 11
1.3.4 Chatbots in Tourism 11
1.4 Examples 12
1.5 Comparative Analysis of Generative AI Techniques 14
1.6 Future Scope and Potential 16
1.7 Conclusion 17
References 17
2 A Comprehensive Study of Large Language Models 21
Pawan Kumar, Anu Chaudhary, Shashank Sahu, Mradul Kumar Jain and Updesh Kumar Jaiswal
2.1 Introduction 22
2.2 Background 24
2.2.1 Tokenization 24
2.2.2 Positions Encoding 24
2.2.3 Attention in LLM 25
2.2.4 Activation Function 26
2.2.5 Data Preprocessing 26
2.2.6 Architecture Model 27
2.2.7 Pre-Training 28
2.2.8 Fine-Tuning 29
2.3 Large Language Models (LLMs) 31
2.3.1 BERT (Bidirectional Encoder Representations Transformer) 31
2.3.1.1 BERT Architecture 31
2.3.1.2 Working of BERT Model 32
2.3.1.3 Fine-Tuning in BERT 33
2.3.1.4 BERT Applications 34
2.3.1.5 Advantages of the BERT Language Model 35
2.3.1.6 Disadvantages of the BERT Language Model 35
2.3.2 ChatGPT (Chat Generative Pre-Trained Transformer) 36
2.3.2.1 ChatGPT Architecture 36
2.3.2.2 Tokenization 38
2.3.2.3 Embeddings in ChatGPT 39
2.3.2.4 Pre-Training 39
2.3.2.5 Fine-Tuning 39
2.4 Challenges and Future Directions 40
2.5 Conclusion 40
References 41
Part 2: Generative AI Project Lifecycle 45
3 A Deep Learning Methodology with Transformers LLM to Calculate the Global Temperature Difference in Recent Years 47
Ana Carolina Borges Monteiro, Reinaldo Padilha Franca and Rodrigo Bonacin
3.1 Introduction 48
3.2 Overview of Literature IoT 50
3.3 Overview of Literature AI 53
3.4 Methodology 56
3.5 Results 57
3.6 Discussion 61
3.7 Conclusions 63
References 64
4 Navigating the Generative AI Project Ecosystem with a Focus on Addressing Data Architecture Complexities and Strategic Model Selection for Optimal Outcomes 67
Mohammad Shabaz, Shanky Goyal, Ismail Keshta, Mukesh Soni and Vijay Kumar
4.1 Introduction 68
4.2 Literature Review 69
4.3 Proposed Method 72
4.4 Result 83
4.5 Conclusion 88
References 89
5 Generative AI Project Life Cycle-Use Case Planning and Scope Definition 93
Jyoti Rani, Pawan Kumar and Nidhi Sharma
5.1 What is Generative AI? 94
5.2 What is Artificial Intelligence? 95
5.2.1 Introduction to Generative Life Cycle 95
5.3 Generative AI on AWS 98
5.4 Why Generative AI on AWS? 99
5.5 How is Generative AI Operational? 101
5.6 Multiplicative Artificial Intelligence Interfaces 102
5.7 ChatGPT 102
5.7.1 How Does ChatGPT Work? 102
5.7.2 In What Ways is ChatGPT Being Helpful for Users? 103
5.8 What Advantages Does ChatGPT Offer? 104
5.8.1 What are ChatGPT's limitations? To What Extent is it Accurate? 105
5.9 Dall-e 106
5.9.1 How DALL-E Works 106
5.9.2 How Do You Use DALL-E? 107
5.9.3 How is DALL-E Taught? 108
5.9.4 The Prospects of ChatGPT and Generative AI 109
5.9.5 Fields that Utilize DALL-E 110
5.9.6 Advantages of Using DALL-E to Create Images 111
5.9.7 DALL-E's Effect on Image Production 112
5.9.8 Constraints with DALL-E 112
5.9.9 Examples of DALL-E's Use in the Real World 113
5.9.10 What DALL-E's Challenges Are 113
5.10 Bard 114
5.10.1 What is LaMDA? 114
5.10.2 How is Google Bard AI Used? 115
5.10.3 Google Bard AI Features 115
5.10.4 Examples and Use Cases for Google Bard AI 115
5.10.5 AI's Reach with Google Bard 116
5.10.6 Bard AI by Google vs. ChatGPT 116
5.10.7 Constraints with Google Bard AI 117
5.10.8 Important Uses of Generative AI 118
5.10.9 Creation and Manipulation of Images 118
5.11 Coding and Software 119
5.12 Making of Videos 119
5.13 Creating and Condensing Text 119
5.14 Interorganizational Cooperation 120
5.15 Enhancement of Chatbot's Performance 120
5.16 Business Exploration 121
5.17 Conclusion 121
References 122
6 Generative AI Unleashed: A Multi-Domain Journey of Successful Implementations of Large Language Models 125
Nikhil Kumar, Anurag Barthwal, Saurabh Mishra and Abhishek Jain
6.1 Introduction 126
6.1.1 Background and Motivation 126
6.1.1.1 Neural Networks and Deep Learning 127
6.1.1.2 Transformers 127
6.1.1.3 Pre-Training and Fine-Tuning 127
6.1.1.4 Scaling 127
6.1.2 Scope and Objectives 128
6.2 Literature Review 128
6.2.1 Historical Development of Generative Artificial Intelligence 129
6.2.2 Evolution of LLMs 129
6.2.3 Applications of Generative AI Across Different Domains 130
6.2.4 Challenges and Limitations in Implementing LLMs 131
6.3 Methodology 131
6.3.1 Research and Design 131
6.3.2 Methods of Data Collection 131
6.3.3 Model Selection and Training Techniques 132
6.3.4 Evaluation Measures 132
6.3.5 Ethical Considerations 132
6.4 LLM-Based Case Studies 132
6.4.1 Natural Language Generation in Healthcare 133
6.4.1.1 Case Study 1: Patient Diagnosis Support System 133
6.4.1.2 Case Study 2: Electronic Health Records Summarization 134
6.4.2 Creative Content in Media and Entertainment 134
6.4.2.1 Case Study 3: A Scriptwriting Support Tool 134
6.4.2.2 Case Study 4: Developing Virtual Characters 135
6.4.3 Language Translation and Multilingual Communication 135
6.4.3.1 Case Study 5: Multilingual Communication Platform 135
6.4.3.2 Case Study 6: Real-Time Interpretation Service 136
6.5 Results and Analysis for LLMs 136
6.5.1 Performance Evaluation of Implemented Models 136
6.5.1.1 Quantitative Metrics 137
6.5.1.2 Qualitative Analysis 139
6.5.2 Impact Assessment of LLMs Across Different Domains 139
6.5.2.1 Impact Assessment of LLMs in Healthcare 140
6.5.2.2 Impact Assessment of LLMs in Infotainment 141
6.5.2.3 Impact Assessment of LLMs in Language Translation 142
6.5.3 User Feedback and Acceptance 143
6.5.3.1 A/B Testing: Choice as a Coping Strategy 144
6.5.3.2 Surveys: Capturing Broad Feedback 144
6.5.3.3 User Interviews: Getting Into the Weeds of UX 144
6.5.4 Comparison with Existing Systems 145
6.6 Discussion 145
6.6.1 Understanding the Successful Implementation of LLMs 145
6.6.1.1 Multimodal Generative AI: Unleashing the Power of Many Data Types 146
6.6.2 Challenges and Limitations 147
6.6.3 Ethical Implications and Responsible AI Practices 148
6.6.4 Future Directions and Emerging Trends 149
6.6.4.1 LLMs: A Powerful Tool, But One That Demands Careful Consideration for Society 150
6.7 Conclusion 151
References 152
Appendix 155
Glossary 155
7 Misbehaving AI Models and AI Interaction Issues with Humans 157
Nishi Gupta and Shikha Gupta
7.1 Introduction 158
7.2 Literature Review 160
7.3 Misbehaving AI Models 162
7.3.1 Causes of Misbehaving AI Models 162
7.3.2 Consequences of Misbehaving AI Models 164
7.3.3 Mitigation Strategies That Can Be Employed to Address Misbehaving AI Models 167
7.4 Human Interaction with AI models 168
7.4.1 Human Interaction Issues with AI Models 168
7.4.2 Laws Made to Deal with Misbehaving AI Models 169
7.4.3 The Importance of Ongoing Research and Development in Addressing Misbehaving AI Models 171
7.5 Conclusion 173
References 174
8 Decoding Potential of ChatGPT: A Comprehensive Exploration of AI Generated Contents and Challenges 177
Anju Kaushik and Anil Kaushik
8.1 Introduction 178
8.2 Chapter Organization 179
8.3 ChatGPT Popularity Statistics 179
8.4 Implementation and Work Flow of ChatGPT 180
8.5 ChatGPT Key Characteristics in Present Scenario 182
8.6 Potential Challenges 186
8.7 Security Threats in ChatGPT 187
8.8 ChatGPT's Privacy Risks 189
8.9 Ethical Concern 192
8.10 Computer Ethics Challenges Raised by ChatGPT 194
8.11 Limitation of ChatGPT 195
8.12 Balance Between Human Knowledge and AI-Supported Innovation 196
8.13 Future Challenges 197
8.14 Conclusion 197
References 198
9 Economizing Large Language Model Training and Alignment with Human Values through Cost Effective Architectures and Transfer Learning Techniques 201
Mohammed Wasim Bhatt, Rubal Jeet, Mukesh Soni, Haewon Byeon and Vishal Sagar
9.1 Introduction 202
9.2 Literature Survey 203
9.3 Proposed Method 205
9.4 Results 216
9.5 Discussion 219
9.6 Conclusion 219
References 220
Part 3: In-Context Learning/Prompt Engineering 223
10 From Prompts to Performance: Innovations in Context Learning 225
Amandeep Sharma, Prince Kumar and Shashank Dhamija
10.1 The Art of Prompt Engineering: A Deep Dive 226
10.1.1 Core Definitions and Key Concepts of Prompt Engineering 226
10.1.1.1 Significance of Prompt Engineering 226
10.1.1.2 Fundamental Components of a Prompt 226
10.1.1.3 Prompt Engineering's Technical Aspects 228
10.2 Strategies for Crafting Effective Prompts 229
10.3 Techniques for Controlling the Model Behavior and Output 245
10.4 Best Practices for Prompt Engineering 246
10.4.1 Prompt Engineering Principles 247
10.4.2 Structured Procedure Behind Prompt Engineering 247
10.4.3 Prompt Engineering Use Cases and Applications 248
References 250
Part 4: LangChain Framework 253
11 Introduction to LangChain Framework 255
Deepti Goyal and Amita Gautam
11.1 Introduction of LangChain Framework 256
11.2 Large Language Model (LLM) 258
11.3 What Do You Mean by Chains in LangChain Framework 260
11.3.1 Various Types of Chains 260
11.3.1.1 LLMChain 261
11.3.1.2 Router Chain 261
11.3.1.3 Sequential Chain 262
11.4 Why LangChain Framework is Important 263
11.5 Main Components of LangChain Framework 264
11.5.1 Large Language Model (LLM) 264
11.5.2 Prompt Template 265
11.5.2.1 Indexes 265
11.5.2.2 Retriever 265
11.5.2.3 Parsers for Output 265
11.5.2.4 Vector Store 266
11.5.2.5 Agents 266
11.5.2.6 Memory 266
11.5.2.7 Chain 267
11.6 Feature of LangChain Framework 267
11.6.1 Scalability 267
11.6.2 Improved Usability 267
11.6.3 Adaptability 267
11.6.4 Extension 267
11.6.5 External Integrations 268
11.6.6 Thriving Community 268
11.6.7 Flexibility Across Zones 268
11.6.8 Integrations 268
11.6.9 Standardized Interfaces 268
11.6.10 Prompt Management and Optimization 268
11.6.11 Visualization and Experimentation 268
11.7 How to Install 269
11.7.1 Steps to Develop an Application in LangChain Framework 270
11.7.1.1 Describe the Use Case 270
11.7.1.2 Develop Functionality 270
11.7.1.3 Tailor the Functionality 270
11.7.1.4 Optimizing LLMs 270
11.7.1.5 Data Purification 270
11.7.1.6 Experimenting 271
11.7.2 Build a New Application with LangChain Framework 271
11.8 Real World Applications with LangChain Framework 272
11.8.1 LangSmith 272
11.8.2 Chatbots 272
11.8.3 Automated Blog Outlines 272
11.8.4 Integration with MongoDB Atlas 272
11.8.5 Medical Care 272
11.8.6 Help with Coding 273
11.8.7 Creating Condensed Content 273
11.9 Integration of LangChain Framework 273
11.10 Creating a Prompt in LangChain Framework 274
11.10.1 Types of LangChain Prompts 275
11.10.2 Prompt Template 275
11.10.3 Few_Shot_Prompt_Template 276
11.10.4 Chat_Prompt_Template 276
11.11 Future of LangChain Framework with AI Enabled Tools 278
11.11.1 ChatGPT and Chatbots 278
11.11.2 AI-Powered Text Categorization Tools 278
11.11.3 False References 279
11.12 Limitation of LangChain Framework 279
11.13 Alternative Technologies Apart from LangChain Framework Used in 2024 280
11.13.1 Auto-GPT: Bringing AI Agent Development to New Heights 280
11.13.2 Prompt_Chainer 281
11.13.3 Auto_Chain 282
11.13.4 AgentGPT: Unleashing the Power of Autonomous AI Agents 282
11.13.5 BabyAGI: A Glimpse Into the Future of Task-Driven AI 283
11.13.6 SimpleaiChat 283
11.13.7 GradientJ: Building LLM-Powered Applications with Ease 284
11.14 Conclusion 284
References 285
12 LangChain: Simplifying Development with Language Models 287
Sangeetha Annam, Merry Saxena, Ujjwal Kaushik and Shikha Mittal
12.1 Introduction 288
12.2 Phases and Characteristics of LLM Application 289
12.3 Components and Key Elements of LLM 290
12.4 Types and Architecture of LLM 293
12.5 Benefits and Approaches of LLM 296
12.6 Building an LLM Application 299
12.7 Use Cases 300
References 302
13 Addressing Ethical Challenges in LLMs: Bias and Misinformation 305
Pummy Dhiman and Amandeep Kaur
13.1 Introduction 305
13.2 LLM Evolution Tree 308
13.2.1 Bert 309
13.2.2 Gpt 311
13.3 Types of LLMs 313
13.4 Limitations of LLMs 314
13.5 Factors Contributing to Bias and Misinformation Generation 316
13.6 Methods to Address Bias and Misinformation 317
13.7 Conclusion 319
References 320
Part 5: LLM-Powered Applications 323
14 LegalEase: Application Development with LangChain Framework 325
Nidhi Malik, Lakshita Chhikara, Abhilakshay and Ambika Thakur
14.1 Introduction 325
14.1.1 Large Language Model 326
14.1.2 General Architecture 327
14.1.3 Examples of LLMs 329
14.1.4 Benefits 329
14.1.5 Industry Applications 330
14.2 LangChain 331
14.2.1 Key Features of LangChain 331
14.2.2 Key Components 333
14.2.3 Who Should Explore 335
14.3 Example of Application Development 335
14.3.1 Key Features 336
14.3.2 Purpose and Benefits 336
14.4 Development Steps 337
14.4.1 Libraries and Imports 337
14.4.2 Environment Setup 340
14.4.3 Data Collection 341
14.4.4 User Interface Setup 342
14.4.5 Document Summarization 343
14.4.6 Querying the Document 355
14.5 Conclusion 362
References 363
15 Unveiling the Potential of Massive Language Models in Software Engineering: Exploring Opportunities, Addressing Risks, and Comprehending Implications 365
Mitali Chugh
15.1 Introduction 366
15.2 Harnessing the Power: Abilities of Large Language Models 367
15.3 Navigating Challenges: Risks and Ethical Considerations 369
15.4 Ethical Application: Strategies and Frameworks 371
15.5 Establishing Ethical Frameworks for Accountability 372
15.6 Collaborative Standards: Industry and Research Collaboration 373
15.7 Transformative Effects: Broader Implications in Software Engineering 375
15.8 Shaping the Future: Prospective Directions of Large Language Models 377
15.9 Conclusion 378
References 379
16 Multidimensional Impacts of Generative AI and an In-Depth Analysis of LLMs with Their Expanding Horizons in Technology and Society 383
Rubal Jeet, Mohammed Wasim Bhatt, Maher Ali Rusho, Aadam Quraishi and Mahesh Manchanda
16.1 Introduction 384
16.2 Literature Review 386
16.3 Proposed Methodology 389
16.4 Results 402
16.5 Conclusion 408
References 409
Part 6: Responsible AI 413
17 Responsible AI: Ethical Considerations in Generative AI 415
Kamal Kumar and Poonam
17.1 Introduction 416
17.1.1 Defining Generative AI 416
17.1.2 Distinguishing Machine Learning Approaches 417
17.1.3 Brief History and Recent Breakthroughs 417
17.1.4 Overview of Key Generative Architectures and Techniques 420
17.1.4.1 Autoregressive Models 420
17.1.4.2 Generative Adversarial Networks (GANs) 420
17.1.4.3 VariationalAutoencoders (VAEs) 420
17.1.4.4 Diffusion Models 421
17.1.4.5 Self-Supervised, Meta and Multi-Task Learning 422
17.1.5 Promising Applications and Benefits 422
17.2 Key Ethical Considerations, Risks, and Challenges 423
17.2.1 Societal Biases and Unfair Representational Harms 423
17.2.2 Truth Manipulation and Attribution Difficulties 424
17.2.3 Violations of Consent, Privacy, and Agency 424
17.2.4 Misuse Potentials Across Fraud, Deceit, and Sabotage 424
17.2.5 Broader Societal Impacts on Economics, Culture and Psychology 425
17.3 Guiding Principles and Frameworks for Responsible Generative AI 425
17.3.1 Transparency 426
17.3.2 Justice, Fairness, and Inclusion 426
17.3.3 Non-Maleficence 426
17.3.4 Responsibility and Accountability 426
17.3.5 Privacy and Data Protection 426
17.4 Governance Strategies for Trustworthy Generative AI Innovation 427
17.4.1 AI Ethics Guidelines and Organizational Policies 427
17.4.2 Laws, Regulations, and Dynamic Governance Complexities 427
17.4.3 Technical Approaches to Fairness, Transparency and Control 427
17.4.4 Stakeholder Participation and Public Discourse Ethics 428
17.5 Recommendations for Key Generative AI Stakeholders 428
17.5.1 Guidelines for Technology Researchers and Developers 428
17.5.2 Strategies for Organizations, Platforms, and Corporations 429
17.5.3 Ethical Governance Strategies for Organizations 429
17.5.4 Policy Options for Governments and Lawmakers 429
17.5.5 Priorities for Broader Industry Governance Entities 430
17.5.6 Considerations for Civil Society Groups, Activists, and General Public 430
17.5.7 The Impact of Generative AI Like ChatGPT on Education 430
Significant Risks and Difficulties to Surmount 431
Research Priorities for the Future 431
17.6 Conclusions 432
References 433
18 From Prototyping to Deployment: Human-Centered Design Practices in Responsible AI Innovation 435
Jyoti Snehi, Manish Snehi, Isha Kansal and Vikas Khullar
18.1 Introduction 436
18.2 Literature Review 441
Overview of Human-Centered Design Principles 443
Responsible AI 447
Gaps in Existing Research 451
Methodology 452
Research Design 452
Rationale for Qualitative Approach 452
Human-Centered Design in AI Prototyping 456
Distinctions and Issues 456
User Research and Personas 456
Early-Phase Prototyping 457
Iterative Design and Feedback Loops 457
Ethical Considerations in AI Prototyping 458
Identifying Ethical Challenges 458
Incorporating Ethical Guidelines Into Prototyping 458
Case Studies of Ethical AI Prototyping 459
From Prototyping to Development 459
Transitioning From Prototype to Full Development 460
Ensuring Consistency in HCD Practices 460
Collaboration Across Multidisciplinary Teams 461
Tools and Techniques for Managing Development Phases 461
Human-Centered Design in AI Deployment 462
Challenges and Solutions 463
Common Challenges in Implementing HCD in AI 463
Solutions and Best Practices 465
Lessons Learned From Case Studies 467
Framework for Human-Centered and Responsible AI 469
18.3 Conclusion 471
References 472
19 Toward Accurate Abbreviation Disambiguation in Medical Texts: A Comparative Study of AI Models 475
A. Pandey and M. Saini
19.1 Introduction 476
19.2 Related Work 477
19.3 Datasets 479
19.4 Methodology 480
19.4.1 Data Collection 481
19.4.2 Pre-Processing 481
19.4.3 Vector Feature Extraction 482
19.4.4 Classification Model 484
19.5 Results and Discussion 488
19.6 Conclusion 491
References 491
Index 495