Slide 1

Slide 1 text

Generative AI Developer Consultant

Slide 2

Slide 2 text

▪ Was Sie ▪ Hintergrundwissen und Theorie zu RAG ▪ Überblick über ▪ die auftreten können ▪ Pragmatische Methoden für die Verwendung im RAG ▪ Demos ( ) ▪ Was Sie erwartet ▪ ChatGPT, CoPilot(s) ▪ Grundlagen von ML ▪ Deep Dives in LLMs, Vektor-Datenbanken, LangChain Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 2

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

▪ Generative AI in business settings ▪ Flexible and scalable backends ▪ All things .NET ▪ Pragmatic end-to-end architectures ▪ Developer productivity ▪ Software quality [email protected] @phoenixhawk https://www.thinktecture.com Sprachzentrierte Anwendungen mit Large Language Models, Python & .NET Developer Consultant @ Thinktecture AG 4

Slide 5

Slide 5 text

Special Day Generative AI für Business-Anwendungen Thema Sprecher Datum, Uhrzeit Generative AI: Large Language Models – Szenarien, Use Cases und Patterns für Business-Anwendungen Christian Weyer DI, 13. Februar 2024, 10.45 bis 11.45 Generative AI: A Story About LLM Prompting (and how Tools like TypeChat Can Help) Rainer Stropek DI, 13. Februar 2024, 12.15 bis 13.15 Generative AI: Semantische Suche und LLMs jenseits des Hello World- RAG-Tutorials Sebastian Gingter DI, 13. Februar 2024, 15.30 bis 16.30 Generative AI: Optimierte Informationssuche durch AI-gesteuerte Datenquellenwahl Marco Frodl DI, 13. Februar 2024, 17.00 bis 18.00 Generative AI: Private GPT LLMs: Azure OpenAI Service sicher deployen mit Terraform Kenny Pflug DI, 13. Februar 2024, 19.00 bis 20.00

Slide 6

Slide 6 text

6 ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 6

Slide 7

Slide 7 text

7 ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 7

Slide 8

Slide 8 text

8 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Introduction Embeddings Vector-DBs Indexing Retrieval Indexing II RAG 8

Slide 9

Slide 9 text

9 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 9

Slide 10

Slide 10 text

Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Indexing & (Semantic) search Cleanup & Split Text Embedding Question Text Embedding Save Query Relevant Text Question LLM 10 Vector DB Embedding model Embedding model Indexing / Embedding QA

Slide 11

Slide 11 text

11 ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 11

Slide 12

Slide 12 text

12 ▪ ▪ ▪ ▪ ▪ ➔ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 12

Slide 13

Slide 13 text

13 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Introduction Embeddings Vector-DBs Indexing Retrieval Indexing II RAG 13

Slide 14

Slide 14 text

14 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials ▪ ▪ ▪ ▪ ▪ 14

Slide 15

Slide 15 text

15 ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 15

Slide 16

Slide 16 text

16 ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 16

Slide 17

Slide 17 text

17 ▪ ▪ Ԧ 𝑎 = 𝑎𝑥 𝑎𝑦 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 17

Slide 18

Slide 18 text

18 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Ԧ 𝑎 = 𝑎𝑥 𝑎𝑦 18

Slide 19

Slide 19 text

19 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Ԧ 𝑎 = 𝑎𝑥 𝑎𝑦 𝑎𝑧 19

Slide 20

Slide 20 text

20 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Ԧ 𝑎 = 𝑎𝑢 𝑎𝑣 𝑎𝑤 𝑎𝑥 𝑎𝑦 𝑎𝑧 20

Slide 21

Slide 21 text

21 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 21

Slide 22

Slide 22 text

22 𝐵𝑟𝑜𝑡ℎ𝑒𝑟 − 𝑀𝑎𝑛 + 𝑊𝑜𝑚𝑎𝑛 ≈ 𝑆𝑖𝑠𝑡𝑒𝑟 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Man Woman Brother Sister https://arxiv.org/abs/1301.3781 22

Slide 23

Slide 23 text

23 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials ▪ ▪ ▪ ▪ ▪ ▪ ▪ 23

Slide 24

Slide 24 text

24 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 0 24

Slide 25

Slide 25 text

25 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials [ 0.50451 , 0.68607 , -0.59517 , -0.022801, 0.60046 , -0.13498 , -0.08813 , 0.47377 , -0.61798 , -0.31012 , -0.076666, 1.493 , -0.034189, -0.98173 , 0.68229 , 0.81722 , -0.51874 , -0.31503 , -0.55809 , 0.66421 , 0.1961 , -0.13495 , -0.11476 , -0.30344 , 0.41177 , -2.223 , -1.0756 , -1.0783 , -0.34354 , 0.33505 , 1.9927 , -0.04234 , -0.64319 , 0.71125 , 0.49159 , 0.16754 , 0.34344 , -0.25663 , -0.8523 , 0.1661 , 0.40102 , 1.1685 , -1.0137 , -0.21585 , -0.15155 , 0.78321 , -0.91241 , -1.6106 , -0.64426 , -0.51042 ] 25 http://jalammar.github.io/illustrated-word2vec/

Slide 26

Slide 26 text

27 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials http://jalammar.github.io/illustrated-word2vec/ 27

Slide 27

Slide 27 text

28 ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 28

Slide 28

Slide 28 text

Sentence Transformers, local embedding model Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 29

Slide 29

Slide 29 text

30 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Introduction Embeddings Vector-DBs Indexing Retrieval Indexing II RAG 30

Slide 30

Slide 30 text

31 ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 31

Slide 31

Slide 31 text

▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Vector-Databases ▪ 32

Slide 32

Slide 32 text

33 ▪ ▪ 𝑆𝐶(a,b) = a ∙𝑏 𝑎 × 𝑏 ▪ ▪ ▪ ~ ▪ ∞ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 33

Slide 33

Slide 33 text

LangChain, Chroma, local embedding model Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 34

Slide 34

Slide 34 text

35 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Introduction Embeddings Vector-DBs Indexing Retrieval Indexing II RAG 35

Slide 35

Slide 35 text

36 ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 36

Slide 36

Slide 36 text

37 ▪ Import documents from different sources, in different formats ▪ LangChain has very strong support for loading data ▪ Support for cleanup ▪ Support for splitting Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 37 https://python.langchain.com/docs/integrations/document_loaders

Slide 37

Slide 37 text

38 ▪ HTML Tags ▪ Formatting information ▪ Normalization ▪ lowercasing ▪ stemming, lemmatization ▪ remove punctuation & stop words ▪ Enrichment ▪ tagging ▪ keywords, categories ▪ metadata Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 38

Slide 38

Slide 38 text

39 ▪ Document is too large / too much content / not concise enough Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials ▪ by size (text length) ▪ by character (\n\n) ▪ by paragraph, sentence, words (until small enough) ▪ by size (tokens) ▪ overlapping chunks (token-wise) 39

Slide 39

Slide 39 text

40 ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 𝑎 𝑏 𝑐 … 40

Slide 40

Slide 40 text

41 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Introduction Embeddings Vector-DBs Indexing Retrieval Indexing II RAG 41

Slide 41

Slide 41 text

42 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 𝑎 𝑏 𝑐 … “What is the name of the teacher?” Doc. 1: 0.86 Doc. 2: 0.84 Doc. 3: 0.79 … (Answer generation) 42

Slide 42

Slide 42 text

LangChain, Chroma, local embedding model, OpenAI GPT Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 43

Slide 43

Slide 43 text

44 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Introduction Embeddings Vector-DBs Indexing Retrieval Indexing II RAG 44

Slide 44

Slide 44 text

45 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials ? 45

Slide 45

Slide 45 text

46 ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 46

Slide 46

Slide 46 text

47 ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials LLM, e.g. GPT-3.5-turbo Embedding 𝑎 𝑏 𝑐 … Vector- Database Doc. 3: 0.86 Doc. 2: 0.81 Doc. 1: 0.81 Weighted result Hypothetical Document Embedding- Model Write a company policy that contains all information which will answer the given question: {QUERY} “What should I do, if I missed the last train?” https://arxiv.org/abs/2212.10496 47

Slide 47

Slide 47 text

48 ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 48

Slide 48

Slide 48 text

49 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Write 3 questions, which are answered by the following document. 𝑎 𝑏 𝑐 … 49

Slide 49

Slide 49 text

50 ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 𝑎 𝑏 𝑐 … Doc. 3: 0.89 Doc. 1: 0.86 Doc. 2: 0.76 “What should I do, if I missed the last train?” 50

Slide 50

Slide 50 text

LangChain, Qdrant, OpenAI GPT Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 51

Slide 51

Slide 51 text

52 Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 52

Slide 52

Slide 52 text

Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials Indexing & (Semantic) search Cleanup & Split Text Embedding Question Text Embedding Save Query Relevant Text Question LLM 53 Vector DB Embedding model Embedding model Indexing / Embedding QA

Slide 53

Slide 53 text

54 ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 54

Slide 54

Slide 54 text

58 ▪ ▪ ▪ Semantische Suche und LLMs jenseits des Hello World-RAG-Tutorials 58

Slide 55

Slide 55 text

https://github.com/thinktecture-labs/basta-spring-2024-rag

Slide 56

Slide 56 text

No content