<?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 Shimin Zhang on Medium]]></title>
        <description><![CDATA[Stories by Shimin Zhang on Medium]]></description>
        <link>https://medium.com/@shimin.zhang98?source=rss-adc5656f95cc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FHjdWHWA6NRBYHC6BtTJmg.jpeg</url>
            <title>Stories by Shimin Zhang on Medium</title>
            <link>https://medium.com/@shimin.zhang98?source=rss-adc5656f95cc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 15:02:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shimin.zhang98/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[Evaluating LLM-based chatbots: A comprehensive guide to performance metrics]]></title>
            <link>https://medium.com/data-science-at-microsoft/evaluating-llm-based-chatbots-a-comprehensive-guide-to-performance-metrics-9c2388556d3e?source=rss-adc5656f95cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c2388556d3e</guid>
            <category><![CDATA[evaluation]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Shimin Zhang]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 07:17:22 GMT</pubDate>
            <atom:updated>2024-11-18T16:18:33.952Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By</em><strong><em> </em></strong><a href="https://www.linkedin.com/in/szshiminzhang/"><em>Shimin Zhang</em></a><em>, </em><a href="https://www.linkedin.com/in/yan-chen-0a310037/"><em>Yan Chen</em></a><em>, </em><a href="https://www.linkedin.com/in/theruihu/"><em>Rui Hu</em></a><em>, and </em><a href="https://www.linkedin.com/in/gorkem-ozer-0a35514/"><em>Gorkem Ozer Yilmaz</em></a></p><blockquote><strong><em>From the Editor:</em></strong> This is part of a special series of <strong>Data Science at Microsoft “Thursday Special”</strong> articles sponsored by the <strong>Microsoft IDEAS</strong> data science team, in which team members discuss their work and how it contributes to business and organizational success. Microsoft IDEAS is the central data and growth plane for the Experiences + Devices (E+D) and Security divisions at Microsoft, supporting both productivity-centric research and the aggregation of Copilot-centric data and insights across Microsoft. With stewardship over 240 petabytes of data and 38,000 datasets spanning 2,700 data sources, Microsoft IDEAS orchestrates personalized experiences across more than 350 product surfaces, with an impact on billions of customer touchpoints each year and driving critical decisions across the internal Microsoft ecosystem. You can read an overview article of the Microsoft IDEAS team in their own words here: <a href="https://medium.com/data-science-at-microsoft/the-evolution-of-a-data-platform-the-story-of-the-microsoft-ideas-team-f1c215173da2?source=friends_link&amp;sk=ed8f293b4d9f75590d3d541dc48d9164">The evolution of a data platform | by Ravi Vedula | Data Science at Microsoft | Sep 2024 | Medium</a>.</blockquote><h3>Introduction</h3><p>As Large Language Models (LLMs) like <a href="https://openai.com/index/gpt-4/">GPT-4</a> continue to revolutionize the field of <a href="https://dev.botframework.com/">conversational AI</a> — technology that enables human beings to interact with it through speech — evaluating the performance of LLM-based chatbots has become increasingly important. Whether for customer service, virtual assistance, or content generation, the effectiveness of a chatbot depends on several key metrics and evaluation strategies. This article explores the essential aspects of evaluating LLM-based chatbots, offering insights into performance metrics and best practices to ensure optimal functionality and user satisfaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzFJZvrGG0dEJ9u5lmMIPA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@growtika?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Growtika</a> on <a href="https://unsplash.com/photos/an-abstract-image-of-a-sphere-with-dots-and-lines-nGoCBxiaRO0?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a>.</figcaption></figure><p>LLM-based chatbots use Large Language Models to generate human-like responses, handling tasks from answering questions to complex dialog. Evaluating their performance is challenging due to the free-form nature of user prompts and responses, which come in various languages and different expressive styles. The complexity is heightened further by the large absence of explicit user feedback. Explicit user feedback such as “thumbs up” and “thumbs down” is usually rare and it is not unique to a single product, making it much harder to measure user satisfaction and identify areas for improvement.</p><p>In practice, one must often rely on indirect information like query, response, user engagement, and behavior patterns to gauge effectiveness. These methods, while insightful, are less straightforward than explicit feedback. Furthermore, in the absence of direct feedback, continuous monitoring and iterative improvement of the chatbot’s responses become crucial to maintaining and enhancing performance.</p><p>To address these challenges, advanced evaluation and analytics mechanisms are essential. This is the reason for us to write this article, as we seek to explain some common solutions to support product development for LLM-based chatbots. The solutions are language agnostic and therefore suitable for all users. They can be fully automated and scaled for large amounts of user traffic. Moreover, the types of evaluation we suggest can be conducted in “eyes-off” fashion to meet privacy requirements. Lastly, we believe that it is important to keep humans in the loop to help ensure that chatbots deliver human-level precision for safety and accuracy.</p><h3>Evaluation metrics</h3><p>We first began exploring various metrics with IDEAS Copilot, as detailed in <a href="https://medium.com/data-science-at-microsoft/leveraging-ai-for-next-level-data-productivity-in-ideas-part-3-c19390079fe7?source=friends_link&amp;sk=16b8d4f53d8c1773aa23187ba1d4be25">Leveraging AI for next-level data productivity in IDEAS (Part 3) | by Ravi Vedula | Data Science at Microsoft | Oct, 2024 | Medium</a>. With this new article, we are expanding these efforts to other copilots. These metrics, developed and utilized company-wide at Microsoft, offer valuable insights into different aspects of chatbot performance, enabling us to optimize and improve the user experience.</p><h3>1. Search performance for RAG-based chatbots</h3><p>Why do we need <a href="https://en.wikipedia.org/wiki/Retrieval-augmented_generation">Retrieval-Augmented Generation</a> (RAG)? While LLMs excel at analyzing and deriving context, they often lack the specific domain knowledge required to accurately answer users’ questions. This limitation arises because LLMs are trained on a broad corpus of text and may not have access to up-to-date or specialized information, which is needed for precise responses.</p><p>To address this, we often employ Retrieval-Augmented Generation. RAG combines the strengths of traditional search engines with the generative capabilities of LLMs. By integrating a retrieval system that can access and fetch relevant information from a knowledge base, RAG ensures that the chatbot can provide accurate and contextually relevant answers (e.g., see more about the <a href="https://medium.com/data-science-at-microsoft/leveraging-ai-for-next-level-data-productivity-in-ideas-part-3-c19390079fe7?source=friends_link&amp;sk=16b8d4f53d8c1773aa23187ba1d4be25">IDEAS Copilot</a>). This hybrid approach leverages the reasoning power of LLMs while compensating for their knowledge gaps through dynamic information retrieval. Below is a simplified RAG chatbot architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N270o3RGOFBdG2R5cx_mrg.png" /><figcaption>RAG chatbot architecture</figcaption></figure><p><strong><em>User Query:</em></strong><em> The user inputs a query into the chatbot.</em></p><p><strong><em>Retrieval Component:</em></strong><em> The retrieval system searches a knowledge base for relevant documents or information related to the query.</em></p><p><strong><em>Knowledge Base:</em></strong><em> The database or collection of documents that the retrieval component searches through.</em></p><p><strong><em>Retrieved Information:</em></strong><em> The information retrieved by the retrieval component, relevant to the user query.</em></p><p><strong><em>Generative Component:</em></strong><em> The LLM uses both the original user query and the retrieved information to generate a comprehensive response.</em></p><p><strong><em>Response to User:</em></strong><em> The chatbot delivers the generated response to the user.</em></p><p>Search is crucial in RAG because it provides domain-specific knowledge, ensures response accuracy, handles diverse queries, and optimizes generative outputs, all of which ultimately improves user satisfaction. It bridges the gap between LLM capabilities and the need for precise, up-to-date information (e.g., <a href="https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search">Introduction to Azure AI Search — Azure AI Search | Microsoft Learn</a>).</p><p>Because search is a critical component of the RAG system, evaluating its performance is essential to ensuring the overall quality of the chatbot’s responses. Two key metrics for evaluating search performance include search stability and search relevance.</p><p><strong>Search stability</strong> measures the chatbot’s ability to retrieve the same results from semantically equivalent but differently worded inputs. This metric evaluates the chatbot’s robustness in handling varied query phrasings, ensuring consistent responses. This evaluation is critical for verifying the chatbot’s linguistic flexibility and its capability to interpret diverse user inputs effectively.</p><p><strong>Search relevance</strong> assesses the quality of search results by evaluating their relevance and order of the returned search results. Common metrics used to evaluate search relevance in traditional information retrieval systems include <a href="https://en.wikipedia.org/wiki/Discounted_cumulative_gain">Normalized Discounted Cumulative Gain (NDCG)</a>, which measures the effectiveness of search result rankings by considering the position and relevance of each result. By favoring higher relevance for earlier results, search relevance aims to optimize user satisfaction and engagement. This metric enables developers to fine-tune search algorithms and ranking mechanisms to prioritize the most relevant results, thereby enhancing the overall user experience.</p><p>In the context of chatbots, measuring search relevance becomes more complex. Unlike traditional search engines, in which users are presented with a list of search results, chatbots often provide a summarized result of the top one or top <em>N</em> results. This lack of visibility into the full list of results and the limited user feedback (such as clicks or explicit relevance feedback) pose significant challenges.</p><p>Given these challenges, alternative methodologies must be employed to evaluate search relevance in chatbots:</p><ol><li><a href="https://en.wikipedia.org/wiki/Evaluation_measures_(information_retrieval)#Precision_at_k"><strong>Precision@<em>K</em></strong></a><strong>:</strong> A curated dataset, created by domain experts or knowledgeable human evaluators, can serve as “ground truth.” For queries that are part of the ground truth dataset, Precision@<em>K</em> or similar metrics can be used to measure how often the top <em>K</em> results match the labeled relevant results. This provides a quantifiable way to track how well the chatbot ranks relevant information in alignment with real-world expectations.</li><li><a href="https://hbr.org/2017/06/a-refresher-on-ab-testing"><strong>A/B testing</strong></a><strong>:</strong> Conducting A/B tests with different versions of the chatbot’s ranking algorithms can help determine which approach yields better user engagement and satisfaction. By comparing metrics like conversation length, user retention, and task completion rates, developers can infer the effectiveness of different relevance models.</li><li><a href="https://arxiv.org/abs/2403.04190"><strong>Leveraging LLMs</strong></a><strong>:</strong> Utilizing LLMs to train ranking mechanisms for chatbot responses can enhance relevance. For instance, LLMs can be used as labelers to generate high-quality training data, which can then be used to train a ranker. This approach leverages the contextual understanding of LLMs to improve the relevance of chatbot responses. To ensure the quality of LLM-generated training data and user simulations, we can periodically conduct human audits in which a small, random sample of chatbot responses is evaluated against a reference ground truth. This audit process can help prevent the system from “drifting” toward irrelevant or incorrect responses over time.</li><li><a href="https://github.com/tsinghua-fib-lab/LLM-Agent-Based-Modeling-and-Simulation?tab=readme-ov-file#How-to-simulate-actions"><strong>User simulation</strong></a><strong>:</strong> Creating simulated users to interact with the chatbot can generate large amounts of interaction data. This data can be analyzed to evaluate the relevance and effectiveness of the chatbot’s responses, helping to identify areas for improvement. When generating large interaction datasets via user simulation, we can build checks into the simulation by incorporating heuristics or rule-based evaluators that compare simulated interactions against a ground truth dataset. While user simulation is beneficial for scaling interactions, this hybrid approach ensures that the quality of the generated data is aligned with human expectations.</li></ol><h3>2. LLM-based evaluations</h3><p>Evaluations that are rooted in LLMs include task completion, intelligence, relevance, and hallucination, each of which we cover below.</p><h4><strong>Task completion</strong></h4><p>This utilizes LLM models to evaluate the chatbot’s performance in executing user-requested tasks. By analyzing the conversation context and user instructions, the LLM model determines whether the chatbot has effectively understood and completed the specified tasks. Here is an example of a task completion assessment:</p><blockquote><strong><em>User:</em></strong> “Can you set a reminder for my meeting tomorrow at 10 AM?”</blockquote><blockquote><strong><em>Chatbot:</em></strong> “Sure, I have set a reminder for your meeting tomorrow at 10 AM.”</blockquote><blockquote><strong><em>LLM evaluation:</em></strong><em> </em>Score: 100/100</blockquote><blockquote><strong><em>Explanation:</em></strong> The user requested that a reminder be set for a meeting tomorrow at 10 in the morning. The chatbot responded affirmatively, stating that the reminder has been set. This directly answers the user’s request and indicates that the task has been completed as requested.</blockquote><h4><strong>Intelligence</strong></h4><p>This quantifies how impressive or intelligent the chatbot’s responses appear to users. It focuses on the chatbot’s ability to provide coherent, contextually appropriate, and insightful answers that not only address the user’s queries but also demonstrate a high level of originality, insight, creativity, knowledge, and adaptability. Here is an example of an intelligence assessment:</p><blockquote><strong><em>User:</em></strong> “What’s the weather like in New York today?”</blockquote><blockquote><strong><em>Chatbot:</em></strong> “I’m unable to access real-time data, but you can check the current weather in New York by visiting a reliable weather website or using a weather app on your phone.”</blockquote><blockquote><strong><em>LLM evaluation:</em></strong><em> </em>Score: 50/100</blockquote><blockquote><strong><em>Explanation:</em></strong> The chatbot provided a technically accurate and relevant response, but it lacked perceived intelligence in several respects. The response didn’t engage the user deeply or creatively. It gave straightforward guidance without demonstrating originality or wit. There was no attempt to use any rhetorical devices or elaborate explanations that could stimulate curiosity or interest. While it was coherent and accurate, it didn’t cover multiple dimensions or provide an insightful answer that would leave the user impressed with its ability.</blockquote><h4><strong>Relevance</strong></h4><p>This evaluates overall performance, taking into consideration relevance, coherence, tone, clarity, and courtesy. This comprehensive evaluation ensures that the content generated aligns with the intended purpose, maintains a logical and consistent flow, adopts an appropriate and respectful tone, and communicates ideas clearly and effectively to the user. Here is an example of relevance:</p><blockquote><strong><em>User:</em></strong> “Can you provide some tips for managing remote teams effectively?”</blockquote><blockquote><strong><em>Chatbot:</em></strong> “Managing remote teams effectively requires clear communication, setting expectations, and fostering a sense of community. Utilize tools like video conferencing and instant messaging to maintain regular contact. Establish clear goals and deadlines to keep everyone on the same page. Encourage team bonding through virtual activities and recognize achievements to boost morale and engagement.”</blockquote><blockquote><strong><em>LLM evaluation:</em></strong><em> Score: 90/100</em></blockquote><blockquote><strong><em>Explanation:</em></strong> The bot provides accurate and relevant information that matches the user’s intent and expectations. It offers practical tips and strategies for managing remote teams effectively, such as clear communication, goal setting, and team bonding. The bot also uses natural and conversational language that is easy to understand and follow, without any errors or inconsistencies. However, the bot could improve its engagement and tone by adding more personality and emotion to its responses and adapting its tone and style to the user’s mood and preferences. The bot could also cite some credible sources or references to support its claims and enhance its credibility. Overall, the bot provides a helpful and informative response that meets the user’s needs and expectations.</blockquote><h4><strong>Hallucination</strong></h4><p>This measures the groundedness of the RAG-based chatbot’s responses. It ensures that the information provided by the chatbot is based on search results. Here is an example:</p><blockquote><strong><em>User:</em></strong> What are the characteristics of the Siberian Tiger?</blockquote><blockquote><strong><em>Chatbot:</em></strong> The Siberian tiger, or Amur tiger, weighs 400–700 pounds and measures 10–12 feet long.</blockquote><blockquote>Search results: ‘‘‘[ { “species”: “Siberian Tiger”, “otherName”: “Amur Tiger”, “size”: “Largest big cat in the world”, “weightRange”: “400–700 pounds”, “length”: “10–12 feet (including tail)” } ] ’’’</blockquote><blockquote><strong><em>LLM evaluation:</em></strong> Score: 100/100</blockquote><blockquote><strong><em>Explanation:</em></strong></blockquote><blockquote>- “Siberian tiger, or Amur tiger” — grounded: “species: ‘Siberian Tiger’, otherName: ‘Amur Tiger’”.</blockquote><blockquote>- “Weighs 400–700 pounds” — grounded: “weightRange: ‘400–700 pounds’”.</blockquote><blockquote>- “Measures 10–12 feet long” — grounded: “length: ‘10–12 feet (including tail)’”.</blockquote><p>To implement LLM-based metrics, we can leverage existing frameworks like RAGAS (<a href="https://docs.ragas.io/en/latest/concepts/metrics/overview/#different-types-of-metrics">Overview — Ragas</a>). Additionally, we have the option to create custom prompts to tailor metrics to our specific needs (see, for example, <a href="https://towardsdatascience.com/llm-evals-setup-and-the-metrics-that-matter-2cc27e8e35f3">The Guide To LLM Evals: How To Build and Benchmark Your Evals | by Aparna Dhinakaran | Towards Data Science</a>).</p><h3>3. No Response</h3><p>No Response refers to instances where the chatbot either fails to provide a response or resorts to a generic fallback response. This metric is essential for assessing the chatbot’s reliability and effectiveness. It is monitored by analyzing log telemetry data, which provides detailed records of user interactions with the chatbot. The commonly used metrics include:</p><ul><li><strong>Apology Rate:</strong> Measures how often the chatbot apologizes for not understanding or not being able to answer a query.</li><li><strong>No Response Rate:</strong> The frequency of instances where the chatbot fails to respond altogether.</li></ul><h3>4. Responsible AI and ethics</h3><p>Responsible AI (RAI) ensures that AI systems operate fairly and safely. Responsible AI metrics track user prompts and responses blocked by RAI policies, which filter inappropriate content. These metrics help maintain ethical interactions and guide improvements in the AI system’s adherence to ethical standards. You can find more info in a previous Data Science at Microsoft article here: <a href="https://medium.com/data-science-at-microsoft/responsible-ai-in-action-part-1-get-started-ee50bebbdff3">Responsible AI in action, Part 1: Get started | by Kate B | Data Science at Microsoft | Medium</a>.</p><h3>5. Resource utilization</h3><p>Token usage metrics track wasted tokens when retrieved content isn’t used in the final response, aiding in optimizing the AI’s response efficiency.</p><h3>6. User feedback and sentiment</h3><p><strong>User sentiment </strong>aims to gauge customer satisfaction by evaluating the complete dialog between users and the AI when explicit user feedback (thumbs up/down) is not available. This process involves analyzing the full series of queries and responses exchanged during an interaction to infer the user’s level of satisfaction (e.g., <a href="https://arxiv.org/abs/2403.12388">[2403.12388] Interpretable User Satisfaction Estimation for Conversational Systems with Large Language Models (arxiv.org)</a>). By examining these conversations holistically, the system can identify patterns and outcomes that contribute to user contentment or dissatisfaction.</p><p><strong>Implicit user feedback</strong> leverages subtle signals from user engagement to provide a richer and more nuanced understanding of user feedback. By analyzing log telemetry data, this approach captures how users interact with the AI beyond explicit ratings or comments. It considers metrics such as:</p><p>· The frequency of users copying responses</p><p>· The click-through rate of provided links</p><p>· The nature of follow-up questions they ask</p><h3>7. User intent/domain categorization</h3><p>This approach employs advanced text mining methods to effectively categorize user conversations across different use cases, languages, and input forms. By accurately identifying the intent or domain of user interactions, this system helps to pinpoint inefficiencies within the chatbot or AI system. Understanding user intent allows for the detection of areas in which responses may be lacking or where the AI might need improvement, thereby enhancing the system’s overall effectiveness and user satisfaction. For a detailed exploration of these techniques, a good example called TnT-LLM can be found here: <a href="https://arxiv.org/abs/2403.12173">[2403.12173] TnT-LLM: Text Mining at Scale with Large Language Models (arxiv.org)</a>.</p><h3>Conclusion</h3><p>As we have described in this article, the evaluation of LLM-based chatbots is a multifaceted process that requires a comprehensive understanding of various performance metrics. From search stability and relevance to task completion and user sentiment, each metric offers valuable insights into the chatbot’s functionality and user satisfaction. As the field of conversational AI continues to evolve, these metrics will play a crucial role in guiding developers to optimize chatbot performance and ensure that they meet the high standards expected by users. Continuously monitoring and refining these metrics can help to ensure that LLM-based chatbots remain effective, reliable, and ethical tools for communication and interaction in the digital age.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c2388556d3e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-at-microsoft/evaluating-llm-based-chatbots-a-comprehensive-guide-to-performance-metrics-9c2388556d3e">Evaluating LLM-based chatbots: A comprehensive guide to performance metrics</a> was originally published in <a href="https://medium.com/data-science-at-microsoft">Data Science + AI at Microsoft</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>