<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Supraja Srikanth on Medium]]></title>
        <description><![CDATA[Stories by Supraja Srikanth on Medium]]></description>
        <link>https://medium.com/@suprajasrikanth872?source=rss-80cae6e1e7d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5eWsb5zgXDAXzygA3mvIPA.jpeg</url>
            <title>Stories by Supraja Srikanth on Medium</title>
            <link>https://medium.com/@suprajasrikanth872?source=rss-80cae6e1e7d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 15 May 2026 08:39:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@suprajasrikanth872/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[AI Code Polisher — Turn Raw Code into Production-Ready Software With One Command]]></title>
            <link>https://medium.com/@suprajasrikanth872/ai-code-polisher-turn-raw-code-into-production-ready-software-with-one-command-d5a02ee3cfa5?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5a02ee3cfa5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Sun, 11 Jan 2026 02:19:11 GMT</pubDate>
            <atom:updated>2026-01-11T02:21:35.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI Code Polisher — Turn Raw Code into Production-Ready Software With One Command🚀</h3><p>In modern software development, teams ship features fast — but that speed often comes with messy code, inconsistent style, missing documentation, overlooked security issues, and tangled technical debt. What if you could automate *all of that* — without lifting a finger?</p><p><strong>AI Code Polisher</strong>, an intelligent multi-agent system that takes your existing codebase and transforms it into a clean, consistent, documented, secure, and production-ready project — with one simple command.</p><p>AI Code Polisher acts like an AI-powered senior engineer, reviewing your entire repository end-to-end and applying best practices automatically.</p><p><a href="https://github.com/supraja777/ai-code-polisher">GitHub - supraja777/ai-code-polisher: AI Code Polisher is an intelligent multi-agent system that automatically refactors, documents, secures, and deploys your codebase. Powered by Groq and Llama 3, it scans projects, improves readability, fixes formatting, detects secrets, updates .gitignore, and handles Git commits-turning raw code into production-ready software with a single command.</a></p><p><strong>✨ What Is AI Code Polisher?</strong></p><p>AI Code Polisher is an open-source automation system built on advanced language models like **Groq** and **Llama 3**, designed to:</p><p>✅ Refactor code for readability and naming quality <br>✅ Insert consistent documentation and comments <br>✅ Detect hard-coded secrets and stop leaks <br>✅ Fix formatting, syntax, and style issues <br>✅ Update `.gitignore` intelligently <br>✅ Automate Git commits with meaningful messages</p><p>It does all this by orchestrating a suite of specialized AI agents — each responsible for a specific aspect of code quality and project hygiene.</p><p><strong>Here’s what happens under the hood:</strong></p><ol><li><strong>Auto-Discovery Agent</strong> scans your entire project recursively.</li><li><strong>Security Guard Agent</strong> identifies and highlights sensitive data or API keys.</li><li><strong>Refactor Architect Agent</strong> renames variables and functions to follow clean, professional naming conventions.</li><li><strong>Documentation Writer Agent</strong> adds structured docstrings and headers for maintainability.</li><li><strong>Syntax Linter Agent</strong> normalizes formatting and fixes minor syntax issues.</li><li><strong>Summary Analyst Agent</strong> produces high-level file summaries — ideal for README generation</li><li><strong>Hygiene Manager Agent</strong> intelligently updates .gitignore to avoid committing unnecessary or sensitive files.</li><li><strong>Git Courier Agent</strong> stages and commits changes with meaningful tags.</li></ol><p>The result? A unified, consistent, and polished codebase — ready for deployment, review, or release.</p><h3>🧠 Why It Matters</h3><p>As software scales, manual maintenance tasks become tedious distractions. Developers spend countless hours:</p><ul><li>Hunting down inconsistent naming</li><li>Fixing formatting and linting issues</li><li>Writing documentation</li><li>Updating ignores and cleaning up repos</li></ul><p>AI Code Polisher offloads those repetitive chores so you can focus on <em>shipping features</em>, not chasing syntax errors and formatting inconsistencies.</p><h3>📦 Installation &amp; Setup</h3><p>Getting started is easy:</p><pre>pip install git+https://github.com/supraja777/ai-code-polisher</pre><p>Then add your <strong>Groq API key</strong> to your .env file:</p><pre>GROQ_API_KEY=your_groq_api_key_here</pre><blockquote><em>⚠ Tip: Always add </em><em>.env to your </em><em>.gitignore to keep keys secure.</em></blockquote><h3>🚀 One Simple Command</h3><p>Once the setup is done, just run:</p><pre>polish</pre><p>And watch as your project gets:</p><p>🔹 Clean naming conventions<br>🔹 Fresh documentation<br>🔹 Proper formatting<br>🔹 Security hardening<br>🔹 Auto-generated commits</p><p>All without manual effort!</p><h3>🧩 Who Should Use It?</h3><p>AI Code Polisher is perfect for:</p><ul><li>Solo developers polishing personal projects</li><li>Teams that want consistent style across repos</li><li>Open source maintainers streamlining hygiene tasks</li><li>Devs preparing projects for production or distribution</li></ul><h3>📣 Final Thoughts</h3><p>Manual cleanup and project maintenance can be slow and error-prone. With AI Code Polisher, you get a smart automation layer that turns your raw repository into something that <em>looks and feels</em> like it was reviewed by a professional engineer.</p><p>👉 <strong>Check out the project on GitHub and give it a star! </strong><br><em>Happy coding and polishing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5a02ee3cfa5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Retrieval-Augmented Generation (RAG):]]></title>
            <link>https://medium.com/@suprajasrikanth872/mastering-retrieval-augmented-generation-rag-ddc01e132323?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddc01e132323</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Sun, 11 Jan 2026 02:04:42 GMT</pubDate>
            <atom:updated>2026-01-11T02:24:25.342Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Hands-On Walkthrough of All-RAG-Techniques</h3><p>Large Language Models are powerful, but they are not perfect. One of their biggest limitations is that they rely entirely on what they learned during training. They cannot inherently access new information, reason over private datasets, or reliably stay grounded in facts. This is where <strong>Retrieval-Augmented Generation (RAG)</strong> becomes essential.</p><p>RAG enhances language models by allowing them to retrieve relevant information from external knowledge sources before generating an answer. Instead of guessing, the model reasons over real context. This approach significantly improves accuracy, reduces hallucinations, and enables domain-specific intelligence.</p><p>To deeply understand how RAG works beyond theory, I built <strong>All-RAG-Techniques</strong> — an open-source repository that implements multiple RAG architectures, ranging from simple baselines to advanced agentic and self-correcting systems.</p><p><a href="https://github.com/supraja777/All-RAG-Techniques">GitHub - supraja777/All-RAG-Techniques: Built to explore and learn Retrieval‑Augmented Generation (RAG) techniques through practical implementations. Developed a collection of RAG workflows-from simple baselines to advanced methods like self‑refinement, reranking, and agentic RAG-across linked repositories.</a></p><h3>What Is Retrieval-Augmented Generation?</h3><p>At a high level, a RAG pipeline has two core stages:</p><ol><li><strong>Retrieval</strong> — Relevant documents or text chunks are fetched from a knowledge source using semantic search.</li><li><strong>Generation</strong> — The language model generates a response conditioned on both the user query and the retrieved context.</li></ol><p>This separation of knowledge storage and reasoning makes RAG systems flexible, scalable, and easy to update without retraining the model.</p><h3>What’s Inside the Repository</h3><p>The project is organized as a collection of focused RAG implementations, each demonstrating a distinct idea.</p><h3>1. Simple RAG</h3><p>A clean baseline implementation that demonstrates the classic retrieval → generation flow. This serves as the foundation for understanding how context injection works.</p><h3>2. RAG with Reranking</h3><p>Initial retrieval is often imperfect. This approach introduces a reranking step to reorder retrieved documents based on relevance, improving final response quality.</p><h3>3. Self-RAG (Self-Refinement)</h3><p>In this architecture, the model evaluates its own output and retrieved context, then refines the response iteratively. This reduces hallucinations and improves coherence.</p><h3>4. Agentic RAG</h3><p>This version introduces reasoning and planning. Instead of a single retrieval step, the model decides <em>when</em> and <em>how</em> to retrieve, enabling multi-step problem solving.</p><h3>5. Corrective RAG (CRAG)</h3><p>CRAG adds validation and correction mechanisms that detect unreliable context and trigger corrective retrieval when needed.</p><h3>6. Hypothetical Document Embeddings</h3><p>This technique improves retrieval by generating hypothetical documents from the query and embedding them to improve semantic matching.</p><h3>7. Query Transformation RAG</h3><p>Implements query rewriting, decomposition, and step-back prompting to improve retrieval coverage and relevance.</p><h3>8. Reliable RAG</h3><p>Focuses on consistency and trustworthiness by adding structured checks before and after generation.</p><p>Each technique is implemented independently so you can study, modify, and experiment without unnecessary complexity.</p><h3>Key Learnings from Building These Systems</h3><p>Building multiple RAG pipelines revealed several important insights:</p><ul><li><strong>Retrieval quality matters more than model size</strong></li><li><strong>More context is not always better</strong></li><li><strong>Self-evaluation dramatically improves reliability</strong></li><li><strong>Agentic reasoning unlocks complex workflows</strong></li><li><strong>RAG systems are engineering problems, not just prompts</strong></li></ul><h3>Final Thoughts</h3><p>RAG is not a single technique — it is a design space. The future of reliable, scalable AI systems depends on how well we combine retrieval, reasoning, and validation.</p><p><strong>All-RAG-Techniques</strong> is my attempt to explore that space in a practical, hands-on way.</p><p>If you find the repository useful, feel free to ⭐ it and explore further.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddc01e132323" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLMs as Judges: The Evaluation Process]]></title>
            <link>https://medium.com/@suprajasrikanth872/llms-as-judges-the-evaluation-process-030ab11868e7?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/030ab11868e7</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Fri, 31 Jan 2025 08:39:10 GMT</pubDate>
            <atom:updated>2025-01-31T08:39:10.124Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*3NAEczBqDNPM1xL7.jpg" /></figure><p><a href="https://medium.com/@suprajasrikanth872/what-are-llms-f78f1e43ab9f"><strong>Large Language Models (LLMs)</strong></a> have made significant advancements in reasoning, analytical capabilities, and handling complex tasks. This progress has led to the emergence of the <strong><em>LLMs-as-Judges</em></strong> paradigm, where LLMs assess the quality and relevance of generated outputs based on predefined criteria.</p><p>This article provides a comprehensive overview of the need for LLM judges, their benefits and challenges, evaluation techniques, and future directions.</p><h3>Why LLMs as Judges?</h3><p>Traditional <a href="https://medium.com/@suprajasrikanth872/evaluating-llms-key-techniques-4cf91e6578a6">LLM evaluation methods</a>, such as <strong>BLEU (Bilingual Evaluation Understudy) </strong>and<strong> ROUGE (Recall-Oriented Understudy for Gisting Evaluation), </strong>struggle to capture critical subjective aspects like fluency, logical coherence, and creativity. While human annotation provides a more detailed assessment, it is time-consuming, expensive, and difficult to scale.</p><p>With the rapid advancements in LLMs, relying solely on statistical methods or manual evaluation is no longer sufficient. Instead, LLM-Judges leverage their vast knowledge base and contextual understanding to dynamically assess model performance and provide richer insights.</p><h3>Advantages of LLM Judges</h3><p>The LLMs-as-Judges paradigm introduces a flexible evaluation framework that enables models to:</p><p>-&gt; Offer <strong>scalable</strong> and<strong> reproducible alternatives to human evaluation,</strong> reducing costs and effort while maintaining consistency.</p><p><strong>-&gt; Provide interpretive evaluations</strong>, generating detailed feedback instead of just a numerical score.</p><p><strong>-&gt; </strong>Evaluates subjective criteria such as fluency, creativity, and writing style.</p><h3>The Evaluation Process</h3><p>The evaluation framework follows the function:</p><blockquote>(Y, ε, F) = E(T, C, X, R)</blockquote><p><strong>Where the inputs are:</strong></p><p>E: Evaluation Function</p><p>T: Evaluation Type</p><p>C: Evaluation Criteria</p><p>X: Evaluation Item</p><p>R: Optional Reference</p><p><strong>Based on these inputs, the model generates three outputs:</strong></p><p>Y: Evaluation Result</p><p>ε: Explanation</p><p>F: Feedback.</p><h3>The Evaluation Function (E)</h3><p>The evaluation function is classified into three configurations:</p><h4><strong>1. Single-LLM Evaluation System</strong></h4><p>A Single-LLM Evaluation System relies on a single model to perform evaluation tasks, making it easier to deploy and scale.</p><p>This approach is efficient for tasks that do not require specialized evaluation.</p><p><strong>Drawbacks:</strong></p><p><strong>Limited flexibility </strong>and<strong> </strong>struggles with tasks that demand specialized knowledge or reasoning capabilities.</p><p>If not trained properly, it may introduce biases, leading to inaccurate evaluations.</p><h4><strong>2. Multi-LLM Evaluation System</strong></h4><p>A Multi-LLM Evaluation System combines multiple models that interact and work either competitively or collaboratively to perform evaluation tasks.</p><p>This approach produces refined outputs and achieves higher accuracy.</p><p><strong>Drawbacks:</strong></p><p><strong>Higher computational costs </strong>make deployment and maintenance challenging.</p><p>Methods for models to interact, reach consensus, or resolve differences remain an area of ongoing research.</p><h4><strong>3. Human-AI Collaboration System</strong></h4><p>In this system, LLMs work alongside human evaluators, combining the efficiency of automated evaluation with human judgment. This collaboration helps mitigate potential biases and provides subjective insights into complex evaluation tasks.</p><p><strong>Drawbacks:</strong></p><p>Coordinating models and human evaluators to ensure consistent evaluation is challenging.</p><p>Human involvement increases costs and time, making it less scalable than purely model-based systems.</p><h3>Evaluation Type (T)</h3><p>Evaluation type determines how the evaluation will be conducted. There are three key methods: <strong>Pointwise evaluation, Pairwise evaluation, and Listwise evaluation.</strong></p><h4>Pointwise Evaluation</h4><p>Pointwise evaluation assesses each candidate item individually based on predefined criteria. E.g., for summarization tasks, an LLM might evaluate each summary independently based on factors like informativeness and coherence.</p><p><strong>Drawback</strong>:<br>Fails to consider <strong>relative quality differences</strong> between candidates and can be biased due to isolated assessments.</p><h4>Pairwise Evaluation</h4><p>The pairwise evaluation compares two candidate items at a time to determine which performs better based on given criteria. E.g., given two summaries, the model determines which is more informative, fluent, or coherent.</p><p>This approach closely resembles the human decision-making process as it follows relative preferences rather than assigning absolute scores. It is more effective in use cases where the difference between the outputs is subtle and difficult to quantify.</p><h4>Listwise Evaluation</h4><p>This method is designed to collectively assess an entire list of candidate items, evaluating and ranking them based on a specific criteria. It is widely applied in tasks like document retrieval, where the objective is to determine the relevance of documents in relation to the user query.</p><p>Considering multiple candidates makes it well-suited for applications that require a holistic analysis.</p><blockquote>These evaluation modes can be combined (e.g., <strong>Pointwise + Pairwise</strong>, <strong>Pairwise + Listwise</strong>) for better assessment.</blockquote><h3>Evaluation Outputs</h3><p><strong>The evaluation outputs of LLMs-Judges consist of Result Y, Explanation E, and Feedback F.</strong></p><h4>Evaluation Result (Y)</h4><p>The primary output, which can be a numerical score, ranking, a categorical label, or qualitative assessment. It reflects on the performance of the candidate item based on specified criteria. E.g.,<strong> </strong>in a dialogue generation task, the output Y could rate coherence on a scale of 1–5.</p><h4>Explanation (E)</h4><p>Explanation E provides detailed reasoning for evaluation results, which helps build trust and reliability in the model’s output. For example, in the case of summarization, an LLM could explain why it gave a low score, such as missing crucial information in the summary.</p><h4>Feedback (F)</h4><p>It consists of actionable suggestions and recommendations aimed at improving the evaluated output. It is especially valuable for the iterative development of the model as it provides concrete pointers to help developers tune the model.</p><h3>LLM Judges Functionality</h3><p>The LLM-judges functionalities are categorised as —<strong> Performance evaluation, Model enhancement, and Data Construction.</strong></p><h3>Performance evaluation</h3><p>It is the fundamental objective of LLM-Judges. This focuses on understanding and optimising the model. It comprises of <strong>Response evaluation and Model evaluation</strong></p><h4><strong>Response Evaluation</strong></h4><p>The purpose of evaluating responses is to identify better answers within the specified context or task to make better decisions. It considers general attributes like accuracy, relevance, fluency or some customized metrics to evaluate the response tailored to specific tasks.</p><p>This evaluation is not only limited to assessing the quality of the final answer but also extends to the process. E.g., assessing whether retrieval is required at a given step, relevance of retrieved documents, etc.</p><h4><strong>Model Evaluation</strong></h4><p>This begins with assessing individual responses and then extending to analyse the overall capabilities of the model. It aims to analyse the model’s performance across various tasks or domains, such as coding abilities, instruction following, proficiency, etc. and all the skills relevant to the intended application.</p><h3><strong>Model Enhancements</strong></h3><p>Here, the model provides feedback and rewards to enhance the model’s performance. It comprises <strong>Reward modeling during training, Acting as verifier during inference, and Feedback for refinement.</strong></p><h4><strong>Reward Modeling During Training</strong></h4><p>Here the LLM judges assigns scores to evaluate the model against human defined criteria. It rewards the model based on the quality of the output produced.</p><p>This overcomes the traditional RLHF dependency, fostering self-evolution through continuous self-assessment. The model can also evaluate intermediate generation steps, providing detailed guidance during training.</p><h4><strong>Acting as Verifier During Inference</strong></h4><p>LLM judges act as verifiers, selecting the optimal response from multiple candidates. This is achieved by comparing the responses using various metrics like factual accuracy, reasoning consistency, coherence etc.</p><p>One of the application involves using Best-Of-N sampling where the model is sampled N times and the best result is selected, and another application where the average score of n samples is considered improving consistency. These sampling techniques enhance inference stability by selecting the best result from multiple evaluations.</p><h4>Feedback For Refinement</h4><p>LLM judges provide actionable feedback to refine output quality iteratively. By using the specified metrics, the LLM identifies weaknesses in the output and offers suggestions for improvement. This iterative refinement plays a crucial role in applications that require adaptability.</p><p>This approach of providing feedback and iterative improvements has enhanced the performance of LLMs across various code generation tasks.</p><h3>Data Construction</h3><p>The quantity and quality of data used in deep learning models significantly impact their performance. LLMs-as-judges has transformed this area by substantially reducing the reliance on human effort. The data construction process involves two perspectives: <strong>Data Annotation and Data Synthesis.</strong></p><h4>Data Annotation</h4><p>This involves leveraging the language understanding and reasoning capabilities of LLMs and utilizing LLM-judges to generate high-quality and accurate labels with minimal human intervention. Research is exploring their applications in multimodal data annotation.</p><h4>Data Synthesis</h4><p>Here the goal is to create entirely new data either from scratch or from seed data while ensuring that the distribution is similar to the real data. Advancements in LLMs have led to significant improvements in both the quality and efficiency of data synthesis methods. Iterative feedback using LLM-judges, and optimization leads to generation of diverse data samples, enhancing the model’s generalization ability to unseen data.</p><h3><strong>Limitations of LLMs as Judges</strong></h3><h4><strong>Inconsistency in evaluation methods</strong></h4><p>The results obtained from different evaluation methods may not always be consistent. For instance, if pointwise evaluation assigns scores of 5 and 3 to outputs A and B, respectively, it does not guarantee that pairwise evaluation will rank A above B. Moreover, LLM-as-Judges do not always satisfy transitivity; if A is preferred over B and B over C in pairwise comparisons, A &gt; C may not necessarily hold.</p><h4>Bias</h4><p>Essentially, LLMs are trained on vast amounts of data to generate human-like responses, but this also makes them vulnerable to inheriting the biases present in the training data. These biases can significantly affect the evaluation results, compromising the fairness and accuracy of decisions.</p><h4>Adversarial Attacks</h4><p>LLM-as-Judges can be prone to adversarial attacks; the attackers may modify the input content by introducing misleading content or small changes in the input. Even these small, insignificant changes can significantly affect the model’s responses, leading to inaccurate ratings or assessments.</p><h3>Future Work</h3><h4>1) Dynamic Adaptation</h4><p>LLM-Judges often rely on manual predefined criteria, lacking the ability to adapt dynamically during the assessment process. Future LLM judges could incorporate enhanced adaptability by tailoring evaluation criteria based on task types.</p><h4>2) Enhancing Domain Knowledge</h4><p>Current LLM-Judges often fall short of handling specialized tasks due to insufficient domain knowledge. Future work could focus on enhancing domain knowledge through knowledge graphs and embedding domain-specific expertise.</p><h4>3) Multimodal Integration</h4><p>Current LLM-Judges primarily focus on processing textual data, with limited attention given to integrating other modalities like images, audio, and videos. Future work could focus on integrating multimodal validation techniques.</p><h3>Conclusion</h3><p>The LLM-as-Judge paradigm represents a significant advancement in AI evaluation, offering scalable, consistent, and automated assessments across various tasks.</p><p>While it provides efficiency and reduces human involvement, challenges such as bias, lack of true reasoning, and transitivity violations remain key concerns.</p><p>Future improvements focus on integrating domain-specific knowledge, leveraging multimodal validation, and refining self-assessment mechanisms to enhance reliability.</p><p>As AI continues to evolve, refining the LLM-as-Judge framework will be crucial in ensuring fair, accurate, and interpretable evaluations for real-world applications.</p><p><strong>Thank you for reading!</strong></p><h3>References</h3><p><a href="https://arxiv.org/abs/2412.05579">LLMs-as-Judges: A Comprehensive Survey on LLM-based Evaluation Methods</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=030ab11868e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Evaluating LLMs: Key Techniques]]></title>
            <link>https://medium.com/@suprajasrikanth872/evaluating-llms-key-techniques-4cf91e6578a6?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cf91e6578a6</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 04:32:59 GMT</pubDate>
            <atom:updated>2025-01-27T04:32:59.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*JmD-gDoE8an9hy0C.jpg" /></figure><p><a href="https://medium.com/@suprajasrikanth872/what-are-llms-f78f1e43ab9f"><strong>Large language models (LLMs)</strong></a><strong> </strong>are at the core of many cutting-edge AI applications, ranging from chatbots that enhance customer experiences to transformative healthcare innovations like virtual health assistants. Evaluating these models is essential to ensure their <strong>performance, accuracy, and efficiency</strong> in real-world scenarios.</p><p>Evaluating LLMs involves rigorous testing against carefully designed datasets that push the boundaries of LLMs. This process helps gain insights to fine-tune LLM models, ensuring they meet user requirements such as answering questions, providing recommendations, generating content, or making decisions.</p><blockquote>The cycle of continuous evaluation, data collection, and iterative improvements ensures that the model performs better and adapts effectively to user needs.</blockquote><h3>Importance of LLM evaluation</h3><p>-&gt; Rigorous LLM evaluations endorse the readiness of LLMs to serve their intended purposes effectively and reliably.</p><p>-&gt; Provides valuable insights for fine-tuning and ensuring that the model is calibrated to meet specific user requirements.</p><p>-&gt; Ensures that the model can handle sensitive topics, such as <strong>toxicity</strong> and <strong>harmful content</strong>, while producing <strong>age-appropriate </strong>responses.</p><h3>Characteristics of LLM evaluation metrics</h3><h4><strong>Quantitative</strong></h4><p>Metrics should always produce a <strong>measurable</strong> score when evaluating the task at hand. This allows developers and researchers to set a <strong>minimum threshold</strong> for the LLM’s performance, ensuring it meets the desired standards.</p><h4><strong>Reliable</strong></h4><p>The evaluation metric must be reliable for the specific task and have the ability to capture the true capabilities of the model.</p><h4><strong>Accuracy</strong></h4><p>A good evaluation metric should align closely with human judgment, and accuracy in the provided results is essential for meaningful assessments.</p><h3>Critical Factors in LLM Evaluation</h3><p><strong>Relevance: </strong>Does the LLM provide responses that are relevant to the user’s query?</p><p><strong>Hallucination: </strong>Is the model prone to generating factually incorrect or misleading statements?</p><p><strong>Question-Answering Accuracy: </strong>In applications like chatbots, how effectively can the LLM handle and answer user queries?</p><p><strong>Responsible Metrics: </strong>Are the model’s outputs free from bias, toxicity, and harmful content?</p><p><strong>Prompt Alignment: </strong>Does the LLM output align with the instructions provided in the prompt, following the intended structure and requirements?</p><h3>Common Evaluation Techniques for LLMs:</h3><h3>Perplexity</h3><p>Perplexity measures the <strong>uncertainty</strong> of an LLM when predicting the next token. In other words, <strong>it quantifies how confident the model </strong>is in its prediction: the higher the probability of a token, the lower the perplexity.</p><p>A lower perplexity score indicates better performance as it reflects the model’s ability in capturing language patterns to generate coherent text.</p><p><strong>The minimum value is 1</strong>, which occurs when the model predicts every word with perfect confidence <strong>(probability = 1).</strong></p><p><strong>Perplexity is crucial for tasks like machine translation, speech recognition, and text generation.</strong></p><h4><strong>Perplexity is calculated as:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lav4H_pbKSqj-t4K" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/0*9WhgPttT8ynRAyel" /></figure><h4>What Does a High Perplexity Score Indicate<strong>?</strong></h4><p>1. The input is ambiguous or unclear.</p><p>2. The model hasn’t encountered a similar example during training.</p><p>3. It signals that the model may require human oversight or additional training.</p><h4>Benefits of Using Perplexity:</h4><p>1. Provides a good measure of fluency and relevance in the model’s output.</p><p>2. Offers insights into how well the model generalizes to unseen data.</p><p>3. Serves as an easy way to compare different models.</p><p>4. Acts as an excellent metric for optimizing model performance.</p><h4>Challenges with Perplexity:</h4><p>1. It heavily depends on the model’s vocabulary.</p><p>2. As an objective metric, it doesn’t consider subjective factors like style, creativity, or contextual appropriateness.</p><p>3. It doesn’t fully capture the model’s broader understanding of context.</p><p>4. A low perplexity score doesn’t guarantee that the model can handle ambiguity better.</p><p>5. Deep learning models can <strong>exhibit confidence even when wrong,</strong> which can be problematic in high-stakes situations like medical or legal applications.</p><h4><strong>Key Points to Note:</strong></h4><ol><li>A model with a vocabulary size of 10,000 words and a perplexity score of 2.71 <strong>is much better than a model </strong>with 100 words and the same perplexity score of 2.71.</li><li>Given the non-deterministic nature of the LLMs, a lower perplexity score means that the model is most likely to produce the same output over multiple runs.</li><li>A model with low training perplexity and a high validation perplexity indicates that the model might be overfitting.</li></ol><blockquote>Low perplexity only guarantees that a model is confident, not necessarily accurate!</blockquote><h3>BLEU Score (BiLingual Evaluation Understudy)</h3><p>BLEU is based on the idea that the closer the predicted sentence is to the human-generated target sentence, the better it is.</p><p>It compares the generated sentence against one or more reference sentences, evaluating how well the candidate sentence matches the reference.</p><p>BLEU calculates the overlap of <strong>n-grams</strong> (contiguous sequences of words) between the generated and reference text (<strong>precision for n-grams</strong>) while<strong> penalizing</strong> overly short outputs known as <strong>Brevity Penalty</strong>.</p><p><strong>BLEU scores range from 0 to 1.</strong> A score around 0.6 or 0.7 is considered optimal, while a score closer to 1 is unrealistic and may indicate overfitting.</p><p><strong>BLEU is crucial for tasks like language generation, image caption generation, text summarization, and speech recognition.</strong></p><h4><strong>The BLEU score is calculated as</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/0*uU99Ow4J9iY43uPT.png" /></figure><p>where BP is the brevity penalty, wn​ are weights for n-gram precisions, pn​ is the precision for n-grams, and N is the maximum n-gram size.</p><h4>Advantages of BLEU:</h4><p>1<strong>. </strong>BLEU is efficient to compute and easy to understand.</p><p>2.<strong> </strong>It aligns closely with the way humans would evaluate text.</p><p>3.<strong> </strong>BLEU works across different languages, making it versatile.</p><p>4<strong>. </strong>It can be applied to scenarios where more than one reference sentence is available.</p><h4>Challenges with BLEU:</h4><p>1. BLEU does not account for synonyms or meaning variations. Eg: Home and house mean the same thing, but BLEU considers them to be different.</p><p>2. BLEU only considers exact matches, so variations like “work” and “working” are treated as errors.</p><p>3. Ignores the concept of the importance of words. It penalizes insignificant words (e.g., “is,” “an,” “of”) as heavily as more meaningful words.</p><p>4. BLEU doesn’t consider creativity or grammatical correctness in its evaluation.</p><h3><strong>METEOR </strong>(Metric for Evaluation of Translation with Explicit Ordering)</h3><p>METEOR is designed to improve upon the BLEU score by incorporating not only exact word matches but also synonyms and paraphrases, which aligns more closely with human judgment.</p><p>Unlike BLEU, which focuses primarily on precision, METEOR computes both precision and recall, balancing the need to generate text that closely matches the reference (precision) while ensuring that the meaning of the reference text is fully captured. (recall)</p><p><strong>METEOR is crucial for tasks like machine translation and text generation.</strong></p><h4>Key Linguistic Components of METEOR:</h4><p><strong>1. Synonym matching</strong> using resources like WordNet.</p><p><strong>2. Stemming</strong> to match words with the same root (e.g., “walk” and “walking”).</p><p><strong>3. Paraphrase matching</strong>, allowing variations in phrasing that convey the same meaning.</p><h4><strong>METEOR Components:</strong></h4><p>1. <strong>Chunk-based Matching: </strong>Aligns words in the generated and the reference text while considering both content and word order.</p><p>2. <strong>Fragmentation penalty: </strong>If matching words are scattered within the generated text rather than appearing consecutively, a penalty is applied.</p><h4>METEOR is calculated as:</h4><p><strong><em>P </em></strong><em>= Number of matching unigrams / ​Total number of unigrams in candidate</em></p><p><strong><em>R </em></strong><em>= Number of matching unigrams​ / Total number of unigrams in reference</em></p><p><strong><em>Fmean</em></strong><em> = (10 * P * R) / (R + 9 * P)​</em></p><p><strong><em>METEOR Score</em></strong><em> = Fmean * (1 − Penalty)</em></p><h4><strong>Advantages of METEOR:</strong></h4><p><strong>1. Semantic awareness: </strong>By considering synonyms, stemming, and paraphrasing, METEOR is better at recognising the true meaning of text.</p><p><strong>2. Balanced evaluation: </strong>With the<strong> i</strong>nclusion of precision, recall, and fragmentation penalties, METEOR provides a more balanced evaluation compared to BLEU.</p><p><strong>3. Better Correlations with Human Judgments: </strong>METEOR often correlates more closely with human judgment of translation quality than BLEU.</p><h4><strong>Limitations of METEOR:</strong></h4><p>1. Due to the overhead cost of synonym dictionaries, stemming algorithms, and other linguistic resources, METEOR can be computationally costly.</p><p>2. METEOR’s performance can be impacted by language-specific constraints and reliance on linguistic tools.</p><h3>Other evaluation metrics</h3><p><strong>ROUGE</strong>: Similar to the BLEU score, <strong>ROUGE evaluates text by comparing it to ground truth</strong>. It has multiple versions, such as ROUGE-N and ROUGE-L, each focusing on different aspects of text comparison.</p><p><strong>Accuracy: </strong>This metric calculates how often an LLM makes correct predictions. It is widely used for classification tasks.</p><p><strong>BERT SCORE: </strong>This metric<strong> </strong>evaluates texts by comparing the similarity of contextual embeddings from models like BERT, focusing on meaning rather than exact words.</p><p><strong>Recall: </strong>Recall<strong> </strong>measures the number of true positives (correct predictions) compared to the total number of actual positives, helping assess the model’s ability to capture relevant instances.</p><p><strong>Burstiness: </strong>Burstiness<strong> </strong>evaluates the model’s ability to produce unexpected and unique outputs. It captures LLM’s potential to go beyond predictable patterns, showcasing creativity and diversity in responses.</p><h3>LLM Benchmarks</h3><p>LLM benchmarks are a key evaluation methodology. They consist of sample datasets, tasks, and prompts designed to test LLM’s specific skills, such as question-answering, machine translation, summarization, and more. By evaluating LLMs on these benchmarks, developers can compare the performance of different models and track progress over time.</p><h4>Popular LLM Benchmarks:</h4><p><strong>MMLU (Massive Multitask Language Understanding</strong>):<strong> </strong>A benchmark with multiple-choice questions spanning across different domains, testing the model’s language understanding.</p><p><strong>Human Eval</strong>: Focuses on assessing the LLM’s ability to generate functional code and its correctness.</p><p><strong>Truthful QA</strong>: Addresses the hallucination problem by measuring the LLM’s ability to generate truthful answers to questions.</p><p><strong>GLUE</strong> <strong>(General Language Understanding Evaluation)</strong>: A collection of diverse tasks aimed at testing the linguistic capabilities of LLMs.</p><p><strong>SUPER GLUE:</strong> An advanced version of GLUE, designed to challenge models with more complex tasks that test robustness and understanding.</p><p><strong>SQuAD (Stanford Question Answering Dataset):</strong> Focuses on reading comprehension, scoring models based on their ability to <strong>answer questions</strong> accurately from a given text.</p><h4>Challenges in Using Benchmarks:</h4><p><strong>Rapid LLM Development</strong>: The fast-paced advancements in LLM technology make it difficult to establish a <strong>standardized</strong>, <strong>long-lasting </strong>benchmarks.</p><p><strong>Bias:</strong> Many datasets used in benchmarking are not representative of diverse languages and cultures, making it difficult to accurately measure <strong>bias</strong> in the models.</p><h3>Conclusion</h3><p>Given the wide range of applications for LLMs, a one-size-fits-all approach to evaluation is impractical. The metrics, datasets, and evaluation methods must be tailored to specific tasks and objectives. Each evaluation technique provides valuable insights but also presents its own set of challenges. Ultimately, the choice of evaluation method depends on the developer’s goals and the outcomes they wish to achieve.</p><p><strong>Thank you for reading!</strong></p><h3>References</h3><p><a href="https://www.superannotate.com/blog/llm-evaluation-guide">LLM Evaluation: Metrics, Frameworks, and Best Practices | SuperAnnotate</a></p><p><a href="https://www.datacamp.com/blog/llm-evaluation">https://www.datacamp.com/blog/llm-evaluation</a></p><p><a href="https://www.ibm.com/think/insights/llm-evaluation">https://www.ibm.com/think/insights/llm-evaluation</a></p><p><a href="https://www.confident-ai.com/blog/llm-evaluation-metrics-everything-you-need-for-llm-evaluation">https://www.confident-ai.com/blog/llm-evaluation-metrics-everything-you-need-for-llm-evaluation</a></p><p><a href="https://ramblersm.medium.com/the-significance-of-perplexity-in-evaluating-llms-and-generative-ai-62e290e791bc">https://ramblersm.medium.com/the-significance-of-perplexity-in-evaluating-llms-and-generative-ai-62e290e791bc</a></p><p><a href="https://blog.uptrain.ai/decoding-perplexity-and-its-significance-in-llms/">https://blog.uptrain.ai/decoding-perplexity-and-its-significance-in-llms</a></p><p><a href="https://towardsdatascience.com/foundations-of-nlp-explained-bleu-score-and-wer-metrics-1a5ba06d812b">https://towardsdatascience.com/foundations-of-nlp-explained-bleu-score-and-wer-metrics-1a5ba06d812b</a></p><p><a href="https://medium.com/data-science-in-your-pocket/llm-evaluation-metrics-explained-af14f26536d2">https://medium.com/data-science-in-your-pocket/llm-evaluation-metrics-explained-af14f26536d2</a></p><p><a href="https://bobrupakroy.medium.com/comprehensive-10-llm-evaluation-from-bleu-rouge-and-meteor-to-scenario-based-metrics-like-9f6602c92c17">https://bobrupakroy.medium.com/comprehensive-10-llm-evaluation-from-bleu-rouge-and-meteor-to-scenario-based-metrics-like-9f6602c92c17</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cf91e6578a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinking ⚡]]></title>
            <link>https://medium.com/@suprajasrikanth872/rstar-math-small-llms-can-master-math-reasoning-with-self-evolved-deep-thinking-2282e1968453?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/2282e1968453</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 13:24:24 GMT</pubDate>
            <atom:updated>2025-01-20T13:24:24.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fvpa0XMD1klJrzT_6k6_5A.png" /></figure><p>This article offers an explanation about the recent paper — <strong>rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinking</strong> <strong>(2025)</strong> by<strong> </strong><a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Guan,+X">Xinyu Guan</a>, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Zhang,+L+L">Li Lyna Zhang</a>, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Liu,+Y">Yifei Liu</a>, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Shang,+N">Ning Shang</a>, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Sun,+Y">Youran Sun</a>, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Zhu,+Y">Yi Zhu</a>, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Yang,+F">Fan Yang</a>, and <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Yang,+M">Mao Yang</a> discussing the capabilities of the rStar-Math approach employing <strong>Small Language Models (SLMs)</strong> that have demonstrated tremendous results in the field of mathematics through “<strong><em>deep thinking</em></strong>”. This approach is exercised using <strong>Monte Carlo Tree Search (MCTS)</strong>, where a <strong>math policy SLM</strong> performs test time search guided by an SLM-based <strong>process reward model.</strong></p><p>This research achieved results on par with and sometimes surpassing the previous competent model <strong>O1 of OpenAI</strong>. rStar-Math, with only about <strong>1.5 to</strong> <strong>7 billion parameters,</strong> is able to solve Olympiad-level complex problems.</p><p>💬 Before we dive into the rStar-Math approach, we need to understand what small language models (SLMs) are.</p><h3>📚 Small Language Models (SLMs)</h3><p>Small language models are the smaller versions of their counterpart <a href="https://medium.com/@suprajasrikanth872/what-are-llms-f78f1e43ab9f"><strong>large language models (LLMs)</strong></a> and, like LLMs, are trained on massive datasets of texts and code. Several techniques, such as <strong>knowledge distillation, pruning, quantization, and efficient architectures,</strong> are employed to achieve their smaller size and efficiency. SLMs provide benefits in terms of <strong>efficiency, training time, and computational costs.</strong></p><blockquote>💬 Check out <a href="https://medium.com/@nageshmashette32/small-language-models-slms-305597c9edf2">this</a> detailed article on small language models by <a href="https://medium.com/u/15950ee74774">Nagesh Mashette</a> for further reading on SLMs, the techniques, and advantages.</blockquote><h3>🧠 And next let’s see what rStar is.</h3><p>rStar is an approach that enables the <strong>reasoning capabilities of SLMs</strong>. Here, the SLMs decouple the reasoning into a self-play <strong>mutual generation-discrimination</strong> process.</p><p>📋 <em>First, a target SLM augments the Monte Carlo Tree Search (MCTS) with a set of human-like actions to construct higher-quality reasoning trajectories.</em></p><p>📋 <em>Next, another SLM with capabilities similar to the target SLM acts as a discriminator to verify each trajectory generated by the target SLM.</em></p><blockquote><strong><em>⏳ The mutually agreed reasoning trajectories are considered to be correct!</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLv6YvDP9sPpvVTrUUfFqw.png" /></figure><h3>🔥 <strong>rStar-Math </strong>with Self-Evolved Deep Thinking!</h3><p>The rStar-Math approach demonstrates the capability of SLMs in math reasoning capability <strong>without the need for distillation</strong> from superior models.</p><p>Large language models, LLMs, following the conventional approach of <strong>system-1 thinking</strong> (generating a complete response in a single inference), often yield fast but error-prone results. And this research suggests a self-evolvable <strong>system-2 style reasoning approach</strong> emulating human-like reasoning through a slower and a deeper thought process.</p><p>A novel <strong>code-augmented COT</strong> (chain of thought) data synthesis is performed using extensive MCTS rollouts (simulations) that generate step-by-step reasoning trajectories with <strong>self-annotated Q values</strong>. Here the Q value indicates the contribution of the individual step in reaching the solution. (Trajectories that lead to correct answers are given higher Q values (close to 1) and considered of higher quality).</p><p><strong>The SLM, serving as a policy model, samples the candidate nodes, each step generating a</strong> <strong>COT and the corresponding python code</strong>. <strong>To verify the generation quality, only nodes with successful python code execution are retained, thus mitigating errors in intermediate steps.</strong></p><p>Second, a<strong> process preference model (PPM)</strong>, an SLM is trained to implement the reward model that predicts a reward label for each math reasoning step.</p><p>These models are trained using a four round self-evolution method that builds the policy model and the PPM from scratch.</p><p><strong>Each round achieves the following:</strong></p><p>📌 Stronger policy SLM</p><p>📌 More reliable PPM</p><p>📌 Generating more reliable reasoning trajectories via PPM augmented MCTS.</p><p>📌 Improving training data coverage to tackle more challenging and complex math problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FPh3gXD7pMqUWFyN" /></figure><h3>🏮 Challenges in Earlier Methods</h3><p>📗 The previous approaches employing the policy models and the reward models to generate reasoning depend on <strong>high-quality training data</strong>. Training data for solving math problems and with reasoning steps is scarce.</p><p>📗 Process reward modelling (PRM) requires <strong>human labelling efforts</strong> and thus poses challenges to <strong>scale</strong>.</p><blockquote><strong>🚨 Why is human labelling important here?</strong><br>Human labeling is important because, even if the final solution is correct, it doesn’t guarantee that the intermediate steps taken to arrive at the solution are also correct. And hence human labeling is needed to evaluate and ensure the accuracy of these intermediate steps.</blockquote><blockquote>🚨 <strong>What is distillation?</strong><br>Distillation is a technique used to transfer knowledge from a larger, more complex model (<strong>the “teacher”</strong>) to a smaller, more efficient model (<strong>the “student”</strong>).</blockquote><blockquote>🚨 <strong>What problems did the distillation approach face?</strong><br>Earlier GPT-distilled approaches for training SLM <strong>limited the model’s abilities to those of the teacher LLM</strong> (GPT). As a result, problems that the teacher couldn’t solve were excluded, and even solvable problems often contained error-prone intermediate steps that were difficult to identify.</blockquote><h3>🔄 <strong>Self Evolution</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cX5IxakFcUloTJ_L" /></figure><p>The<strong> four rounds</strong> of MCTS deep thinking are done progressively to generate higher quality data and to expand the training data set with more challenging math problems.</p><p>Each round uses MCTS to generate step-by-step verified trajectories that are used to train <strong>new policy SLM and PPM.</strong> The new models are then applied in the next round to generate higher quality training data.</p><p>🎯 <strong>Round -1: Bootstrapping an Initial Strong Policy SLM-r1</strong></p><p>Here an initial policy model,<strong> SLM-r1</strong>, is trained using MCTS with <strong>8 rollouts</strong> per problem, no reward model, and a terminal guided annotations of Q values.</p><p>For correct solutions, <strong>the top-2 trajectories</strong> with the <strong>highest average Q</strong> values are selected to train the <strong>PPM-r1</strong> model.</p><p>The limited rollouts yield unreliable Q values, affecting the effectiveness of the PPM-r1.</p><p>🎯 <strong>Round -2: Training a Reliable PPM-r2</strong></p><p>The policy model is adapted to 7 billion parameters; 16 rollouts per problem are conducted for more accurate Q-value annotations and to train a more reliable model — PPM-r2.</p><p>In this round both PPM-r2 and SLM-r2 policy models improve.</p><p>🎯 <strong>Round-3: PPM Augmented MCTS to Significantly Improve Data Quality</strong></p><p>With the reliable PPM-r2, <strong>PPM-augmented MCTS </strong>is performed, leading to higher-quality trajectories covering harder and more complex Olympiad-level problems.</p><p>The generated reasoning trajectories and self-annotated Q values are then used to train the new policy model SLM-r3 and PPM-r3.</p><p>🎯 <strong>Round-4: Solving Challenging Math Problems</strong></p><p>Here the number of MCTS rollouts is increased to <strong>64</strong> and then to <strong>128</strong>, covering all levels and boosting Olympiad-level problems to <strong>80%.</strong></p><blockquote>🚨 <strong>But why is MCTS chosen?</strong></blockquote><blockquote>MCTS breaks down complex math problems into simpler, single-step generation tasks, and this yields step-level training data for both models.</blockquote><blockquote>🚨 <strong>Why can’t we integrate LLMs with MCTS as a policy or reward model?</strong></blockquote><blockquote>MCTS multiple rollouts, assigning Q values, and integrating these large language models will become computationally expensive and hence significantly raise inference costs.</blockquote><h3>🥁 Advantages of the rStar-Math approach</h3><p>👉 Eliminates intermediate error steps.</p><p>👉 Expands training set with more challenging problems.</p><p>👉 Generates high-quality reasoning steps.</p><p>👉 Reduces dependence on expensive LLMs.</p><p>👉 Code augmented COT synthesis provides dense verification during math solution generation.</p><p>👉 The models can generalize to more challenging tasks like theorem proving, code reasoning, and common-sense reasoning.</p><blockquote>🔥 rStar-Math approach demonstrates that size is not the only factor in tackling complex problems!</blockquote><h3>💹 <strong>Other findings of this approach</strong></h3><p>1️⃣ <strong>Emergence of intrinsic self-reflection capability.</strong></p><p>MCTS-driven deep thinking exhibits self-reflection during problem-solving.</p><p>2️⃣ <strong>PPM shapes the reasoning boundary in System 2 deep thinking.</strong></p><p>Once the policy model attains a reasonably strong capability level, the PPM becomes the <strong>key determinant</strong> of the upper performance limit.</p><p>3️⃣ <strong>PPM spots theorem application steps.</strong></p><p>PPM effectively identifies critical theorem application intermediate steps, and these steps are rewarded with a high score, guiding the policy model to generate the correct solution.</p><p>4️⃣ <strong>Generalization discussions.</strong></p><p>rStar-Math generalizes to more challenging math tasks and other tasks such as code and common-sense reasoning.</p><h3>🔎 Evaluation</h3><p>📒 SLMs of different sizes are utilized as the base models: Qwen2.5-Math-1.5B, Phi3-mini-Instruct (3B), Qwen2-Math-7B, and Qwen2.5-Math-7B.</p><p>📒 Four rounds of self-evolution are exclusively done on Qwen2.5- Math-7B, yielding <strong>four</strong> <strong>evolved policy SLMs and four PPMs.</strong></p><p>📒 Well-known benchmarks like <strong>MATH, GSM8K, and AIME</strong> are used to evaluate the performance.</p><p>📒 <strong>Pass@1 accuracy</strong> is calculated for all baselines, and for the System 2, the <strong>default thinking time</strong> is calculated.</p><blockquote>🚨 <strong>What is Pass@k accuracy?</strong></blockquote><blockquote>PASS@k evaluation technique is letting the language model generate k different<br>solutions, and marking something as correct if any one of the k generations yields the correct answer.</blockquote><h3>📊 <strong>Main Results</strong></h3><p>Through four rounds of self-evolution, with millions of synthesized solutions for <strong>747k</strong> math problems, rStar-Math boosts SLM’s math reasoning to state-of-the-art levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZDXFToflu9I5oh9C" /><figcaption><a href="https://arxiv.org/pdf/2501.04519"><strong>Source</strong></a></figcaption></figure><p>On the MATH benchmark, it improves Qwen2.5-Math-7B from <strong>58.8% to 90.0%</strong> and Phi3-mini-3.8B from <strong>41.4% to 86.4%</strong>, surpassing o1-preview by <strong>+4.5% and +0.9%</strong>. On the USA Math Olympiad (AIME), rStar-Math solves an average of <strong>53.3%</strong> (8/15) of problems, ranking among the<strong> top 20% </strong>of<strong> </strong>the brightest high school math students.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imI_I4QxQ8y6s_bIAZDYvQ.png" /><figcaption><strong>Reasoning performance under scaling up the test-time compute (</strong><a href="https://arxiv.org/pdf/2501.04519"><strong>Source</strong></a><strong>)</strong></figcaption></figure><h3>💎 <strong>Key observations:</strong></h3><p>(1) With only 4 trajectories, rStar-Math significantly outperforms Best-of-N baselines, exceeding o1-preview and approaching o1-mini, demonstrating its effectiveness.</p><p>(2) Scaling <strong>test-time compute</strong> improves reasoning accuracy across all benchmarks, though with varying trends.</p><h3>☎ References</h3><h4>📬 <strong>For SLMs:</strong></h4><p><a href="https://medium.com/@nageshmashette32/small-language-models-slms-305597c9edf2">Small Language Models (SLMs)</a></p><h4>📬 <strong>For rStar:</strong></h4><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/2408.06195&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8116f43500755675b8717225c62d43c/href">https://medium.com/media/b8116f43500755675b8717225c62d43c/href</a></iframe><p><a href="https://medium.com/@has.dhia">https://medium.com/@has.dhia</a></p><h4>📬 <strong>For rStar-Math</strong></h4><p><a href="https://www.linkedin.com/pulse/breakthroughs-new-microsoft-researchs-rstar-math-theturingpost-rfbff/">Breakthroughs of the new Microsoft Research&#39;s rStar-Math</a></p><p><a href="https://arxiv.org/pdf/2501.04519">https://arxiv.org/pdf/2501.04519</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2282e1968453" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CAG — Cache Augumented Generation]]></title>
            <link>https://medium.com/@suprajasrikanth872/cag-cache-augumented-generation-3007b79b7e99?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3007b79b7e99</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Thu, 16 Jan 2025 04:14:00 GMT</pubDate>
            <atom:updated>2025-01-16T04:19:23.314Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌐 Cache Augmented Generation (CAG)🚀</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cxViIYR6umxUn136.jpg" /></figure><p>Before diving into <strong>CAG</strong>, let’s first understand <strong>RAG</strong> (Retrieval-Augmented Generation) and how CAG serves as a promising alternative for enhancing the performance of <a href="https://medium.com/@suprajasrikanth872/what-are-llms-f78f1e43ab9f">Large Language Models (LLMs).</a></p><h3>📖 <strong>RAG, </strong>Retrieval-Augmented Generation</h3><p>RAG is an effective approach that combines the strengths of <strong>retrieval systems</strong> (for gathering dynamic data) with <strong>generative models</strong>. These systems have proven effective in handling open-domain questions by leveraging retrieval pipelines to provide contextually relevant answers.</p><h3>📚 Key Features of RAG:</h3><p>📌 <strong>Embedding and vector search</strong>: Encoding and querying external vector databases for retrieving contextually relevant documents.</p><p>📌 <strong>Real-time integration</strong>: Combining retrieved data with user queries in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2LKDADCxUEwjTK1p.png" /><figcaption><a href="https://www.clarifai.com/blog/what-is-rag-retrieval-augmented-generation"><strong>Source</strong></a></figcaption></figure><h3>📢 <strong>Challenges of RAG -</strong></h3><p>1️⃣ <strong>Latency</strong>: Increased inference time due to real-time dependencies on external databases for context retrieval and vector search operations.</p><p>2️⃣ <strong>Errors in document ranking</strong>: Inaccurate or irrelevant document retrieval can lead to suboptimal results, reducing the system’s reliability.</p><p>3️⃣ <strong>Complicated setup</strong>: Integration of retrieval and generation requires careful tuning, additional infrastructure, and continuous maintenance, increasing overhead.</p><p>4️⃣ <strong>Security Issues</strong>: Reliance on external data stores for sensitive information raises concerns about privacy and data protection.</p><p>5️⃣ <strong>Computational cost</strong>: Encoding, querying, and performing vector searches demand substantial computational resources.</p><blockquote>⌛ The computational and <strong>memory</strong> demands of the RAG-based approach, particularly during inference, pose consequential challenges.</blockquote><h3>🤔 What is CAG, and how does it serve as an alternative to RAG?</h3><p>CAG optimizes memory, reduces redundant computation, and enhances model performance using the concept of <strong>key-value (KV) cache</strong>. It eliminates the retrieval bottleneck by preloading relevant knowledge directly into the LLM’s extended context window, allowing for efficient tensor calculations within the self-attention mechanism.</p><h3>Key Benefits of CAG:</h3><ul><li>Reduces retrieval latency by staying entirely within the <strong>LLM’s mathematical computation.</strong></li><li>Optimizes knowledge integration by <strong>caching runtime parameters.</strong></li></ul><p>This makes CAG particularly effective for scenarios with a limited range of documents and knowledge.</p><h3>🔊 CAG Framework: Operational Phases</h3><p>📍<strong> External knowledge preloading</strong></p><p>A curated collection of documents D relevant to the target application is preprocessed and formatted to fit within the model’s extended context window. The LLM, M, with parameters θ, processes D into a computed KV cache:</p><blockquote><em>Ckv = KV-Encode(D)</em></blockquote><p>The KV cache, encapsulating the inference state of the LLM, is stored on disk or in memory for future use. <strong>The computational cost of processing D is incurred only once, regardless of the number of subsequent queries.</strong></p><p>📍 <strong>Inference</strong></p><p>During inference, the precomputed KV cache Ckv, containing LLM’s internal representation of all relevant external knowledge, is loaded into the LLM’s working memory alongside the user’s query Q. The LLM utilizes this cached context to generate responses.</p><blockquote><em>R = M(Q | Ckv)</em></blockquote><p>By preloading the external knowledge, this phase eliminates retrieval latency and reduces the risk of errors or omissions that can arise during dynamic retrieval. The combined prompt <strong>P = Concat(D, Q)</strong> ensures a unified understanding of both knowledge and user query.</p><p>📍 <strong>Cache Reset</strong></p><p>To maintain system performance across multiple inference sessions, new tokens t1, t2,…, and tk​ are sequentially added to the cache. Resetting involves truncating these tokens in a compressed manner:</p><blockquote><em>Creset, kv = Truncate(Ckv, t1, t2, ..., tk)</em></blockquote><p>This allows for rapid reinitialization without reloading the entire cache from the disk, ensuring speed and responsiveness.</p><blockquote>⌛ CAG offers a fresh perspective on external knowledge integration, especially in use cases with fixed or manageable data.</blockquote><h3>🧐 <strong>How Does the Key-Value Cache Work?</strong></h3><p>In autoregressive generation, LLMs compute key-value matrices for all previously generated tokens during self-attention. Without KV caching, embeddings are repeatedly computed for each token, incurring O(N²) time complexity.</p><p>With KV caching, K and V matrices for previous tokens are stored and reused, reducing the complexity to O(N). This significantly improves efficiency by limiting redundant computations.</p><blockquote>⌛ Key-value caching makes CAG an efficient and robust solution for handling complex, knowledge-intensive tasks across diverse applications.</blockquote><h3>📬 <strong>Key Features of CAG:</strong></h3><p>👉 <strong>Static Knowledge Integration</strong>: Ensures consistency across interactions.</p><p>👉 <strong>Inference State Caching</strong>: Reduces repeated computations.</p><p>👉 <strong>Simplified Infrastructure</strong>: Removes the need for external databases.</p><h3>📊 <strong>Comparison of RAG and CAG workflow</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/0*KOG2cxXljPxPZFtX" /><figcaption><a href="https://arxiv.org/pdf/2412.15605"><strong>Source</strong></a></figcaption></figure><p><strong>RAG</strong>: During inference, when a query is made, it fetches the relevant documents from the external sources, which are preprocessed and incorporated into responses.</p><p><strong>CAG</strong>: During inference, the model accesses the context from the KV cache to generate tokens and updates the cache with the generated tokens.</p><blockquote>⌛ Don’t Do RAG When Cache Augmented Generation Is All You Need For Knowledge Tasks!</blockquote><h3>🧐 Advantages of CAG Over RAG</h3><p>1️⃣ <strong>Reduced inference time</strong>: Experiments show that the latency of CAG is <strong>40% </strong>lower than that of the RAG system. This aids in <strong>latency-sensitive</strong> applications such as real-time support chatbots.</p><p>2️⃣ <strong>Simplified architecture: </strong>CAG eliminates the need of constructing and retrieving data from an external vector store or vector space. And hence the overhead infrastructure is avoided, and the model can be deployed in environments where database management isn’t feasible.</p><p>3️⃣ <strong>Improved security</strong>: CAG offers improved security by storing sensitive information within the LLM’s contextual memory.</p><p>4️⃣ <strong>Reliability: </strong>Errors are reduced by eliminating the dependence on the accuracy of document retrieval.</p><p>5️⃣ <strong>Unified context</strong>: Providing all the context and information to the model at once helps it understand the data better and respond more <strong>holistically</strong>.</p><blockquote>⌛ Studies suggest that as long as all documents fit within the context length, traditional RAG systems can be replaced by long context models.</blockquote><blockquote>For tasks with constrained database, CAG delivers results on par or even better than RAG. ⚡</blockquote><h3>🚧 <strong>Challenges of CAG?</strong></h3><p>🚨 <strong>Limited knowledge size:</strong> CAG requires the entire knowledge source to fit within the context window, making it less suitable for tasks with extremely large datasets.</p><p>🚨 <strong>Memory requirements:</strong> Maintaining a large key-value cache for large datasets demands extensive memory and storage. As key-value cache grows sequentially, this can quickly exceed the hardware memory limits, especially for long sequences.</p><p>🚨 <strong>Compressing tradeoffs:</strong> Compressing the key value cache can reduce the memory usage but may degrade the model performance if the key information is lost.</p><p>🚨 <strong>Cache eviction policies:</strong> Determining which items to evict when the cache reaches its capacity is a complex problem. Popular caching techniques like LRU and LFU do not align with LLM patterns, leading to suboptimal results.</p><p>🚨 <strong>Processing overhead:</strong> Preparing, encoding, and storing data in key-value cache requires significant effort during runtime.</p><p>🚨 <strong>Static data dependence:</strong> Not ideal for dynamic datasets. Cannot adapt to updated datasets.</p><h3>🔥 Use cases of CAG:</h3><p>➡ <strong>Specialised Q&amp;A</strong>: Answering questions based on specific domains like legal, medical, or finance, where all relevant documentation can be preloaded.</p><p>➡ <strong>Research: </strong>To assist research that involves large datasets with known context.</p><h3>🎻 <strong>Future of CAG-</strong></h3><p>CAG is poised to become the preferred method for knowledge integration. This approach is anticipated to be even more potent with the expected advancements in LLMs.</p><p>💎 As the future models continue to expand their context length, they will be able to process increasingly larger knowledge collections in a single inference step.</p><p>💎 The improved abilities of these models to extract and utilise relevant information from long context will further enhance their performance.</p><p>The above-mentioned skills will notably extend the usability of the CAG approach, enabling it to handle more complex and diverse applications.</p><p>Additionally, there is potential for <strong>hybrid approaches</strong> that combine preloading with selective retrieval. <strong>Example</strong>: A system could preload a foundation context and use retrieval only to augment edge cases or highly specific queries. This would balance the efficiency of preloading with the flexibility of retrieval, making it suitable for scenarios where<strong> context completion</strong> and <strong>adaptability</strong> are equally important!.</p><blockquote>⌛ As LLMs evolve with expanded context capabilities, the CAG framework establishes a foundation for more efficient and reliable knowledge-intensive applications.</blockquote><h3>🎤 <strong>Key takeaways:</strong></h3><blockquote>CAG eliminates the retrieval bottleneck by preloading all the relevant knowledge directly into LLM’s extended context window.</blockquote><blockquote>CAG relies on key-value cache to cache the runtime parameters.</blockquote><blockquote>CAG is a faster, more accurate, and reliable alternative to traditional RAG for tasks with static datasets.</blockquote><h3>📚 <strong>References</strong> -</h3><p><a href="https://www.linkedin.com/posts/bhavishya-pandit_rag-vs-cag-activity-7282615153852862464-ES23?utm_source=share&amp;utm_medium=member_desktop">https://www.linkedin.com/posts/bhavishya-pandit_rag-vs-cag-activity-7282615153852862464-ES23?utm_source=share&amp;utm_medium=member_desktop</a></p><p><a href="https://www.linkedin.com/pulse/cache-augmented-generation-cag-streamlined-approach-knowledge-roy-zr9ic/">https://www.linkedin.com/pulse/cache-augmented-generation-cag-streamlined-approach-knowledge-roy-zr9ic</a></p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/2412.15605v1&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/19a4648a364422e0048cd655b9303204/href">https://medium.com/media/19a4648a364422e0048cd655b9303204/href</a></iframe><p><a href="https://www.youtube.com/watch?v=NaEf_uiFX6o">https://www.youtube.com/watch?v=NaEf_uiFX6o</a>CAG</p><p><a href="https://arxiv.org/pdf/2412.19442">https://arxiv.org/pdf/2412.19442</a></p><p><a href="https://www.linkedin.com/posts/anish-goswami-9b8271b7_generativeai-innovation-knowledgeintegration-activity-7282292812409155585--_6U?utm_source=share&amp;utm_medium=member_desktop">https://www.linkedin.com/posts/anish-goswami-9b8271b7_generativeai-innovation-knowledgeintegration-activity-7282292812409155585--_6U?utm_source=share&amp;utm_medium=member_desktop</a></p><p><a href="https://aivineet.com/cache-augmented-generation-cag-superior-alternative-to-rag/">https://aivineet.com/cache-augmented-generation-cag-superior-alternative-to-rag</a></p><p><a href="https://www.marktechpost.com/2025/01/11/cache-augmented-generation-leveraging-extended-context-windows-in-large-language-models-for-retrieval-free-response-generation/">https://www.marktechpost.com/2025/01/11/cache-augmented-generation-leveraging-extended-context-windows-in-large-language-models-for-retrieval-free-response-generation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3007b79b7e99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Exploring Multi-Agent LLM Systems ⚡]]></title>
            <link>https://medium.com/@suprajasrikanth872/exploring-multi-agent-llm-systems-bd1833cff180?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd1833cff180</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[llm-agent]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 04:28:34 GMT</pubDate>
            <atom:updated>2025-01-12T04:28:34.966Z</atom:updated>
            <content:encoded><![CDATA[<h4>Collaborative Intelligence for Complex Problem Solving 🔎</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdbdnybYEgIXoKjLOBz11Q.png" /></figure><h3>📚 <strong>What Are Multi-Agent LLM Systems?</strong></h3><p>Multi-Agent Systems (MAS) powered by <a href="https://medium.com/@suprajasrikanth872/what-are-llms-f78f1e43ab9f"><strong>Large Language Models</strong></a> (LLMs) enable specialized agents to coordinate and solve complex, dynamic problems. MAS excels in addressing large-scale challenges, such as in healthcare systems and supply chain optimisation, that require diverse expertise.</p><p>💬 Consider an example where agents are tasked with planning an itinerary for a holiday trip. One agent might focus on finding travel options by exploring various websites and APIs, while a second agent investigates different destinations. Meanwhile, another agent searches for accommodation options. In this scenario, the agents communicate to determine accommodation based on the locations scheduled for each day of the trip.</p><blockquote>⌛ MAS mimics human collaboration across specialties to achieve shared goals.</blockquote><h3>🧠 <strong>Key Components of Multi-Agent LLM Systems</strong></h3><p>📌 <strong>Agents: </strong>Each agent has its own role and context. All agents in the MAS work in parallel until the overall goal is accomplished. Each agent may specialize in a different domain.</p><p>📌 <strong>Tool-use capability: </strong>An agent’s tool-use capability allows it to leverage external tools and resources to accomplish the goals, enhancing its functional capabilities and enabling it to operate more effectively in diverse and dynamic environments. The tools could include APIs for weather data, geolocation services, or sentiment analysis models.</p><p>📌 <strong>LLM: </strong>LLMs serve as the core intelligence for autonomous agents within MAS. These agents can execute various tasks automatically, utilizing the reasoning and language generation capabilities of LLMs for functions such as planning, decision-making, and problem-solving.</p><p>📌 <strong>Orchestration</strong> <strong>layer: </strong>The orchestration layer is central to the MAS, responsible for maintaining memory, state management, reasoning processes, and planning activities. Continuous monitoring, scheduling tasks, and conflict resolution are the responsibilities of the orchestration layer.</p><p>📌 <strong>Memory: </strong>In multi-agent systems, shared memory plays a crucial role, allowing agents to access a centralized knowledge base, ensuring they operate with consistent information and context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMmNDnhEQnjTU9tZlvhaBg.png" /><figcaption><a href="https://www.reply.com/aim-reply/en/content/introduction-to-multi-agent-architecture-for-llm-based-applications"><strong>Source</strong></a></figcaption></figure><h3>🤔 But how do the agents interact and work together?</h3><p>And to answer this we have different <strong>multi-agent interaction patterns:</strong></p><p>👉 <strong>Collaborative agents: </strong>Multiple agents work together on different parts of the tasks while sharing the progress, context, learnings, and experiences.</p><p>👉 <strong>Supervised agents: </strong>A central supervisor agent is employed that manages other agents, coordinating their activities and verifying the result to ensure quality.</p><p>👉 <strong>Hierarchical agents: </strong>A structured, tree-like system where higher-level agents oversee lower-level agents.</p><h3>🔄 <strong>Advantages of Multi-Agent Systems Over Single-Agent Systems</strong></h3><p>1️⃣ <strong>Handling large data: </strong>Single-agent systems are constrained by context window size, limiting their ability to process extensive datasets effectively. This poses problems when dealing with huge volumes of data, conversation logs, and context over an extended duration of time. Multi-agents handle this by dividing the data among several agents, each agent focusing on a segment of text or data. The agents then share the acquired knowledge with other agents in the system.</p><p>2️⃣ <strong>Efficiency and multitasking: </strong>While single-agent systems operate on a single computational resource or thread, processing one chunk of work at a given time, MAS allows for parallel processing of work by multiple agents, reducing latency and enhancing the productivity of the system.</p><p>3️⃣ <strong>Separation of concerns: </strong>Unlike single-agent systems, in MAS each agent is specialized in a particular domain and skilled to perform a designated task. This removes the need for a single agent being proficient in multiple areas.</p><p>4️⃣ <strong>Robustness: </strong>The MAS system can continue to operate even if some agents fail, and hence it can be a better choice when compared to single-agent systems in scenarios where the availability of the system is critical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*HxSjIaGY2ofTgBMoT4gTkw.png" /></figure><h3>📢 <strong>Challenges Faced by Multi-Agent Systems</strong></h3><p>🚨 <strong>Hallucinations: </strong>Hallucination is a significant problem in LLMs and in single-agent systems but becomes increasingly challenging in a multiagent system where one agent’s hallucinated output can affect the other agent in the system, having a cascading effect. The misinformation from one agent can be accepted and propagated throughout the interconnected chain of agents.</p><p>🚨 <strong>Scaling the system: </strong>Each agent built upon large language models, like GPT-4, requires extensive computational resources and memory. Scaling a number of these agents significantly affects the resources of the system.</p><p>🚨 <strong>Managing context and conversations: </strong>The goal being divided into subtasks and being carried out by different agents — introduces the challenge of sharing the context and conversation between the agents.</p><p>🚨 <strong>Task allocation: </strong>For complex problems, efficiently breaking down and allocating the tasks among the available agents, adhering to their capabilities and expertise, is challenging. The allocation of work should ensure maximum efficiency of the agents and not cause bottlenecks.</p><h3>🥁 <strong>Key Takeaways:</strong></h3><blockquote>LLM based multi-agents utilise the knowledge and skills of agents to improve efficiency and deliver effective outcomes.</blockquote><blockquote>MAS excels in handling large datasets, ensuring robustness, and enabling efficient multitasking.</blockquote><blockquote>Despite its advantages, MAS faces challenges such as hallucinations, scalability issues, context management, and efficient task allocation.</blockquote><h3>⚙️ <strong>References:</strong></h3><p><a href="https://abvijaykumar.medium.com/multi-agent-architectures-e09c53c7fe0d">https://abvijaykumar.medium.com/multi-agent-architectures-e09c53c7fe0d</a></p><ul></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd1833cff180" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Large Concept Models]]></title>
            <link>https://medium.com/@suprajasrikanth872/large-concept-models-3cf7b9f11a24?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cf7b9f11a24</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 13:55:49 GMT</pubDate>
            <atom:updated>2025-01-06T13:55:49.347Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Language Modeling in a Sentence Representation Space</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-HuHCGBC_Y7XDTIs" /></figure><p><strong>For a Quick Read</strong></p><p>While Large Language Models (LLMs) traditionally generate outputs by predicting one token at a time, Large Concept Models (LCMs) operate at the <strong>concept level,</strong> decoupling from both language and modality.</p><p>By employing <strong>concept-based learning</strong>, LCMs can generate multilingual and multimodal outputs without additional training, showcasing <strong>zero-shot learning</strong>.</p><p>The main characteristics of LCMs include <strong>reasoning beyond tokens</strong>, predicting the next concept, and <strong>hierarchical processing</strong>, similar to the human-like top-down approach.</p><p>LCMs are used in tasks like text generation, summarization, translation, and multimodal content generation. While LCMs enable efficient processing of long texts and zero-shot learning, challenges such as <strong>bias</strong>, <strong>explainability</strong>, and <strong>hallucinations</strong> remain significant.</p><p><strong>LLMs Explained: Opportunities and Challenges</strong></p><p>LLM models like GPT have exhibited excellent performance in various tasks including text generation, summarization, translation, and question answering.</p><p>These models work in an autoregressive manner, i.e., considering the previous tokens and generating one token at a time. However, this approach incurs high computational costs.</p><p>For example, if an LLM is tasked with generating a story of over 1,000 words, it becomes computationally expensive to generate one token at a time. Additionally, the LLM would require additional training/fine-tuning when presented with the same tasks in a different language.</p><p>Moreover, LLMs miss a key characteristic of human behavior — explicit reasoning and planning at multiple levels of abstraction.</p><blockquote><strong>To address these shortcomings, the paper Large Concept Models by Meta introduces the idea of Large Concept Models, which operate at the concept level.</strong></blockquote><p><strong>How Large Concept Models Work</strong></p><p>The primary goal of LCMs is to mimic human behavior by breaking down tasks into manageable chunks of ideas and concepts. For example, when preparing multiple talks on the same topic, one would consider all concepts and key points rather than crafting identical speeches each time. While the choice of words may differ, the underlying concept remains consistent — this is what LCMs incorporate!</p><p>The core idea of LCMs is to decouple reasoning from language representations. The model approaches the problem by moving away from processing at the token level and closer to reasoning in an abstract embedding space. This abstract embedding space is designed to be independent of the language or modality in which content is expressed. Hence the model works on the semantic level (concept) and not its instantiation in a specific language.</p><p>Rather than predicting the next token, LCMs are trained to predict the next concept or high-level idea in a multimodal and multilingual embedding space. Predicting the next concept helps generate smoother and more coherent outputs, especially when longer outputs are expected!</p><blockquote><strong><em>Note </em></strong>: The paper refers to the concept as a sentence and uses an existing sentence embedding space, SONAR, which supports 200 languages in both text and speech.</blockquote><p>LCM offers zero-shot generalization to unseen languages and is more computationally efficient as input context grows since the input is represented as a concept/sentence embedding rather than at the token level.</p><p><strong>What Makes LCMs Unique?</strong></p><p><strong>Reasoning beyond tokens: </strong>Enabling understanding at the conceptual level for better understanding and planning</p><p><strong>Hierarchical processing: </strong>Simulating a human-like, top-down approach for solving complex tasks and generating coherent outputs.</p><p><strong>Inside the LCM Framework</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D_W36BFMknisNInQ" /><figcaption><strong><em>Fundamental architecture of an Large Concept Model (LCM).</em></strong></figcaption></figure><p>LCM uses <strong>autoregressive</strong> sentence prediction. The input is first segmented into sentences, and each one is embedded with <strong>SONAR</strong> to achieve a sequence of concepts, i.e., sequence embeddings.</p><p>The sequence of concepts is then processed by the Large Concept Model (LCM) to generate an output of concepts.</p><p>Finally, these generated concepts are decoded back by SONAR.</p><p>The encoder and the decoder used are fixed and not trained. The unchanged concepts can be decoded into any language or modality without additional training. Hence, it exhibits <strong>zero-shot learning </strong>on inputs in any language or modality since it operates on concepts.</p><blockquote><strong>Example</strong><em> : An LCM capable of translating a text from spanish to english, can also translate a text / speech from french to english without additional training.</em></blockquote><p><strong>The Flipside of LCMs</strong></p><p><strong>Bias: </strong>A common issue in LLMs — persists in LCMs. Bias in the training data can lead to inaccurate results. A diversified data set and careful evaluation of the model are required to mitigate the issue.</p><p><strong>Explainability: </strong>Generating output at the concept level would make it difficult to understand how the models are making decisions and processing the information.</p><p><strong>Hallucinations</strong>: Like LLMs, LCMs may still generate outputs that are factually incorrect or misaligned with the input data.</p><p><strong>Key Takeaways</strong></p><blockquote>Works on the concept level, predicting the next sentence or idea in a sequence.</blockquote><blockquote>Processes sentence embeddings (concepts) that are independent of language and modality.</blockquote><blockquote>Generates text sentence by sentence, focusing on higher-level reasoning.</blockquote><blockquote>Zero-shot generalization — handles multiple languages and modalities without the need for retraining, saving time and computational costs.</blockquote><blockquote>The LCM is trained to reduce the concept prediction error.</blockquote><blockquote>Efficient while working with long contexts as it processes sequences into sentence embeddings that are shorter than token sequences.</blockquote><blockquote>Best for sentence-level tasks like summarization, story generation, and multimodal generation.</blockquote><p><strong>References</strong></p><p><a href="https://ai.meta.com/blog/meta-fair-updates-agents-robustness-safety-architecture/">https://ai.meta.com/blog/meta-fair-updates-agents-robustness-safety-architecture/</a></p><p><a href="https://medium.com/data-science-in-your-pocket/meta-large-concept-models-lcm-end-of-llms-68cb0c5cd5cf">https://medium.com/data-science-in-your-pocket/meta-large-concept-models-lcm-end-of-llms-68cb0c5cd5cf</a></p><p><a href="https://spotifycreators-web.app.link/e/OK6Y8gtWtPb">https://spotifycreators-web.app.link/e/OK6Y8gtWtPb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cf7b9f11a24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Are LLMs?]]></title>
            <link>https://medium.com/@suprajasrikanth872/what-are-llms-f78f1e43ab9f?source=rss-80cae6e1e7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f78f1e43ab9f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Supraja Srikanth]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 06:41:51 GMT</pubDate>
            <atom:updated>2024-12-19T06:41:51.571Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*hVRboDbHek58Skck.png" /></figure><p>Large Language Models (LLMs) are advanced AI systems designed to understand and generate human-like text. These models are trained on vast amounts of data, enabling them to perform tasks ranging from answering questions and summarizing text to generating creative content.</p><p><strong>How Do Text Generation LLMs Work?</strong></p><p>LLM works by utilizing the concept of predicting the next word (or token) based on a given context. For example, when we type “The sky is,” an LLM predicts the most likely next word based on patterns it has learned from training data. This process is called <strong>autoregressive </strong>modeling — the model generates text one word at a time, using previous words as context.</p><p>Training these models involves teaching them to <strong>predict missing words in sentences</strong>. For instance, given the sentence “The ___ is blue,” the model learns to predict “sky.”</p><p><strong>Why Are LLMs Significant?</strong></p><p>The power of LLMs goes beyond understanding and generating text. They can:</p><ul><li><strong>Answer Complex Questions:</strong> LLMs can reason through unfamiliar topics and provide meaningful answers.</li><li><strong>Adapt to Specific Use Cases:</strong> By fine-tuning on specialized datasets, they can perform tasks like medical diagnosis, legal document analysis, or creative writing.</li></ul><p><strong>Use Cases of LLMs</strong></p><p>LLMs have a wide range of applications, including:</p><ul><li><strong>Text Generation:</strong> Writing articles, creating stories, and generating code.</li><li><strong>Chatbots:</strong> Powering customer service bots like ChatGPT.</li><li><strong>Summarization:</strong> Condensing lengthy texts into concise summaries.</li><li><strong>Language Translation:</strong> Facilitating communication across different languages.</li><li><strong>Content Moderation:</strong> Detecting harmful or inappropriate language.</li></ul><p><strong>Challenges in LLMs</strong></p><p>Despite their capabilities, LLMs face several challenges:</p><ul><li><strong>Data Requirements:</strong> Training LLMs requires enormous datasets that are diverse and high-quality.</li><li><strong>Computational Costs:</strong> The training process demands significant computational resources, leading to high energy consumption.</li><li><strong>Hallucinations:</strong> LLMs sometimes generate inaccurate or nonsensical content.</li><li><strong>Ethical Concerns:</strong> Biases in training data can result in unfair or harmful outputs.</li></ul><p><strong>Key Concepts in LLMs</strong></p><p><strong>Representation Models:</strong></p><ul><li>These models, like BERT, are encoder-only and focus on understanding and representing input text accurately.</li><li>Applications: Text classification, sentiment analysis, and named entity recognition (NER).</li></ul><p><strong>Generative Models:</strong></p><ul><li>Models like GPT are decoder-only and specialize in generating coherent text.</li><li>Applications: Text generation, conversation systems, and creative writing.</li></ul><p><strong>Transfer Learning:</strong></p><ul><li>The process of pretraining a model on a large dataset and fine-tuning it for a specific task or domain.</li></ul><p><strong>Masked Language Models:</strong></p><ul><li>These models predict missing words in a sentence, like guessing “sky” in “The ___ is blue.”</li></ul><p><strong>Autoregressive Models:</strong></p><ul><li>LLMs like GPT use autoregressive modeling, generating text sequentially by predicting the next word based on prior context.</li></ul><p><strong>Decoding Strategies:</strong></p><ul><li>These are methods for selecting the next word during text generation. For example, greedy decoding always chooses the highest probability word, while other strategies balance creativity and accuracy.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f78f1e43ab9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>