{"exhaustive":{"nbHits":false,"typo":false},"exhaustiveNbHits":false,"exhaustiveTypo":false,"hits":[{"_highlightResult":{"author":{"matchLevel":"none","matchedWords":[],"value":"sourabh03agr"},"story_text":{"fullyHighlighted":false,"matchLevel":"full","matchedWords":["hallucination","rag","groundedness"],"value":"<em>Hallucinations</em> are an interesting artifact of LLMs where the model tends to make up facts or generate outputs that are not factually correct.<p>There are two broad approaches for detecting <em>hallucinations</em>:<p>1. Verify the correctness of the response against world knowledge (via Google/Bing search)<p>2. Verify the <em>groundedness</em> of the response against the information present in the retrieved context<p>The 2nd approach is more interesting and useful as the majority of LLM applications have an <em>RAG</em> component, and we ideally want the LLM only to utilize the retrieved knowledge to generate the response.<p>While researching state-of-the-art techniques on how to verify that the response is grounded wrt context, two of the papers stood out to us:<p>1. FactScore (https://arxiv.org/pdf/2305.14251.pdf): Developed by researchers at UW, UMass Amherst, Allen AI and Meta, it first breaks down the response into a series of independent facts and independently verifies if each of them.<p>2. Automatic Evaluation of Attribution by LLMs (https://arxiv.org/pdf/2305.06311.pdf): Developed by researchers at Ohio State University, it prompts the LLM judge to determine whether the response is attributable (can be verified), extrapolatory (unclear) or contradictory (can\u2019t be verified).<p>While both the papers are awesome reads, you can observe that they tackle complementary problems and, hence, can be combined for superior performance:<p>1. The responses in production systems typically consist of multiple assertions; hence, breaking them into facts, evaluating them individually, and taking average is a more practical approach.<p>2. Many responses in production systems fall in the grey area, i.e. the context may not explicitly support (or disprove) them but one can make a reasonable argument to infer them from the context. Hence, having three options - Yes, No, Unclear is a more practical approach<p>This is exactly what we do at UpTrain to evaluate factual accuracy. Learn more about it: https://docs.uptrain.ai/predefined-evaluations/context-awareness/factual-accuracy"},"title":{"fullyHighlighted":false,"matchLevel":"partial","matchedWords":["hallucination"],"value":"How does one detect <em>hallucinations</em>?"}},"_tags":["story","author_sourabh03agr","story_39454961","ask_hn"],"author":"sourabh03agr","children":[39456129],"created_at":"2024-02-21T15:27:36Z","created_at_i":1708529256,"num_comments":2,"objectID":"39454961","points":5,"story_id":39454961,"story_text":"Hallucinations are an interesting artifact of LLMs where the model tends to make up facts or generate outputs that are not factually correct.<p>There are two broad approaches for detecting hallucinations:<p>1. Verify the correctness of the response against world knowledge (via Google&#x2F;Bing search)<p>2. Verify the groundedness of the response against the information present in the retrieved context<p>The 2nd approach is more interesting and useful as the majority of LLM applications have an RAG component, and we ideally want the LLM only to utilize the retrieved knowledge to generate the response.<p>While researching state-of-the-art techniques on how to verify that the response is grounded wrt context, two of the papers stood out to us:<p>1. FactScore (https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2305.14251.pdf): Developed by researchers at UW, UMass Amherst, Allen AI and Meta, it first breaks down the response into a series of independent facts and independently verifies if each of them.<p>2. Automatic Evaluation of Attribution by LLMs (https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2305.06311.pdf): Developed by researchers at Ohio State University, it prompts the LLM judge to determine whether the response is attributable (can be verified), extrapolatory (unclear) or contradictory (can\u2019t be verified).<p>While both the papers are awesome reads, you can observe that they tackle complementary problems and, hence, can be combined for superior performance:<p>1. The responses in production systems typically consist of multiple assertions; hence, breaking them into facts, evaluating them individually, and taking average is a more practical approach.<p>2. Many responses in production systems fall in the grey area, i.e. the context may not explicitly support (or disprove) them but one can make a reasonable argument to infer them from the context. Hence, having three options - Yes, No, Unclear is a more practical approach<p>This is exactly what we do at UpTrain to evaluate factual accuracy. Learn more about it: https:&#x2F;&#x2F;docs.uptrain.ai&#x2F;predefined-evaluations&#x2F;context-awareness&#x2F;factual-accuracy","title":"How does one detect hallucinations?","updated_at":"2024-09-20T16:27:19Z"},{"_highlightResult":{"author":{"matchLevel":"none","matchedWords":[],"value":"alexostrovskyy"},"comment_text":{"fullyHighlighted":false,"matchLevel":"full","matchedWords":["hallucination","rag","groundedness"],"value":"I think many of us have felt the pain of building a cool LLM-powered application or <em>RAG</em> pipeline, only to find it's too brittle and unpredictable for real-world use. The core problem is that they are black boxes. When they fail, it's hard to know why.<p>I've been focused on this problem of &quot;productionizing&quot; AI workflows. It's not just about testing; it's about deep observability, performance tuning, and building systems you can trust to be stable.<p>I wrote up a guide on a methodology I've found very effective. It's based on an open-source framework that uses decorators to trace the entire execution path of a chatbot. This gives you the data to:<p>- Pinpoint Performance Bottlenecks: See the exact latency of every LLM call, tool use, and retrieval step.\n- Automate Quality Control: Use an LLM-as-a-judge to programmatically check for <em>hallucinations</em> (<em>groundedness</em>), safety violations, and adherence to custom rules.\n- Create a Feedback Loop for Improvement: When you change a prompt or logic, you can run the test suite and get a concrete report on whether performance and reliability have improved or worsened.<p>You can read the guide here: \n- LangChain-based application: <a href=\"https://alexostrovskyy.com/the-glass-box-why-your-chatbot-needs-more-than-just-black-box-testing/\" rel=\"nofollow\">https://alexostrovskyy.com/the-glass-box-why-your-chatbot-ne...</a>,\n- LlamaIndex-based application: <a href=\"https://alexostrovskyy.com/production-llm-chatbot-tracing-and-automated-testing/\" rel=\"nofollow\">https://alexostrovskyy.com/production-llm-chatbot-tracing-an...</a><p>I\u2019ve created this open-source project to use in my projects and help other creators.<p>My goal is to create a framework (open-source) that can help us build stable, trustworthy AI systems, not just clever demos.<p>I'd be very interested to hear feedback from other engineers and creators."},"story_title":{"matchLevel":"none","matchedWords":[],"value":"An Open-Source Framework for Building Stable and Reliable LLM-Powered Systems"},"story_url":{"matchLevel":"none","matchedWords":[],"value":"https://chatbot-testing-framework.readthedocs.io/en/latest/"}},"_tags":["comment","author_alexostrovskyy","story_45445710"],"author":"alexostrovskyy","comment_text":"I think many of us have felt the pain of building a cool LLM-powered application or RAG pipeline, only to find it&#x27;s too brittle and unpredictable for real-world use. The core problem is that they are black boxes. When they fail, it&#x27;s hard to know why.<p>I&#x27;ve been focused on this problem of &quot;productionizing&quot; AI workflows. It&#x27;s not just about testing; it&#x27;s about deep observability, performance tuning, and building systems you can trust to be stable.<p>I wrote up a guide on a methodology I&#x27;ve found very effective. It&#x27;s based on an open-source framework that uses decorators to trace the entire execution path of a chatbot. This gives you the data to:<p>- Pinpoint Performance Bottlenecks: See the exact latency of every LLM call, tool use, and retrieval step.\n- Automate Quality Control: Use an LLM-as-a-judge to programmatically check for hallucinations (groundedness), safety violations, and adherence to custom rules.\n- Create a Feedback Loop for Improvement: When you change a prompt or logic, you can run the test suite and get a concrete report on whether performance and reliability have improved or worsened.<p>You can read the guide here: \n- LangChain-based application: <a href=\"https:&#x2F;&#x2F;alexostrovskyy.com&#x2F;the-glass-box-why-your-chatbot-needs-more-than-just-black-box-testing&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;alexostrovskyy.com&#x2F;the-glass-box-why-your-chatbot-ne...</a>,\n- LlamaIndex-based application: <a href=\"https:&#x2F;&#x2F;alexostrovskyy.com&#x2F;production-llm-chatbot-tracing-and-automated-testing&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;alexostrovskyy.com&#x2F;production-llm-chatbot-tracing-an...</a><p>I\u2019ve created this open-source project to use in my projects and help other creators.<p>My goal is to create a framework (open-source) that can help us build stable, trustworthy AI systems, not just clever demos.<p>I&#x27;d be very interested to hear feedback from other engineers and creators.","created_at":"2025-10-02T02:08:02Z","created_at_i":1759370882,"objectID":"45445711","parent_id":45445710,"story_id":45445710,"story_title":"An Open-Source Framework for Building Stable and Reliable LLM-Powered Systems","story_url":"https://chatbot-testing-framework.readthedocs.io/en/latest/","updated_at":"2026-03-05T22:48:22Z"}],"hitsPerPage":20,"nbHits":2,"nbPages":1,"page":0,"params":"query=hallucination+RAG+groundedness&advancedSyntax=true&analyticsTags=backend","processingTimeMS":13,"processingTimingsMS":{"_request":{"queue":1,"roundTrip":20},"fetch":{"query":11,"total":12},"total":13},"query":"hallucination RAG groundedness","serverTimeMS":14}
