Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mastering Generative AI: From Word Embeddings t...

Mastering Generative AI: From Word Embeddings to Custom AI Agents

Turkiye Java Community - DefineX Meetup - 25.05.2024

https://kommunity.com/turkiye-java-community/events/tjc-definex-developer-meetups-af0916f1

Abstract
What are embeddings? How can an LLM answer questions about your data? How challenging is it to implement your own AI agent?

In this talk, we’ll start from scratch, exploring key NLP concepts such as vector databases and word embeddings, while gaining a deeper understanding of large language models and the art of prompting. We’ll then implement our first RAG application together and explore techniques to enhance it. Building on this foundation, we’ll advance our GenAI knowledge to learn how to implement an agent capable of connecting to any tool we choose.

By the end of this presentation, you’ll gain a solid grasp of generative AI fundamentals and have a clear understanding of how to implement an LLM-based system.

Bilge Yücel

May 25, 2024
Tweet

More Decks by Bilge Yücel

Other Decks in Technology

Transcript

  1. 01 - What is it? • 🥑 Developer Relations Engineer

    at deepset • 🏗 Open source LLM Framework: Haystack • 📍 Istanbul, Turkey Bilge Yücel Twitter: @bilgeycl Linkedin: Bilge Yucel GitHub: @bilgeyucel Hi! 👋
  2. Agenda 01 - Text Embeddings 02 - Vector Databases 03

    - Retrieval 04 - LLMs 05 - RAG 06 - Agents & Function Calling
  3. Text Embeddings/Text Vectors to be or not to be •

    Manageable by computers • Different techniques: ◦ Sparse: TF-IDF, BM25... ◦ Dense: Trained models (Sentence Transformers, Cohere, OpenAI...) • Come in different dimensions
  4. • Databases that store high-dimensional vectors • Optimized for vectors:

    ◦ Vector search ◦ CRUD operations ◦ Metadata filtering Vector Databases
  5. Retrieval Query • Getting the most relevant information to the

    query • Used for semantic search, question answering and more
  6. Large Language Models (LLMs) • Big language models • More

    data & more parameter • Prompt → Human-like output • Text generation: summarization, generative QA, writing code, chat…
  7. LLM: Limitations • LLMs do not know the answer to

    everything • But they are good at following instructions • We can help them in their task by giving them the relevant context + instruction
  8. • Haystack is an open source Python framework for building

    production-ready LLM applications • Prototyping, evaluation, deployment, monitoring… • Building blocks: Components & Pipelines Haystack
  9. Agents • Complex systems (multiple LLMs) • Prompting: Chain of

    Thought/ReAct • Generate accurate responses to complex queries • Might use tools for answers • Use cases: chat bot, personal assistants
  10. Agents - Reason + Act (ReAct) REACT: SYNERGIZING REASONING AND

    ACTING IN LANGUAGE MODELS - https://arxiv.org/pdf/2210.03629
  11. Function Calling • Passing prompt + functions/tools (name, description, parameters)

    • User query -> function name + JSON object for arguments • Use arguments to call the function • Voila! 🎉
  12. Agents Search Google and answer: why did Elon Musk sue

    OpenAI? Elon Musk sued OpenAI for breaching its founding agreement and diverging from its original nonprofit mission….
  13. Agents Using TinyURL create a shortened URL from this long

    URL https://haystack.deep set.ai/blog/haystack- 2-release https://tinyurl.com/hjr6yttr
  14. Recap 01 - Text Embeddings 02 - Vector Databases 03

    - Retrieval 04 - LLMs 05 - RAG 06 - Agents & Function Calling