ChAI Talk #3: LLMs and Tokens (Word Chunks) ☕️🧩 ☕️ 𝗧𝗼𝗱𝗮𝘆'𝘀 𝘀𝗶𝗽: LLMs Learn New Words Just Like Us! 🧠💡 Remember learning 'play' + 'ground' = 'playground'? LLMs do the same with 'tokens' (word parts). Why use tokens? 1. Speed: Process language faster 2. Smarts: Understand new words easily How it works: • LLM recognizes parts: 'play', 'ing', 'er', 'sing' from known words ('playing', 'singer') • LLM combines parts: Learns new word 'play' + 'er' = 'player', 'sing' + 'ing' = 'singing'. Result: Huge vocab from fewer parts! 🤯 𝗠𝗶𝗻𝗱-𝗯𝗼𝗴𝗴𝗹𝗶𝗻𝗴 𝗳𝗮𝗰𝘁: GPT-3 covers all English with a 50,000-token vocabulary, from 𝘵𝘦𝘢 to 𝘱𝘯𝘦𝘶𝘮𝘰𝘯𝘰𝘶𝘭𝘵𝘳𝘢𝘮𝘪𝘤𝘳𝘰𝘴𝘤𝘰𝘱𝘪𝘤𝘴𝘪𝘭𝘪𝘤𝘰𝘷𝘰𝘭𝘤𝘢𝘯𝘰𝘤𝘰𝘯𝘪𝘰𝘴𝘪𝘴! 👇 𝗬𝗼𝘂𝗿 𝘁𝘂𝗿𝗻: Play around with https://lnkd.in/e3cw3Gmc to see how words break into tokens! Share your experience below! #ChAI #ChAITalk #ChAITalk03 #LLM #NLP #ML #AI #OpenAI #GPT3
subhasmita sahoo’s Post
More Relevant Posts
-
"Building Your First RAG Application from Scratch - A Beginner's Guide"! 🚀 In this chapter, I break down the process of creating a Retrieval-Augmented Generation (RAG) prototype, perfect for those new to the concept. You'll learn how to: 🔍 Extract text from PDFs using PyMuPDF 🧩 Chunk documents for LLM processing 🔑 Implement both keyword-based retrieval (Okapi BM25) and vector embeddings 🧠 Use OpenAI's embedding model for semantic search 🤖 Combine retrieved context with LLM output The best part? We build everything from the ground up! No prior RAG experience needed. 💪 This beginner-friendly approach demystifies RAG and sets a solid foundation for more advanced applications. While the prototype isn't perfect (e.g. Q&A on tables and document summaries), it's a starting point for anyone interested in intelligent document Q&A systems. Here's the blog: https://lnkd.in/eXF6_96J #AI #MachineLearning #NLP #RAG #BeginnerFriendly #LLM
To view or add a comment, sign in
-
This post will teach you about 'RAG' (Retrieval Augmented Generation) I need your attention for just 2 minutes, but I promise it will enrich your knowledge with something cool. Let's understand first why RAG came into the picture, and then we'll also explain RAG. Bear with me. There were a few challenges associated with LLMs (Large Language Models) such as: 1. False Information 2. Outdated Information 3. Non-Authoritative Sources For example, generating information or answers using sources that are 'NOT' considered reliable, credible, or expert in a particular subject matter. 4. Terminology Confusion For example, the AI system, which is trained on various culinary sources, may generate inaccurate responses when asked for a "biscuit" recipe due to terminology confusion between American quick bread, British cookies, and Indian biscuits. To overcome this scenario, the RAG concept came into the picture, and RAG references an authoritative knowledge base outside of its training data sources before generating a response. [1] This means you can provide a set of documents for the model to read and base its response on that. [2] You can also get a lot of RAGOps done on an organization's internal knowledge base. The best thing is 'all without the need to retrain the model.' In a nutshell, [1] RAG is more in a developer's control. [2] provides current information [3] is cost-effective [4] and will boost our trust with them. I hope you loved this, and if this knowledge has given you even 1 new information. Then kindly follow Vivek Sunny for more such valuable information. #RAG #RetrievalAugmentedGeneration #LLMs #LargeLanguageModels #TerminologyConfusion #FalseInformation #OutdatedInformation #NonAuthoritativeSources #KnowledgeBase #NLP #NaturalLanguageProcessing #AI #ArtificialIntelligence #Innovation #Technology #KnowledgeEnhancement
To view or add a comment, sign in
-
Inside an LLM: From Prompt to Prediction! 🔍💡 Ever wondered what really happens when an LLM takes your prompt and turns it into a response? Let’s break down the magic (and spoiler alert—it’s way cooler in practice! 😎). 1. Tokenization & Positional Encoding 🌐 First, your prompt is split into tokens—tiny chunks the model can process. Each token gets a positional encoding, helping the model understand the order of words and capture context. 2. Self-Attention Power 🧠 Now, the LLM asks itself, “Which words in the prompt are actually important?” Self-attention allows it to recognize key relationships between tokens, helping it process the sentence’s meaning. 3. Enrichment via FFN 🚀 Once it knows what’s important, the model enriches these tokens through a Feed-Forward Network (FFN), adding layers of depth to each token’s meaning. 4. Autoregression in Action 🌀 Here’s where autoregression comes in! Using the enriched embeddings, the model predicts the next word. It re-feeds the new phrase back into itself, building the response one word at a time until it’s fully formed. So… What Can LLMs Do Now? Recent breakthroughs are 🔥: - Multimodal Superpowers 🎥: Cutting-edge models (like Meta’s latest LLaMA) can handle text, audio, and even video, making them game-changers in fields that rely on diverse. - Advanced Reasoning 🧩: Thanks to self-attention, LLMs are surprisingly good at logical reasoning, solving complex problems, and generating insights for multi-layered questions. 💭 Want to know how we turn all this into a chat assistant? Stay tuned! 📎 Check out the attachments for the full LLaMA 3 page, code, and an in-depth video! 📝Llama 3 Page: https://lnkd.in/dJc76rVQ 💻Implementation: https://lnkd.in/dYbKThXh 📹Video Explanation: https://lnkd.in/dxNFybh7 #AI #ArtificialIntelligence #MachineLearning #LLM #LargeLanguageModel #DeepLearning #NLP #GPT #TransformerModels #LLAMA3 #GROK #GEMINI #MultimodalAI
To view or add a comment, sign in
-
Tips and tricks for GPT-3.5 Struggling with GPT-3.5? This ultimate guide has the answers 🤔 1. Experiment with different prompt formats: GPT-3's performance can vary depending on the prompt format and length. Try different prompt structures, such as questions, prompts with fill-in-the-blank sections, or prompts with multiple options. 2. Use the right parameters: GPT-3 has several parameters that can be adjusted to improve its performance, such as temperature, top-p sampling, and length penalty. Experiment with different parameter settings to find the right balance between quality and diversity of generated text. 3. Fine-tune the model: If you have a specific use case, consider fine-tuning GPT-3 on a smaller dataset related to your task. This can improve the model's performance on your specific task. 4. Use curated datasets: GPT-3 works best when it has access to high-quality training data. Consider curating your own dataset of high-quality examples related to your task or domain. 5. Consider using GPT-3 in combination with other tools: GPT-3 is not a one-size-fits-all solution, and may not work for all use cases. Consider using GPT-3 in combination with other tools or techniques, such as rule-based systems or other machine learning algorithms. #GPT35 #AI #artificialintelligence #languagemodel #NLP #chatbot #promptengineering #finetuning #machinelearning #naturallanguageprocessing #explore #explorepage #trending
To view or add a comment, sign in
-
This is why word embedding is the founding pillar of NLP applications like LLM and GPTs. One thing is clear, machines don't understand words, let alone the intricacies of human language. Then how come we have come so far in models being capable of communicating with humans?! Machines talk in numbers, humans in words. If only there was a way to convert words to numbers and vice versa. That's exactly what word embeddings are! They convert words into vectors (array of numbers) where the distance between vectors reflect the similarity between words. Let's consider a three-dimensional word representation: Dog = [0.2, -0.4, 0.7] Cat = [0.3, -0.1, 0.5] Laptop = [-0.1, 0.9, 0.4] Words with similar context (dog and cat) are expected to have similar vectors than a word that is completely different like a laptop. In reality, we have hundreds of dimensions for representation and not just 3. The fact that now words are represented in numerical form, some sort of numerical operations could be performed on them. And that is why examples like below are famous, although not true. King + Women - Men = Queen It's these random-looking numbers in vectors that are what calculated using a model. There are different techniques used for this purpose such as GloVe, Word2vec, TF-IDF, etc. It would take another discussion to talk about these methods. Let me know if I should talk about these in detail. Until then let's stay connected! Cheers! #wordembeddings #NLP #LLM #GPT #datascience #bigdata
To view or add a comment, sign in
-
🚀 Introducing Multi-PDF Chatter 🌟 Excited to share Multi-PDF Chatter, an AI-powered tool that lets you upload PDFs and get answers to your queries in seconds! 📄 Upload PDFs ⚡ Fast Search: Combines Pinecone vector search & BM25 keyword search. 🤖 Smart Q&A: Powered by Gemma2-9b-it for accurate answers. 🔗 LangChain Integration A seamless way to query and interact with document content. Feedback is welcome! #Github: https://lnkd.in/dN7HxZcx #AI #Streamlit #NLP #Innovation
To view or add a comment, sign in
-
🚀 Unveiling DocumentsReader! 🚀 Proud to introduce DocumentsReader, my latest AI-powered tool that uses Retrieval-Augmented Generation (RAG) to deliver accurate answers from documents in real-time! This app is designed to make document-based Q&A as easy and efficient as possible. 🔍 Features: - Advanced retrieval from knowledge bases 📄 - Supports multiple document formats 📚 (PDFs, Word docs, PPTs, etc.) - AI-powered responses for enhanced insights 🤖 📽️ Check out the demo video to see it in action, and test it out yourself here: https://lnkd.in/dAiRmxnH 💬 I’d love to hear your thoughts! Feedback is highly appreciated as I continue to improve and build on this tool. #AI #MachineLearning #DocumentProcessing #RAG #HuggingFace #Innovation #NLP #RetrievalAugmentedGeneration #SoftwareEngineering #ProjectDemo #ArtificialIntelligence
To view or add a comment, sign in
-
Retrieval VS Fine-Tuning: Which is Better for Injecting New Knowledge into LLMs? In the ever-evolving landscape of Large Language Models (LLMs), staying up-to-date with the latest knowledge is a challenge. A recent study explored two approaches to this problem: fine-tuning and retrieval-augmented generation (RAG). The results? Retrieval wins the race! The research found that RAG consistently outperforms fine-tuning, whether the task involves familiar knowledge or entirely new information. Why does this matter? Rather than overloading LLMs with internal updates through fine-tuning, RAG leverages external knowledge sources. This makes it a more efficient, scalable, and versatile solution for injecting fresh knowledge into LLMs. Takeaway: Combining LLMs with external retrieval systems unlocks their full potential - rethinking how we design knowledge powered AI. 📄 Read the full paper here: https://lnkd.in/dCMJ22pR (EMNLP 24) Let’s discuss: Do you see retrieval as the future for keeping LLMs updated? 🤔 #nlp #llm #finetuning #rag #emnlp24
To view or add a comment, sign in
-
🚀 Level up your AI with fine-tuning! 🚀 Large language models (LLMs) are impressive, but what if you could push them to excel at a specific task? Fine-tuning is your secret weapon. Imagine a world-class athlete – versatile, but you need a champion. Fine-tuning is like giving them targeted training to dominate their sport. Here's the gist: 🔹 **Start strong:** Leverage a pre-trained LLM, already loaded with language knowledge. 🔹 **Sharpen the focus:** Identify your goal – creative writing, code generation, answering complex questions? 🔹 **Domain expertise:** Feed the LLM relevant data, like text and labels for supervised learning. 🔹 **Fine-tune the machine:** The LLM refines its skills based on this new data, becoming a master in your chosen area. **Why fine-tune?** ✨ Supercharge performance: LLMs become laser-focused and effective for your specific task. 🚀 Work smarter, not harder: It's faster and less resource-intensive than training from scratch. 🔓 Unlock potential: Access the power of LLMs even if you don't have massive training resources. #ai #machinelearning #llms #nlp #artificialintelligence #futureofwork
To view or add a comment, sign in
-
#LLMs as Classifiers: Navigating the Challenges and a Practical Solution The trend of using Large Language Models (LLMs) for classification tasks is gaining momentum. At a glance, using LLMs as classifiers—especially compared to #zero-shot classification with embeddings—seems promising. However, as you scale or deal with similar classes, stability becomes a concern. While increasing the #dataset (few-shot learning) helps, it’s often costly and not always #feasible. Traditionally, one might opt for an encoder-only model like #BERT or #RoBERTa, which generally requires thousands of examples per class. Yet, with the rapid evolution of use cases, this isn't always practical. Enter #SetFit from #HuggingFace: A balanced approach to #fineTuning sentence #transformers for #classification tasks. SetFit innovatively combines: Sentence Transformer Model (The Body): To generate meaningful embeddings. Simple Classifier (The Head): Often just a logistic regression, tasked with classification. How SetFit Works: It employs a contrastive learning objective to refine embeddings, using both positive (same class) and negative (different class) sentence pairs. This method effectively pulls similar items closer and pushes dissimilar ones apart in the embedding landscape, enhancing classification accuracy. Advantages of SetFit: Data Efficiency: Remarkably, sometimes only 8 samples per class are needed. Speed: Optimized for quick training and inference, compatible even with CPU setups. This approach not only addresses the instability issues when scaling LLM classifiers but does so in an economically and computationally efficient manner. #LLM #MachineLearning #Classifiers #SetFit #HuggingFace #SentenceTransformers #DataScience #AI #Technology #Innovation #BERT #RoBERTa #NLP #NeuralNetworks #TechSolution #Efficiency #Classification #HamzaAliKhalid #MoonSys SetFit provides a pragmatic middle ground for those looking to leverage the power of LLMs for classification without the traditional resource constraints. Dive into this method and see how it can streamline your classification tasks!
To view or add a comment, sign in