The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── LICENSE.md
├── README.md
├── free_courses
    ├── Applied_LLMs_Mastery_2024
    │   ├── README.MD
    │   ├── img
    │   │   ├── Blue_and_Grey_Illustrative_Creative_Mind_Map.png
    │   │   ├── Name.png
    │   │   ├── PEFT_(1).pdf
    │   │   ├── RAG.png
    │   │   ├── RAG_1.png
    │   │   ├── RAG_2.png
    │   │   ├── RAG_3.png
    │   │   ├── RAG_w1.png
    │   │   ├── Screenshot_2024-01-09_at_9.48.57_PM.png
    │   │   ├── Screenshot_2024-01-14_at_3.50.46_PM.png
    │   │   ├── Screenshot_2024-01-14_at_3.53.32_PM.png
    │   │   ├── Screenshot_2024-01-27_at_1.37.28_PM.png
    │   │   ├── Screenshot_2024-01-28_at_1.23.33_PM.png
    │   │   ├── Screenshot_2024-01-28_at_1.33.40_PM.png
    │   │   ├── Screenshot_2024-01-28_at_1.34.09_PM.png
    │   │   ├── Screenshot_2024-01-28_at_2.00.23_PM.png
    │   │   ├── Screenshot_2024-02-16_at_3.21.36_PM.png
    │   │   ├── Screenshot_2024-02-16_at_4.11.44_PM.png
    │   │   ├── Screenshot_2024-02-17_at_3.39.35_PM.png
    │   │   ├── Screenshot_2024-02-17_at_3.52.00_PM.png
    │   │   ├── Screenshot_2024-02-17_at_4.00.44_PM.png
    │   │   ├── Screenshot_2024-02-17_at_4.23.14_PM.png
    │   │   ├── Screenshot_2024-02-18_at_3.09.34_PM.png
    │   │   ├── Screenshot_2024-02-18_at_3.18.49_PM.png
    │   │   ├── Screenshot_2024-02-18_at_3.46.23_PM.png
    │   │   ├── Screenshot_2024-02-23_at_10.24.38_AM.png
    │   │   ├── Screenshot_2024-02-23_at_10.32.53_AM.png
    │   │   ├── Screenshot_2024-02-23_at_10.33.00_AM.png
    │   │   ├── Screenshot_2024-02-24_at_2.19.47_PM.png
    │   │   ├── business_cases.png
    │   │   ├── challenges.png
    │   │   ├── domain_specific.png
    │   │   ├── eval_0.png
    │   │   ├── eval_1.png
    │   │   ├── finetuning.png
    │   │   ├── finetuning_1.png
    │   │   ├── finetuning_2.png
    │   │   ├── finetuning_3.png
    │   │   ├── history.png
    │   │   ├── llm_app_steps.png
    │   │   ├── llm_challenges.png
    │   │   ├── llm_sizes.png
    │   │   ├── mind_map.png
    │   │   ├── prompting.png
    │   │   ├── prompting_1.png
    │   │   ├── prompting_10.png
    │   │   ├── prompting_11.png
    │   │   ├── prompting_2.png
    │   │   ├── prompting_3.png
    │   │   ├── prompting_4.png
    │   │   ├── prompting_5.png
    │   │   ├── prompting_6.png
    │   │   ├── prompting_7.png
    │   │   ├── prompting_8.png
    │   │   ├── prompting_9.png
    │   │   ├── s2s_11.png
    │   │   ├── tools_1.png
    │   │   ├── tools_2.png
    │   │   ├── tools_3.png
    │   │   ├── transformer_11.png
    │   │   └── types_domain_task.png
    │   ├── week10_research_trends.md
    │   ├── week11_foundations.md
    │   ├── week1_part1_foundations.md
    │   ├── week1_part2_domain_task_adaptation.md
    │   ├── week2_prompting.md
    │   ├── week3_finetuning_llms.md
    │   ├── week4_RAG.md
    │   ├── week5_tools_for_LLM_apps.md
    │   ├── week6_llm_evaluation.md
    │   ├── week7_build_llm_app.md
    │   ├── week8_advanced_features.md
    │   └── week9_challenges_with_llms.md
    └── generative_ai_genius
    │   ├── README.md
    │   └── genai_intro.png
├── interview_prep
    ├── 60_gen_ai_questions.md
    └── img
    │   ├── 60_fig_1.png
    │   ├── 60_fig_2.png
    │   ├── 60_fig_3.png
    │   ├── 60_fig_4.png
    │   ├── 60_fig_5.png
    │   ├── 60_fig_6.png
    │   ├── 60_fig_7.png
    │   ├── 60_fig_8.png
    │   └── Untitled.png
├── research_updates
    ├── 2024_papers
    │   ├── april_list.md
    │   ├── august_list.md
    │   ├── december_list.md
    │   ├── february_list.md
    │   ├── january_list.md
    │   ├── july_list.md
    │   ├── june_list.md
    │   ├── march_list.md
    │   ├── may_list.md
    │   ├── october_list.md
    │   └── september_list.md
    ├── 2025_papers
    │   ├── february_list.md
    │   └── january_list.md
    ├── rag_research_table.md
    └── survey_papers.md
└── resources
    ├── 60_ai_projects.md
    ├── RAG_roadmap.md
    ├── agentic_rag_101.md
    ├── agents_101_guide.md
    ├── agents_roadmap.md
    ├── fine_tuning_101.md
    ├── gen_ai_projects.md
    ├── genai_roadmap.md
    ├── img
        ├── Applied_LLMs_(28).png
        ├── Applied_LLMs_-_2024-05-03T122206.505.png
        ├── RAG_roadmap.png
        ├── Screenshot_2024-04-07_at_2.39.12_PM.png
        ├── Screenshot_2024-04-07_at_2.53.23_PM.png
        ├── Screenshot_2024-04-07_at_3.03.48_PM.png
        ├── Screenshot_2024-04-07_at_3.28.33_PM.png
        ├── Screenshot_2024-05-02_at_12.06.06_PM.png
        ├── Screenshot_2024-05-02_at_12.06.29_PM.png
        ├── Screenshot_2024-05-02_at_12.21.46_PM.png
        ├── Screenshot_2024-05-03_at_10.55.00_AM.png
        ├── agent_roadmap_image.gif
        ├── babyAGI.png
        ├── differences.png
        ├── fine-tuning-main.png
        ├── fine-tuning-stack.png
        ├── llm_guide.png
        └── main_agentic_rag.png
    ├── llm_lingo
        ├── llm_lingo_p1.pdf
        ├── llm_lingo_p2.pdf
        ├── llm_lingo_p3.pdf
        ├── llm_lingo_p4.pdf
        ├── llm_lingo_p5.pdf
        └── llm_lingo_p6.pdf
    ├── mm_llms_guide.md
    └── our_favourite_ai_tools.md


/LICENSE.md:
--------------------------------------------------------------------------------
 1 | MIT License
 2 | 
 3 | Copyright (c) 2024 Aishwarya Naresh Reganti
 4 | 
 5 | Permission is hereby granted, free of charge, to any person obtaining a copy
 6 | of this software and associated documentation files (the "Software"), to deal
 7 | in the Software without restriction, including without limitation the rights
 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | 
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 | 
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/README.MD:
--------------------------------------------------------------------------------
 1 | # Applied LLMs Mastery 2024
 2 | 
 3 | ![mind_map.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/mind_map.png)
 4 | 
 5 | # About This Course
 6 | 
 7 | 
 8 | **[Official Course Website](https://areganti.notion.site/The-LevelUp-Org-Applied-LLMs-562ddaa27791463e9a1286199325045c)**
 9 | 
10 | Welcome to an exciting 10-week journey into the world of large language models!
11 | 
12 | LLMs are currently experiencing a substantial surge in popularity. Their significance has notably increased in diverse applications, including natural language processing, machine translation, and code and text generation. This rise in prominence is driven by a growing trend among both companies and individuals to leverage LLMs for automating a wide range of tasks. Understanding and learning about LLMs is highly valuable in light of their growing usage and transformative impact across various domains.
13 | 
14 | If you're eager to dive into this trend, you'll discover plenty of resources on the internet. But here's the catch – many of them are all over the place, missing a step-by-step guide from basics to real-world use. This can be overwhelming, and you might feel a bit lost. 
15 | 
16 | Imagine this course as your comprehensive guide, exploring every aspect of using LLMs in real-world scenarios. It serves as the crucial link that brings everything together. Each week, we'll delve into the above topics, providing in-depth insights and hands-on experiences. This approach ensures you gain a thorough and well-rounded understanding of every facet within the topic.
17 | 
18 | We've organized the content into four key pillars – 
19 | 
20 | - **Fundamentals**  (Week 1)
21 | - **Tools and Techniques** (Weeks 2-5)
22 | - **Deployment and Evaluation** (Weeks 6-9)
23 | - **Challenges and Future trends** (Weeks 9-10)
24 | 
25 | This course caters to a diverse audience, including business leaders, professionals, computer science enthusiasts, or students looking to enhance their knowledge in LLMs. While we aim to keep mathematical foundations relatively light, we'll touch on LLM architectural basics in week 11 as bonus content for those interested in delving into LLM research. 
26 | 
27 | # Course Format
28 | 
29 | To make this course accessible to a wide audience, we've designed it as a self-paced audit course. You can register for the course here and course material will be released weekly, featuring mind maps, "ETMI5: Explain to Me in 5" sections for a quick overview, relevant resources, and comprehensive content to ensure your understanding of each topic. Additionally, we'll provide research papers and distilled summaries to keep you updated on the latest research. This page serves as your central hub for all resources.
30 | 
31 | Stay informed by registering for email notifications whenever new content is uploaded, or follow our updates on [LinkedIn](https://www.linkedin.com/in/areganti/). For any queries, feel free to contact the instructor at ***aish@levelup4all.org*** or on LinkedIn. At the end of each week, we'll address frequently asked questions. To maximize your learning experience, allocate 2-3 hours weekly for reading content and engaging in suggested hands-on experiments.
32 | 
33 | 
34 | # Key Takeaways
35 | 
36 | - Understanding the practical fundamentals of LLMs, including its capabilities and limitations
37 | - Hands-on experience with end-to-end execution of LLM use cases
38 | - Learning best practices for exploring and evaluating the usefulness of LLMs in specific scenarios
39 | - Proficiency in integrating and comprehending new updates in LLMs, effectively fitting each piece into the larger puzzle and understanding its relevance.
40 | 
41 | 
42 | 
43 | # Disclaimer
44 | 
45 | This course content is developed by [Aishwarya Naresh Reganti](https://www.linkedin.com/in/areganti/). The course is offered independently, for **free** and is not affiliated with her professional responsibilities or employer. The content presented in this course is intended for educational purposes only and does not reflect the views or policies of any associated organizations.
46 | 
47 | 
48 | 
49 | To cite this guide, use the below format:
50 | 
51 | ```
52 | @article{areganti_generative_ai_guide,
53 | author = {Reganti, Aishwarya},
54 | journal = {https://github.com/aishwaryanr/awesome-generative-ai-resources},
55 | month = {01},
56 | title = {{Generative AI Guide}},
57 | year = {2024}
58 | }
59 | ```
60 | 
61 | ## License
62 | 
63 | [MIT License]
64 | 


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Blue_and_Grey_Illustrative_Creative_Mind_Map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Blue_and_Grey_Illustrative_Creative_Mind_Map.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Name.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/PEFT_(1).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/PEFT_(1).pdf


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/RAG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/RAG.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/RAG_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/RAG_1.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/RAG_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/RAG_2.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/RAG_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/RAG_3.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/RAG_w1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/RAG_w1.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-09_at_9.48.57_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-09_at_9.48.57_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-14_at_3.50.46_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-14_at_3.50.46_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-14_at_3.53.32_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-14_at_3.53.32_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-27_at_1.37.28_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-27_at_1.37.28_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_1.23.33_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_1.23.33_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_1.33.40_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_1.33.40_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_1.34.09_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_1.34.09_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_2.00.23_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-01-28_at_2.00.23_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-16_at_3.21.36_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-16_at_3.21.36_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-16_at_4.11.44_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-16_at_4.11.44_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_3.39.35_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_3.39.35_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_3.52.00_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_3.52.00_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_4.00.44_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_4.00.44_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_4.23.14_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-17_at_4.23.14_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-18_at_3.09.34_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-18_at_3.09.34_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-18_at_3.18.49_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-18_at_3.18.49_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-18_at_3.46.23_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-18_at_3.46.23_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-23_at_10.24.38_AM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-23_at_10.24.38_AM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-23_at_10.32.53_AM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-23_at_10.32.53_AM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-23_at_10.33.00_AM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-23_at_10.33.00_AM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-24_at_2.19.47_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/Screenshot_2024-02-24_at_2.19.47_PM.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/business_cases.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/business_cases.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/challenges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/challenges.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/domain_specific.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/domain_specific.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/eval_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/eval_0.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/eval_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/eval_1.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/finetuning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/finetuning.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/finetuning_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/finetuning_1.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/finetuning_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/finetuning_2.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/finetuning_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/finetuning_3.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/history.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/llm_app_steps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/llm_app_steps.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/llm_challenges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/llm_challenges.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/llm_sizes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/llm_sizes.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/mind_map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/mind_map.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_1.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_10.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_11.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_2.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_3.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_4.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_5.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_6.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_7.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_8.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/prompting_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/prompting_9.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/s2s_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/s2s_11.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/tools_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/tools_1.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/tools_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/tools_2.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/tools_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/tools_3.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/transformer_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/transformer_11.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/img/types_domain_task.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/Applied_LLMs_Mastery_2024/img/types_domain_task.png


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/week1_part1_foundations.md:
--------------------------------------------------------------------------------
  1 | # [Week 1, Part 1] Applied LLM Foundations and Real World Use Cases
  2 | 
  3 | [Jan 15 2024] You can register [here](https://forms.gle/353sQMRvS951jDYu7) to receive course content and other resources 
  4 | 
  5 | ## ETMI5: Explain to Me in 5
  6 | 
  7 | In this part of the course, we delve into the intricacies of Large Language Models (LLMs). We start off by exploring the historical context and fundamental concepts of artificial intelligence (AI), machine learning (ML), neural networks (NNs), and generative AI (GenAI). We then examine the core attributes of LLMs, focusing on their scale, extensive training on diverse datasets, and the role of model parameters. Then we go over the types of challenges associated with using LLMs.
  8 | 
  9 | In the next section, we explore practical applications of LLMs across various domains, emphasizing their versatility in areas like content generation, language translation, text summarization, question answering etc. The section concludes with an analysis of the challenges encountered in deploying LLMs, covering essential aspects such as scalability, latency, monitoring etc.
 10 | 
 11 | In summary, this part of the course provides a practical and informative exploration of Large Language Models, offering insights into their evolution, functionality, applications, challenges, and real-world impact.
 12 | 
 13 | ## History and Background
 14 | 
 15 | ![history](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/history.png)
 16 | 
 17 |                    Image Source: [https://medium.com/womenintechnology/ai-c3412c5aa0ac](https://medium.com/womenintechnology/ai-c3412c5aa0ac)
 18 | 
 19 | The terms mentioned in the image above have likely come up in conversations about ChatGPT. The visual representation offers a broad overview of how they fit into a hierarchy. AI is a comprehensive domain, where LLMs constitute a specific subdomain, and ChatGPT exemplifies an LLM in this context.
 20 | 
 21 | In summary, **Artificial Intelligence (AI)** is a branch of computer science that involves creating machines with human-like thinking and behavior. **Machine Learning(ML)**, a subfield of AI, allows computers to learn patterns from data and make predictions without explicit programming. **Neural Networks (NNs)**, a subset of ML, mimic the human brain's structure and are crucial in deep learning algorithms. Deep Learning (DL), a subset of NN, is effective for complex problem-solving, as seen in image recognition and language translation technologies. **Generative AI (GenAI)**, a subset of DL, can create diverse content based on learned patterns. **Large Language Models (LLMs)**, a form of GenAI, specialize in generating human-like text by learning from extensive textual data. 
 22 | 
 23 | Generative AI and Large Language Models (LLMs) have revolutionized the field of artificial intelligence, allowing machines to create diverse content such as text, images, music, audio, and videos. Unlike discriminative models that classify, generative AI models generate new content by learning patterns and relationships from human-created datasets.
 24 | 
 25 | At the core of generative AI are foundation models which essentially refer to large AI models capable of multi-tasking, performing tasks like summarization, Q&A, and classification out-of-the-box. These models, like the popular one that everyone’s heard of-ChatGPT, can adapt to specific use cases with minimal training and generate content with minimal example data.
 26 | 
 27 | The training of generative AI often involves supervised learning, where the model is provided with human-created content and corresponding labels. By learning from this data, the model becomes proficient in generating content similar to the training set.
 28 | 
 29 | Generative AI is not a new concept. One notable example of early generative AI is the Markov chain, a statistical model introduced by Russian mathematician Andrey Markov in 1906. Markov models were initially used for tasks like next-word prediction, but their simplicity limited their ability to generate plausible text.
 30 | 
 31 | The landscape has significantly changed over the years with the advent of more powerful architectures and larger datasets. In 2014, generative adversarial networks (GANs) emerged, using two models working together—one generating output and the other discriminating real data from the generated output. This approach, exemplified by models like StyleGAN, significantly improved the realism of generated content.
 32 | 
 33 | A year later, diffusion models were introduced, refining their output iteratively to generate new data samples resembling the training dataset. This innovation, as seen in Stable Diffusion, contributed to the creation of realistic-looking images.
 34 | 
 35 | In 2017, Google introduced the transformer architecture, a breakthrough in natural language processing. Transformers encode each word as a token, generating an attention map that captures relationships between tokens. This attention to context enhances the model's ability to generate coherent text, exemplified by large language models like ChatGPT.
 36 | 
 37 | The generative AI boom owes its momentum not only to larger datasets but also to diverse research advances. These approaches, including GANs, diffusion models, and transformers, showcase the breadth of methods contributing to the exciting field of generative AI.
 38 | 
 39 | ## Enter LLMs
 40 | 
 41 | The term "Large" in Large Language Models (LLMs) refers to the sheer scale of these models—both in terms of the size of their architecture and the vast amount of data they are trained on. The size matters because it allows them to capture more complex patterns and relationships within language. Popular LLMs like GPT-3, Gemini, Claude etc. have thousands of billion model parameters. In the context of machine learning, model parameters are like the knobs and switches that the algorithm tunes during training to make accurate predictions or generate meaningful outputs.
 42 | 
 43 | Now, let's break down what "Language Models" mean in this context. Language models are essentially algorithms or systems that are trained to understand and generate human-like text. They serve as a representation of how language works, learning from diverse datasets to predict what words or sequences of words are likely to come next in a given context.
 44 | 
 45 | The "Large" aspect amplifies their capabilities. Traditional language models, especially those from the past, were smaller in scale and couldn't capture the intricacies of language as effectively. With advancements in technology and the availability of massive computing power, we've been able to build much larger models. These Large Language Models, like ChatGPT, have billions of parameters, which are essentially the variables the model uses to make sense of language.
 46 | 
 47 | Take a look at the infographic from “Information is beautiful” below to see how many parameters recent LLMs have. You can view the live visualization [here](https://informationisbeautiful.net/visualizations/the-rise-of-generative-ai-large-language-models-llms-like-chatgpt/)
 48 | 
 49 | ![llm_sizes.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/llm_sizes.png)
 50 | 
 51 | Image source: [https://informationisbeautiful.net/visualizations/the-rise-of-generative-ai-large-language-models-llms-like-chatgpt/](https://informationisbeautiful.net/visualizations/the-rise-of-generative-ai-large-language-models-llms-like-chatgpt/) 
 52 | 
 53 | ## Training LLMs
 54 | 
 55 | Training LLMs is a complex process that involves instructing the model to comprehend and produce human-like text. Here's a simplified breakdown of how LLM training works:
 56 | 
 57 | 1. **Providing Input Text:**
 58 |     - LLMs are initially exposed to extensive text data, encompassing various sources such as books, articles, and websites.
 59 |     - The model's task during training is to predict the next word or token in a sequence based on the context provided. It learns patterns and relationships within the text data.
 60 | 2. **Optimizing Model Weights:**
 61 |     - The model comprises different weights associated with its parameters, reflecting the significance of various features.
 62 |     - Throughout training, these weights are fine-tuned to minimize the error rate. The objective is to enhance the model's accuracy in predicting the next word.
 63 | 3. **Fine-tuning Parameter Values:**
 64 |     - LLMs continuously adjust parameter values based on error feedback received during predictions.
 65 |     - The model refines its grasp of language by iteratively adjusting parameters, improving accuracy in predicting subsequent tokens.
 66 | 
 67 | The training process may vary depending on the specific type of LLM being developed, such as those optimized for continuous text or dialogue.
 68 | 
 69 | LLM performance is heavily influenced by two key factors:
 70 | 
 71 | - **Model Architecture:** The design and intricacy of the LLM architecture impact its ability to capture language nuances.
 72 | - **Dataset:** The quality and diversity of the dataset utilized for training are crucial in shaping the model's language understanding.
 73 | 
 74 | Training a private LLM demands substantial computational resources and expertise. The duration of the process can range from several days to weeks, contingent on the model's complexity and dataset size. Commonly, cloud-based solutions and high-performance GPUs are employed to expedite the training process, making it more efficient. Overall, LLM training is a meticulous and resource-intensive undertaking that lays the groundwork for the model's language comprehension and generation capabilities.
 75 | 
 76 | After the initial training, LLMs can be easily customized for various tasks using relatively small sets of supervised data, a procedure referred to as fine-tuning.
 77 | 
 78 | There are three prevalent learning models:
 79 | 
 80 | 1. **Zero-shot learning:** The base LLMs can handle a wide range of requests without explicit training, often by using prompts, though the accuracy of responses may vary.
 81 | 2. **Few-shot learning:** By providing a small number of pertinent training examples, the performance of the base model significantly improves in a specific domain.
 82 | 3. **Domain Adaptation:** This extends from few-shot learning, where practitioners train a base model to adjust its parameters using additional data relevant to the particular application or domain.
 83 | 
 84 | We will be diving deep into each of these methods during the course.
 85 | 
 86 | ## LLM Real World Use Cases
 87 | 
 88 | LLMs are already being leveraged in various applications showcasing their versatility and power of these models in transforming several domains. Here's how LLMs can be applied to specific cases:
 89 | 
 90 | ![Blue and Grey Illustrative Creative Mind Map.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/Blue_and_Grey_Illustrative_Creative_Mind_Map.png)
 91 | 
 92 | 1. **Content Generation:**
 93 |     - LLMs excel in content generation by understanding context and generating coherent and contextually relevant text. They can be employed to automatically generate creative content for marketing, social media posts, and other communication materials, ensuring a high level of quality and relevance.
 94 |     - **Real World Applications:** Marketing platforms, social media management tools, content creation platforms, advertising agencies
 95 | 2. **Language Translation:**
 96 |     - LLMs can significantly improve language translation tasks by understanding the nuances of different languages. They can provide accurate and context-aware translations, making them valuable tools for businesses operating in multilingual environments. This can enhance global communication and outreach.
 97 |     - **Real World Applications**: Translation services, global communication platforms, international business applications
 98 | 3. **Text Summarization:**
 99 |     - LLMs are adept at summarizing lengthy documents by identifying key information and maintaining the core message. This capability is valuable for content creators, researchers, and businesses looking to quickly extract essential insights from large volumes of text, improving efficiency in information consumption.
100 |     - **Real World Applications**: Research tools, news aggregators, content curation platforms
101 | 4. **Question Answering and Chatbots:**
102 |     - LLMs can be employed for question answering tasks, where they comprehend the context of a question and generate relevant and accurate responses. They enable these systems to engage in more natural and context-aware conversations, understanding user queries and providing relevant responses.
103 |     - **Real World Applications***:* Customer support systems, chatbots, virtual assistants, educational platforms
104 | 5. **Content Moderation:**
105 |     - LLMs can be utilized for content moderation by analyzing text and identifying potentially inappropriate or harmful content. This helps in maintaining a safe and respectful online environment by automatically flagging or filtering out content that violates guidelines, ensuring user safety.
106 |     - **Real World Applications**: Social media platforms, online forums, community management tools.
107 | 6. **Information Retrieval:**
108 |     - LLMs can enhance information retrieval systems by understanding user queries and retrieving relevant information from large datasets. This is particularly useful in search engines, databases, and knowledge management systems, where LLMs can improve the accuracy of search results.
109 |     - **Real World Applications**: Search engines, database systems, knowledge management platforms
110 | 7. **Educational Tools:**
111 |     - LLMs contribute to educational tools by providing natural language interfaces for learning platforms. They can assist students in generating summaries, answering questions, and engaging in interactive learning conversations. This facilitates personalized and efficient learning experiences.
112 |     - **Real World Applications**: E-learning platforms, educational chatbots, interactive learning applications
113 | 
114 | Summary of popular LLM use-cases
115 | 
116 | | No. | Use case | Description |
117 | | --- | --- | --- |
118 | | 1 | Content Generation | Craft human-like text, videos, code and images when provided with instructions |
119 | | 2 | Language Translation | Translate languages from one to another |
120 | | 3 | Text Summarization | Summarize lengthy texts, simplifying comprehension by highlighting key points. |
121 | | 4 | Question Answering and Chatbots | LLMs can provide relevant answers to queries, leveraging their vast knowledge |
122 | | 5 | Content Moderation | Assist in content moderation by identifying and filtering inappropriate or harmful language |
123 | | 6 | Information Retrieval | Retrieve relevant information from large datasets or documents. |
124 | | 7 | Educational Tools | Tutor, provide explanations, and generate learning materials. |
125 | 
126 | Understanding the utilization of generative AI models, especially LLMs, can also be gleaned from the extensive array of startups operating in this domain. An [infographic](https://www.sequoiacap.com/article/generative-ai-act-two/) presented by Sequoia Capital highlighted these companies across diverse sectors, illustrating the versatile applications and the significant presence of numerous players in the generative AI space.
127 | 
128 | ![business_cases.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/business_cases.png)
129 | 
130 |                                 Image Source: [https://markovate.com/blog/applications-and-use-cases-of-llm/](https://markovate.com/blog/applications-and-use-cases-of-llm/)
131 | 
132 | ## LLM Challenges
133 | 
134 | ![llm_challenges.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/llm_challenges.png)
135 | 
136 | Although LLMs have undoubtedly revolutionized various applications, numerous challenges persist. These challenges are categorized into different themes:
137 | 
138 | - **Data Challenges:** This pertains to the data used for training and how the model addresses gaps or missing data.
139 | - **Ethical Challenges:** This  involves addressing issues such as mitigating biases, ensuring privacy, and preventing the generation of harmful content in the deployment of LLMs.
140 | - **Technical Challenges:** These challenges focus on the practical implementation of LLMs.
141 | - **Deployment Challenges:** Concerned with the specific processes involved in transitioning fully-functional LLMs into real-world use-cases (productionization)
142 | 
143 | **Data Challenges:**
144 | 
145 | 1. **Data Bias:** The presence of prejudices and imbalances in the training data leading to biased model outputs.
146 | 2. **Limited World Knowledge and Hallucination:** LLMs may lack comprehensive understanding of real-world events and information and tend to hallucinate information. Note that training them on new data is a long and expensive process.
147 | 3. **Dependency on Training Data Quality:** LLM performance is heavily influenced by the quality and representativeness of the training data.
148 | 
149 | **Ethical and Social Challenges:**
150 | 
151 | 1. **Ethical Concerns:** Concerns regarding the responsible and ethical use of language models, especially in sensitive contexts.
152 | 2. **Bias Amplification:** Biases present in the training data may be exacerbated, resulting in unfair or discriminatory outputs.
153 | 3. **Legal and Copyright Issues:** Potential legal complications arising from generated content that infringes copyrights or violates laws.
154 | 4. **User Privacy Concerns:** Risks associated with generating text based on user inputs, especially when dealing with private or sensitive information.
155 | 
156 | **Technical Challenges:**
157 | 
158 | 1. **Computational Resources:** Significant computing power required for training and deploying large language models.
159 | 2. **Interpretability:** Challenges in understanding and explaining the decision-making process of complex models.
160 | 3. **Evaluation**: Evaluation presents a notable challenge as assessing models across diverse tasks and domains is inadequately designed, particularly due to the challenges posed by freely generated content.
161 | 4. **Fine-tuning Challenges:** Difficulties in adapting pre-trained models to specific tasks or domains.
162 | 5. **Contextual Understanding:** LLMs may face challenges in maintaining coherent context over longer passages or conversations.
163 | 6. **Robustness to Adversarial Attacks:** Vulnerability to intentional manipulations of input data leading to incorrect outputs.
164 | 7. **Long-Term Context:** Struggles in maintaining context and coherence over extended pieces of text or discussions.
165 | 
166 | **Deployment Challenges:**
167 | 
168 | 1. **Scalability:** Ensuring that the model can scale efficiently to handle increased workloads and demand in production environments.
169 | 2. **Latency:** Minimizing the response time or latency of the model to provide quick and efficient interactions, especially in real-time applications.
170 | 3. **Monitoring and Maintenance:** Implementing robust monitoring systems to track model performance, detect issues, and perform regular maintenance to avoid downtime.
171 | 4. **Integration with Existing Systems:** Ensuring smooth integration of LLMs with existing software, databases, and infrastructure within an organization.
172 | 5. **Cost Management:** Optimizing the cost of deploying and maintaining large language models, as they can be resource-intensive in terms of both computation and storage.
173 | 6. **Security Concerns:** Addressing potential security vulnerabilities and risks associated with deploying language models in production, including safeguarding against malicious attacks.
174 | 7. **Interoperability:** Ensuring compatibility with other tools, frameworks, or systems that may be part of the overall production pipeline.
175 | 8. **User Feedback Incorporation:** Developing mechanisms to incorporate user feedback to continuously improve and update the model in a production environment.
176 | 9. **Regulatory Compliance:** Adhering to regulatory requirements and compliance standards, especially in industries with strict data protection and privacy regulations.
177 | 10. **Dynamic Content Handling:** Managing the generation of text in dynamic environments where content and user interactions change frequently.
178 | 
179 | ## Read/Watch These Resources (Optional)
180 | 
181 | 1. [https://www.nvidia.com/en-us/glossary/generative-ai/](https://www.nvidia.com/en-us/glossary/generative-ai/)
182 | 2. [https://markovate.com/blog/applications-and-use-cases-of-llm/](https://markovate.com/blog/applications-and-use-cases-of-llm/)
183 | 3. [https://www.sequoiacap.com/article/generative-ai-act-two/](https://www.sequoiacap.com/article/generative-ai-act-two/)
184 | 4. [https://datasciencedojo.com/blog/challenges-of-large-language-models/](https://datasciencedojo.com/blog/challenges-of-large-language-models/)
185 | 5. [https://snorkel.ai/enterprise-llm-challenges-and-how-to-overcome-them/](https://snorkel.ai/enterprise-llm-challenges-and-how-to-overcome-them/)
186 | 6. [https://www.youtube.com/watch?v=MyFrMFab6bo](https://www.youtube.com/watch?v=MyFrMFab6bo)
187 | 7. [https://www.youtube.com/watch?v=cEyHsMzbZBs](https://www.youtube.com/watch?v=cEyHsMzbZBs)
188 | 
189 | ## Read These Papers (Optional)
190 | 
191 | 1. [https://dl.acm.org/doi/abs/10.1145/3605943](https://dl.acm.org/doi/abs/10.1145/3605943)
192 | 2. [https://www.sciencedirect.com/science/article/pii/S2950162823000176](https://www.sciencedirect.com/science/article/pii/S2950162823000176)
193 | 3. [https://arxiv.org/pdf/2303.13379.pdf](https://arxiv.org/pdf/2303.13379.pdf)
194 | 4. [https://proceedings.mlr.press/v202/kandpal23a/kandpal23a.pdf](https://proceedings.mlr.press/v202/kandpal23a/kandpal23a.pdf)
195 | 5. [https://link.springer.com/article/10.1007/s12599-023-00795-x](https://link.springer.com/article/10.1007/s12599-023-00795-x)


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/week1_part2_domain_task_adaptation.md:
--------------------------------------------------------------------------------
  1 | # [Week 1, Part 2] Domain and Task Adaptation Methods
  2 | 
  3 | ## ETMI5: Explain to Me in 5
  4 | 
  5 | In this section, we delve into the limitations of general AI models in specialized domains, underscoring the significance of domain-adapted LLMs. We explore the advantages of these models, including depth, precision, improved user experiences, and addressing privacy concerns.
  6 | 
  7 | We introduce three types of domain adaptation methods: Domain-Specific Pre-Training, Domain-Specific Fine-Tuning, and Retrieval Augmented Generation (RAG). Each method is outlined, providing details on types, training durations, and quick summaries. We then explain each of these methods in further detail with real-world examples. In the end, we provide an overview of when RAG should be used as opposed to model updating methods.
  8 | 
  9 | ## Using LLMs Effectively
 10 | 
 11 | While general AI models such as ChatGPT demonstrate impressive text generation abilities across various subjects, they may lack the depth and nuanced understanding required for specific domains. Additionally, these models are more prone to generating inaccurate or contextually inappropriate content, referred to as hallucinations. For instance, in healthcare, specific terms like "electronic health record interoperability" or "patient-centered medical home" hold significant importance, but a generic language model may struggle to fully comprehend their relevance due to a lack of specific training on healthcare data. This is where task-specific and domain-specific LLMs play a crucial role. These models need to possess specialized knowledge of industry-specific terminology and practices to ensure accurate interpretation of domain-specific concepts. Throughout the remainder of this course, we will refer to these specialized LLMs as **domain-specific LLM**s, a commonly used term for such models.
 12 | 
 13 | Here are some benefits of using domain-specific LLMs:
 14 | 
 15 | 1. **Depth and Precision**: General LLMs, while proficient in generating text across diverse topics, may lack the depth and nuance required for specialized domains. Domain-specific LLMs are tailored to understand and interpret industry-specific terminology, ensuring precision in comprehension.
 16 | 2. **Overcoming Limitations**: General LLMs have limitations, including potential inaccuracies, lack of context, and susceptibility to hallucinations. In domains like finance or medicine, where specific terminology is crucial, domain-specific LLMs excel in providing accurate and contextually relevant information.
 17 | 3. **Enhanced User Experiences**: Domain-specific LLMs contribute to enhanced user experiences by offering tailored and personalized responses. In applications such as customer service chatbots or dynamic AI agents, these models leverage specialized knowledge to provide more accurate and insightful information.
 18 | 4. **Improved Efficiency and Productivity**: Businesses can benefit from the improved efficiency of domain-specific LLMs. By automating tasks, generating content aligned with industry-specific terminology, and streamlining operations, these models free up human resources for higher-level tasks, ultimately boosting productivity.
 19 | 5. **Addressing Privacy Concerns**: In industries dealing with sensitive data, such as healthcare, using general LLMs may pose privacy challenges. Domain-specific LLMs can provide a closed framework, ensuring the protection of confidential data and adherence to privacy agreements.
 20 | 
 21 | If you recall from the [previous section](https://www.notion.so/Week-1-Applied-LLM-Foundations-369ae7cf630d467cbfeedd3b9b3bfc46?pvs=21), we had multiple ways to use LLMs in specific use cases, namely
 22 | 
 23 | 1. **Zero-shot learning**
 24 | 2. **Few-shot learning**
 25 | 3. **Domain Adaptation**
 26 | 
 27 | Zero-shot learning and few-shot learning involve instructing the general model either through examples or by prompting it with specific questions of interest. Another concept introduced is domain adaptation, which will be the primary focus in this section. More details about the first two methods will be explored when we delve into the topic of prompting.
 28 | 
 29 | ## Types of Domain Adaptation Methods
 30 | 
 31 | There are several methods to incorporate domain-specific knowledge into LLMs, each with its own advantages and limitations. Here are three classes of approaches:
 32 | 
 33 | 1. **Domain-Specific Pre-Training:**
 34 |     - ***Training Duration**:* Days to weeks to months
 35 |     - ***Summary**:* Requires a large amount of domain training data; can customize model architecture, size, tokenizer, etc.
 36 |     
 37 |     In this method, LLMs are pre-trained on extensive datasets representing various natural language use cases. For instance, models like PaLM 540B, GPT-3, and LLaMA 2 have been pre-trained on datasets with sizes ranging from 499 billion to 2 trillion tokens. Examples of domain-specific pre-training include models like ESMFold, ProGen2 for protein sequences, Galactica for science, BloombergGPT for finance, and StarCoder for code. These models outperform generalist models within their domains but still face limitations in terms of accuracy and potential hallucinations.
 38 |     
 39 | 2. **Domain-Specific Fine-Tuning:**
 40 |     - ***Training Duration**:* Minutes to hours
 41 |     - ***Summary**:* Adds domain-specific data; tunes for specific tasks; updates LLM model
 42 |     
 43 |     Fine-tuning involves training a pre-trained LLM on a specific task or domain, adapting its knowledge to a narrower context. Examples include Alpaca (fine-tuned LLaMA-7B model for general tasks), xFinance (fine-tuned LLaMA-13B model for financial-specific tasks), and ChatDoctor (fine-tuned LLaMA-7B model for medical chat). The costs for fine-tuning are significantly smaller compared to pre-training.
 44 |     
 45 | 3. **Retrieval Augmented Generation (RAG):**
 46 |     - ***Training Duration**:* Not required
 47 |     - ***Summary**:* No model weights; external information retrieval system can be tuned
 48 |     
 49 |     RAG involves grounding the LLM's parametric knowledge with external or non-parametric knowledge from an information retrieval system. This external knowledge is provided as additional context in the prompt to the LLM. The advantages of RAG include no training costs, low expertise requirement, and the ability to cite sources for human verification. This approach addresses limitations such as hallucinations and allows for precise manipulation of knowledge. The knowledge base is easily updatable without changing the LLM. Strategies to combine non-parametric knowledge with an LLM's parametric knowledge are actively researched.
 50 |     
 51 | 
 52 | ## **Domain-Specific Pre-Training**
 53 | 
 54 | ![domain_specific](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/domain_specific.png)
 55 | 
 56 |       Image Source [https://www.analyticsvidhya.com/blog/2023/08/domain-specific-llms/](https://www.analyticsvidhya.com/blog/2023/08/domain-specific-llms/)
 57 | 
 58 | Domain-specific pre-training involves training large language models on extensive datasets that specifically represent the language and characteristics of a particular domain or field. This process aims to enhance the model's understanding and performance within a defined subject area.  Let’s understand domain specific pretraining through the example of [BloombergGPT,](https://arxiv.org/pdf/2303.17564.pdf) a large language model for finance. 
 59 | 
 60 | BloombergGPT is a 50 billion parameter language model designed to excel in various tasks within the financial industry. While general models are versatile and perform well across diverse tasks, they may not outperform domain-specific models in specialized areas. At Bloomberg, where a significant majority of applications are within the financial domain, there is a need for a model that excels in financial tasks while maintaining competitive performance on general benchmarks. BloombergGPT can perform the following tasks:
 61 | 
 62 | 1. **Financial Sentiment Analysis:** Analyzing and determining sentiment in financial texts, such as news articles, social media posts, or financial reports. This helps in understanding market sentiment and making informed investment decisions.
 63 | 2. **Named Entity Recognition:** Identifying and classifying entities (such as companies, individuals, and financial instruments) mentioned in financial documents. This is crucial for extracting relevant information from large datasets.
 64 | 3. **News Classification:** Categorizing financial news articles into different topics or classes. This can aid in organizing and prioritizing news updates based on their relevance to specific financial areas.
 65 | 4. **Question Answering in Finance:** Answering questions related to financial topics. Users can pose queries about market trends, financial instruments, or economic indicators, and BloombergGPT can provide relevant answers.
 66 | 5. **Conversational Systems for Finance:** Engaging in natural language conversations related to finance. Users can interact with BloombergGPT to seek information, clarify doubts, or discuss financial concepts.
 67 | 
 68 | To achieve this, BloombergGPT undergoes domain-specific pre-training using a large dataset that combines domain-specific financial language documents from Bloomberg's extensive archives with public datasets. This dataset, named FinPile, consists of diverse English financial documents, including news, filings, press releases, web-scraped financial documents, and social media content. The training corpus is roughly divided into half domain-specific text and half general-purpose text. The aim is to leverage the advantages of both domain-specific and general data sources.
 69 | 
 70 | The model architecture is based on guidelines from previous research efforts, containing 70 layers of transformer decoder blocks (read more in the [paper](https://arxiv.org/pdf/2303.17564.pdf))
 71 | 
 72 | ## **Domain-Specific Fine-Tuning**
 73 | 
 74 | Domain-specific fine-tuning is the process of refining a pre-existing language model for a particular task or within a specific domain to enhance its performance and tailor it to the unique context of that domain. This method involves taking an LLM that has undergone pre-training on a diverse dataset encompassing various language use cases and subsequently fine-tuning it on a narrower dataset specifically related to a particular domain or task. 
 75 | 
 76 | 💡Note that the previous method, i.e., domain-specific pre-training involves training a language model exclusively on data from a specific domain, creating a specialized model for that domain. On the other hand, domain-specific fine-tuning takes a pre-trained general model and further trains it on domain-specific data, adapting it for tasks within that domain without starting from scratch. Pre-training is domain-exclusive from the beginning, while fine-tuning adapts a more versatile model to a specific domain.
 77 | 
 78 | The key steps in domain-specific fine-tuning include:
 79 | 
 80 | 1. **Pre-training:** Initially, a large language model is pre-trained on an extensive dataset, allowing it to grasp general language patterns, grammar, and contextual understanding (A general LLM).
 81 | 2. **Fine-tuning Dataset:** A more focused dataset, tailored to the desired domain or task, is collected or prepared. This dataset contains relevant examples and instances related to the target domain, potentially including labeled examples for supervised learning.
 82 | 3. **Fine-tuning Process:** The pre-trained language model undergoes further training on this domain-specific dataset. During fine-tuning, the model's parameters are adjusted based on the new dataset, while retaining the general language understanding acquired during pre-training.
 83 | 4. **Task Optimization:** The fine-tuned model is optimized for specific tasks within the chosen domain. This optimization may involve adjusting parameters related to the task, such as the model architecture, size, or tokenizer, to achieve optimal performance.
 84 | 
 85 | Domain-specific fine-tuning offers several advantages:
 86 | 
 87 | - It enables the model to specialize in a particular domain, enhancing its effectiveness for tasks within that domain.
 88 | - It saves time and computational resources compared to training a model from scratch, leveraging the knowledge gained during pre-training.
 89 | - The model can adapt to the specific requirements and nuances of the target domain, leading to improved performance on domain-specific tasks.
 90 | 
 91 | A popular example for domain-specific fine-tuning is the ChatDoctor LLM which is a specialized language model fine-tuned on Meta-AI's large language model meta-AI (LLaMA) using a dataset of 100,000 patient-doctor dialogues from an online medical consultation platform. The model undergoes fine-tuning on real-world patient interactions, significantly improving its understanding of patient needs and providing more accurate medical advice. ChatDoctor uses real-time information from online sources like Wikipedia and curated offline medical databases, enhancing the accuracy of its responses to medical queries. The model's contributions include a methodology for fine-tuning LLMs in the medical field, a publicly shared dataset, and an autonomous ChatDoctor model capable of retrieving updated medical knowledge. Read more about ChatDoctor in the paper [here](https://arxiv.org/pdf/2303.14070.pdf).
 92 | 
 93 | ## Retrieval Augmented Generation (RAG)
 94 | 
 95 | Retrieval Augmented Generation (RAG) is an AI framework that enhances the quality of responses generated by LLMs by incorporating up-to-date and contextually relevant information from external sources during the generation process. It addresses the inconsistency and lack of domain-specific knowledge in LLMs, reducing the chances of hallucinations or incorrect responses. RAG involves two phases: retrieval, where relevant information is searched and retrieved, and content generation, where the LLM synthesizes an answer based on the retrieved information and its internal training data. This approach improves accuracy, allows source verification, and reduces the need for continuous model retraining. 
 96 | 
 97 | ![RAG_w1.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/RAG_w1.png)
 98 | 
 99 | Image Source: [https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/](https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/)
100 | 
101 | The diagram above outlines the fundamental RAG pipeline, consisting of three key components:
102 | 
103 | 1. **Ingestion:**
104 |     - Documents undergo segmentation into chunks, and embeddings are generated from these chunks, subsequently stored in an index.
105 |     - Chunks are essential for pinpointing the relevant information in response to a given query, resembling a standard retrieval approach.
106 | 2. **Retrieval:**
107 |     - Leveraging the index of embeddings, the system retrieves the top-k documents when a query is received, based on the similarity of embeddings.
108 | 3. **Synthesis:**
109 |     - Examining the chunks as contextual information, the LLM utilizes this knowledge to formulate accurate responses.
110 | 
111 | 💡Unlike previous methods for domain adaptation, it's important to highlight that RAG doesn't necessitate any model training whatsoever. It can be readily applied without the need for training when specific domain data is provided.
112 | 
113 | In contrast to earlier approaches for model updates (pre-training and fine-tuning), RAG comes with specific advantages and disadvantages. The decision to employ or refrain from using RAG depends on an evaluation of these factors.
114 | 
115 | | Advantages of RAG  | Disadvantages of RAG |
116 | | --- | --- |
117 | | Information Freshness: RAG addresses the static nature of LLMs by providing up-to-date or context-specific data from an external database. | Complex Implementation (Multiple moving parts): Implementing RAG may involve creating a vector database, embedding models, search index etc. The performance of RAG depends on the individual performance of all these components |
118 | | Domain-Specific Knowledge: RAG supplements LLMs with domain-specific knowledge by fetching relevant results from a vector database | Increased Latency: The retrieval step in RAG involves searching through databases, which may introduce latency in generating responses compared to models that don't rely on external sources. |
119 | | Reduced Hallucination and Citations: RAG reduces the likelihood of hallucinations by grounding LLMs with external, verifiable facts and can also cite sources |  |
120 | | Cost-Efficiency: RAG is a cost-effective solution, avoiding the need for extensive model training or fine-tuning |  |
121 | 
122 | ## **Choosing Between RAG, Domain-Specific Fine-Tuning, and Domain-Specific Pre-Training**
123 | 
124 | ![types_domain_task.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/types_domain_task.png)
125 | 
126 | ### **Use Domain-Specific Pre-Training When:**
127 | 
128 | - **Exclusive Domain Focus:** Pre-training is suitable when you require a model exclusively trained on data from a specific domain, creating a specialized language model for that domain.
129 | - **Customizing Model Architecture:** It allows you to customize various aspects of the model architecture, size, tokenizer, etc., based on the specific requirements of the domain.
130 | - **Extensive Training Data Available:** Effective pre-training often requires a large amount of domain-specific training data to ensure the model captures the intricacies of the chosen domain.
131 | 
132 | ### **Use Domain-Specific Fine-Tuning When:**
133 | 
134 | - **Specialization Needed:** Fine-tuning is suitable when you already have a pre-trained LLM, and you want to adapt it for specific tasks or within a particular domain.
135 | - **Task Optimization:** It allows you to adjust the model's parameters related to the task, such as architecture, size, or tokenizer, for optimal performance in the chosen domain.
136 | - **Time and Resource Efficiency:** Fine-tuning saves time and computational resources compared to training a model from scratch since it leverages the knowledge gained during the pre-training phase.
137 | 
138 | ### **Use RAG When:**
139 | 
140 | - **Information Freshness Matters:** RAG provides up-to-date, context-specific data from external sources.
141 | - **Reducing Hallucination is Crucial:** Ground LLMs with verifiable facts and citations from an external knowledge base.
142 | - **Cost-Efficiency is a Priority:** Avoid extensive model training or fine-tuning; implement without the need for training.
143 | 
144 | ## Read/Watch These Resources (Optional)
145 | 
146 | 1. [https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/](https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/)
147 | 2. [https://www.superannotate.com/blog/llm-fine-tuning#what-is-llm-fine-tuning](https://www.superannotate.com/blog/llm-fine-tuning#what-is-llm-fine-tuning)
148 | 3. [https://aws.amazon.com/what-is/retrieval-augmented-generation/#:~:text=Retrieval-Augmented Generation (RAG),sources before generating a response](https://aws.amazon.com/what-is/retrieval-augmented-generation/#:~:text=Retrieval%2DAugmented%20Generation%20(RAG),sources%20before%20generating%20a%20response).
149 | 4. [https://www.youtube.com/watch?v=cXPYtkosXG4](https://www.youtube.com/watch?v=cXPYtkosXG4)
150 | 5. [https://gradientflow.substack.com/p/best-practices-in-retrieval-augmented](https://gradientflow.substack.com/p/best-practices-in-retrieval-augmented)
151 | 
152 | ## Read These Papers (Optional)
153 | 
154 | 1. [https://proceedings.neurips.cc/paper_files/paper/2020/file/6b493230205f780e1bc26945df7481e5-Paper.pdf](https://proceedings.neurips.cc/paper_files/paper/2020/file/6b493230205f780e1bc26945df7481e5-Paper.pdf)
155 | 2. [https://arxiv.org/abs/2202.01110](https://arxiv.org/abs/2202.01110)
156 | 3. [https://arxiv.org/abs/1801.06146](https://arxiv.org/abs/1801.06146)
157 | 


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/week7_build_llm_app.md:
--------------------------------------------------------------------------------
  1 | # [Week 7] Building Your Own LLM Application
  2 | 
  3 | ## ETMI5: Explain to Me in 5
  4 | 
  5 | In the previous parts of the course we covered techniques such as prompting, RAG, and fine-tuning, this section will adopt a practical, hands-on approach to showcase how LLMs can be employed in application development. We'll start with basic examples and progressively incorporate more advanced functionalities like chaining, memory management, and tool integration. Additionally, we'll explore implementations of RAG and fine-tuning. Finally, by integrating these concepts, we'll learn how to construct LLM agents effectively.
  6 | 
  7 | ## Introduction
  8 | 
  9 | As LLMs have become increasingly prevalent, there are now multiple ways to utilize them. We'll start with basic examples and gradually introduce more advanced features, allowing you to build upon your understanding step by step.
 10 | 
 11 | This guide is designed to cover the basics, aiming to familiarize you with the foundational elements through simple applications. These examples serve as starting points and are not intended for production environments. For insights into deploying applications at scale, including discussions on LLM tools, evaluation, and more, refer to our content from previous weeks. As we progress through each section, we'll gradually move from basic to more advanced components. 
 12 | 
 13 | In every section, we'll not only describe the component but also provide resources where you can find code samples to help you develop your own implementations. There are several frameworks available for developing your application, with some of the most well-known being LangChain, LlamaIndex, Hugging Face, and Amazon Bedrock, among others. Our goal is to supply resources from a broad array of these frameworks, enabling you to select the one that best fits the needs of your specific application.
 14 | 
 15 | As you explore each section, select a few resources to help build the app with the component and proceed further.
 16 | 
 17 | ![llm_app_steps.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/Applied_LLMs_Mastery_2024/img/llm_app_steps.png)
 18 | 
 19 | ## 1. Simple LLM App (Prompt + LLM)
 20 | 
 21 | **Prompt:** A prompt, in this context,  is essentially a carefully constructed request or instruction that guides the model in generating a response. It's the initial input given to the LLM that outlines the task you want it to perform or the question you need answered. In the second week's content, we delved extensively into prompt engineering, please head back to older content to learn more.
 22 | 
 23 | The foundational aspect of LLM application development is the interaction between a user-defined prompt and the LLM itself. This process involves crafting a prompt that clearly communicates the user's request or question, which is then processed by the LLM to generate a response.  For example:
 24 | 
 25 | ```python
 26 | # Define the prompt template with placeholders
 27 | prompt_template = "Provide expert advice on the following topic: {topic}."
 28 | # Fill in the template with the actual topic
 29 | prompt = prompt_template.replace("{topic}", topic)
 30 | # API call to an LLM
 31 | llm_response = call_llm_api(topic)
 32 | 	
 33 | ```
 34 | 
 35 | Observe that the prompt functions as a template rather than a fixed string, improving its reusability and flexibility for modifications at run-time. The complexity of the prompt can vary; it can be crafted with simplicity or detailed intricacy depending on the requirement.
 36 | 
 37 | ### Resources/Code
 38 | 
 39 | 1. [**Documentation/Code**] LangChain cookbook for simple LLM Application ([link](https://python.langchain.com/docs/expression_language/cookbook/prompt_llm_parser))
 40 | 2. [**Video**] Hugging Face + LangChain in 5 mins by AI Jason ([link](https://www.youtube.com/watch?v=_j7JEDWuqLE))
 41 | 3. [**Documentation/Code**] Using LLMs with LlamaIndex ([link](https://docs.llamaindex.ai/en/stable/understanding/using_llms/using_llms.html))
 42 | 4. [**Blog**] Getting Started with LangChain  by Leonie Monigatti ([link](https://towardsdatascience.com/getting-started-with-langchain-a-beginners-guide-to-building-llm-powered-applications-95fc8898732c))
 43 | 5. [**Notebook**] Running an LLM on your own laptop by LearnDataWithMark ([link](https://github.com/mneedham/LearnDataWithMark/blob/main/llm-own-laptop/notebooks/LLMOwnLaptop.ipynb))
 44 | 
 45 | ---
 46 | 
 47 | ## 2. Chaining Prompts (Prompt Chains + LLM)
 48 | 
 49 | Although utilizing prompt templates and invoking LLMs is effective, sometimes, you might need to ask the LLM  several questions, one after the other, using the answers you got before to ask the next question. Imagine this: first, you ask the LLM to figure out what topic your question is about. Then, using that information, you ask it to give you an expert answer on that topic. This step-by-step process, where one answer leads to the next question, is called "chaining." Prompt Chains are essentially this sequence of chains used for executing a series of LLM actions.
 50 | 
 51 | LangChain has emerged as a widely-used library for creating LLM applications, enabling the chaining of multiple questions and answers with the LLM to produce a singular final response. This approach is particularly beneficial for larger projects requiring multiple steps to achieve the desired outcome. The example discussed illustrates a basic method of chaining. LangChain's [documentation](https://js.langchain.com/docs/modules/chains/) offers guidance on more complex chaining techniques.
 52 | 
 53 | ```python
 54 | prompt1 ="what topic is the following question about-{question}?"
 55 | prompt2 = "Provide expert advice on the following topic: {topic}."
 56 | ```
 57 | 
 58 | ### Resources/Code
 59 | 
 60 | 1. **[Article] ****Prompt Chaining Article on Prompt Engineering Guide([link](https://www.promptingguide.ai/techniques/prompt_chaining))
 61 | 2. [**Video**] LLM Chains using GPT 3.5 and other LLMs — LangChain #3 James Briggs ([link](https://www.youtube.com/watch?v=S8j9Tk0lZHU))
 62 | 3. [**Video**] LangChain Basics Tutorial #2 Tools and Chains by Sam Witteveen ([link](https://www.youtube.com/watch?v=hI2BY7yl_Ac))
 63 | 4. [**Code**] LangChain tools and Chains Colab notebook by Sam Witteveen ([link](https://colab.research.google.com/drive/1zTTPYk51WvPV8GqFRO18kDe60clKW8VV?usp=sharing))
 64 | 
 65 | ---
 66 | 
 67 | ## **3. Adding External Knowledge Base: Retrieval-Augmented Generation (RAG)**
 68 | 
 69 | Next, we'll explore a different type of application. If you've followed our previous discussions, you're aware that although LLMs excel at providing information, their knowledge is limited to what was available up until their last training session. To generate meaningful outputs beyond this point, they require access to an external knowledge base. This is the role that Retrieval-Augmented Generation (RAG) plays.
 70 | 
 71 | Retrieval-Augmented Generation, or RAG, is like giving your LLM a personal library to check before answering. Before the LLM comes up with something new, it looks through a bunch of information (like articles, books, or the web) to find stuff related to your question. Then, it combines what it finds with its own knowledge to give you a better answer. This is super handy when you need your app to pull in the latest information or deep dive into specific topics.
 72 | 
 73 | To implement RAG (Retrieval-Augmented Generation) beyond the LLM and prompts, you'll need the following technical elements:
 74 | 
 75 | **A knowledge base, specifically a vector database**
 76 | 
 77 | A comprehensive collection of documents, articles, or data entries that the system can draw upon to find information. This database isn't just a simple collection of texts; it's often transformed into a vector database. Here, each item in the knowledge base is converted into a high-dimensional vector representing the semantic meaning of the text. This transformation is done using models similar to the LLM but focused on encoding texts into vectors.
 78 | 
 79 | The purpose of having a vectorized knowledge base is to enable efficient similarity searches. When the system is trying to find information relevant to a user's query, it converts the query into a vector using the same encoding process. Then, it searches the vector database for vectors (i.e., pieces of information) that are closest to the query vector, often using measures like cosine similarity. This process quickly identifies the most relevant pieces of information within a vast database, something that would be impractical with traditional text search methods.
 80 | 
 81 | **Retrieval Component**
 82 | 
 83 | The retrieval component is the engine that performs the actual search of the knowledge base to find information relevant to the user's query. It's responsible for several key tasks:
 84 | 
 85 | 1. **Query Encoding:** It converts the user's query into a vector using the same model or method used to vectorize the knowledge base. This ensures that the query and the database entries are in the same vector space, making similarity comparison possible.
 86 | 2. **Similarity Search:** Once the query is vectorized, the retrieval component searches the vector database for the closest vectors. This search can be based on various algorithms designed to efficiently handle high-dimensional data, ensuring that the process is both fast and accurate.
 87 | 3. **Information Retrieval:** After identifying the closest vectors, the retrieval component fetches the corresponding entries from the knowledge base. These entries are the pieces of information deemed most relevant to the user's query.
 88 | 4. **Aggregation (Optional):** In some implementations, the retrieval component may also aggregate or summarize the information from multiple sources to provide a consolidated response. This step is more common in advanced RAG systems that aim to synthesize information rather than citing sources directly.
 89 | 
 90 | In the RAG framework, the retrieval component's output (i.e., the retrieved information) is then fed into the LLM along with the original query. This enables the LLM to generate responses that are not only contextually relevant but also enriched with the specificity and accuracy of the retrieved information. The result is a hybrid model that leverages the best of both worlds: the generative flexibility of LLMs and the factual precision of dedicated knowledge bases.
 91 | 
 92 | By combining a vectorized knowledge base with an efficient retrieval mechanism, RAG systems can provide answers that are both highly relevant and deeply informed by a wide array of sources. This approach is particularly useful in applications requiring up-to-date information, domain-specific knowledge, or detailed explanations that go beyond the pre-existing knowledge of an LLM.
 93 | 
 94 | Frameworks like LangChain already have good abstractions in place to build RAG frameworks
 95 | 
 96 | A simple example from LangChain is shown [here](https://python.langchain.com/docs/expression_language/cookbook/retrieval)
 97 | 
 98 | ### Resources/Code
 99 | 
100 | 1. [**Article**] All You Need to Know to Build Your First LLM App by Dominik Polzer ([link](https://towardsdatascience.com/all-you-need-to-know-to-build-your-first-llm-app-eb982c78ffac))
101 | 2. [**Video**] RAG from Scratch series by LangChain ([link](https://www.youtube.com/watch?v=wd7TZ4w1mSw&list=PLfaIDFEXuae2LXbO1_PKyVJiQ23ZztA0x))
102 | 3. [**Video**] A deep dive into Retrieval-Augmented Generation with LlamaIndex ([link](https://www.youtube.com/watch?v=Y0FL7BcSigI&t=3s))
103 | 4. [**Notebook**] RAG using LangChain with Amazon Bedrock Titan text, and embedding, using OpenSearch vector engine notebook ([link](https://github.com/aws-samples/rag-using-langchain-amazon-bedrock-and-opensearch))
104 | 5. [**Video**] LangChain - Advanced RAG Techniques for better Retrieval Performance by Coding Crashcourses ([link](https://www.youtube.com/watch?v=KQjZ68mToWo))
105 | 6. [**Video**] Chatbots with RAG: LangChain Full Walkthrough by James Briggs ([link](https://www.youtube.com/watch?v=LhnCsygAvzY&t=11s))
106 | 
107 | ---
108 | 
109 | ## **4. Adding** Memory to LLMs
110 | 
111 | We've explored chaining and incorporating knowledge. Now, consider the scenario where we need to remember past interactions in lengthy conversations with the LLM, where previous dialogues play a role. 
112 | 
113 | This is where the concept of Memory comes into play as a vital component. Memory mechanisms, such as those available on platforms like LangChain, enable the storage of conversation history. For example, LangChain's ConversationBufferMemory feature allows for the preservation of messages, which can then be retrieved and used as context in subsequent interactions. You can discover more about these memory abstractions and their applications on LangChain's [documentation](https://python.langchain.com/docs/modules/memory/types/).
114 | 
115 | ### Resources/Code
116 | 
117 | 1. [**Article**] Conversational Memory for LLMs with LangChain  by Pinecone([link](https://www.pinecone.io/learn/series/langchain/langchain-conversational-memory/))
118 | 2. [**Blog**] How to add memory to a chat LLM model by Nikolay Penkov ([link](https://medium.com/@penkow/how-to-add-memory-to-a-chat-llm-model-34e024b63e0c))
119 | 3. [**Documentation**] Memory in LlamaIndex documentation ([link](https://docs.llamaindex.ai/en/latest/api_reference/memory.html))
120 | 4. [**Video**] LangChain: Giving Memory to LLMs by Prompt Engineering ([link](https://www.youtube.com/watch?v=dxO6pzlgJiY))
121 | 5. [**Video**] Building a LangChain Custom Medical Agent with Memory by   ([link](https://www.youtube.com/watch?v=6UFtRwWnHws))
122 | 
123 | ---
124 | 
125 | ## **5. Using External Tools with LLMs**
126 | 
127 | Consider a scenario within an LLM application, such as a travel planner, where the availability of destinations or attractions depends on seasonal openings. Imagine we have access to an API that provides this specific information. In this case, the application must query the API to determine if a location is open. If the location is closed, the LLM should adjust its recommendations accordingly, suggesting alternative options. This illustrates a crucial instance where integrating external tools can significantly enhance the functionality of LLMs, enabling them to provide more accurate and contextually relevant responses. Such integrations are not limited to travel planning; there are numerous other situations where external data sources, APIs, and tools can enrich LLM applications. Examples include weather forecasts for event planning, stock market data for financial advice, or real-time news for content generation, each adding a layer of dynamism and specificity to the LLM's capabilities.
128 | 
129 | In frameworks like LangChain, integrating these external tools is streamlined through its chaining framework, which allows for the seamless incorporation of new elements such as APIs, data sources, and other tools. 
130 | 
131 | ### Resources/Code
132 | 
133 | 1. [**Documentation/Code**] List of LLM tools by LangChain ([link](https://python.langchain.com/docs/integrations/tools))
134 | 2. [**Documentation/Code**]Tools in LlamaIndex ([link](https://docs.llamaindex.ai/en/stable/module_guides/deploying/agents/tools/root.html))
135 | 3. [**Video**] Building Custom Tools and Agents with LangChain by Sam Witteveen ([link](https://www.youtube.com/watch?v=biS8G8x8DdA))
136 | 
137 | ---
138 | 
139 | ## **6. LLMs Making Decisions: Agents**
140 | 
141 | In the preceding sections, we explored complex LLM components like tools and memory. Now, let's say we want our LLM to effectively utilize these elements to make decisions on our behalf.
142 | 
143 | LLM agents do exactly this, they are systems designed to perform complex tasks by combining LLMs with other modules such as planning, memory, and tool usage. These agents leverage the capabilities of LLMs to understand and generate human-like language, enabling them to interact with users and process information effectively.
144 | 
145 | For instance, consider a scenario where we want our LLM agent to assist in financial planning. The  task is to analyze an individual's spending habits over the past year and provide recommendations for budget optimization.
146 | 
147 | To accomplish this task, the agent  first utilizes its memory module to access stored data regarding the individual's expenditures, income sources, and financial goals. It then employs a planning mechanism to break down the task into several steps:
148 | 
149 | 1. **Data Analysis**: The agent uses external tools to process the financial data, categorizing expenses, identifying trends, and calculating key metrics such as total spending, savings rate, and expenditure distribution.
150 | 2. **Budget Evaluation**: Based on the analyzed data, the LLM agent evaluates the current budget's effectiveness in meeting the individual's financial objectives. It considers factors such as discretionary spending, essential expenses, and potential areas for cost reduction.
151 | 3. **Recommendation Generation**: Leveraging its understanding of financial principles and optimization strategies, the agent formulates personalized recommendations to improve the individual's financial health. These recommendations may include reallocating funds towards savings, reducing non-essential expenses, or exploring investment opportunities.
152 | 4. **Communication**: Finally, the LLM agent communicates the recommendations to the user in a clear and understandable manner, using natural language generation capabilities to explain the rationale behind each suggestion and potential benefits.
153 | 
154 | Throughout this process, the LLM agent seamlessly integrates its decision-making abilities with external tools, memory storage, and planning mechanisms to deliver actionable insights tailored to the user's financial situation.
155 | 
156 | Here's how LLM agents combine various components to make decisions:
157 | 
158 | 1. **Language Model (LLM)**: The LLM serves as the central controller or "brain" of the agent. It interprets user queries, generates responses, and orchestrates the overall flow of operations required to complete tasks.
159 | 2. **Key Modules**:
160 |     - **Planning**: This module helps the agent break down complex tasks into manageable subparts. It formulates a plan of action to achieve the desired goal efficiently.
161 |     - **Memory**: The memory module allows the agent to store and retrieve information relevant to the task at hand. It helps maintain the state of operations, track progress, and make informed decisions based on past observations.
162 |     - **Tool Usage**: The agent may utilize external tools or APIs to gather data, perform computations, or generate outputs. Integration with these tools enhances the agent's capabilities to address a wide range of tasks.
163 | 
164 | Existing frameworks offer built-in modules and abstractions for constructing agents. Please refer to the resources provided below for implementing your own agent.
165 | 
166 | ### Resources/Code
167 | 
168 | 1. [**Documentation/Code**] Agents in LangChain ([link](https://python.langchain.com/docs/modules/agents/))
169 | 2. [**Documentation/Code**] Agents in LlamaIndex ([link](https://docs.llamaindex.ai/en/stable/module_guides/deploying/agents/root.html))
170 | 3. [**Video**] LangChain Agents - Joining Tools and Chains with Decisions by Sam Witteveen ([link](https://www.youtube.com/watch?v=ziu87EXZVUE&t=59s))
171 | 4. [**Article**] Building Your First LLM Agent Application by Nvidia ([link](https://developer.nvidia.com/blog/building-your-first-llm-agent-application))
172 | 5. [**Video**] OpenAI Functions + LangChain : Building a Multi Tool Agent by Sam Witteveen ([link](https://www.youtube.com/watch?v=4KXK6c6TVXQ))
173 | 
174 | ---
175 | 
176 | ## **7. Fine-Tuning**
177 | 
178 | In earlier sections, we explored using pre-trained LLMs with additional components. However, there are scenarios where the LLM must be updated with relevant information before usage, particularly when LLMs lack specific knowledge on a subject. In such instances, it's necessary to first fine-tune the LLM before applying the strategies outlined in sections 1-5 to build an application around it. 
179 | 
180 | Various platforms offer fine-tuning capabilities, but it's important to note that fine-tuning demands more resources than simply eliciting responses from an LLM, as it involves training the model to understand and generate information on the desired topics.
181 | 
182 | ### Resources/Code
183 | 
184 | 1. [**Article**] How to Fine-Tune LLMs in 2024 with Hugging Face by philschmid ([link](https://www.philschmid.de/fine-tune-llms-in-2024-with-trl))
185 | 2. [**Video**] Fine-tuning Large Language Models (LLMs) | w/ Example Code by Shaw Talebi ([link](https://www.youtube.com/watch?v=eC6Hd1hFvos))
186 | 3. [**Video**] Fine-tuning LLMs with PEFT and LoRA by  Sam Witteveen ([link](https://www.youtube.com/watch?v=Us5ZFp16PaU&t=261s))
187 | 4. [**Video**] LLM Fine Tuning Crash Course: 1 Hour End-to-End Guide by AI Anytime ([link](https://www.youtube.com/watch?v=mrKuDK9dGlg))
188 | 5. [**Article**] How to Fine-Tune an LLM series by Weights and Biases ([link](https://wandb.ai/capecape/alpaca_ft/reports/How-to-Fine-Tune-an-LLM-Part-1-Preparing-a-Dataset-for-Instruction-Tuning--Vmlldzo1NTcxNzE2))
189 | 
190 | ---
191 | 
192 | ## Read/Watch These Resources (Optional)
193 | 
194 | 1. List of LLM notebooks by aishwaryanr ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide?tab=readme-ov-file#notebook-code-notebooks))
195 | 2. LangChain How to and Guides by Sam Witteveen ([link](https://www.youtube.com/watch?v=J_0qvRt4LNk&list=PL8motc6AQftk1Bs42EW45kwYbyJ4jOdiZ))
196 | 3. LangChain Crash Course For Beginners | LangChain Tutorial by codebasics ([link](https://www.youtube.com/watch?v=nAmC7SoVLd8))
197 | 4. Build with LangChain Series ([link](https://www.youtube.com/watch?v=mmBo8nlu2j0&list=PLfaIDFEXuae06tclDATrMYY0idsTdLg9v))
198 | 5. LLM hands on course by Maxime Labonne ([link](https://github.com/mlabonne/llm-course))
199 | 


--------------------------------------------------------------------------------
/free_courses/Applied_LLMs_Mastery_2024/week8_advanced_features.md:
--------------------------------------------------------------------------------
  1 | # [Week 8] Advanced Features and Deployment
  2 | 
  3 | ## ETMI5: Explain to Me in 5
  4 | 
  5 | In this section of our content, we will delve into the complexities of deploying LLMs and managing them effectively throughout their lifecycle. We will first discuss LLMOps which involves specialized practices, techniques, and tools tailored to the operational management of LLMs in production environments. We will explore the deployment lifecycle of LLMs, examining  areas where operational efficiency is important.We will then proceed to discuss in more depth the crucial components for deployment, namely Monitoring and Observability for LLMs, as well as Security and Compliance for LLMs.
  6 | 
  7 | ## LLM Application Stages
  8 | 
  9 | When deploying LLMs, it's essential to establish a layer of abstraction to manage tasks surrounding them effectively, ensuring smooth operation and optimal performance. This layer is generally referred to as LLMOps, a more formal definition is given below:
 10 | 
 11 | LLMOps, or Large Language Model Operations, refers to the specialized practices, techniques, and tools used for the operational management of LLMs in production environments. This field focuses on managing and automating the lifecycle of LLMs from development, deployment, to maintenance, ensuring efficient deployment, monitoring, and maintenance of these models.
 12 | 
 13 | In the upcoming sections, we'll initially explore the deployment lifecycle of LLMs, followed by an examination of critical areas where operational efficiency is crucial.
 14 | 
 15 | Here’s an outline that follows the chronological sequence of the LLM lifecycle:
 16 | 
 17 | ### **1. Pre-Development and Planning**
 18 | 
 19 | This phase sets the foundation for a successful LLM project by emphasizing early engagement with the broader AI and ML community and incorporating ethical considerations into the model development strategy. It involves understanding the landscape of LLM technology, including trends, opportunities, and challenges, as well as preemptively addressing potential ethical and bias issues. This stage is critical for aligning the project with best practices, legal and ethical standards, and ensuring that the development team is equipped with the latest knowledge and tools. It includes components like:
 20 | 
 21 | - **Literature Survey**: Engaging with the AI and ML community early on to understand current trends, challenges, and best practices.
 22 | - **Ethical Model Development**: Considering ethical implications, potential biases, and privacy concerns at the planning stage to guide the development process.
 23 | 
 24 | ### **2. Data Preparation and Analysis**
 25 | 
 26 | Data is at the heart of LLMs, and this superclass focuses on the collection, cleaning, labeling, and preparation of data, followed by exploratory analysis to understand its characteristics and inform subsequent modeling decisions. This stage is crucial for ensuring that the data is of high quality, representative, and free of biases as much as possible, laying a solid foundation for training effective and reliable models. This phase can be divided into:
 27 | 
 28 | - **Data Management**: The initial step involves collecting, cleaning, labeling, and preparing data, which is foundational for training LLMs.
 29 | - **Exploratory Data Analysis**: Analyzing the data to understand its characteristics, which informs the model training strategy and prompt design.
 30 | 
 31 | ### **3. Model Development and Training**
 32 | 
 33 | At this stage, the focus shifts to the actual construction and optimization of the LLM, involving training and fine-tuning on the prepared data, as well as prompt engineering to guide the model towards generating desired outputs. This phase is where the model's ability to perform specific tasks is developed and refined, making it a critical period for setting up the model's eventual performance and applicability to real-world tasks. This phase can be divided into:
 34 | 
 35 | - **Model Training and Fine-tuning**: Utilizing pre-trained models and adjusting them with specific datasets to improve performance for targeted tasks.
 36 | - **Prompt Engineering**: Developing inputs that guide the model to generate desired outputs, essential for effective model training and task performance.
 37 | 
 38 | ### **4. Optimization for Deployment**
 39 | 
 40 | Before deployment, models undergo optimization processes such as hyperparameter tuning, pruning, and quantization to balance performance with computational efficiency. This superclass is about making the model ready for production by ensuring it operates efficiently, can be deployed on the required platforms, and meets the necessary performance benchmarks, thus preparing the model for real-world application. This phase can be divided into:
 41 | 
 42 | - **Hyperparameter Tuning**: Fine-tuning model parameters to balance between performance and computational efficiency, crucial before deployment.
 43 | - **Model Pruning and Quantization**: Techniques employed to make models lighter and faster, facilitating easier deployment, especially in resource-constrained environments.
 44 | 
 45 | ### **5. Deployment and Integration**
 46 | 
 47 | This phase involves making the trained and optimized model accessible for real-world application, typically through APIs or web services, and integrating it into existing systems or workflows. It includes automating the deployment process to facilitate smooth updates and scalability. This stage is key to translating the model's capabilities into practical, usable tools or services. It can be divided into:
 48 | 
 49 | - **Deployment Process**: Making the model available for use in production through suitable interfaces such as APIs or web services.
 50 | - **Continuous Integration and Delivery (CI/CD)**: Automating the model development, testing, and deployment process to ensure a smooth transition from development to production.
 51 | 
 52 | ### **6. Post-Deployment Monitoring and Maintenance**
 53 | 
 54 | After deployment, ongoing monitoring and maintenance are essential to ensure the model continues to perform well over time, remains secure, and adheres to compliance requirements. This involves tracking performance, identifying and correcting drift or degradation, and updating the model as necessary. This phase ensures the long-term reliability and effectiveness of the LLM in production environments. It can be divided into:
 55 | 
 56 | - **Monitoring and Observability**: Continuously tracking the model’s performance to detect and address issues like model drift.
 57 | - **Model Review and Governance**: Managing the lifecycle of models including updates, version control, and ensuring they meet performance benchmarks.
 58 | - **Security and Compliance**: Ensuring ongoing compliance with legal and ethical standards, including data privacy and security protocols.
 59 | 
 60 | ### **7. Continuous Improvement and Compliance**
 61 | 
 62 | This overarching class emphasizes the importance of regularly revisiting and refining the model and its deployment strategy to adapt to new data, feedback, and evolving regulatory landscapes. It underscores the need for a proactive, iterative approach to managing LLMs, ensuring they remain state-of-the-art, compliant, and aligned with user needs and ethical standards. It can be divided into
 63 | 
 64 | - **Privacy and Regulatory Compliance**: Regularly reviewing and updating practices to adhere to evolving regulations such as GDPR and CCPA.
 65 | - **Best Practices Adoption**: Implementing the latest methodologies and tools for data science and software engineering to refine and enhance the model development and deployment processes.
 66 | 
 67 | Now that we understand the necessary steps for deploying and managing LLMs, let's dive further into the aspects that hold greater relevance for deployment i.e., in this section of our course, go over the post-deployment process, building on the groundwork laid in our discussions over the past weeks. 
 68 | 
 69 | While phases 1-5 have been outlined previously, and certain elements such as data preparation and model development are universal across machine learning models, our focus now shifts exclusively to nuances involved in deploying LLMs. 
 70 | 
 71 | We will explore in greater detail the  areas of:
 72 | 
 73 | - **Deployment of LLMs**: Understanding the intricacies of deploying large language models and the mechanisms for facilitating ongoing learning and adaptation.
 74 | - **Monitoring and Observability for LLMs**: Examining the strategies and technologies for keeping a vigilant eye on LLM performance and ensuring operational transparency.
 75 | - **Security and Compliance for LLMs**: Addressing the safeguarding of LLMs against threats and ensuring adherence to ethical standards and practices.
 76 | 
 77 | ## **Deployment of LLMs**
 78 | 
 79 | Deploying LLMs  into production environments entails a good understanding of both the technical landscape and the specific requirements of the application at hand. Here are some key considerations to keep in mind when deploying LLM applications:
 80 | 
 81 | ### **1. Choice Between External Providers and Self-hosting**
 82 | 
 83 | - **External Providers**: Leveraging services like OpenAI or Anthropic can simplify deployment by outsourcing computational tasks but may involve higher costs and data privacy concerns.
 84 | - **Self-hosting**: Opting for open-source models offers greater control over data and costs but requires more effort in setting up and managing infrastructure.
 85 | 
 86 | ### **2. System Design and Scalability**
 87 | 
 88 | - A robust LLM application service must ensure seamless user experiences and 24/7 availability, necessitating fault tolerance, zero downtime upgrades, and efficient load balancing.
 89 | - Scalability must be planned, considering both the current needs and potential growth, to handle varying loads without degrading performance.
 90 | 
 91 | ### **3. Monitoring and Observability**
 92 | 
 93 | - **Performance Metrics**: Such as Queries per Second (QPS), Latency, and Tokens Per Second (TPS), are crucial for understanding the system's efficiency and capacity.
 94 | - **Quality Metrics**: Customized to the application's use case, these metrics help assess the LLM's output quality and relevance.
 95 | 
 96 | We will go over this more deeply in the next section
 97 | 
 98 | ### **4. Cost Management**
 99 | 
100 | - Deploying LLMs, especially at scale, can be costly. Strategies for cost management include careful resource allocation, utilizing cost-efficient computational resources (e.g., spot instances), and optimizing model inference costs through techniques like request batching.
101 | 
102 | ### **5. Data Privacy and Security**
103 | 
104 | - Ensuring data privacy and compliance with regulations (e.g., GDPR) is paramount, especially when using LLMs for processing sensitive information.
105 | - Security measures should be in place to protect both the data being processed and the application itself from unauthorized access and attacks.
106 | 
107 | ### **6. Rapid Iteration and Flexibility**
108 | 
109 | - The ability to quickly iterate and adapt the LLM application is crucial due to the fast-paced development in the field. Infrastructure should support rapid deployment, testing, and rollback procedures.
110 | - Flexibility in the deployment strategy allows for adjustments based on performance feedback, emerging best practices, and evolving business requirements.
111 | 
112 | ### **7. Infrastructure as Code (IaC)**
113 | 
114 | - Employing IaC for defining and managing infrastructure can greatly enhance the reproducibility, consistency, and speed of deployment processes, facilitating easier scaling and management of LLM applications.
115 | 
116 | ### **8. Model Composition and Task Composability**
117 | 
118 | - Many applications require composing multiple models or tasks, necessitating a system design that supports such compositions efficiently.
119 | - Tools and frameworks that facilitate the integration and orchestration of different LLM components are essential for building complex applications.
120 | 
121 | ### **9. Hardware and Resource Optimization**
122 | 
123 | - Choosing the right hardware (GPUs, TPUs) based on the application's latency and throughput requirements is critical for performance optimization.
124 | - Effective resource management strategies, such as auto-scaling and load balancing, ensure that computational resources are used efficiently, balancing cost and performance.
125 | 
126 | ### **10. Legal and Ethical Considerations**
127 | 
128 | - Beyond technical and operational considerations, deploying LLMs also involves ethical considerations around the model's impact, potential biases, and the fairness of its outputs.
129 | - Legal obligations regarding the use of AI and data must be carefully reviewed and adhered to, ensuring that the deployment of LLMs aligns with societal norms and regulations.
130 | 
131 | ## **Monitoring and Observability for LLMs**
132 | 
133 | Monitoring and observability  refer to the processes and tools used to track, analyze, and understand the behavior and performance of these models during deployment and operation.
134 | 
135 | Monitoring is crucial for LLMs to ensure optimal performance, detect faults, plan capacity, maintain security and compliance, govern models, and drive continuous improvement. 
136 | 
137 | Here are some key metrics that should be monitored for LLMs, we’ve already discussed tools for monitoring  in the previous parts of our course
138 | 
139 | ### Basic Monitoring Strategies
140 | 
141 | **1. User-Facing Performance Metrics**
142 | 
143 | - **Latency**: The time it takes for the LLM to respond to a query, critical for user satisfaction.
144 | - **Availability**: The percentage of time the LLM service is operational and accessible to users, reflecting its reliability.
145 | - **Error Rates**: The frequency of unsuccessful requests or responses, indicating potential issues in the LLM or its integration points.
146 | 
147 | **2. Model Outputs**
148 | 
149 | - **Accuracy**: Measuring how often the LLM provides correct or useful responses, fundamental to its value.
150 | - **Confidence Scores**: The LLM's own assessment of its response accuracy, useful for filtering or prioritizing outputs.
151 | - **Aggregate Metrics**: Compilation of performance indicators such as precision, recall, and F1 score to evaluate overall model efficacy.
152 | 
153 | **3. Data Inputs**
154 | 
155 | - **Logging Queries**: Recording user inputs to the LLM for later analysis, troubleshooting, and understanding user interaction patterns.
156 | - **Traceability**: Ensuring a clear path from input to output, aiding in debugging and improving model responses.
157 | 
158 | **4. Resource Utilization**
159 | 
160 | - **Compute Usage**: Tracking CPU/GPU consumption to optimize computational resource allocation and cost.
161 | - **Memory Usage**: Monitoring the amount of memory utilized by the LLM, important for managing large models and preventing system overload.
162 | 
163 | **5. Training Data Drift**
164 | 
165 | - **Statistical Analysis**: Employing statistical tests to compare current input data distributions with those of the training dataset, identifying significant variances.
166 | - **Detection Mechanisms**: Implementing automated systems to alert on detected drifts, ensuring the LLM remains accurate over time.
167 | 
168 | **6. Custom Metrics**
169 | 
170 | - **Application-Specific KPIs**: Developing unique metrics that directly relate to the application's goals, such as user engagement or content generation quality.
171 | - **Innovation Tracking**: Continuously evolving metrics to capture new insights and improve LLM performance and user experience.
172 | 
173 | ### Advanced Monitoring Strategies
174 | 
175 | **1. Real-Time Monitoring**
176 | 
177 | - **Immediate Insights**: Offering a live view into the LLM's operation, enabling quick detection and response to issues.
178 | - **System Performance**: Understanding the dynamic behavior of the LLM in various conditions, adjusting resources in real-time.
179 | 
180 | **2. Data Drift Detection**
181 | 
182 | - **Maintaining Model Accuracy**: Regularly comparing incoming data against the model's training data to ensure consistency and relevance.
183 | - **Adaptive Strategies**: Implementing mechanisms to adjust the model or its inputs in response to detected drifts, preserving performance.
184 | 
185 | **3. Scalability and Performance**
186 | 
187 | - **Demand Management**: Architecting the LLM system to expand resources in response to user demand, ensuring responsiveness.
188 | - **Efficiency Optimization**: Fine-tuning the deployment architecture for optimal performance, balancing speed with cost.
189 | 
190 | **4. Interpretability and Debugging**
191 | 
192 | - **Model Understanding**: Applying techniques like feature importance, attention mechanisms, and example-based explanations to decipher model decisions.
193 | - **Debugging Tools**: Utilizing logs, metrics, and model internals to diagnose and resolve issues, enhancing model reliability.
194 | 
195 | **5. Bias Detection and Fairness**
196 | 
197 | - **Proactive Bias Monitoring**: Regularly assessing model outputs for unintentional biases, ensuring equitable responses across diverse user groups.
198 | - **Fairness Metrics**: Developing and tracking measures of fairness, correcting biases through model adjustments or retraining.
199 | 
200 | **6. Compliance Practices**
201 | 
202 | - **Regulatory Adherence**: Ensuring the LLM meets legal and ethical standards, incorporating data protection, privacy, and transparency measures.
203 | - **Audit and Reporting**: Maintaining records of LLM operations, decisions, and adjustments to comply with regulatory requirements and facilitate audits.
204 | 
205 | ## **Security and Compliance for LLMs**
206 | 
207 | ### Security
208 | 
209 | Maintaining security in LLM deployments is crucial due to the advanced capabilities of these models in text generation, problem-solving, and interpreting complex instructions. As LLMs increasingly integrate with external tools, APIs, and applications, they open new avenues for potential misuse by malicious actors, raising concerns about social engineering, data exfiltration, and the safe handling of sensitive information. To safeguard against these risks, businesses must develop comprehensive strategies to regulate LLM outputs and mitigate security vulnerabilities.
210 | 
211 | Security plays a crucial role in preventing their misuse for generating misleading content or facilitating malicious activities, such as social engineering attacks. By implementing robust security measures, organizations can protect sensitive data processed by LLMs, ensuring confidentiality and privacy. Furthermore, maintaining stringent security practices helps uphold user trust and ensures compliance with legal and ethical standards, fostering responsible deployment and usage of LLM technologies. In essence, prioritizing LLM security is essential for safeguarding both the integrity of the models and the trust of the users who interact with them.
212 | 
213 | **How to Ensure LLM Security?**
214 | 
215 | - **Data Security**: Implement Reinforcement Learning from Human Feedback (RLHF) and external censorship mechanisms to align LLM outputs with human values and filter out impermissible content.
216 | - **Model Security**: Secure the model against tampering by employing validation processes, checksums, and measures to prevent unauthorized modifications to the model’s architecture and parameters.
217 | - **Infrastructure Security**: Protect hosting environments through stringent security protocols, including firewalls, intrusion detection systems, and encryption, to prevent unauthorized access and threats.
218 | - **Ethical Considerations**: Integrate ethical guidelines to prevent the generation of harmful, biased, or misleading outputs, ensuring LLMs contribute positively and responsibly to users and society.
219 | 
220 | ### Compliance
221 | 
222 | Compliance in the context of LLMs refers to adhering to legal, regulatory, and ethical standards governing their development, deployment, and usage. It encompasses various aspects such as data privacy regulations, intellectual property rights, fairness and bias mitigation, transparency, and accountability. 
223 | 
224 | Below are some considerations to bear in mind to guarantee adherence to compliance standards when deploying LLMs.
225 | 
226 | - **Familiarize with GDPR and EU AI Act**: Gain a comprehensive understanding of regulations like the GDPR in the EU, which governs data protection and privacy, and stay updated on the progress and requirements of the proposed EU AI Act, particularly concerning AI systems.
227 | - **International Data Protection Laws**: For global operations, be aware of and comply with data protection laws in other jurisdictions, ensuring LLM deployments meet all applicable international standards.
228 | 
229 | ## Read/Watch These Resources (Optional)
230 | 
231 | 1. LLM Monitoring and Observability — A Summary of Techniques and Approaches for Responsible AI -[https://towardsdatascience.com/llm-monitoring-and-observability-c28121e75c2f](https://towardsdatascience.com/llm-monitoring-and-observability-c28121e75c2f)
232 | 2. LLM Observability- [https://www.tasq.ai/glossary/llm-observability/](https://www.tasq.ai/glossary/llm-observability/)
233 | 3. LLMs — Observability and Monitoring**-** [https://medium.com/@bijit211987/llm-observability-and-monitoring-925f93242ccf](https://medium.com/@bijit211987/llm-observability-and-monitoring-925f93242ccf)


--------------------------------------------------------------------------------
/free_courses/generative_ai_genius/README.md:
--------------------------------------------------------------------------------
  1 | # Generative AI Genius 2024
  2 | 
  3 | ![Screenshot 2024-06-13 at 3.19.32 PM.png](https://github.com/aishwaryanr/awesome-generative-ai-resources/blob/main/free_courses/generative_ai_genius/genai_intro.png)
  4 | 
  5 | # 🎉The course starts on July 8th 2024! Registrations Closed (You can audit the course for free)
  6 | 
  7 | # About the Course:
  8 | 
  9 | Welcome to Generative AI Genius! This 20-day introductory course is designed to help you break into generative AI.  This course is designed for today's busy individuals who crave concise, succinct information. 
 10 | 
 11 | **Generative AI Genius the first AI course based on short videos or reels!** 
 12 | 
 13 | If you've been wanting to learn about generative AI, understand the buzzwords, and not feel lost, you're in the right place. You can spend as little as 2-5 minutes a day learning generative AI in a way that builds on the knowledge gained from previous videos, giving you a comprehensive mind-map of the field. 
 14 | 
 15 | I see each of you as one of the following types of learners:
 16 | 
 17 | **1. The Busy Bee** 
 18 | 
 19 | If you're short on time but want to grasp generative AI concepts, my videos/reels are perfect for you. Just dedicate 2-5 minutes daily, and you'll stay informed without needing to look up extra material. Concepts will build on each other, keeping you perfectly in the loop.
 20 | 
 21 | **2. The Curious Learner**
 22 | 
 23 | If you liked the the videos but want to explore the concepts further, I've handpicked some great resources for you. These usually take about 20-30 minutes and will help you grasp the material more deeply. They'll also improve your understanding of related concepts, making everything more cohesive.
 24 | 
 25 | **3. The Hands-On Enthusiast**
 26 | 
 27 | If you're someone with a coding background who prefers hands-on learning, I'll be sharing few mini-project resources throughout the course. These projects will allow you to put the concepts into practice, using high-quality tutorials and videos.
 28 | 
 29 | 🚨**NOTE: The videos stand alone, so you can understand the concepts without needing to read the additional resources—they're just there to aid your understanding.**
 30 | 
 31 | # What you'll Learn
 32 | This course heavily focuses on applied generative AI to help you get started with building applications. Here's an overview of the topics we'll cover, and if you don't understand some of these, don't worry—you'll get enough background during the course:
 33 | 
 34 | - Basics of Generative AI and Large Language Models (LLMs)
 35 | - Prompting Techniques
 36 | - Building Generative AI Applications (RAG)
 37 | - Basics of Fine-Tuning
 38 | - Common Challenges and Evaluation
 39 | - Future Trends in Generative AI
 40 | 
 41 | Please note that this course emphasizes understanding applied concepts and building applications using generative AI. It won't teach you to build generative AI models, which requires a much more comprehensive course structure and a lot of prerequisites. If someone tells you otherwise, I'd double-check their credentials 🙂
 42 | 
 43 | # What are the Prerequisites?
 44 | 
 45 | Honestly, this is a course I want people from all backgrounds to engage with and take away valuable insights at their preferred level of understanding. However, the amount of information you can absorb may vary depending on your background.
 46 | 
 47 | Here’s what it offers to individuals with different backgrounds:
 48 | 
 49 | ### 1. No Computer Science (CS) Background
 50 | 
 51 | The course may introduce terms that are new to you and some parts might be challenging. However, you'll still gain a high-level overview of the field and understand key concepts. Based on my experience, you should be able to grasp about 60-80% of the content. It's still worth your 2-5 minutes daily, right?
 52 | 
 53 | ### 2. CS Background, Limited Machine Learning (ML) Experience
 54 | 
 55 | If you're a software engineer or tech enthusiast, you probably have a basic understanding of ML concepts such as training and evaluation. You should be able to follow the course from beginning to end and complete a few projects in generative AI. My primary audience consists of individuals like you who are seeking to enter the field. This course can also serve as your entry into building generative AI projects and transitioning to a career as a generative AI engineer.
 56 | 
 57 | ### 3. ML Background
 58 | 
 59 | If you have experience in ML but are new to NLP or LLMs, the main advantage for you will be the mini-projects and supplementary reading materials. These resources should provide you with enough knowledge to begin implementing your own projects and also enable you to start studying generative AI research and understand its broader context.
 60 | 
 61 | # How to Register:
 62 | 
 63 | You have two options: auditing the course or registering, both of which are free!
 64 | 
 65 | **Auditing the Course:**
 66 | 
 67 | - You can watch the daily videos first on [Instagram](https://rb.gy/ae4z68) & [YouTube](https://www.youtube.com/@aishwaryanr4606). Links will be posted here too, but there might be a delay. For quicker updates, follow my account.
 68 | - Access additional resources through this page daily; mini-project resources will also be available here.
 69 | 
 70 | **Registering For the Course:**
 71 | 
 72 | - **Registrations are closed for this course, feel free to audit (watch videos and access content here)**
 73 | - Registered participants will receive all the benefits mentioned above, plus
 74 |     - Priority RSVP to a 1 hour seminar on building generative AI applications for the real world
 75 |     - Updates regarding any future courses or events
 76 |     - A completion certificate
 77 | 
 78 | # About your Instructor:
 79 | 
 80 | [Aishwarya Naresh Reganti](https://www.linkedin.com/in/areganti/) works as a tech lead at the AWS-Generative AI Innovation Center in California, where she leads projects aimed at building production-ready generative AI applications for medium to large-sized businesses. With over 8 years of experience in machine learning, Aishwarya has published 30+ research papers in top AI conferences and mentored numerous graduate students. She actively collaborates with research labs and professors from institutions like Stanford University, University of Michigan, and University of South Carolina on projects related to LLMs, graph models and generative AI.
 81 | 
 82 | Outside her professional and academic pursuits, Aishwarya actively contributes to education through various channels. She offers free courses online, with over 3000 individuals having taken them already, and serves as a guest instructor at  institutions like Massachusetts Institute of Technology and University of Oxford.  
 83 | 
 84 | Additionally, she co-founded The LevelUp Org in 2022, a tech mentoring community dedicated to assisting newcomers in the field through mentorship programs and career-oriented events. A recognized industry expert and thought leader, Aishwarya frequently speaks at various industry conferences like ODSC, WomenTech Network, ReWork, and AI4, and has presented research at top-tier AI research conferences including EMNLP, AAAI, and CVPR.
 85 | 
 86 | LinkedIn: [https://www.linkedin.com/in/areganti/](https://www.linkedin.com/in/areganti/)
 87 | 
 88 | Instagram: [https://www.instagram.com/aish_reganti/](https://www.instagram.com/aish_reganti/)
 89 | 
 90 | YouTube: [https://www.youtube.com/@aishwaryanr4606](https://www.youtube.com/@aishwaryanr4606)
 91 | 
 92 | ---
 93 | 
 94 | ---
 95 | 
 96 | 
 97 | ### Course Videos: 
 98 | 
 99 | The videos will be available here everyday at 7:30 PM, Pacific Time
100 | 1. [Instagram](https://www.instagram.com/aish_reganti)
101 | 2. [YouTube](https://www.youtube.com/playlist?list=PLZoalK-hTD4VBBF03HAifKd6-DF68sYlC)
102 | 
103 | 
104 | ## 🗓️ Day 1: What is Generative AI (July 8th, 2024)
105 | 
106 | ---
107 | **Key Topics**: AI, Generative AI, Neural Networks, Large Language Models(LLMs), Model Training
108 | 
109 | **Reading Material**:
110 | - https://medium.com/womenintechnology/ai-c3412c5aa0ac
111 | 
112 | ## 🗓️ Day 2: How are LLMs like ChatGPT Trained? (July 9th, 2024)
113 | 
114 | ---
115 | **Key Topics**: Training, Fine-Tuning, Reinforcement Learning, Alignment
116 | 
117 | **Reading Material**:
118 | - https://snorkel.ai/large-language-model-training-three-phases-shape-llm-training/
119 | 
120 | ## 🗓️ Day 3: Basics of Prompt Engineering (July 10th, 2024)
121 | 
122 | ---
123 | **Key Topics**: Prompting, Prompt Engineering
124 | 
125 | **Reading Material**:
126 | - https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api
127 | 
128 | 
129 | ## 🗓️ Day 4: Advanced Prompt Engineering (July 11th, 2024) 
130 | ---
131 | **Key Topics**: Chain of Thought Prompting, Self-Refine, Self-Consistency, Zero-Shot, Few-Shot
132 | 
133 | **Reading Material**:
134 | - https://www.promptingguide.ai/techniques
135 | - [Optional] [The Prompt Report: A Systematic Survey of Prompting Techniques](https://arxiv.org/pdf/2406.06608)
136 | 
137 | ## 🗓️ Day 5: Automatic Prompt Engineering (July 12th, 2024) 
138 | ---
139 | **Key Topics**: Meta Prompting, Automatic Prompt Engineeering
140 | 
141 | **Reading Material**:
142 | - [Claude Meta Prompting Engine](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/prompt-generator)
143 | - https://cobusgreyling.medium.com/automatic-prompt-engineering-907e230ece0
144 | 
145 | ## 🗓️ Day 6: LLM Hallucinations and Causes (July 13th, 2024) 
146 | ---
147 | **Key Topics**: Hallucinations, Sycophancy, Causes of Hallucinations
148 | 
149 | **Reading Material**:
150 | - https://www.iguazio.com/glossary/llm-hallucination/
151 | 
152 | ---
153 | ## 💻 Mini-Project 1 (Build a GPT-3.5 backed Chatbot)
154 | 
155 | In this mini-project, you'll complete a 1 hour course from Deeplearning.AI that can help you build a chatbot that does the following
156 | - Summarizing (e.g., summarizing user reviews for brevity)
157 | - Inferring (e.g., sentiment classification, topic extraction)
158 | - Transforming text (e.g., translation, spelling & grammar correction)
159 | - Expanding (e.g., automatically writing emails)
160 | 
161 | Prerequisites: Familiarity with Python
162 | 
163 | The course is completely free for everyone to take. Please find it [here](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/)
164 | 
165 | Happy coding!!
166 | 
167 | ---
168 | ## 🗓️ Day 7: Context Length (July 14th, 2024) 
169 | ---
170 | **Key Topics**: Definition, Needle in a haystack test, Lost in the middle problem
171 | 
172 | **Reading Material**:
173 | - https://agi-sphere.com/context-length/
174 | ---
175 | 
176 | ## 🗓️ Day 8: Retrieval Augmented Generation (RAG) (July 15th, 2024) 
177 | ---
178 | **Key Topics**: Basics, 4 Phases of RAG
179 | 
180 | **Reading Material**:
181 | - https://blogs.nvidia.com/blog/what-is-retrieval-augmented-generation/
182 | 
183 | ---
184 | ## 🗓️ Day 9:What are embeddings? (July 16th, 2024) 
185 | ---
186 | **Key Topics**: Word Vectors/Embeddings, Semantic Similarity, Embeddings in RAG
187 | 
188 | **Reading Material**:
189 | - https://learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/rag/rag-generating-embeddings
190 | 
191 | ---
192 | ## 🗓️ Day 10:What are vector databases? (July 17th, 2024) 
193 | ---
194 | **Key Topics**: Embeddings, Vector databases, Similarity search
195 | 
196 | **Reading Material**:
197 | - https://www.pinecone.io/learn/vector-database/
198 | ---
199 | ## 🗓️ Day 11: LLM Evaluation (July 18th, 2024) 
200 | ---
201 | **Key Topics**: Evaluation Dimensions
202 | 
203 | **Reading Material**:
204 | - https://www.labellerr.com/blog/evaluating-large-language-models/#:~:text=To%20ensure%20a%20comprehensive%20evaluation,of%20a%20set%20of%20prompts.
205 | ---
206 | ## 🗓️ Day 12: Fine-Tuning(July 19th, 2024) 
207 | ---
208 | **Key Topics**: Definition, Resources
209 | 
210 | **Reading Material**:
211 | - https://learn.microsoft.com/en-us/ai/playbook/technology-guidance/generative-ai/working-with-llms/fine-tuning
212 | - https://www.superannotate.com/blog/llm-fine-tuning
213 |   
214 | **Notebooks and Coding Courses/Tutorials**:
215 | - https://github.com/aishwaryanr/awesome-generative-ai-guide?tab=readme-ov-file#fine-tuning-tutorials
216 | - [Training & Fine-Tuning LLMs for Production](https://learn.activeloop.ai/courses/llms) by Activeloop
217 | - [Finetuning Large Language Models](https://www.deeplearning.ai/short-courses/finetuning-large-language-models/) by DeepLearning.AI
218 | - [Tutorial to Fine-Tune Mistal on your own data](https://github.com/brevdev/notebooks/blob/main/mistral-finetune-own-data.ipynb) by Brev.Dev
219 | 
220 | **Apps to generate AI videos (like the one I created)**
221 | - https://www.heygen.com/
222 | - https://www.synthesia.io/
223 | - https://www.tryparrotai.com/
224 | ---
225 | ## 🗓️ Day 13: RLHF (July 20th, 2024) 
226 | ---
227 | **Key Topics**: Definition, Alignment, Reward model
228 | 
229 | **Reading Material**:
230 | - https://huggingface.co/blog/rlhf
231 |   
232 | ## 🗓️ Day 14: AI projects for your resume (July 21st, 2024) 
233 | ---
234 | 
235 | **Reading Material**:
236 | - https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/gen_ai_projects.md
237 | ---
238 | ## 🗓️ Day 15: LLM Agents (July 22nd, 2024) 
239 | ---
240 | **Key Topics**: Planning, Memory, Tools
241 | 
242 | **Reading Material**:
243 | - https://developer.nvidia.com/blog/introduction-to-llm-agents/
244 | ---
245 | ## 🗓️ Day 16: Adversarial Attacks (July 23rd, 2024) 
246 | ---
247 | **Key Topics**: Jailbreaking, Attacks
248 | 
249 | **Reading Material**:
250 | - https://www.discovermagazine.com/technology/adversarial-attack-makes-chatgpt-produce-objectionable-content
251 | - Jailbreaking paper shown in the video ([link](https://chats-lab.github.io/persuasive_jailbreaker/))
252 | ---
253 | ## 🗓️ Day 17: Emerging AI Trends (July 24th, 2024) 
254 | ---
255 | **Key Topics**: SLMs, Multimodal Models, Agents, Embodied AI
256 | 
257 | **Reading Material**:
258 | - https://www.forbes.com/sites/janakirammsv/2024/01/02/exploring-the-future-5-cutting-edge-generative-ai-trends-in-2024/
259 | - https://vmblog.com/archive/2023/12/14/kognic-2024-predictions-the-year-of-embodied-ai.aspx
260 | ---
261 | ## 🗓️ Day 18: Small Language Models(July 25th, 2024) 
262 | ---
263 | **Key Topics**: Knowledge distillation, Pruning, Quantization
264 | 
265 | **Reading Material**:
266 | - https://aisera.com/blog/small-language-models/
267 | ---
268 | 
269 | ## 🗓️ Day 19: AI Engineer Interview Tips Part 1(July 25th, 2024) 
270 | ---
271 | 
272 | **Key Topics**: AI Engineer Skill Checklist
273 | 
274 | ---
275 | 
276 | 
277 | ## 🗓️ Day 20: AI Engineer Interview Tips Part 2(July 25th, 2024) 
278 | ---
279 | 
280 | **Key Topics**: AI Engineer Interview Structure
281 | 
282 | ---
283 | 
284 | 
285 | 
286 | 
287 | 
288 | 


--------------------------------------------------------------------------------
/free_courses/generative_ai_genius/genai_intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/free_courses/generative_ai_genius/genai_intro.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_1.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_2.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_3.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_4.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_5.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_6.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_7.png


--------------------------------------------------------------------------------
/interview_prep/img/60_fig_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/60_fig_8.png


--------------------------------------------------------------------------------
/interview_prep/img/Untitled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/interview_prep/img/Untitled.png


--------------------------------------------------------------------------------
/research_updates/2024_papers/january_list.md:
--------------------------------------------------------------------------------
 1 | ## :star:January 2024 Best GenAI Papers
 2 | 
 3 | | Date        | Name                                                                                                                  | Summary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Topics                  |
 4 | | ----------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
 5 | | 31 Jan 2024 | [Large Language Models for Mathematical Reasoning: Progresses and Challenges](https://arxiv.org/html/2402.00157v1)                                           | This survey delves into the landscape of Large Language Models in mathematical problem-solving, addressing various problem types, datasets, techniques, factors, and challenges. It comprehensively explores the advancements and obstacles in this burgeoning field, providing insights into the current state and future directions. This survey offers a holistic perspective on LLMs' role in mathematical reasoning, aiming to guide future research in this rapidly evolving domain.                                                                                             | Task Specific LLMs      |
 6 | | 29 Jan 2024 | [Corrective Retrieval Augmented Generation](https://arxiv.org/abs/2401.15884)                                                                             | To address concerns about retrieval-augmented generation models' robustness, Corrective Retrieval Augmented Generation (CRAG) is proposed. CRAG incorporates a lightweight retrieval evaluator to assess document quality and triggers different retrieval actions based on confidence levels. It extends retrieval results through large-scale web searches and employs a decompose-then-recompose algorithm to focus on key information. Experiments demonstrate CRAG's effectiveness in enhancing RAG-based approaches across various generation tasks.                             | RAG                     |
 7 | | 29 Jan 2024 | [MoE-LLaVA: Mixture of Experts for Large Vision-Language Models](https://arxiv.org/abs/2401.15947)                                                         | This work introduces MoE-Tuning, a training strategy for Large Vision-Language Models that addresses the computational costs of existing scaling methods by constructing sparse models with constant computational overhead. It also presents MoE-LLaVA, a MoE-based sparse LVLM architecture that activates only the top-k experts during deployment. Experimental results demonstrate MoE-LLaVA's significant performance across various visual understanding and object hallucination benchmarks, providing insights for more efficient multi-modal learning systems.               | MoE Models              |
 8 | | 29 Jan 2024 | [The Power of Noise: Redefining Retrieval for RAG Systems](https://arxiv.org/abs/2401.14887)                                                               | This study examines the impact of Information Retrieval components on Retrieval-Augmented Generation systems, complementing previous research focused on LLMs' generative aspect within RAG systems. By analyzing characteristics such as document relevance, position, and context size, the study reveals unexpected insights, like the surprising performance boost from including irrelevant documents. These findings emphasize the importance of developing specialized strategies to integrate retrieval with language generation models, guiding future research in this area. | RAG                     |
 9 | | 24 Jan 2024 | [MM-LLMs: Recent Advances in MultiModal Large Language Models](https://arxiv.org/abs/2401.13601)                                                           | This paper presents a comprehensive survey of MultiModal Large Language Models (MM-LLMs), which augment off-the-shelf LLMs to support multimodal inputs or outputs. It outlines design formulations, introduces 26 existing MM-LLMs, reviews their performance on mainstream benchmarks, and summarizes key training recipes. Promising directions for MM-LLMs are explored, alongside a real-time tracking website for the latest developments, aiming to contribute to the ongoing advancement of the MM-LLMs domain.                                                                | Multimodal LLMs         |
10 | | 23 Jan 2024 | [Red Teaming Visual Language Models](https://arxiv.org/abs/2401.12915)                                                                                     | A novel red teaming dataset, RTVLM, is introduced to assess Vision-Language Models' (VLMs) performance in generating harmful or inaccurate content. It encompasses 10 subtasks across faithfulness, privacy, safety, and fairness aspects. Analysis reveals significant performance gaps among prominent open-source VLMs, prompting exploration of red teaming alignment techniques. Application of red teaming alignment to LLaVA-v1.5 bolsters model performance, indicating the need for further development in this area.                                                         | Red-Teaming             |
11 | | 23 Jan 2024 | [Lumiere: A Space-Time Diffusion Model for Video Generation](https://arxiv.org/abs/2401.12945)                                                            | Lumiere is introduced as a text-to-video diffusion model aimed at synthesizing realistic and coherent motion in videos. It employs a Space-Time U-Net architecture to generate entire video durations in a single pass, enabling global temporal consistency. Through spatial and temporal down- and up-sampling, and leveraging a pre-trained text-to-image diffusion model, Lumiere achieves state-of-the-art text-to-video generation results, facilitating various content creation and video editing tasks with ease.                                                             | Diffusion Models        |
12 | | 22 Jan 2024 | [WARM: On the Benefits of Weight Averaged Reward Models](https://arxiv.org/abs/2401.12187)                                                                | Reinforcement Learning with Human Feedback  for large language models can lead to reward hacking. To address this, Weight Averaged Reward Models (WARM) are proposed, where multiple fine-tuned reward models are averaged in weight space. WARM improves efficiency and reliability under distribution shifts and preference inconsistencies, enhancing the quality and alignment of LLM predictions. Experiments on summarization tasks demonstrate WARM's effectiveness, with RL fine-tuned models using WARM outperforming single RM counterparts.                                 | Instruction Tuning      |
13 | | 18 Jan 2024 | [Self-Rewarding Language Models](https://arxiv.org/abs/2401.10020)                                                                                        | This paper introduces Self-Rewarding Language Models, where the language model itself provides rewards during training via LLM-as-a-Judge prompting. Through iterative training, the model not only improves its instruction-following ability but also enhances its capacity to generate high-quality rewards. Fine-tuning Llama 2 70B using this approach yields a model that surpasses existing systems on the AlpacaEval 2.0 leaderboard, showcasing potential for continual improvement in both performance axes.                                                                 | Prompt Engineering      |
14 | | 16 Jan 2024 | [Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering](https://arxiv.org/abs/2401.08500)                                        | AlphaCodium is proposed as a new approach to code generation by Large Language Models, emphasizing a test-based, multi-stage, code-oriented iterative flow tailored for code tasks. Tested on the CodeContests dataset, AlphaCodium consistently improves LLM performance, significantly boosting accuracy compared to direct prompts. The principles and best practices derived from this approach are deemed broadly applicable to general code generation tasks.                                                                                                                    | Code Generation         |
15 | | 13 Jan 2024 | [Leveraging Large Language Models for NLG Evaluation: A Survey](https://arxiv.org/html/2401.07103v1)                                                        | This survey delves into leveraging Large Language Models for evaluating Natural Language Generation, providing a comprehensive taxonomy for organizing existing evaluation metrics. It critically assesses LLM-based methodologies, highlighting their strengths, limitations, and unresolved challenges such as bias and domain-specificity. The survey aims to offer insights to researchers and advocate for fairer and more advanced NLG evaluation techniques.                                                                                                                    | Evaluation              |
16 | | 12 Jan 2024 | [How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMs](https://arxiv.org/html/2401.06373v1)      | This paper explores a new perspective on AI safety by considering large language models as human-like communicators and studying how to jailbreak them through persuasion. It introduces a persuasion taxonomy and applies it to generate interpretable persuasive adversarial prompts (PAP), achieving high attack success rates on LLMs like GPT-3.5 and GPT-4. The study also highlights gaps in existing defenses against such attacks and advocates for more fundamental mitigation strategies for interactive LLMs.                                                              | Red-Teaming             |
17 | | 11 Jan 2024  | [Seven Failure Points When Engineering a Retrieval Augmented Generation](https://arxiv.org/abs/2401.05856) System                                      | The paper explores the integration of semantic search capabilities into applications through Retrieval Augmented Generation (RAG) systems. It identifies seven failure points in RAG system design based on case studies across various domains. Key takeaways include the feasibility of validating RAG systems during operation and the evolving nature of system robustness. The paper concludes with suggestions for potential research directions to enhance RAG system effectiveness. | RAG              |
18 | 
19 | 
20 | 
21 | 
22 | 
23 | | 10 Jan 2024 | [TrustLLM: Trustworthiness in Large Language Models](https://arxiv.org/abs/2401.05561)                                                                     | The paper examines trustworthiness in large language models like ChatGPT, proposing principles and benchmarks. It evaluates 16 LLMs, finding a correlation between trustworthiness and effectiveness, but noting concerns about proprietary models outperforming open-source ones. It emphasizes the need for transparency in both models and underlying technologies for trustworthiness analysis.                                                                                                                                                                                    | Alignment               |
24 | | 9 Jan 2024  | [Chain-of-Table: Evolving Tables in the Reasoning Chain for Table Understanding](https://arxiv.org/abs/2401.04398)                                          | The Chain-of-Table framework proposes leveraging tabular data explicitly in the reasoning chain to enhance table-based reasoning tasks. It guides large language models using in-context learning to iteratively generate operations and update the table, allowing for dynamic planning based on previous results. This approach achieves state-of-the-art performance on various table understanding benchmarks, showcasing its effectiveness in enhancing LLM-based reasoning.                                                                                                      | Prompt Engineering, RAG |
25 | | 8 Jan 2024  | [MoE-Mamba: Efficient Selective State Space Models with Mixture of Experts](https://arxiv.org/abs/2401.04081)                                              | The paper introduces MoE-Mamba, a model combining Mixture of Experts (MoE) with Sequential State Space Models (SSMs) to enhance scaling and performance. MoE-Mamba surpasses both Mamba and Transformer-MoE, achieving Transformer-like performance with fewer training steps while maintaining the inference gains of Mamba over Transformers.                                                                                                                                                                                                                                        | MoE Models              |
26 | | 4 Jan 2024  | [Blending Is All You Need: Cheaper, Better Alternative to Trillion-Parameters LLM](https://arxiv.org/abs/2401.02994)                                      | The paper investigates whether combining smaller chat AI models can match or exceed the performance of a single large model like ChatGPT, without requiring extensive computational resources. Through empirical evidence and A/B testing on the Chai research platform, the "blending" approach demonstrates potential to rival or surpass the capabilities of larger models.                                                                                                                                                                                                          | Smaller Models          |
27 | 
28 | 
29 | 


--------------------------------------------------------------------------------
/research_updates/survey_papers.md:
--------------------------------------------------------------------------------
 1 | # :star2: Best Survey Papers
 2 | ### (Updated July 2024)
 3 | 
 4 | A good research survey can save you hours of catching up on a topic and help you create a clear mind map. Here are my go-to papers for various generative AI topics.
 5 | 
 6 | 1. Foundation Models: [A Survey of Large Language Models](https://arxiv.org/pdf/2303.18223)
 7 | 2. Prompt Engineering: [The Prompt Report: A Systematic Survey of Prompting Techniques](https://arxiv.org/pdf/2406.06608v1)
 8 | 3. Retrieval Augmented Generation (RAG): [A Survey on Retrieval-Augmented Text Generation for Large Language Models](https://arxiv.org/pdf/2404.10981)
 9 | 4. Hallucinations: [A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions](https://arxiv.org/pdf/2311.05232)
10 | 5. Parameter Efficient Fine-Tuning: [Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey](https://arxiv.org/pdf/2403.14608)
11 | 6. LLM Agents: [A Survey on Large Language Model based Autonomous Agents](https://arxiv.org/pdf/2308.11432)
12 | 7. Multimodal Models: [A Survey on Multimodal Large Language Models](https://arxiv.org/pdf/2306.13549)
13 | 8. LLM Evaluation: [A Survey on Evaluation of Large Language Models](https://arxiv.org/pdf/2307.03109)
14 | 9. Adversarial Attacks: [Survey of Vulnerabilities in Large Language Models Revealed by Adversarial Attacks](https://arxiv.org/pdf/2310.10844)
15 | 
16 | 
17 | 


--------------------------------------------------------------------------------
/resources/RAG_roadmap.md:
--------------------------------------------------------------------------------
 1 | # 3 Day RAG Roadmap: Understanding, Building and Evaluating RAG Systems 2024
 2 | 
 3 | Retrieval Augmented Generation (RAG) has become a popular application of LLMs recently, with significant progress made in just a few months. Its popularity stems from its lightweight nature and the ease with which it can be integrated with any LLM. To help you get acquainted with RAG, we have put together a 3-day learning plan.
 4 | 
 5 | This guide will introduce you to the fundamentals, show you how to develop applications, delve into advanced functionalities, and teach you how to assess RAG applications. Plan to spend about 2-3 hours each day on the provided materials.
 6 | 
 7 | Happy Learning!
 8 | 
 9 | ![RAG_roadmap.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/RAG_roadmap.png)
10 | 
11 | ## Day 1: Introduction to RAG
12 | 
13 | **Watch these videos:**
14 | 
15 | 1. Explanation of RAG by [DeepLearning.AI](http://DeepLearning.AI) ([link](<https://learn.deeplearning.ai/courses/building-applications-vector-databases/lesson/3/retrieval-augmented-generation-(rag)>))
16 | 
17 | **Read these resources:**
18 | 
19 | 1. What is RAG by DataStax ([link](https://www.datastax.com/guides/what-is-retrieval-augmented-generation))
20 | 2. Retrieval-Augmented Generation (RAG) from basics to advanced by Tejpal Kumawat ([link](https://medium.com/@tejpal.abhyuday))
21 | 
22 | ---
23 | 
24 | ## Day 2: Advanced RAG + Build Your Own RAG System
25 | 
26 | **Watch these videos:**
27 | 
28 | 1. Advanced RAG series (6 videos) by Sam Witteveen ([link](https://www.youtube.com/watch?v=f4LeWlt3T8Y&t=125s))
29 | 2. LangChain101: Question A 300 Page Book (w/ OpenAI + Pinecone) by Greg Kamradt ([link](https://www.youtube.com/watch?v=h0DHDp1FbmQ))
30 | 
31 | **Read these resources:**
32 | 
33 | 1. Blog on advanced RAG techniques by Akash ([link](https://akash-mathur.medium.com/advanced-rag-optimizing-retrieval-with-additional-context-metadata-using-llamaindex-aeaa32d7aa2f))
34 | 2. RAG hands-on tutorials on GitHub([link](https://github.com/gkamradt/langchain-tutorials/blob/main/data_generation/Ask%20A%20Book%20Questions.ipynb))
35 | 
36 | ---
37 | 
38 | ## Day 3: RAG Evaluation and Challenges
39 | 
40 | **Watch these videos:**
41 | 
42 | 1. LlamaIndex Sessions: 12 RAG Pain Points and Solutions ([link](https://www.youtube.com/watch?v=EBpT_cscTis))
43 | 2. Building and Evaluating Advanced RAG Applications by [DeepLearning.AI](http://DeepLearning.AI)([link](https://www.deeplearning.ai/short-courses/building-evaluating-advanced-rag/))
44 | 3. Challenges with Naive RAG & How to Evaluate RAG Applications? by ActiveLoop ([link](https://www.youtube.com/watch?v=CgQdg0SRuC0))
45 | 
46 | **Read these resources:**
47 | 
48 | 1. 12 RAG Pain Points and Solutions article([link](https://towardsdatascience.com/12-rag-pain-points-and-proposed-solutions-43709939a28c))
49 | 2. RAGas core concepts for evaluating RAG([link](https://docs.ragas.io/en/stable/concepts/index.html))
50 | 
51 | ---
52 | 
53 | ## Optional Resources to Read
54 | 
55 | 1. Week 4 content from Applied LLMs mastery course on RAG ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/free_courses/Applied_LLMs_Mastery_2024/week4_RAG.md))
56 | 2. “Seven Failure Points When Engineering a Retrieval Augmented
57 |    Generation System” paper([link](https://arxiv.org/pdf/2401.05856.pdf))
58 | 3. “Retrieval-Augmented Generation for Large Language Models: A Survey” paper([link](https://arxiv.org/abs/2312.10997))
59 | 4. RAG description and available tools on Huggingface([link](https://huggingface.co/transformers/v3.3.1/model_doc/rag.html))
60 | 5. Original RAG paper "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” ([link](https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html))
61 | 
62 | ---
63 | 
64 | ## Latest RAG Research from 2023-2024
65 | 
66 | [Click Here](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/research_updates/rag_research_table.md)
67 | ---
68 | 


--------------------------------------------------------------------------------
/resources/agentic_rag_101.md:
--------------------------------------------------------------------------------
  1 | 
  2 | ![main_agentic_rag.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/main_agentic_rag.png)
  3 | 
  4 | Agentic Retrieval Augmented Generation or Agentic RAG is quickly becoming a popular approach in AI, as it combines the strengths of retrieval systems with the smart decision-making of agents. This makes it possible for large language models (LLMs) to pull in real-time data and use it to improve their answers. By doing this, these systems become more flexible and can handle more complex, ever-changing tasks.
  5 | 
  6 | ### Section 1: Understanding RAG and Agents
  7 | 
  8 | **Retrieval Augmented Generation (RAG)** is a method used to improve LLMs by giving them access to real-time data. Normally, LLMs rely only on the data they were trained on, which can become outdated. RAG fixes this by allowing models to retrieve information from external sources, like databases or live web searches. This way, when the model is asked a question, it can pull in fresh, relevant data and combine it with its own knowledge to create a more accurate and useful response. RAG is especially valuable in areas like customer support or finance, where up-to-date information is crucial.
  9 | 
 10 | **Agents**, on the other hand, are systems that can make decisions and act on their own. In AI, agents are used to manage tasks and processes, automatically adjusting to whatever situation they are in. They can assess what needs to be done, choose the best way to do it, and then carry out the task, making them very flexible and efficient.
 11 | 
 12 | **Enter Agentic RAG!**
 13 | 
 14 | ---
 15 | 
 16 | ### Section 2: What is Agentic RAG?
 17 | 
 18 | When **RAG and agents** are combined, the agents take charge of the entire process, deciding how and when to retrieve the data and how to use it to generate the best possible response. Instead of simply retrieving information, the agents make smart choices about where to get the data, what is most important, and how to integrate it into the LLM’s answer. This results in a system that can handle more complex queries and deliver responses that are both accurate and tailored to the specific situation.
 19 | 
 20 | The table below provides a clear overview of how **Agents**, **RAG**, and **Agentic RAG** differ in terms of their key features and functionalities:
 21 | 
 22 | ![differences.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/differences.png)
 23 | 
 24 | **How Agentic RAG Works – Step-by-Step Example**
 25 | 
 26 | Let’s walk through an example to understand how Agentic RAG operates in real-time. Suppose you’re using a customer support chatbot powered by Agentic RAG to resolve an issue with your internet service. The query you input is:
 27 | 
 28 | **"Why is my internet slow in the evenings?"**
 29 | 
 30 | ### Step-by-Step Breakdown:
 31 | 
 32 | 1. **User Query**
 33 |     - You type your query into the chatbot: "Why is my internet slow in the evenings?"
 34 |     - The query is received by the system, which activates the intelligent agent to determine the next steps.
 35 | 2. **Agent Analyzes the Query**
 36 |     - The agent analyzes your question, recognizing that it’s a service-related query that might need data on your internet usage patterns, network traffic, and potential service disruptions.
 37 |     - Based on this, the agent identifies relevant data sources, such as your service history, network reports, and real-time traffic data.
 38 | 3. **Agent Decides on Retrieval Strategy**
 39 |     - The agent determines which external data sources to query. In this case, it may decide to:
 40 |         - Fetch data from your account history to check if there are any noted service issues.
 41 |         - Retrieve network traffic reports from the internet service provider (ISP) to analyze peak usage times in your area.
 42 |         - Query a public knowledge base to gather information on common causes of evening slowdowns.
 43 | 4. **Data Retrieval**
 44 |     - The retrieval system, directed by the agent, pulls information from multiple sources. It fetches:
 45 |         - Your service history, showing an uptick in complaints during the evening.
 46 |         - Network traffic reports indicating high congestion in your neighborhood between 6 PM and 10 PM.
 47 |         - Articles from the knowledge base explaining how peak-time usage and congestion can cause slower speeds.
 48 | 5. **LLM Generates Response**
 49 |     - Once the relevant data is retrieved, the large language model (LLM) processes it. The model takes into account both its pre-trained knowledge and the real-time data fetched by the agent.
 50 |     - The LLM generates a response that integrates these insights:**"It appears that your internet speed slows down in the evenings due to high traffic in your area during peak hours. You might want to consider upgrading your plan or using the internet during off-peak times to avoid congestion."**
 51 | 6. **Response Delivery**
 52 |     - The generated response is delivered to you, providing a clear and accurate explanation of why your internet is slow in the evenings, based on both real-time data and the model’s general understanding of network congestion.
 53 | 7. **Follow-Up Actions**
 54 |     - If necessary, the agent could continue assisting by offering additional solutions. For instance, it could recommend a faster internet plan or schedule a technician visit if it detects any ongoing issues with your connection.
 55 | 
 56 | ### Key Points of Agentic RAG in Action:
 57 | 
 58 | - The **agent** autonomously decides which sources to query based on your question.
 59 | - The **retrieval system** pulls real-time data specific to your query, enhancing the LLM’s response.
 60 | - The **LLM** generates an answer that is more accurate and context-aware because it integrates both pre-trained knowledge and the fresh data fetched by the agent.
 61 | 
 62 | Note that while this is a basic example of how Agentic RAG operates, it can also interact with not just knowledge bases but also other tools and services, similar to the way traditional agents do.
 63 | 
 64 | ---
 65 | 
 66 | ### Section 3: Agentic RAG Capabilities
 67 | 
 68 | Agentic RAG offers a range of powerful features that make it an attractive option for systems requiring dynamic, real-time data retrieval and decision-making. Here are some of the standout features:
 69 | 
 70 | 1. **Dynamic Data Retrieval**
 71 |     
 72 |     One of the main features of Agentic RAG is its ability to fetch real-time information based on user queries. By incorporating intelligent agents, the system can decide which data sources to query, ensuring the most relevant and up-to-date information is retrieved. This allows for more accurate and contextually aware responses, especially in environments where data changes frequently, like news or finance.
 73 |     
 74 | 2. **Autonomous Decision-Making**
 75 |     
 76 |     In a traditional RAG setup, the retrieval process is relatively straightforward. However, in Agentic RAG, intelligent agents make autonomous decisions throughout the pipeline. They determine what data to retrieve, when to retrieve it, and how to use it, all without the need for human intervention. This autonomy makes the system more flexible and adaptable, allowing it to handle a wide range of complex tasks efficiently.
 77 |     
 78 | 3. **Context-Aware Responses**
 79 |     
 80 |     Agentic RAG doesn’t just retrieve information blindly. Agents assess the context of each query and adjust the retrieval process accordingly. This means that the system can tailor responses based on the specific needs of the user, improving relevance and accuracy. The agents consider the context in real-time, allowing the system to respond more intelligently to nuanced queries.
 81 |     
 82 | 4. **Scalability**
 83 |     
 84 |     With agents taking control of the retrieval and decision-making processes, Agentic RAG scales more effectively than traditional RAG systems. It can handle more complex queries across different domains by leveraging multiple data sources and balancing workloads intelligently. The system is designed to expand in complexity and volume while maintaining performance, making it suitable for large-scale applications like customer support or enterprise search.
 85 |     
 86 | 5. **Reduced Hallucination Risk**
 87 |     
 88 |     One of the challenges with traditional LLMs is hallucination, where the model generates incorrect or nonsensical responses. Since Agentic RAG pulls real-time data and intelligently integrates it into responses, the likelihood of hallucinations is significantly reduced. The agents ensure that the information used is accurate and relevant, lowering the chance of the system providing false information.
 89 |     
 90 | 6. **Customizable Workflows**
 91 |     
 92 |     Agentic RAG allows for highly customizable workflows based on the task or domain. Agents can be fine-tuned to follow different retrieval strategies, prioritize certain data sources, or adapt to specific business needs. This flexibility makes the system highly versatile, capable of functioning effectively in different industries or application settings.
 93 |     
 94 | 7. **Multi-Step Reasoning**
 95 |     
 96 |     Agentic RAG pipelines can handle complex tasks that require multiple steps to reach a solution. They can break down a user’s query into smaller steps, retrieve data, and progressively build an answer, allowing for more nuanced and logical responses.
 97 |     
 98 | 
 99 | ---
100 | 
101 | ### Section 4: Types of Agentic RAG
102 | 
103 | Agentic RAG systems can be classified based on how agents operate and the complexity of their interactions with the retrieval and generation components. There are several types, each suited for different tasks and levels of complexity:
104 | 
105 | 1. **Single-Agent RAG**
106 |     - In this setup, a single intelligent agent is responsible for managing the entire retrieval and generation process. The agent decides which sources to query, what data to retrieve, and how the data should be used in generating the final response.
107 |     - This type is ideal for simpler tasks or systems where decision-making doesn’t require much complexity. Single-agent RAG is efficient when managing routine queries with straightforward information retrieval needs.
108 | 2. **Multi-Agent RAG**
109 |     - Multi-agent RAG involves multiple agents working together, each handling different aspects of the retrieval and generation process. One agent might handle retrieval from a specific source, while another might focus on optimizing the integration of data into the LLM's response.
110 |     - Multi-agent systems are well-suited for more complex scenarios, where different types of data need to be fetched from various sources or when tasks need to be broken down into smaller, specialized parts.
111 | 3. **Hierarchical Agentic RAG**
112 |     - In this setup, agents are organized in a hierarchy, where higher-level agents supervise and guide lower-level agents. Higher-level agents may decide which data sources are worth querying, while lower-level agents focus on executing those queries and returning the results.
113 |     - This type is beneficial for highly complex tasks, where strategic decision-making is required at multiple levels. For example, hierarchical Agentic RAG is useful in systems that need to prioritize certain data sources or balance competing priorities.
114 | 
115 | ---
116 | ### Section 5: Implementing Agentic RAG
117 | 
118 | Here are some resources you can use to get started with implementing Agentic RAG.
119 | 
120 | 1. https://medium.com/the-ai-forum/implementing-agentic-rag-using-langchain-b22af7f6a3b5
121 | 2. https://github.com/benitomartin/agentic-rag-langchain-pinecone
122 | 3. https://www.llamaindex.ai/blog/agentic-rag-with-llamaindex-2721b8a49ff6
123 | 4. https://docs.llamaindex.ai/en/stable/examples/agent/agentic_rag_using_vertex_ai/
124 | 5. https://www.analyticsvidhya.com/blog/2024/07/building-agentic-rag-systems-with-langgraph/
125 | ---
126 | 
127 | ### Section 6: Agentic RAG Challenges and Future Directions
128 | 
129 | As Agentic Retrieval Augmented Generation (RAG) continues to evolve, it faces several challenges that need to be addressed to reach its full potential. At the same time, there are exciting future directions that promise to make the technology even more powerful and adaptable
130 | 
131 | ### Challenges:
132 | 
133 | 1. **Coordination Complexity**
134 |     - As systems integrate more agents, ensuring smooth coordination between them becomes more complex. Each agent may operate with different priorities, leading to potential bottlenecks or conflicts in decision-making.
135 |     - Inefficient coordination can lead to slower response times or incomplete answers if agents don’t properly sync their retrieval tasks.
136 | 2. **Scalability Concerns**
137 |     - While agents can make systems more flexible, managing a large number of agents and data sources can be resource-intensive. As the system scales, maintaining real-time performance without sacrificing accuracy becomes more difficult.
138 |     - High-latency responses and overburdened retrieval pipelines can diminish the benefits of real-time, dynamic data integration.
139 | 3. **Data Quality and Reliability**
140 |     - The quality of the retrieved information is crucial for accurate responses. If agents pull data from unreliable or low-quality sources, it could lead to misinformation or inaccurate answers.
141 |     - Poor data quality can undermine trust in the system and lead to incorrect decisions, particularly in critical fields like healthcare or finance.
142 | 4. **Agent Decision-Making Transparency**
143 |     - Understanding and monitoring how agents make decisions about retrieval and data usage can be difficult. Without transparency, it’s challenging to ensure that agents are consistently making optimal choices.
144 |     - Lack of transparency can lead to a “black box” effect, where users and developers struggle to interpret why certain decisions were made, making debugging and optimization harder.
145 | 
146 | ### Future Directions:
147 | 
148 | 1. **Improved Agent Collaboration and Orchestration**
149 |     - Future Agentic RAG systems will focus on better orchestration methods that allow agents to collaborate more efficiently. This includes smarter workflows, where agents can better divide tasks, communicate seamlessly, and resolve conflicts without human intervention.
150 |     - This will enable smoother operations, reducing bottlenecks, and ensuring faster, more accurate responses across complex queries.
151 | 2. **Hybrid Human-Agent Systems**
152 |     - In the future, systems could integrate human oversight, where agents operate autonomously but humans intervene in cases of uncertainty or high stakes. This would allow agents to handle routine queries, while humans handle exceptions or complex situations.
153 |     - This would combine the efficiency of agents with human intuition and expertise, especially in areas where the consequences of errors are high, such as legal or medical decisions.
154 | 3. **Learning Agents**
155 |     - RAG Agents may become more adaptive by incorporating learning mechanisms. Instead of following static rules, agents will be able to learn from past interactions, improving their ability to make decisions over time.
156 |     - Learning agents would allow systems to evolve, becoming better at handling new and complex queries as they accumulate more experience, leading to smarter, more personalized interactions.
157 | 4. **Ethical Decision-Making Agents**
158 |     - As Agentic RAG systems become more integrated into sensitive applications, developing agents that can make ethical decisions will be crucial. These agents will need to consider factors such as fairness, bias mitigation, and responsible AI usage.
159 |     - Ethical decision-making agents will help reduce biases in responses, ensure fairness in automated processes, and build trust in AI systems, particularly in sectors like law enforcement or social services.
160 | 
161 | ---
162 | 


--------------------------------------------------------------------------------
/resources/agents_101_guide.md:
--------------------------------------------------------------------------------
  1 | # LLM Agents 101
  2 | 
  3 | ![llm_guide.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/llm_guide.png)
  4 | 
  5 | ## Introduction to LLM Agents
  6 | 
  7 | LLM agents, short for Large Language Model agents, are gaining quite some popularity because they blend advanced language processing with other crucial components like planning and memory. They smart systems that can handle complex tasks by combining a large language model with other tools.
  8 | 
  9 | Imagine you're trying to create a virtual assistant that helps people plan their vacations. You want it to be able to handle simple questions like "What's the weather like in Paris next week?" or "How much does it cost to fly to Tokyo in July?"
 10 | 
 11 | A basic virtual assistant might be able to answer those questions using pre-programmed responses or by searching the internet. But what if someone asks a more complicated question, like "I want to plan a trip to Europe next summer. Can you suggest an itinerary that includes visiting historic landmarks, trying local cuisine, and staying within a budget of $3000?"
 12 | 
 13 | That's a tough question because it involves planning, budgeting, and finding information about different destinations. An LLM agent could help with this by using its knowledge and tools to come up with a personalized itinerary. It could search for flights, hotels, and tourist attractions, while also keeping track of the budget and the traveler's preferences.
 14 | 
 15 | To build this kind of virtual assistant, you'd need an LLM as the main "brain" to understand and respond to questions. But you'd also need other modules for planning, budgeting, and accessing travel information. Together, they would form an LLM agent capable of handling complex tasks and providing personalized assistance to users.
 16 | 
 17 | ![Screenshot 2024-04-07 at 2.39.12 PM.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/Screenshot_2024-04-07_at_2.39.12_PM.png)
 18 | 
 19 | Image Source: [https://arxiv.org/pdf/2309.07864.pdf](https://arxiv.org/pdf/2309.07864.pdf)
 20 | 
 21 | The above image represents a potential theoretical structure of an LLM-based agent proposed by the paper “**[The Rise and Potential of Large Language Model Based Agents: A Survey](https://arxiv.org/pdf/2309.07864.pdf)**”
 22 | 
 23 | It comprises three integral components: the brain, perception, and action. 
 24 | 
 25 | - Functioning as the central controller, the **brain** module engages in fundamental tasks such as storing information, processing thoughts, and making decisions.
 26 | - Meanwhile, the **perception** module is responsible for interpreting and analyzing various forms of sensory input from the external environment.
 27 | - Subsequently, the **action** module executes tasks using appropriate tools and influences the surrounding context.
 28 | 
 29 | The above framework represents one approach to breaking down the design of an LLM agent into distinct, self-contained components. However, please note that this framework is just one of many possible configurations.
 30 | 
 31 | In essence, an LLM agent goes beyond basic question-answering capabilities of an LLM. It processes feedback, maintains memory, strategizes for future actions, and collaborates with various tools to make informed decisions. This functionality resembles rudimentary human-like behavior, marking LLM agents as stepping stones towards the notion of Artificial General Intelligence (AGI). Here, LLMs can autonomously undertake tasks without human intervention, representing a significant advancement in AI capabilities.
 32 | 
 33 | ## LLM Agent Framework
 34 | 
 35 | In the preceding section, we discussed one framework for comprehending LLM agents, which involved breaking down the agent into three key components: the brain, perception, and action. In this section, we will explore a more widely used framework for structuring agent components. 
 36 | 
 37 | This framework comprises the following essential elements:
 38 | 
 39 | ![Screenshot 2024-04-07 at 2.53.23 PM.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/Screenshot_2024-04-07_at_2.53.23_PM.png)
 40 | 
 41 | Image Source: [https://developer.nvidia.com/blog/introduction-to-llm-agents/](https://developer.nvidia.com/blog/introduction-to-llm-agents/)
 42 | 
 43 | 1. **Agent Core:** The agent core functions as the central decision-making component within an AI agent. It oversees the core logic and behavioral patterns of the agent. Within this core, various aspects are managed, including defining the agent's overarching goals, providing instructions for tool utilization, specifying guidelines for employing different planning modules, incorporating pertinent memory items from past interactions, and potentially shaping the agent's persona.
 44 | 2. **Memory Module:** Memory modules are essential components of AI agents, serving as repositories for storing internal logs and user interactions. These modules consist of two main types: 
 45 |     1. Short-term memory: captures the agent's ongoing thought processes as it attempts to respond to a single user query. 
 46 |     2. Long-term memory: maintains a historical record of conversations spanning extended periods, such as weeks or months. 
 47 |     
 48 |     Memory retrieval involves employing techniques based on semantic similarity, complemented by factors such as importance, recency, and application-specific metrics.
 49 |     
 50 | 3. **Tools:** Tools represent predefined executable workflows utilized by agents to execute tasks effectively. They encompass various capabilities, such as RAG pipelines for context-aware responses, code interpreters for tackling complex programming challenges, and APIs for conducting internet searches or accessing simple services like weather forecasts or messaging.
 51 | 4. **Planning Module:** Complex problem-solving often requires well structured approaches. LLM-powered agents tackle this complexity by employing a blend of techniques within their planning modules. These techniques may involve task decomposition, breaking down complex tasks into smaller, manageable parts, and reflection or critique, engaging in thoughtful analysis to arrive at optimal solutions.
 52 | 
 53 | ## Multi-agent systems (MAS)
 54 | 
 55 | While LLM-based agents demonstrate impressive text understanding and generation capabilities, they typically operate in isolation, lacking the ability to collaborate with other agents and learn from social interactions. This limitation hinders their potential for enhanced performance through multi-turn feedback and collaboration in complex scenarios.
 56 | 
 57 |  LLM-based multi-agent systems (MAS) prioritize diverse agent profiles, interactions among agents, and collective decision-making. Collaboration among multiple autonomous agents in LLM-MA systems enables tackling dynamic and complex tasks through unique strategies, behaviors, and communication between agents.
 58 | 
 59 | An LLM-based multi-agent system offers several advantages, primarily based on the principle of the division of labor. Specialized agents equipped with domain knowledge can efficiently handle specific tasks, leading to enhanced task efficiency and collective decision improvement. Decomposing complex tasks into multiple subtasks can streamline processes, ultimately improving system efficiency and output quality.
 60 | 
 61 | **Types of Multi-Agent Interactions**
 62 | 
 63 | Multi-agent interactions in LLM-based systems can be broadly categorized into cooperative and adversarial interactions.
 64 | 
 65 | ![Screenshot 2024-04-07 at 3.03.48 PM.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/Screenshot_2024-04-07_at_3.03.48_PM.png)
 66 | 
 67 | Image source: [https://arxiv.org/pdf/2309.07864.pdf](https://arxiv.org/pdf/2309.07864.pdf)
 68 | 
 69 | ### **Cooperative Interaction:**
 70 | 
 71 | In cooperative multi-agent systems, agents assess each other's needs and capabilities, actively seeking collaborative actions and information sharing. This approach enhances task efficiency, improves collective decision-making, and resolves complex real-world problems through synergistic complementarity. Existing cooperative multi-agent applications can be classified into disordered cooperation and ordered cooperation
 72 | 
 73 | 1. **Disordered cooperation**: multiple agents within a system express their perspectives and opinions freely without adhering to a specific sequence or collaborative workflow. However, without a structured workflow, coordinating responses and consolidating feedback can be challenging, potentially leading to inefficiencies.
 74 | 2. **Ordered cooperation**: agents adhere to specific rules or sequences when expressing opinions or engaging in discussions. Each agent follows a predefined order, ensuring a structured and organized interaction.
 75 | 
 76 | Therefore, disordered cooperation allows for open expression and flexibility but may lack organization and pose challenges in decision-making. On the other hand, ordered cooperation offers improved efficiency and clarity but may be rigid and dependent on predefined sequences. Each approach has its own set of benefits and challenges, and the choice between them depends on the specific requirements and goals of the multi-agent system.
 77 | 
 78 | ### **Adversarial Interaction**
 79 | 
 80 | While cooperative methods have been extensively explored, researchers increasingly recognize the benefits of introducing concepts from game theory into multi-agent systems. Adversarial interactions foster dynamic adjustments in agent strategies, leading to robust and efficient behaviors. Successful applications of adversarial interaction in LLM-based multi-agent systems include debate and argumentation, enhancing the quality of responses and decision-making.
 81 | 
 82 | Despite the promising advancements in multi-agent systems, several challenges persist, including limitations in processing prolonged debates, increased computational overhead in multi-agent environments, and the risk of convergence to incorrect consensus. Further development of multi-agent systems requires addressing these challenges and may involve integrating human guides to compensate for agent limitations and promote advancements.
 83 | 
 84 | MAS is a dynamic field of study with significant potential for enhancing collaboration, decision-making, and problem-solving in complex environments. Continued research and development in this area promise to pave way for  new opportunities for intelligent agent interaction and cooperation leading to progress in AGI.
 85 | 
 86 | ## Real World LLM Agents: BabyAGI
 87 | 
 88 | BabyAGI is a popular task-driven autonomous agent designed to perform diverse tasks across various domains. It utilizes technologies such as OpenAI's GPT-4 language model, Pinecone vector search platform, and the LangChain framework. Here's a breakdown of its key components as discussed [by the author](https://yoheinakajima.com/task-driven-autonomous-agent-utilizing-gpt-4-pinecone-and-langchain-for-diverse-applications/) .
 89 | 
 90 | 1. GPT-4 (Agent Core):
 91 |     - OpenAI's GPT-4 serves as the core of the system, enabling it to complete tasks, generate new tasks based on completed results, and prioritize tasks in real-time. It leverages the powerful text-based language model capabilities of GPT-4.
 92 | 2. Pinecone(Memory Module):
 93 |     - Pinecone is utilized for efficient storage and retrieval of task-related data, including task descriptions, constraints, and results. It provides robust search and storage capabilities for high-dimensional vector data, enhancing the system's efficiency.
 94 | 3. LangChain Framework (Tooling Module):
 95 |     - The LangChain framework enhances the system's capabilities, particularly in task completion and decision-making processes. It allows the AI agent to be data-aware and interact with its environment, contributing to a more powerful and differentiated system.
 96 | 4. Task Management (Planning Module):
 97 |     - The system maintains a task list using a deque data structure, enabling it to manage and prioritize tasks autonomously. It dynamically generates new tasks based on completed results and adjusts task priorities accordingly.
 98 |     
 99 |     ![babyAGI](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/babyAGI.png)
100 |     
101 |     Image Source: [https://yoheinakajima.com/task-driven-autonomous-agent-utilizing-gpt-4-pinecone-and-langchain-for-diverse-applications/](https://yoheinakajima.com/task-driven-autonomous-agent-utilizing-gpt-4-pinecone-and-langchain-for-diverse-applications/)
102 |     
103 | 
104 |  BabyAGI operates through the following steps:
105 | 
106 | 1. Completing Tasks: The system processes tasks from the task list using GPT-4 and LangChain capabilities to generate results, which are then stored in Pinecone.
107 | 2. Generating New Tasks: Based on completed task results, BabyAGI employs GPT-4 to generate new tasks, ensuring non-overlapping tasks with existing ones.
108 | 3. Prioritizing Tasks: Task prioritization is conducted based on new task generation and priorities, with assistance from GPT-4 to facilitate the prioritization process.
109 | 
110 | You can find the code to test and play around with BabyAGI [here](https://github.com/yoheinakajima/babyagi)
111 | 
112 | Other popular LLM based agents are listed [here](https://www.promptingguide.ai/research/llm-agents#notable-llm-based-agents)
113 | 
114 | ## **Evaluating LLM Agents**
115 | 
116 | Despite their remarkable performance in various domains, quantifying and objectively evaluating LLM-based agents remain challenging.  Several benchmarks have been designed to evaluate LLM agents. Some examples include
117 | 
118 | 1. [AgentBench](https://github.com/THUDM/AgentBench)
119 | 2. [IGLU](https://arxiv.org/abs/2304.10750)
120 | 3. [ClemBench](https://arxiv.org/abs/2305.13455)
121 | 4. [ToolBench](https://arxiv.org/abs/2305.16504)
122 | 5. [GentBench](https://arxiv.org/pdf/2308.04030.pdf)
123 | 
124 | ![Screenshot 2024-04-07 at 3.28.33 PM.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/Screenshot_2024-04-07_at_3.28.33_PM.png)
125 | 
126 | Image: Tasks and Datasets supported by the GentBench framework
127 | 
128 | Apart from task specific metrics, some dimensions in which agents can be evaluated include
129 | 
130 | - **Utility**: Focuses on task completion effectiveness and efficiency, with success rate and task outcomes being primary metrics.
131 | - **Sociability**: Includes language communication proficiency, cooperation, negotiation abilities, and role-playing capability.
132 | - **Values**: Ensures adherence to moral and ethical guidelines, honesty, harmlessness, and contextual appropriateness.
133 | - **Ability to Evolve Continually**: Considers continual learning, autotelic learning ability, and adaptability to new environments.
134 | - **Adversarial Robustness**: LLMs are susceptible to adversarial attacks, impacting their robustness. Traditional techniques like adversarial training are employed, along with human-in-the-loop supervision.
135 | - **Trustworthiness**: Calibration problems and biases in training data affect trustworthiness. Efforts are made to guide models to exhibit thought processes or explanations to enhance credibility.
136 | 
137 | ## Build Your Own  Agent (Resources)
138 | 
139 | Now that you have gained an understanding of LLM agents and their functioning, here are some top resources to help you construct your own LLM agent.
140 | 
141 | 1. [How to Create your own LLM Agent from Scratch: A Step-by-Step Guide](https://gathnex.medium.com/how-to-create-your-own-llm-agent-from-scratch-a-step-by-step-guide-14b763e5b3b8)
142 | 2. [Building Your First LLM Agent Application](https://developer.nvidia.com/blog/building-your-first-llm-agent-application/)
143 | 3. [Building Agents on LangChain](https://python.langchain.com/docs/use_cases/tool_use/agents/)
144 | 4. [Building a LangChain Custom Medical Agent with Memory](https://www.youtube.com/watch?v=6UFtRwWnHws)
145 | 5. [LangChain Agents - Joining Tools and Chains with Decisions](https://www.youtube.com/watch?v=ziu87EXZVUE)
146 | 
147 | ## References:
148 | 
149 | 1. [The Rise and Potential of Large Language Model Based Agents: A Survey](https://arxiv.org/pdf/2309.07864.pdf)
150 | 2. [Large Language Model based Multi-Agents: A Survey of Progress and Challenges](https://arxiv.org/pdf/2402.01680.pdf)
151 | 3. [LLM Agents by Prompt Engineering Guide](https://www.promptingguide.ai/research/llm-agents#notable-llm-based-agents)
152 | 4. [Introduction to LLM Agents, Nvidia Blog](https://developer.nvidia.com/blog/introduction-to-llm-agents/)


--------------------------------------------------------------------------------
/resources/agents_roadmap.md:
--------------------------------------------------------------------------------
 1 | # LLM Agents: From Zero to One
 2 | 
 3 | LLM agents are gaining quite some momentum in the generative AI space since they can process feedback, maintain memory, strategize for future actions, and collaborate with various tools to make informed decisions.
 4 | 
 5 | If you’ve been looking to learn more about LLM agents and maybe even create your own, this roadmap is just for you! It's filled with great free resources to help you get started and stay up-to-date on what's happening in the world of agents.
 6 | 
 7 | ![agent_roadmap_image.gif](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/agent_roadmap_image.gif)
 8 | 
 9 | # Roadmap
10 | 
11 | ## **Day 1: Introduction to Agents**
12 | 
13 | 1. LLM Agents glossary by Deepchecks ([link](https://deepchecks.com/glossary/llm-agents/))
14 | 2. Navigating the World of LLM Agents: A Beginner’s Guide by Dominik Polzer  ([link](https://towardsdatascience.com/navigating-the-world-of-llm-agents-a-beginners-guide-3b8d499db7a9))
15 | 
16 | ---
17 | 
18 | ## **Day 2: Core Components**
19 | 
20 | 1. Harrison Chase - Agents Masterclass from LangChain Founder ([link](https://www.youtube.com/watch?v=DWUdGhRrv2c))
21 | 2. Introduction to LLM Agents by Nvidia ([link](https://developer.nvidia.com/blog/introduction-to-llm-agents/))
22 | 
23 | ---
24 | 
25 | ## **Day 3: Multi-Agents & Evaluation**
26 | 
27 | 1. Revolutionizing AI: The Era of Multi-Agent Large Language Models by Gary Fowler **([link](https://gafowler.medium.com/revolutionizing-ai-the-era-of-multi-agent-large-language-models-f70d497f3472))**
28 | 2. Multi-Agent LLM Applications | A Review of Current Research, Tools, and Challenges by Victor Dibia ([link](https://newsletter.victordibia.com/p/multi-agent-llm-applications-a-review))
29 | 3. How to Build, Evaluate, and Iterate on LLM Agents by [Deeplearning.AI](http://Deeplearning.AI) ([link](https://www.youtube.com/watch?v=0pnEUAwoDP0))
30 | 4. Benchmarks for evaluating agents (read any one):
31 |     1. [AgentBench](https://github.com/THUDM/AgentBench)
32 |     2. [IGLU](https://arxiv.org/abs/2304.10750)
33 |     3. [ClemBench](https://arxiv.org/abs/2305.13455)
34 |     4. [ToolBench](https://arxiv.org/abs/2305.16504)
35 |     5. [GentBench](https://arxiv.org/pdf/2308.04030.pdf)
36 | 
37 | ---
38 | 
39 | ## **Day 4- Real-World Agents**
40 | 
41 | 1. Harrison Chase - Agents Masterclass from LangChain Founder ([link](https://www.youtube.com/watch?v=DWUdGhRrv2c))
42 | 2. What's next for AI agents ft. LangChain's Harrison Chase ([link](https://www.youtube.com/watch?v=pBBe1pk8hf4))
43 | 3. Scaling AI Agents for Real-World Tasks with Parcha CEO AJ Asver ([link](https://www.youtube.com/watch?v=zCGWDWCTYkE))
44 | 4. Learn about popular real world agents (read any one):
45 |     - ChemCrow: Augmenting large-language models with chemistry tools ([link](https://arxiv.org/abs/2304.05376))
46 |     - BabyAGI ([link](https://github.com/yoheinakajima/babyagi))
47 |     - OS-Copilot: Towards Generalist Computer Agents with Self-Improvement ([link](https://arxiv.org/abs/2402.07456))
48 | 
49 | 4. Use these Github repos to check out the latest research in agents (use this as a reference only; it’s not required to read through everything)
50 |     -  **[awesome-llm-powered-agent](https://github.com/hyp1231/awesome-llm-powered-agent)**
51 |     -  **[awesome-ai-agents](https://github.com/e2b-dev/awesome-ai-agents/tree/main)**
52 | 
53 | ---
54 | 
55 | ## **Day 5- Build Your Own Agent**
56 | 
57 | Choose any one of these resources and follow the implementation guide in them to get started
58 | 
59 | 1. Episode #1: Intro to LLM Agents: When RAG is Not Enough by Neurons Lab ([link](https://www.youtube.com/watch?v=uVkS05qPhik))
60 | 2. Build Anything with AI Agents, Here's How by David Ondrej ([link](https://www.youtube.com/watch?v=AxnL5GtWVNA))
61 | 3. The Complete Guide to Building AI Agents for Beginners by VRSEN([link](https://www.youtube.com/watch?v=MOyl58VF2ak))
62 | 4. Building a LangChain Custom Medical Agent with Memory by ****Sam Witteveen ([link](https://www.youtube.com/watch?v=6UFtRwWnHws))
63 | 5. Langchain Agents [2024 UPDATE] - Beginner Friendly by Ryan Nolan Data ([link](https://www.youtube.com/watch?v=WVUITosaG-g))
64 | 6. AI Agents in LangGraph course by Deeplearning.AI ([Link](https://www.deeplearning.ai/short-courses/ai-agents-in-langgraph/))
65 | 7. Multi-agent Conversation Framework on Microsoft Autogen ([Link](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat/))
66 | 
67 | 
68 | ---
69 | 
70 | ## Other comprehensive resources:
71 | 
72 | 1. My “Agents 101” guide ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/agents_101_guide.md))
73 | 2. LLM Powered Autonomous Agents by Lilian Weng ([link](https://lilianweng.github.io/posts/2023-06-23-agent/))
74 | 3. LLM Agents by Prompt Engineering Guide ([link](https://www.promptingguide.ai/research/llm-agents))
75 | 4. LangChain and the Future of LLM Agents by Arize AI ([link](https://www.youtube.com/watch?v=JwO08Pk6S_Q))
76 | 


--------------------------------------------------------------------------------
/resources/fine_tuning_101.md:
--------------------------------------------------------------------------------
  1 | # Fine-Tuning 101 Guide
  2 | 
  3 | 
  4 | ![main_agentic_rag.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/fine-tuning-main.png)
  5 | 
  6 | 
  7 | ## What is Fine Tuning?
  8 | 
  9 | Fine Tuning is the process of adapting a pre-trained language model for specific tasks or domains by further training it on a smaller, targeted dataset. This approach leverages the general knowledge and capabilities the model acquired during its initial pre-training phase while optimizing its performance for particular applications.
 10 | 
 11 | During fine tuning, most of the model's parameters are updated, but at a lower learning rate than initial training. This allows the model to retain its foundational knowledge while adapting to new contexts.
 12 | 
 13 | ---
 14 | 
 15 | ## Why Fine Tune?
 16 | 
 17 | Fine Tuning addresses several limitations of pre-trained models:
 18 | 
 19 | - **Domain-specific needs**: Pre-trained models have broad knowledge but may lack depth in specialized fields like medicine, law, or technical domains. Fine Tuning can teach models domain-specific terminology, conventions, and knowledge.
 20 | 
 21 | - **Task specialization**: General-purpose models might not excel at specific tasks like sentiment analysis, text classification, or summarization without additional training.
 22 | 
 23 | - **Improved performance**: Fine Tuning typically yields better results than prompting alone for targeted applications, especially when consistent, reliable outputs are required.
 24 | 
 25 | - **Reduced prompt engineering**: A well-fine tuned model often requires less elaborate prompting to achieve desired results.
 26 | 
 27 | - **Adaptation to organizational style**: Organizations can align model outputs with their communication style, tone, and guidelines.
 28 | 
 29 | ---
 30 | 
 31 | ## Fine Tuning vs. Prompting vs. Training from Scratch: When to Use What?
 32 | 
 33 | ### Prompting
 34 | 
 35 | **Best for**: Quick implementations, general tasks, limited resources, or when flexibility is needed  
 36 | **Advantages**: No additional training, immediate deployment, adaptable on-the-fly  
 37 | **Limitations**: May require complex prompt engineering, can be inconsistent, consumes token budget  
 38 | **Use when**: You need quick solutions, have limited data, or requirements change frequently
 39 | 
 40 | ---
 41 | 
 42 | ### Fine Tuning
 43 | 
 44 | **Best for**: Specialized applications, consistent outputs, improved efficiency  
 45 | **Advantages**: Better performance on specific tasks, reduced prompt length, more consistent results  
 46 | **Limitations**: Requires quality training data, computational resources, and expertise  
 47 | **Use when**: You have a well-defined use case, sufficient domain-specific data, and need reliable performance
 48 | 
 49 | ---
 50 | 
 51 | ### Training from Scratch
 52 | 
 53 | **Best for**: Highly specialized applications, proprietary systems, or when privacy is paramount  
 54 | **Advantages**: Complete control over model architecture and training, no reliance on external foundations  
 55 | **Limitations**: Extremely resource-intensive, requires massive datasets and expertise  
 56 | **Use when**: Pre-trained models fundamentally cannot meet your needs, you have massive computational resources, or you're developing novel architectures
 57 | 
 58 | ---
 59 | 
 60 | In practice, many organizations start with prompting to validate use cases, then move to fine tuning as requirements solidify. Training from scratch remains rare outside of large AI research organizations.
 61 | 
 62 | 
 63 | ## Prerequisites for Fine Tuning LLMs
 64 | 
 65 | ---
 66 | 
 67 | 
 68 | 
 69 | ### Tools and Libraries
 70 | 
 71 | The essential toolkit for LLM fine tuning includes:
 72 | 
 73 | - **PyTorch or TensorFlow**: These deep learning frameworks provide the foundation for model training  
 74 | - **Hugging Face Transformers**: A library that makes it easy to work with pre-trained models  
 75 | - **Hugging Face Datasets**: For efficiently loading and processing training data  
 76 | - **Accelerate**: For distributed training across multiple GPUs  
 77 | - **PEFT/LoRA libraries**: For parameter-efficient fine tuning methods  
 78 | - **Weights & Biases** or **TensorBoard**: For experiment tracking and visualization  
 79 | 
 80 | ![main_agentic_rag.png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/fine-tuning-stack.png)
 81 | 
 82 | 
 83 | ---
 84 | 
 85 | 
 86 | ### Hardware Requirements
 87 | 
 88 | Fine tuning requirements vary based on model size:
 89 | 
 90 | - **Small models (< 1B parameters)**: Consumer GPUs (8–16GB VRAM) can handle these  
 91 | - **Medium models (1–7B parameters)**: Require high-end GPUs (24–48GB VRAM) or multiple GPUs  
 92 | - **Large models (> 7B parameters)**: Need multiple high-end GPUs, TPUs, or specialized hardware  
 93 | 
 94 | **Alternative approaches for resource constraints**:
 95 | - Parameter-efficient fine tuning (LoRA, QLoRA, etc.)
 96 | - Quantization to reduce memory footprint
 97 | - Gradient checkpointing to trade computation for memory
 98 | - Cloud-based solutions (e.g., Google Colab Pro, AWS, Azure)
 99 | 
100 | ---
101 | 
102 | ### Data Requirements
103 | 
104 | Effective fine tuning depends heavily on your data:
105 | 
106 | - **Quality**: Clean, relevant, and representative of your target task  
107 | - **Quantity**:
108 |   - Classification: At least 100+ examples per class  
109 |   - Generation: 1,000+ examples recommended  
110 |   - More complex tasks may need significantly more data  
111 | - **Format**: Typically JSON or CSV with clear inputs and desired outputs  
112 | - **Diversity**: Cover the range of scenarios the model should handle  
113 | - **Preprocessing**: Tokenization, cleaning, and formatting for the specific model  
114 | - **Train/validation split**: To monitor overfitting during training  
115 | 
116 | *Data preparation is often the most critical and time-consuming part of successful fine tuning. Even the best models can't overcome poor quality training data.*
117 | 
118 | ---
119 | 
120 | ## The LLM Fine Tuning Workflow: A Step-by-Step Guide
121 | 
122 | Fine tuning a large language model transforms a general-purpose foundation model into a specialized tool tailored to your needs. Below is a concise, step-by-step overview of the process, highlighting critical stages and best practices:
123 | 
124 | 1. **Define the Objective**
125 |    - What task are you fine tuning for? (e.g., classification, summarization, code generation)
126 |    - What outcome do you expect from the fine tuned model?
127 | 
128 | 2. **Gather and Prepare Data**
129 |    - Collect clean, diverse, task-relevant data
130 |    - Format the dataset for training (usually input-output pairs)
131 |    - Split into training and validation sets
132 | 
133 | 3. **Choose the Right Model**
134 |    - Pick a base model aligned with your compute resources and task complexity
135 |    - Use smaller models for low-latency or edge deployments, larger models for higher accuracy
136 | 
137 | 4. **Select Fine Tuning Approach**
138 |    - Full fine tuning (update all parameters)
139 |    - Parameter-efficient fine tuning (e.g., LoRA, adapters)
140 | 
141 | 5. **Configure Training Setup**
142 |    - Set up the environment using Accelerate or native PyTorch/TF
143 |    - Choose loss function, optimizer, batch size, learning rate
144 | 
145 | 6. **Train the Model**
146 |    - Monitor training and validation loss
147 |    - Use checkpoints and experiment tracking (e.g., Weights & Biases)
148 | 
149 | 7. **Evaluate Performance**
150 |    - Run the fine tuned model on a held-out test set or real examples
151 |    - Analyze metrics relevant to your task (accuracy, BLEU, ROUGE, etc.)
152 | 
153 | 8. **Iterate or Deploy**
154 |    - Refine with more data or better hyperparameters if needed
155 |    - Once satisfied, deploy your model into production or integrate into workflows
156 | 
157 | ---
158 | 
159 | ## The LLM Fine Tuning Workflow: A Step-by-Step Guide
160 | 
161 | Fine tuning a large language model transforms a general-purpose foundation model into a specialized tool tailored to your needs. Below is a structured, step-by-step workflow covering essential stages and tools.
162 | 
163 | ---
164 | 
165 | ### 1. Model Selection
166 | 
167 | Begin by choosing a pre-trained LLM that aligns with your task’s requirements—such as domain, size, and computational constraints. Platforms like Hugging Face host a vast library of models (e.g., BERT, LLaMA, GPT variants), each with distinct architectures and pre-training objectives.
168 | 
169 | This decision sets the foundation for your fine tuning success, balancing capability and resource demands.
170 | 
171 | ---
172 | 
173 | ### 2. Data Preparation
174 | 
175 | High-quality training data is the backbone of effective fine tuning. This step involves:
176 | 
177 | - **Collection**: Gather task-specific datasets using libraries like Hugging Face Datasets, NVIDIA’s data tools, or Pandas  
178 | - **Preprocessing**: Clean and standardize text (e.g., normalization, removing noise) for consistency  
179 | - **Formatting**: Tokenize and structure data into model-compatible inputs, such as input-output pairs or instruction templates  
180 | - **Splitting**: Divide the dataset into training, validation, and test sets to ensure robust evaluation  
181 | 
182 | ---
183 | 
184 | ### 3. Data Annotation
185 | 
186 | For supervised fine tuning, annotate your data with precise labels or structures. Tools like **Labelbox**, **SuperAnnotate**, **CVAT**, or **Label Studio** streamline this process.
187 | 
188 | High-quality annotations are especially vital for domain-specific tasks, where unique terminology or context may require expert input.
189 | 
190 | ---
191 | 
192 | ### 4. Synthetic Data Generation
193 | 
194 | To bolster dataset size and diversity, generate synthetic examples using tools like **MostlyAI** or LLM-driven data augmentation.
195 | 
196 | This enhances model robustness, mitigates data scarcity, and improves generalization across varied inputs—particularly useful for niche or low-resource domains.
197 | 
198 | ---
199 | 
200 | ### 5. Fine Tuning Framework Selection
201 | 
202 | Select a fine tuning strategy and framework suited to your goals and resources. Options include:
203 | 
204 | - **Full Fine Tuning**: Update all model parameters (resource-intensive but thorough)  
205 | - **Parameter-Efficient Fine Tuning (PEFT)**: Use methods like **LoRA**, **QLoRA**, or **Adapters** to adjust only a subset of parameters, reducing compute costs  
206 | - **Instruction Tuning**: Adapt the model to follow specific prompts or formats (e.g., Alpaca-style instructions)  
207 | 
208 | Frameworks like **Unsloth**, **LLaMA Factory**, **Axolotl**, **PyTorch**, or **TensorFlow** offer optimized implementations for these approaches.
209 | 
210 | ---
211 | 
212 | ### 6. Experimentation and Tracking
213 | 
214 | Track and compare fine tuning runs to refine performance. Tools like **Weights & Biases**, **TensorBoard**, or **Comet** enable:
215 | 
216 | - Monitoring of loss, accuracy, and other metrics in real time  
217 | - Logging of hyperparameters (e.g., learning rate, batch size) and their impact  
218 | - Visualization of training dynamics for actionable insights  
219 | 
220 | This systematic approach prevents wasted effort and ensures reproducibility.
221 | 
222 | ---
223 | 
224 | ### 7. Model Evaluation
225 | 
226 | Assess the fine tuned model’s performance using task-specific benchmarks and frameworks like **DeepEval**. Key evaluation aspects include:
227 | 
228 | - **Quantitative metrics**: BLEU, F1, perplexity, etc., tailored to your use case  
229 | - **Qualitative analysis**: Output coherence, factual accuracy, and relevance  
230 | - **Bias detection and robustness checks**  
231 | 
232 | Compare results against the base model to quantify improvements.
233 | 
234 | ---
235 | 
236 | ### 8. Deployment and Serving
237 | 
238 | Deploy the fine tuned model for practical use via platforms like **Hugging Face Inference Endpoints** or custom LLM serving solutions. This step involves:
239 | 
240 | - **Optimization**: Apply quantization or pruning to reduce latency and memory footprint  
241 | - **Integration**: Build APIs or endpoints for seamless access  
242 | - **Scaling**: Configure infrastructure to handle expected loads  
243 | - **Monitoring**: Track usage and performance in production with analytics  
244 | 
245 | ---
246 | 
247 | ### Foundational Tools
248 | 
249 | Throughout the workflow, core machine learning libraries like **PyTorch** and **TensorFlow** underpin model manipulation, gradient computation, and optimization, ensuring flexibility and control.
250 | 
251 | ---
252 | 
253 | ## Unlocking the Power of LLMs: A Deep Dive into Fine-Tuning Techniques & Strategies
254 | 
255 | ## Exploring Categories of Fine-Tuning in LLMs
256 | 
257 | Now, let’s explore the three major categories of fine-tuning: **Task Adaptation**, **Alignment**, and **Parameter-Efficient Fine-Tuning**—and the strategies within each that are shaping the possibilities with LLMs for different problem statements.
258 | 
259 | ---
260 | 
261 | ### 1. Task Adaptation Fine-Tuning: Mastering Specific Jobs
262 | 
263 | This category focuses on adapting LLMs to perform particular tasks with high precision.
264 | 
265 | #### Supervised Fine-Tuning (SFT)
266 | 
267 | * **Concept**: Uses labeled examples to teach the model specific tasks.
268 | * **Example**: Categorizing customer feedback as positive, negative, or neutral.
269 | * **Technical Insight**: Adjusts model weights to minimize error on labeled data.
270 | 
271 | #### Unsupervised Fine-Tuning
272 | 
273 | * **Concept**: Learns patterns from unlabeled data.
274 | * **Example**: Training on hospital records to understand medical terminology.
275 | * **Technical Insight**: Uses self-supervised learning.
276 | 
277 | #### Instruction-Based Fine-Tuning
278 | 
279 | * **Concept**: Trains models using instruction-response pairs.
280 | * **Example**: Chatbot trained to answer software bug queries.
281 | * **Technical Insight**: Often used to make models more interactive and user-friendly.
282 | 
283 | #### Group Relative Policy Optimization (GRPO)
284 | 
285 | * **Concept**: Improves models by having them compete against their own outputs.
286 | * **Example**: Math tutoring app selecting best solutions from multiple outputs.
287 | * **Technical Insight**: Reinforcement learning technique comparing outputs against group average.
288 | 
289 | ---
290 | 
291 | ### 2. Alignment Fine-Tuning: Matching Human Values
292 | 
293 | Focuses on aligning model behavior with human preferences.
294 | 
295 | #### Reinforcement Learning from Human Feedback (RLHF)
296 | 
297 | * **Concept**: Uses human ratings as feedback.
298 | * **Example**: Ensuring polite, helpful chatbot responses.
299 | 
300 | #### Direct Preference Optimization (DPO)
301 | 
302 | * **Concept**: Optimizes models directly on preference data.
303 | * **Example**: Preferring short summaries over long ones in news summarization.
304 | 
305 | #### Odds Ratio Preference Optimization (ORPO)
306 | 
307 | * **Concept**: Combines task learning and preference alignment.
308 | * **Example**: Accurate, concise article summaries.
309 | 
310 | ---
311 | 
312 | ### 3. Parameter-Efficient Fine-Tuning (PEFT): Doing More with Less
313 | 
314 | Adapts models without updating all parameters, saving compute and time.
315 | 
316 | #### Adapters
317 | 
318 | * **Concept**: Insert small modules to fine-tune specific capabilities.
319 | * **Example**: Detecting sarcasm in user comments.
320 | 
321 | #### LoRA (Low-Rank Adaptation)
322 | 
323 | * **Concept**: Uses low-rank matrix updates for weight adjustment.
324 | * **Example**: Adapting to Spanish text generation.
325 | 
326 | #### QLoRA
327 | 
328 | * **Concept**: Combines LoRA with quantization for lower memory usage.
329 | * **Example**: Fine-tuning on laptop GPU for French translation.
330 | 
331 | #### Prompt Tuning
332 | 
333 | * **Concept**: Trains special prompts to steer model behavior.
334 | * **Example**: Creating poetic outputs without altering the model.
335 | 
336 | ---
337 | 
338 | ## Fine-Tuning Technique Selection Matrix
339 | 
340 | **Multi-Goal Domain Adaptation**:
341 | 
342 | * **Limited Resources**: Prompt Tuning + LoRA
343 | * **Efficiency**: LoRA or Adapters depending on available compute
344 | * **Abundant Resources**: QLoRA for multilingual tasks
345 | 
346 | **Behavior Alignment**:
347 | 
348 | * **Limited Resources**: DPO
349 | * **Moderate Resources**: RLHF
350 | * **Abundant Resources**: ORPO
351 | 
352 | **Task Performance**:
353 | 
354 | * **Limited Resources**: Supervised Fine-Tuning
355 | * **Moderate Resources**: Instruction-Based Fine-Tuning
356 | * **Abundant Resources**: GRPO
357 | 
358 | ---
359 | 
360 | ## Mastering LLM Fine-Tuning: How to Measure Success
361 | 
362 | ### Why Fine-Tuning Metrics Are Different
363 | 
364 | Fine-tuned models must be evaluated based on task-specific performance, not general fluency.
365 | 
366 | ### Key Metrics
367 | 
368 | #### Task-Specific Metrics
369 | 
370 | * **Accuracy**: Ideal for classification
371 | * **F1 Score**: Balances precision and recall
372 | * **Exact Match (EM)**: Used for QA tasks
373 | * **BLEU & ROUGE**: Text generation and summarization
374 | 
375 | #### Perplexity
376 | 
377 | * Measures fluency and domain adaptation
378 | 
379 | #### Hallucination Detection
380 | 
381 | * Tools: SelfCheckGPT, NLI Scorers
382 | 
383 | #### Toxicity and Bias Metrics
384 | 
385 | * Tools: Detoxify, G-Eval
386 | 
387 | #### Semantic Similarity
388 | 
389 | * Tools: BERTScore, embedding-based comparisons
390 | 
391 | #### Diversity
392 | 
393 | * Important for creative tasks
394 | 
395 | #### Prompt Alignment
396 | 
397 | * Tests if the model follows instructions faithfully
398 | 
399 | ---
400 | 
401 | ## Pro Tips
402 | 
403 | * Build custom benchmarks
404 | * Compare baseline vs fine-tuned
405 | * Watch for overfitting
406 | 
407 | ---
408 | 
409 | ## Resources
410 | 
411 | * [Unsloth Fine-Tuning Notebooks](https://github.com/unslothai/unsloth)
412 | * [LLaMA Factory Framework](https://github.com/hiyouga/LLaMA-Factory)
413 | * [Awesome LLM Fine-Tuning List](https://github.com/Curated-Awesome-Lists/awesome-llms-fine-tuning)
414 | 
415 | 
416 | Written by [Towhidul Islam](https://www.linkedin.com/in/towhidultonmoy/)
417 | 
418 | 


--------------------------------------------------------------------------------
/resources/gen_ai_projects.md:
--------------------------------------------------------------------------------
 1 | # Generative AI projects for your resume
 2 | 
 3 | Boost your resume with these amazing Generative AI project ideas, each designed to provide practical experience and highlight your skills with the latest technologies. 
 4 | 
 5 | Here's a breakdown of each project, relevant tutorials and code to help you get started and the skills you'll develop.
 6 | 
 7 | ## 1. Develop an LLM based Natural Language to SQL Query Generator
 8 | 
 9 | ### **Difficulty Level**: 2/5
10 | 
11 | ### **Description**:
12 | 
13 | In this project, you'll use the OpenAI API and LlamaIndex to create a system that converts natural language queries into SQL queries and executes them on a DuckDB database.
14 | 
15 | ### **Skills Gained:**
16 | 
17 | Prompt Engineering, Text-to-SQL execution using LLMs
18 | 
19 | ### **Resources**:
20 | 
21 | - [Tutorial](https://www.youtube.com/watch?v=03KFt-XSqVI)
22 | - [Code](https://github.com/sudarshan-koirala/youtube-stuffs/blob/main/llamaindex/text_to_sql.ipynb)
23 | 
24 | ---
25 | 
26 | ## 2. Build a GPT-3.5 Backed Customer Support Chatbot
27 | 
28 | ### Difficulty Level: 3/5
29 | 
30 | ### **Description:**
31 | 
32 | In this project, you will create a simple chatbot using GPT-3.5 through the OpenAI API  and LlamaIndex. The chatbot will be capable of handling various customer queries by leveraging internal data, providing more tailored responses than a generic chatbot.
33 | 
34 | ### **Skills Learned:**
35 | 
36 | Prompt Engineering, Prompt Chaining, Data Indexing and Chunking
37 | 
38 | ### **Resources:**
39 | 
40 | - [Tutorial](https://www.confident-ai.com/blog/building-a-customer-support-chatbot-using-gpt-3-5-and-llamaindex)
41 | - [Code](https://github.com/confident-ai/blog-examples/tree/main/customer-support-chatbot)
42 | 
43 | ---
44 | 
45 | ## 3. Fine-tune a Mistral 7B on your own dataset
46 | 
47 | ### Difficulty Level: 4/5
48 | 
49 | ### Description:
50 | 
51 | In this project, you'll train an open-source model on your own dataset using Unsloth. You will learn about standard fine-tuning methods such as LoRA, as well as concepts like model quantization.
52 | 
53 | ### Skills Gained:
54 | 
55 | Fine-tuning open-source models Implementing PEFT (Parameter-Efficient Fine-Tuning) methods
56 | 
57 | ### Resources:
58 | 
59 | - [Tutorial](https://www.youtube.com/watch?v=aQmoog_s8HE)
60 | - [Code](https://colab.research.google.com/drive/1mPw6P52cERr93w3CMBiJjocdTnyPiKTX#scrollTo=6bZsfBuZDeCL)
61 | 
62 | ---
63 | 
64 | ## 4. Creating a YouTube Video Summarization App
65 | 
66 | ### Difficulty Level: 4.5/5
67 | 
68 | ### Description:
69 | 
70 | In this project, you will learn how to create your very own YouTube Video Summarization App using a powerful combination technologies: Haystack, Llama 2, Whisper, and Streamlit. 
71 | 
72 | ### **Skills Gained:**
73 | 
74 | End-to-End LLM Application Deployment
75 | 
76 | ### Resources:
77 | 
78 | - [Tutorial](https://www.youtube.com/watch?v=K9mDAb2Lz6Y)
79 | - [Code](https://github.com/AIAnytime/YouTube-Video-Summarization-App)
80 | 
81 | ---
82 | 


--------------------------------------------------------------------------------
/resources/genai_roadmap.md:
--------------------------------------------------------------------------------
 1 | # 5-Day LLM Foundations Roadmap 2024
 2 | 
 3 | If you're feeling overwhelmed by the scattered knowledge about LLMs, this roadmap and curated resources from top sources are here to guide you. Dedicate 2-3 hours daily to understand the resources thoroughly, and by the fifth day, you'll be ready to develop your own LLM application! **This roadmap is designed for individuals with basic machine learning knowledge**. The optional content can be explored when time permits. Enjoy the learning journey! Once you've established your foundation, utilize this repository to delve into research papers, explore additional courses, and continue enhancing your skills.
 4 | 
 5 | ![Applied_LLMs_(28).png](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/resources/img/Applied_LLMs_(28).png)
 6 | 
 7 | ## Day 1: LLM Basics and Foundations
 8 | 
 9 | **Watch these videos (1 hour):**
10 | 
11 | 1. LLM Foundations by FullStack ([link](https://fullstackdeeplearning.com/llm-bootcamp/spring-2023/llm-foundations/))
12 | 
13 | **Read these resources (1 hour):**
14 | 
15 | 1. Applied LLMs Mastery course week 1 content ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/free_courses/Applied_LLMs_Mastery_2024/week1_part1_foundations.md))
16 | 2. Applications of LLMs article by CellStrat ([link](https://cellstrat.medium.com/real-world-use-cases-for-large-language-models-llms-d71c3a577bf2))
17 | 3. What are LLMs article by Amazon ([link](https://aws.amazon.com/what-is/large-language-model/))
18 | 4. **(Optional)** A survey of LLMs paper([link](https://arxiv.org/abs/2303.18223)) 
19 | 
20 | ---
21 | 
22 | ## Day 2: Prompting for LLMs
23 | 
24 | **Watch these videos (1 hour):**
25 | 
26 | 1. Prompt engineering course by [Deeplearning.AI](http://Deeplearning.AI) ([link](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/))
27 | 
28 | **Read these resources (1 hour):**
29 | 
30 | 1. Applied LLMs Mastery week course 2 content ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/free_courses/Applied_LLMs_Mastery_2024/week2_prompting.md))
31 | 2. Introduction to prompt engineering guide ([link](https://www.promptingguide.ai/introduction))
32 | 3. Advanced prompt engineering techniques guide ([link](https://www.promptingguide.ai/techniques))
33 | 
34 | ---
35 | 
36 | ## Day 3: Retrieval Augmented Generation (RAG)
37 | 
38 | **Watch these videos (30 mins):**
39 | 
40 | 1. What is RAG by [Deeplearning.AI](http://Deeplearning.AI) ([link](https://learn.deeplearning.ai/building-applications-vector-databases/lesson/3/retrieval-augmented-generation-(rag)))
41 | 2. Building production ready RAG applications course by LlamaIndex ([Link](https://www.youtube.com/watch?v=TRjq7t2Ms5I))
42 | 3. **(Optional**) RAG with pinecone and Langchain video ([link](https://www.youtube.com/watch?v=J_tCD_J6w3s))
43 | 
44 | **Read these resources (1 hour):**
45 | 
46 | 1. Applied LLMs Mastery course week 4 content ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/free_courses/Applied_LLMs_Mastery_2024/week4_RAG.md))
47 | 2. RAG blog post by Amazon ([link](https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-foundation-models-customize-rag.html))
48 | 3. Blog on advanced RAG techniques by Akash ([link](https://akash-mathur.medium.com/advanced-rag-optimizing-retrieval-with-additional-context-metadata-using-llamaindex-aeaa32d7aa2f))
49 | 
50 | ---
51 | 
52 | ## Day 4: LLM Fine-Tuning
53 | 
54 | **Watch these videos (1.5 hours):**
55 | 
56 | 1. LLM Fine-Tuning [Deeplearning.AI](http://Deeplearning.AI) ([link](https://learn.deeplearning.ai/finetuning-large-language-models/lesson/1/introduction))
57 | 2. Advanced fine-tuning techniques on YouTube by Shaw ([link](https://www.youtube.com/watch?v=eC6Hd1hFvos))
58 | 
59 | **Read these resources (1 hour):**
60 | 
61 | 1. Applied LLMs Mastery course week 3 content ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/free_courses/Applied_LLMs_Mastery_2024/week3_finetuning_llms.md))
62 | 2. Guide for fine-tuning LLMs by Labellerr ([link](https://www.labellerr.com/blog/comprehensive-guide-for-fine-tuning-of-llms/))
63 | 3. PEFT methods by HuggingFace ([link](https://huggingface.co/blog/peft))
64 | 
65 | ---
66 | 
67 | ## Day 5: LLM Applications and Tooling
68 | 
69 | **Watch these videos (1 hour):**
70 | 
71 | 1. Build your own LLM application using LangChain course by [Deeplearning.AI](http://Deeplearning.AI) ([link](https://learn.deeplearning.ai/langchain/lesson/1/introduction))
72 | 
73 | **Read these resources (1 hour):**
74 | 
75 | 1. Applied LLMs Mastery course week 5 content ([link](https://github.com/aishwaryanr/awesome-generative-ai-guide/blob/main/free_courses/Applied_LLMs_Mastery_2024/week5_tools_for_LLM_apps.md))
76 | 2. Tools for LLM Applications blog by a16z ([link](https://a16z.com/emerging-architectures-for-llm-applications/))
77 | 


--------------------------------------------------------------------------------
/resources/img/Applied_LLMs_(28).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Applied_LLMs_(28).png


--------------------------------------------------------------------------------
/resources/img/Applied_LLMs_-_2024-05-03T122206.505.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Applied_LLMs_-_2024-05-03T122206.505.png


--------------------------------------------------------------------------------
/resources/img/RAG_roadmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/RAG_roadmap.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-04-07_at_2.39.12_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-04-07_at_2.39.12_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-04-07_at_2.53.23_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-04-07_at_2.53.23_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-04-07_at_3.03.48_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-04-07_at_3.03.48_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-04-07_at_3.28.33_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-04-07_at_3.28.33_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-05-02_at_12.06.06_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-05-02_at_12.06.06_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-05-02_at_12.06.29_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-05-02_at_12.06.29_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-05-02_at_12.21.46_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-05-02_at_12.21.46_PM.png


--------------------------------------------------------------------------------
/resources/img/Screenshot_2024-05-03_at_10.55.00_AM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/Screenshot_2024-05-03_at_10.55.00_AM.png


--------------------------------------------------------------------------------
/resources/img/agent_roadmap_image.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/agent_roadmap_image.gif


--------------------------------------------------------------------------------
/resources/img/babyAGI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/babyAGI.png


--------------------------------------------------------------------------------
/resources/img/differences.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/differences.png


--------------------------------------------------------------------------------
/resources/img/fine-tuning-main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/fine-tuning-main.png


--------------------------------------------------------------------------------
/resources/img/fine-tuning-stack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/fine-tuning-stack.png


--------------------------------------------------------------------------------
/resources/img/llm_guide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/llm_guide.png


--------------------------------------------------------------------------------
/resources/img/main_agentic_rag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/img/main_agentic_rag.png


--------------------------------------------------------------------------------
/resources/llm_lingo/llm_lingo_p1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/llm_lingo/llm_lingo_p1.pdf


--------------------------------------------------------------------------------
/resources/llm_lingo/llm_lingo_p2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/llm_lingo/llm_lingo_p2.pdf


--------------------------------------------------------------------------------
/resources/llm_lingo/llm_lingo_p3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/llm_lingo/llm_lingo_p3.pdf


--------------------------------------------------------------------------------
/resources/llm_lingo/llm_lingo_p4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/llm_lingo/llm_lingo_p4.pdf


--------------------------------------------------------------------------------
/resources/llm_lingo/llm_lingo_p5.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/llm_lingo/llm_lingo_p5.pdf


--------------------------------------------------------------------------------
/resources/llm_lingo/llm_lingo_p6.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aishwaryanr/awesome-generative-ai-guide/83de024b906600b391d5e7b23cc7e58fceed9612/resources/llm_lingo/llm_lingo_p6.pdf


--------------------------------------------------------------------------------
/resources/our_favourite_ai_tools.md:
--------------------------------------------------------------------------------
  1 | # Our Favourite AI Tools
  2 | 
  3 | Welcome to our curated list of favourite AI tools. This resource highlights a variety of products—from model providers and application frameworks to low-code solutions, observability platforms, evaluation tools, and developer utilities—that empower teams to build, deploy, and maintain advanced AI solutions. Each section provides a brief overview of the tool along with relevant links for further exploration and quick-start resources.
  4 | 
  5 | ---
  6 | 
  7 | # AI Model Providers  
  8 | *For foundational AI model providers specializing in language, vision, or multimodal models.*
  9 | 
 10 | ## Anthropic
 11 | 
 12 | Founded in 2021 by former OpenAI executives Dario and Daniela Amodei, **Anthropic** is an AI safety and research company based in San Francisco. The company focuses on developing reliable and interpretable AI systems with a strong emphasis on safety and ethical considerations. Their interdisciplinary team includes experts in machine learning, physics, policy, and product development, all collaborating to create beneficial AI technologies.  
 13 | [Visit Anthropic](https://www.anthropic.com/?utm_source=chatgpt.com)
 14 | 
 15 | One of Anthropic's flagship products is **Claude**, a large language model designed to assist with various tasks, including coding and complex problem-solving. Claude incorporates "Constitutional AI," a framework developed to align AI systems with human values—ensuring outputs are helpful, harmless, and honest.  
 16 | [Learn more on Wikipedia](https://en.wikipedia.org/wiki/Anthropic?utm_source=chatgpt.com)
 17 | 
 18 | In recent developments, Anthropic is finalizing a $3.5 billion funding round, which would value the company at $61.5 billion. This investment underscores the growing confidence in Anthropic's approach to ethical AI development.  
 19 | [Read the Reuters report](https://www.reuters.com/technology/artificial-intelligence/ai-startup-anthropic-finalizing-35-billion-funding-round-wsj-reports-2025-02-24/?utm_source=chatgpt.com)
 20 | 
 21 | **Getting Started with Anthropic:**  
 22 | - [Explore Anthropic Docs](https://docs.anthropic.com/en/docs/welcome)  
 23 | <!-- - [YouTube: Anthropic QuickStart Tutorial :AI Projects in Minutes](https://www.youtube.com/watch?v=-p6VKXDQ_Y8) -->
 24 | 
 25 | ---
 26 | 
 27 | # AI Application Frameworks  
 28 | *Platforms that enable building AI-powered applications or workflows.*
 29 | 
 30 | ## LangChain
 31 | 
 32 | **LangChain** is an open-source framework designed to facilitate the development of applications powered by large language models (LLMs). It provides developers with tools and abstractions necessary for building context-aware, reasoning applications that effectively leverage company data and APIs.  
 33 | [Explore LangChain](https://www.langchain.com/?utm_source=chatgpt.com)
 34 | 
 35 | The framework streamlines every stage of the LLM application lifecycle—from prototyping to deployment. Its flexible architecture supports customization, allowing developers to tailor applications to specific use cases and data sources.  
 36 | [Read the Documentation](https://python.langchain.com/docs/introduction/?utm_source=chatgpt.com)
 37 | 
 38 | Developers can also access extensive guides, tutorials, and community support through LangChain's GitHub repository, making it a versatile resource for creating intelligent systems.  
 39 | [Visit LangChain on GitHub](https://github.com/langchain-ai/langchain?utm_source=chatgpt.com)
 40 | 
 41 | **Getting Started with LangChain:**  
 42 | - [Official Getting Started Guide](https://python.langchain.com/docs/introduction/?utm_source=chatgpt.com)  
 43 | <!-- - [YouTube: LangChain Explained in 13 Minutes | QuickStart Tutorial for Beginners](https://www.youtube.com/watch?v=aywZrzNaKjs) -->
 44 | 
 45 | ---
 46 | 
 47 | # Low-Code/No-Code AI Tools  
 48 | *Tools that make AI more accessible to non-technical users through simplified interfaces.*
 49 | 
 50 | ## LangFlow
 51 | 
 52 | **LangFlow** is a low-code platform designed to democratize AI development by enabling users to create AI agents and workflows without extensive programming knowledge. Its visual interface allows for seamless integration of various APIs, models, and databases, streamlining the process of building AI-powered applications.  
 53 | [Discover LangFlow](https://www.langflow.org/)
 54 | 
 55 | The platform provides a range of pre-built components and templates that facilitate rapid prototyping and deployment. This empowers users to develop tailored applications across various industries while reducing development time and costs.
 56 | 
 57 | **Getting Started with LangFlow:**  
 58 | - [LangFlow Documentation & Quick-Start Guide](https://docs.langflow.org/)  
 59 | - [YouTube: Getting started with Langflow in under 3 minutes](https://www.youtube.com/watch?v=knPg4KdKU6w)
 60 | 
 61 | ## Zapier
 62 | 
 63 | **Zapier** is a widely used automation platform that connects different applications and services, enabling users to create automated workflows—known as "Zaps"—without any coding. It integrates with numerous AI models and tools, allowing for the seamless inclusion of AI functionalities into everyday workflows.  
 64 | [Visit Zapier](https://zapier.com/)
 65 | 
 66 | By supporting a vast ecosystem of applications, Zapier makes it easy to set up triggers and actions between apps. This ensures consistency in automated tasks and reduces the potential for human error, ultimately enhancing productivity and efficiency.
 67 | 
 68 | **Getting Started with Zapier:**  
 69 | - [Zapier Guides](https://zapier.com/learn/)  
 70 | - [YouTube: Let's Get Started With Zapier! | Learn Zapier in 14 Days](https://www.youtube.com/watch?v=JZI-5qHX9jI)
 71 | 
 72 | ---
 73 | 
 74 | # AI Observability and Monitoring  
 75 | *Solutions that help evaluate, track, debug, and optimize AI systems in production.*
 76 | 
 77 | ## Comet
 78 | 
 79 | **Comet** is a comprehensive platform offering tools for tracking, debugging, and optimizing machine learning models throughout their lifecycle. With features such as experiment tracking, model monitoring, and data visualization, it provides data scientists and engineers deep insights into model performance.  
 80 | [Explore Comet](https://www.comet.ml/)
 81 | 
 82 | The platform also offers real-time monitoring and alerting, which ensures that AI systems operate as intended by promptly identifying and resolving issues. Its collaborative features allow teams to share experiments, insights, and reports, fostering a culture of transparency and continuous improvement.
 83 | 
 84 | **Getting Started with Comet:**  
 85 | - [Comet Documentation](https://www.comet.ml/docs/)  
 86 | - [YouTube: Comet Demo](https://www.youtube.com/watch?v=eSRONmqz5Uk)
 87 | 
 88 | ### Opik
 89 | 
 90 | **Opik**  is a monitoring and debugging platform from **Comet**, designed to provide comprehensive insights into AI systems. Effective monitoring tools should offer real-time visibility, anomaly detection, and seamless integration with existing workflows—Opik delivers on all these fronts.
 91 | 
 92 | With Opik, you can log, view, and evaluate your LLM (Large Language Model) traces during both development and production. The platform, combined with LLM-as-a-Judge evaluators, helps you identify and resolve issues in your LLM applications efficiently.
 93 | 
 94 | 
 95 | **Getting Started with Opik:**  
 96 | - [Opik Documentation](https://www.comet.ml/docs/opik/quickstart)
 97 | - [YouTube: Introducing Opik: Open-Source LLM Evaluation from Comet](https://www.youtube.com/watch?v=B4oboG62lyA)
 98 | 
 99 | 
100 | 
101 | ---
102 | 
103 | # AI-Powered Tools  
104 | *Products designed to streamline the AI development lifecycle, from prototyping to debugging and performance tuning.*
105 | 
106 | ## Vercel v0
107 | 
108 | **Vercel v0** is an experimental, AI-enhanced version of Vercel's deployment platform, tailored specifically for developers working on AI-driven applications. It integrates state-of-the-art performance tuning and debugging tools into the development workflow, allowing developers to deploy applications with optimal speed and efficiency.  
109 | [Visit Vercel v0](https://v0.dev/)
110 | 
111 | This tool focuses on automating parts of the deployment process and providing real-time performance insights, which can help reduce development time and minimize manual tuning. With its seamless integration into existing development environments, Vercel v0 supports rapid prototyping and iterative improvement for AI applications.
112 | 
113 | Additionally, Vercel v0 offers detailed analytics and logs that enable developers to quickly identify and resolve performance bottlenecks, ensuring that AI-powered applications run smoothly in production. Its innovative approach makes it a valuable asset for teams looking to optimize their deployment lifecycle.
114 | 
115 | **Getting Started with Vercel v0:**  
116 | - [Vercel v0 Documentation](https://v0.dev/docs)  
117 | - [Youtube: Build anything with v0 (3D games, interactive apps)](https://www.youtube.com/watch?v=zA-eCGFBXjM)
118 | 
119 | ## Replit Agents
120 | 
121 | **Replit Agents** are AI-powered assistants integrated into the Replit online coding environment, designed to streamline the entire development lifecycle. These agents assist developers by automating routine coding tasks, suggesting improvements, and even debugging code in real time—all directly within the IDE.  
122 | [Explore Replit](https://replit.com/)
123 | 
124 | By leveraging machine learning, Replit Agents analyze code and provide contextual recommendations, helping to reduce development time and improve code quality. They are especially useful for rapid prototyping, where quick iterations and debugging are essential for success.
125 | 
126 | Replit Agents also support collaborative coding by offering insights and suggestions that can be shared across teams, making them an invaluable tool for modern software development workflows that require both efficiency and accuracy.
127 | 
128 | **Getting Started with Replit Agents:**  
129 | - [Replit Agents Documentation](https://docs.replit.com/replitai/agent)  
130 | - [YouTube: Meet the Replit Agent](https://www.youtube.com/watch?v=IYiVPrxY8-Y)
131 | 
132 | ## NotebookLM
133 | 
134 | **NotebookLM** is an AI-powered research and note-taking assistant developed by Google Labs. Designed to help users make sense of complex information, it grounds its responses in the sources you upload, such as documents, PDFs, and Google Slides, providing citations and relevant quotes for accuracy. 
135 | [Learn about NotebookLM on the Google AI Blog](https://blog.google/technology/ai/notebooklm-audio-overviews/)
136 | 
137 | One of its latest features, Audio Overview, transforms text-based sources into engaging, AI-generated discussions. With just one click, two virtual hosts summarize your material, make insightful connections, and present the content in a conversational format. The audio can even be downloaded, allowing users to listen on the go.
138 | 
139 | [Visit NotebookLM](https://notebooklm.google/)
140 | 
141 | 
142 | 
143 | **Getting Started with NotebookLM:**  
144 | - [Get started with NotebookLM and NotebookLM Plus](https://support.google.com/notebooklm/answer/15724458?hl=en)  
145 | 


--------------------------------------------------------------------------------