<?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 Zainab Abaid on Medium]]></title>
        <description><![CDATA[Stories by Zainab Abaid on Medium]]></description>
        <link>https://medium.com/@zainab.abaid_87799?source=rss-b99e82192e60------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_naTg83eLQTbw-KU</url>
            <title>Stories by Zainab Abaid on Medium</title>
            <link>https://medium.com/@zainab.abaid_87799?source=rss-b99e82192e60------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:52:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zainab.abaid_87799/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[Benchmarking Hallucination Detection for Reliable RAG Pipelines]]></title>
            <link>https://medium.com/emumba/benchmarking-hallucination-detection-for-reliable-rag-pipelines-2541d9240e3a?source=rss-b99e82192e60------2</link>
            <guid isPermaLink="false">https://medium.com/p/2541d9240e3a</guid>
            <dc:creator><![CDATA[Zainab Abaid]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 07:52:20 GMT</pubDate>
            <atom:updated>2025-07-21T08:01:07.309Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This benchmarking study was conducted within the Genie R&amp;D group at Emumba. Genie (GENaI@Emumba) is Emumba’s dedicated Generative AI research and prototyping team, working across recent advances in large language models and applied GenAI domains — including retrieval-augmented generation (RAG), multi-agent applications, and LLM fine-tuning. Our goal is to validate practical methods that help build safer, more reliable, and production-ready AI systems for enterprise use.</em></p><h3>LLMs Hallucinate — What Should We Do?</h3><p>Hallucinated answers — confident but incorrect outputs — remain a leading cause of user distrust in AI-powered RAG systems. These incorrect answers become a critical failure point in real-world applications.</p><p>To address this, we systematically evaluated <strong>six</strong> hallucination detection techniques: built-in metrics from three LLM evaluation frameworks (<strong>UpTrain</strong>, <strong>Ragas</strong>, and <strong>DeepEval)</strong>; <strong>Vectara HHEM</strong>, an open-source LLM-based classifier; the <strong>LettuceDetect</strong> library; and <strong>Trustworthy Language Model (TLM)</strong>, a SaaS solution for hallucination detection. Except for TLM, all methods are open source and free to use, with the only cost being the underlying LLM API calls where applicable.</p><p>Our goal was to identify which frameworks are most effective for practical use cases, using criteria that go beyond simple accuracy:</p><ul><li><strong>Granularity</strong>: Can the method pinpoint exactly which parts of an answer are hallucinated?</li><li><strong>Precision</strong>: Does it avoid false positives (flagging correct content) and false negatives (missing hallucinations)?</li></ul><p>We conducted a <strong>three-phase experiment:</strong></p><ol><li>Benchmarking on a labeled, hallucination-rich dataset</li><li>Stress-testing top performers with adversarial examples</li><li>Evaluating the top performing method (UpTrain) for fine-grained detection.</li></ol><p>This post shares our methodology, findings, and practical recommendations for choosing the right hallucination detection tool.</p><blockquote><strong>TL; DR: We tested six hallucination detectors for RAG. UpTrain stood out with pinpoint accuracy and clear explanations. Read on to see which tools failed, which ones surprised us, and how to pick the best fit for safer AI.</strong></blockquote><h3>Hallucination Detection Frameworks</h3><p>We evaluated six hallucination detection tools, each using a distinct method to assess whether an LLM-generated answer is grounded in its supporting context. The table below summarizes the core technique behind each tool, the required inputs, and the format of its output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29LpkGyYXy06tW2B2iyYtA.png" /><figcaption>Hallucination detection tools benchmarked in our study.</figcaption></figure><h3>Phase 1: Benchmarking on a Hallucination-Rich Dataset</h3><p>To evaluate how well each framework detects hallucinated outputs, we curated a small but high-quality benchmark dataset deliberately designed to include a wide variety of hallucination types. Starting from a base dataset of question and answer pairs over our internal Wiki data, we injected synthetic hallucinations generated by an LLM, and refined them manually.</p><p>Our goal was to test detection performance across <strong>diverse hallucination patterns</strong> often encountered in RAG pipelines, including:</p><ul><li>Context overrides (ignoring retrieved documents),</li><li>Fabricated details,</li><li>Misinterpretations of source content,</li><li>Over-generalizations,</li><li>Contradictions,</li><li>Conflicts across sources, and</li><li>Incorrect selection from context.</li></ul><p>The hallucinated answers included a balanced mix of the types listed above. Each generated hallucination was manually reviewed and labeled to ensure clean ground-truth annotations. We maintained a high hallucination ratio (~80%) to test the detection frameworks under challenging conditions. The remaining examples were factual, grounded answers for contrast.</p><p>To simulate a realistic retrieval setting, we built a standard RAG pipeline using LangChain over the document set (internal Wiki documents) used for creating the benchmark dataset.</p><h3>A Note on Threshold Calibration</h3><p>Some frameworks return a continuous score instead of a binary label, so in production this score must be thresholded to decide whether to flag a response. We experimented with both F1 score maximization and Youden’s J statistic on the ROC curve to determine optimal thresholds. While not the focus of this study, these calibration methods can significantly affect precision and recall.</p><h3>Phase 1 Results</h3><p>Below, we report accuracy results based on the best-performing thresholds for each tool, sorted from most to least accurate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QsPNGh0aPyjOrTgboOCWQ.png" /><figcaption>Accuracy results for six hallucination detection tools.</figcaption></figure><p>These results provided an initial view of accuracy, but real-world robustness needed more rigorous testing — addressed in Phase 2.</p><h3>Phase 2: Stress-Testing Fine-Grained Detection on Subtle Hallucinations</h3><p>In Phase 1, we evaluated the overall accuracy of different frameworks at detecting whether an answer contained hallucinated content. But benchmark accuracy alone isn’t enough — real-world RAG systems often produce answers that blend fact with subtle hallucinations. Phase 2 tested whether top frameworks can still detect hallucinations embedded within otherwise factual responses.</p><p>This experiment further tested the three top-performing frameworks from Phase 1 — UpTrain, Vectara HHEM, and Ragas — on a larger dataset of 181 queries, each containing adversarially-injected hallucinations. The goal was to see whether these systems would still flag the responses correctly, even when the hallucinations were subtle and contextually embedded.</p><p>Note we evaluated only <strong>overall detection robustness</strong>, not granularity — frameworks needed only to detect that a hallucination was present, not locate it precisely. This is because Vectara HHEM and Ragas do not provide a statement or span level breakdown.</p><h3>Dataset: Hallucination-Augmented Subset from RAGBench</h3><p>For both Phase 2 and Phase 3, we used a new dataset derived from <strong>RAGBench</strong>, a public benchmark available on Hugging Face. We sampled <strong>181 question–answer–context triples</strong>, all originally generated by GPT-4 and grounded in supporting documents.</p><p>To construct a clean factual baseline, we passed each answer through UpTrain and retained only those for which it returned a perfect factuality score of 1.0, manually spot-checking to ensure reliability of the ground truth data. This ensured we began with fully grounded answers with no hallucinations.</p><p>From this verified subset, we created a new test set by injecting hallucinations into selected factual statements using controlled LLM prompts. This produced answers that contained a <strong>mix of grounded and hallucinated statements</strong>, simulating real-world LLM behavior in RAG pipelines where hallucinations often appear subtly within otherwise factual text.</p><h3>Phase 2 Results</h3><p>Each hallucination-augmented sample was passed through the three frameworks. Since all responses now contained some hallucinated content, we expected that:</p><ul><li><strong>None of the frameworks should return a perfect score</strong> (i.e. indicating zero hallucination)</li><li>Any perfect score would indicate a <strong>missed hallucination</strong></li></ul><p>This allowed us to evaluate <strong>real-world robustness</strong> without relying on threshold tuning.</p><p>As the table below shows, UpTrain ended up missing 10.5% of the injected hallucinations, while Ragas captured all but 5.5% of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8t6EFwoCjMS9vMnGmOs6LQ.png" /><figcaption>Missed hallucinations by the top 3 hallucination detection tools.</figcaption></figure><p>While Vectara HHEM appears to have caught all hallucinations, this result is misleading. In our tests, Vectara HHEM never returns a perfect 1.0 score — even for fully factual answers. As a result, if we treat only a perfect score as proof of factuality, every response would be flagged as partially hallucinated by default. This means proper threshold calibration is essential for meaningful results with Vectara HHEM, and its raw output cannot be fairly compared in this phase without that step.</p><h3>Phase 3: Fine-Grained Evaluation of UpTrain</h3><p>While Phase 2 tested whether frameworks can detect that hallucination occurred, it still treated the answer as a whole. But in actual RAG applications, that’s not good enough. For safe and meaningful use, we need frameworks that not only raise a flag, but can also <strong>tell us exactly which parts of an answer are unsupported</strong>.</p><p>UpTrain is the only framework in our study that outputs a <strong>statement-level breakdown</strong>. In Phase 3, we evaluated how reliable this breakdown actually is.</p><ul><li>Does UpTrain correctly flag the hallucinated statements?</li><li>Equally important, does it avoid falsely flagging factual statements?</li></ul><p>We reused the hallucination-augmented dataset from Phase 2, but this time focused on <strong>per-statement performance</strong>. Specifically, we measured:</p><ul><li><strong>True Detections</strong>: Hallucinated statements correctly identified</li><li><strong>False Positives</strong>: Grounded statements incorrectly flagged</li></ul><p>This deeper evaluation allowed us to assess how usable UpTrain’s output would be in a pipeline that aims to remove or revise only the hallucinated parts, rather than discard the whole answer.</p><h3>Phase 3 Results</h3><p><strong>True detections: </strong>UpTrain correctly flagged 232 out of 303 hallucinated statements, achieving a 76.6% detection rate.</p><p><strong>False positives:</strong> UpTrain correctly identified 278 out of 322 factual statements, mislabeling 13.7% as hallucinations.</p><p>While UpTrain’s fine-grained detection is not flawless, its ability to pinpoint hallucinated statements makes it uniquely valuable for production RAG pipelines. Unlike frameworks that only flag the entire answer, UpTrain’s span-level verdicts enable targeted corrections, content pruning, or automated re-queries, all while preserving valid information. As the only open-source tool in our study that provides this granularity, UpTrain stands out as the most practical choice for teams that want to move beyond binary hallucination checks and towards real-time factuality refinement. With further prompt tuning, dataset-specific examples, and potential integration with custom retrieval signals, its accuracy can be further improved, unlocking safer, trustable LLM outputs in high-stakes deployments.</p><h3>Conclusion</h3><p>In summary, hallucination detection is essential for any robust RAG deployment — yet not all frameworks are equal in practicality or depth of insights. Our multi-phase evaluation shows that while general-purpose tools like Ragas and Vectara HHEM offer strong baseline detection with minimal integration effort, UpTrain delivers the best combination of high accuracy and actionable granularity. For organizations building production-grade, trust-sensitive AI systems, investing in a fine-grained, tunable detection workflow like UpTrain can dramatically reduce the risk of misleading outputs and build user confidence in LLM-powered products.</p><p>We hope this benchmarking and fine-grained testing effort helps teams make informed choices to safeguard their RAG pipelines against the persistent risk of hallucinations.</p><h3>Code</h3><p>The code for these experiments is available on <a href="https://github.com/Genie-Experiments/hallucination-detection-benchmark">Github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2541d9240e3a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/emumba/benchmarking-hallucination-detection-for-reliable-rag-pipelines-2541d9240e3a">Benchmarking Hallucination Detection for Reliable RAG Pipelines</a> was originally published in <a href="https://medium.com/emumba">Emumba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Generative AI Landscape: A Decision-Making Framework for Success]]></title>
            <link>https://medium.com/emumba/navigating-the-generative-ai-landscape-a-decision-making-framework-for-success-337703b2bb64?source=rss-b99e82192e60------2</link>
            <guid isPermaLink="false">https://medium.com/p/337703b2bb64</guid>
            <category><![CDATA[mindmap]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genie]]></category>
            <dc:creator><![CDATA[Zainab Abaid]]></dc:creator>
            <pubDate>Tue, 14 May 2024 13:43:59 GMT</pubDate>
            <atom:updated>2025-04-29T05:09:39.820Z</atom:updated>
            <content:encoded><![CDATA[<h3>New Paradigm, New Challenges</h3><p>The advent of generative AI (GenAI) has brought about a paradigm shift that is changing the way we design, develop, and deploy software. It has become essential for development teams to adapt to this new reality.</p><p>GenAI introduces a new modality for development by integrating large language models (LLMs) and advanced AI, alongside new tools and techniques. However, this shift is not merely about adopting new tools. While the software development lifecycle (SDLC) stages — planning, design, development, testing, deployment, and maintenance — remain the same, each step now requires <strong>new and unique </strong>skills and techniques.</p><p>Development teams face two core challenges in navigating this new age, especially when developing GenAI solutions. <strong>First, </strong>a rapidly evolving landscape where new algorithms, techniques, companies and models appear at a dizzying pace. <strong>Second</strong>, the hype around these new, often seemingly overlapping, options causes significant confusion on what approach is best to achieve a specific requirement.</p><p>We, at Emumba, felt a <strong>need</strong> for a structured framework that helps us — as providers of bespoke GenAI service — navigate the landscape of GenAI while building solutions in this exciting new space.</p><h3>The Genie Mind Map</h3><p>This mind map (note: it is live <em>and</em> evolving) is an output from the <strong>Genie (short for GenAI@Emumba) group </strong>to R&amp;D and navigate the GenAI terrain. We read, experimented and leveraged our customer experience to map tools and techniques to the <em>different stage</em>s of design, development and deployment of GenAI applications. We are now releasing this mind map as a public resource for new entrants to this domain.</p><p>We view the benefit of our mind map to be two-fold:</p><p><em>First, </em>it allows management a high-level view of the landscape when making strategic decisions regarding staffing and timelines for building teams or adding capacity for GenAI.</p><p><em>Second, </em>with the ability to drill down, it acts as a <em>strategic decision-making assistant</em> for developers, architects, testers, and LLMOps professionals to execute the GenAI development process.</p><h3>Caveats</h3><ul><li><strong>This map is not exhaustive.</strong> It is not meant to cover every tool or company in the space. Its real value lies in simplifying the landscape and providing a framework to slot in new developments as they emerge in a continuously evolving space.</li><li><strong>This map focuses on text-based LLMs.</strong> Multi-modal or multi-agent systems are excluded to maintain focus on the core capabilities of text-based LLMs.</li><li><strong>This map is not a learning roadmap.</strong> Although it can be used to derive one, it is not intended to be used as a substitute for a personalized learning plan.</li><li><strong>This map is specific to GenAI development.</strong> To retain focus on the unique steps of GenAI development, techniques and tools common to classical software development are left out.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-Z50S_3Jta5ao02f6ZSbA.gif" /><figcaption>The Genie mind map with drill-down ability. Explore the original interactive mindmap <a href="https://www.mindmeister.com/app/map/3171461222?t=muwYOOjdYe&amp;m=outline">here</a>.</figcaption></figure><p>You can interact with the Genie mind map on Mind Meister <a href="https://www.mindmeister.com/app/map/3171461222?m=outline&amp;t=muwYOOjdYe">here</a>. The map opens in a textual <em>Outline</em> view by default. You can see the visual view above by clicking <em>Mind Map</em> from the controls at the bottom left.</p><p><em>Note: Currently the Mind Map view is optimised only for desktop display.</em></p><h3>Understanding Our Mind Map</h3><p>Our mind map aids decision-making throughout various development stages by organising along the standard software development stages: design, development, testing, deployment, and maintenance.</p><p>Relevant tools are incorporated wherever possible, linked to applicable techniques. Tools appear as child nodes of specific techniques (indicating a one-to-one relationship) or parallel to technique nodes (indicating implementation of multiple techniques in one tool).</p><p>Pay special attention to nodes with dotted outlines (visible only in the Mind Map view). These represent non-exhaustive lists, meaning there are additional options available beyond those explicitly shown. While most tool nodes have dotted outlines due to the vastness of the tooling landscape, some technique nodes may also be dotted, signalling that the field is broader than what is presented.</p><p><strong>Design / Architecture</strong></p><p>The <em>design / architecture</em> section of the mind map covers the critical decisions a Software Architect will need to make at the beginning of a project, including selecting the LLM, choosing between open vs. closed-source models, and deciding between external providers or self-hosting options.</p><p><strong>Development</strong></p><p>In the GenAI space, the development role is perhaps the most complex and rapidly evolving. Therefore, it is the central focus of our mind map. We have organised this stage in increasing order of complexity. A developer will usually start at the top with <em>basic techniques</em> to quickly create a simple working example. However, in more complex or innovative use cases, the developer will need to adjust the more intricate knobs under “advanced techniques”. These include fine-tuning and advanced methods for retrieval augmented generation.</p><p><em>Note: Advanced RAG is a vast area with numerous tools and techniques for each stage of the process and will be covered in more depth in a separate, specialised taxonomy that we are currently developing.</em></p><p><strong>Testing</strong></p><p>The mind map divides the <em>testing</em> stage into two categories: accuracy and safety.<em> Accuracy tests</em>, also known as helpfulness tests, aim to evaluate the functional performance of the LLM application. <em>Safety tests</em> consider ethical, privacy, and security concerns. Various relevant tools are linked to each technique, and more comprehensive tools covering multiple techniques are linked in a separate node.</p><p><strong>Deployment and LLMOps</strong></p><p>Like any solution, hosting and production deployment of GenAI solutions has unique avenues of exploration. We outline the two primary model hosting options for GenAI applications: SaaS vs. self-hosting. Both have significant implications for the application’s cost and latency. Other factors to consider for deployment include <em>model optimisation</em> (minimising model size while maintaining performance) and <em>post-deployment operations</em>. These involve monitoring safety, accuracy, and concept drift, as well as managing model updates.</p><h3>Conclusion</h3><p>GenAI has brought about a paradigm shift in software development, introducing new challenges and opportunities. We built a mind map that we believe will serve as a valuable resource for software architects, developers, testers, and other professionals involved in GenAI development. By leveraging this framework, organisations can navigate the rapidly evolving GenAI landscape and build innovative solutions that drive business value.</p><p>#genie</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=337703b2bb64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/emumba/navigating-the-generative-ai-landscape-a-decision-making-framework-for-success-337703b2bb64">Navigating the Generative AI Landscape: A Decision-Making Framework for Success</a> was originally published in <a href="https://medium.com/emumba">Emumba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>