Close Menu
    Trending
    • Here Are the 10 Cheapest States for Single People: Report
    • Trying to Stay Sane in the Age of AI
    • How to Run and Install Xiaomi MiMo-VL Locally | by Ankush k Singal | AI Artistry | Jun, 2025
    • Apple Worldwide Developers Conference Day 1: WWDC Highlights
    • How to Transition From Data Analyst to Data Scientist
    • 🔧 The Chain Is Broken — Engineering the Next Paradigm | by Caelum | Jun, 2025
    • Meet a Swift Student Challenge Winner Attending Apple’s WWDC
    • AI-enabled control system helps autonomous drones stay on target in uncertain environments | MIT News
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Machine Learning»From Retrieval to Generation: How to Measure RAG Performance | by Kauser | Apr, 2025
    Machine Learning

    From Retrieval to Generation: How to Measure RAG Performance | by Kauser | Apr, 2025

    FinanceStarGateBy FinanceStarGateApril 25, 2025No Comments5 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    • It measures how nicely the retrieved context consists of all of the related entities

    Identifies entities ➝ Evaluate entities ➝ Calculate recall

    Instance

    Question: Inform me concerning the Nice Wall of China

    Reference Reply: The Nice Wall of China is a historic fortification positioned in northern China. It was constructed to guard in opposition to invasions and spans over 13,000 miles. The wall was initially constructed by Emperor Qin Shi Huang and later expanded throughout the Ming Dynasty.

    Entities in Reference Contexts: [“Great Wall of China”, “northern China”, “13,000 miles”, “Emperor Qin Shi Huang”, “Ming Dynasty”]

    Retrieved Contexts:

    Context 1: The Nice Wall of China is a historic landmark in northern China. It was constructed throughout the Ming Dynasty and is over 13,000 miles lengthy.

    Entities in Context 1: [“Great Wall of China”, “northern China”, “Ming Dynasty”, “13,000 miles”]

    Context 2: The Nice Wall of China is a well-liked vacationer vacation spot and a UNESCO World Heritage Web site.

    Entities in Context 2: [“Great Wall of China”, “UNESCO”]

    We then discover intersection of contexts within the reference reply and context

    Recall for context 1: 4/5 (80%)

    Recall for context 2: 1/5 (20%)

    As soon as the retriever retrieves the contexts, the generator generates a response by making use of the fetched context.

    Noise sensitivity offers the measure of how delicate the generator is to the noise within the context. With a view to estimate the noise sensitivity, we require the question, reference reply (appropriate reply to the question), retrieved contexts and the generated response. Allow us to perceive this utilizing the next instance.

    Question:

    Why is the Statue of Liberty well-known?

    Reference Reply:

    The Statue of Liberty is known as a logo of freedom and democracy. It was gifted by France to the USA in 1886 to have fun the centennial of American independence.

    Generated Response:

    The Statue of Liberty is known as a present from France in 1886 and for its illustration of freedom. It’s also often called the primary monument constructed after the American Civil Conflict.

    Step 1: Step one is to determine related and irrelevant contexts.

    Retrieved Contexts

    • Context 1: The Statue of Liberty was gifted by France to the USA in 1886 to commemorate the centennial of American independence. ✅ ( Related)
    • Context 2: The statue symbolizes freedom and democracy and is a globally acknowledged icon of the USA. ✅ ( Related)
    • Context 3: Designed by Frédéric Auguste Bartholdi, the statue was in-built France and later assembled within the U.S. ✅ ( Related)
    • Context 4: The Eiffel Tower, one other iconic French construction, attracts tens of millions of holiday makers yearly. ❌ (Not related)
    • Context 5: The American Civil Conflict led to 1865, resulting in vital political and social adjustments. ❌ (Not related)

    Step 2: Establish claims within the generated response and test if the claims are supported by related context

    Generated Response: The Statue of Liberty is known as a present from France in 1886 and for its illustration of freedom. It’s also often called the primary monument constructed after the American Civil Conflict.

    Claims:

    Declare 1: The Statue of Liberty is known as a present from France in 1886 ✅ (Right and supported by Context 1)

    Declare 2: It represents freedom ✅ (Right and supported by Context 2)

    Declare 3: Referred to as the primary monument constructed after the American Civil Conflict. ❌ (Not related as it isn’t supported by related contexts)

    Complete claims — 3

    Noise sensitivity = 1/3 = 0.3333

    Measures how related the generate response is with respect to the person question.

    It checks if the response :

    • Absolutely reply the query
    • Avoids pointless/ irrelevant particulars

    We don’t require the proper reply(reference) to estimate the worth of this metric.

    Person Enter (Authentic Query):

    • When was the final season of Bleach anime aired?

    Generated Response:

    • The final season of Bleach anime, titled Bleach: Thousand-Yr Blood Conflict, aired in October 2022.

    Retrieved Contexts:

    1. Bleach: Thousand-Yr Blood Conflict is the ultimate season of the Bleach anime sequence. It premiered in October 2022.
    2. The Bleach anime, based mostly on Tite Kubo’s manga, returned in 2022 with its final season.
    3. The Thousand-Yr Blood Conflict arc is the concluding season of Bleach, which aired its first episode in October 2022.

    As soon as the response is generated the LLM generates questions based mostly on the response. For instance,

    Reverse engineering questions:

    • When did Bleach: Thousand-Yr Blood Conflict air?
    • What was the air date of the ultimate season of Bleach anime?
    • When was the final season of Bleach launched?

    As soon as the reverse engineering questions are generated, it computes the cosine similarity between the unique query and the reverse engineered questions.

    Computing cosine similarity:

    Authentic Query: When was the final season of Bleach anime aired?

    • Query 1: When did Bleach: Thousand-Yr Blood Conflict air? → 0.92
    • Query 2: What was the air date of the ultimate season of Bleach anime? → 0.89
    • Query 3: When was the final season of Bleach launched? → 0.93

    Response Relevancy is given by the imply of the cosine similarities → (0.92+0.89+0.93)/3 = 0.913

    • Faithfulness measures if the generated response is grounded within the retrieved contexts
    • It’s calculated utilizing the response and retrieved contexts
    • The response is cut up into claims after which the claims which are supported by the context are counted.

    Evaluating RAG methods is a fancy course of, and the metrics mentioned above context relevancy, reply relevancy, groundedness, and others — are only a few of the various accessible metrics. There are various extra metrics, resembling Imply Reciprocal Rank (MRR), Imply Common Precision (MAP), hit charge, hallucination charge, and toxicity detection, that can be used to evaluate completely different facets of RAG efficiency.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleThis Piece of Advice Keeps Setting Founders Up for Failure
    Next Article Predicting the NBA Champion with Machine Learning
    FinanceStarGate

    Related Posts

    Machine Learning

    How to Run and Install Xiaomi MiMo-VL Locally | by Ankush k Singal | AI Artistry | Jun, 2025

    June 10, 2025
    Machine Learning

    🔧 The Chain Is Broken — Engineering the Next Paradigm | by Caelum | Jun, 2025

    June 9, 2025
    Machine Learning

    Enhancing C# Applications with Ollama API | by Ali Mustafa | Jun, 2025

    June 9, 2025
    Add A Comment

    Comments are closed.

    Top Posts

    Creating a Voice-Controlled Snake Game Using Whisper AI and Python | by kamla safdar | Feb, 2025

    February 14, 2025

    How to Sound Like a Good Writer?. Authentic, Human-Like Writing with… | by 101 Failed endeavours | Apr, 2025

    April 2, 2025

    How to Build Partnerships That Actually Drive Growth

    April 17, 2025

    AWS AI Services Showcase — Build and Deploy AI Features with Just API Calls | by Fadhil Umar | May, 2025

    May 8, 2025

    Jobs Report Shows ‘Robust’ But ‘Frozen’ Labor Market: Expert

    February 9, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    Understand Recurrent Neural Networks with this Easy Guide | by Nidhi Gahlawat | Mar, 2025

    March 20, 2025

    UNDERSTANDING HOW TO FLASH BTC, USDT, ETH | by Alexander | Mar, 2025

    March 27, 2025

    Sololearn, Mimo dan DataCamp: Mana yang Lebih Cepat Membantuku Kuasai Basic Programming? | by chelilovee | Feb, 2025

    February 7, 2025
    Our Picks

    How Outdated Systems Are Putting Your Business at Risk

    March 16, 2025

    Questions to Ask Before Creating a Machine Learning Model | by Karim Samir | simplifann | Mar, 2025

    March 30, 2025

    How to Implement Blockchain in Supply Chain Management

    February 27, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.