Skip to content

Commit f17e036

Browse files
Add initial paragraphs of rag evaluation doc page
1 parent 3fdcb39 commit f17e036

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

md-docs/imgs/rag_evaluation.png

1.46 MB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Rag Evaluation
2+
3+
## What is RAG Evaluation?
4+
5+
RAG (Retrieval-Augmented Generation) is a way of building AI models that enhances their ability to generate accurate and contextually relevant responses by combining two main steps: **retrieval** and **generation**.
6+
1. **Retrieval**: The model first searches through a large set of documents or pieces of information to "retrieve" the most relevant ones based on the user query.
7+
2. **Generation**: It then uses these retrieved documents as context to generate a response, which is typically more accurate and aligned with the question than if it had generated text from scratch without specific guidance.
8+
9+
Evaluating RAG involves assessing how well the model does in both retrieval and generation.
10+
11+
Our RAG evaluation module analyzes the three main components of a RAG framework:
12+
- **User Input**: The query or question posed by the user.
13+
- **Context**: The retrieved documents or information that the model uses to generate a response.
14+
- **Response**: The generated answer or output provided by the model.
15+
16+
In particular, the analysis is performed on the relationships between these components:
17+
- **User Input - Context**: Retrieval Evaluation
18+
- **Context - Response**: Context Factual Correctness
19+
- **User Input - Response**: Response Evaluation
20+
21+
![ML cube Platform RAG Evaluation](../../imgs/rag_evaluation.png)
22+
23+
The evaluation is performed through an LLM-as-a-Judge approach, where a Language Model (LM) acts as a judge to evaluate the quality of a RAG model.
24+
25+
## What are the computed metrics?
26+
27+
Below are the metrics computed by the RAG evaluation module, divided into the three relationships mentioned above.
28+
29+
### User Input - Context
30+
31+
- **Relevance**: Measures how much the retrieved context is relevant to the user input. The score ranges from 1 to 5, with 5 being the highest relevance.
32+
- **Usefulness**: Evaluates how useful the retrieved context is in generating the response. For example, if a context talks about the topic of the user query but it does not contain the information needed to answer the question, it is relevant but not useful. The score ranges from 1 to 5, with 5 being the highest usefulness.
33+
- **Utilization**: Measures the percentage of the retrieved context that contains information that can be used to generate the response. A higher utilization score indicates that more of the retrieved context is useful for generating the response. The score ranges from 0 to 100.
34+
- **Attribution**: Indicates which of the chunks of the retrieved context can be used to generate the response. It is a list of the indices of the chunks that are used, with the first chunk having index 1.
35+
36+
### Context - Response
37+
- **Faithfulness**: Measures how much the response contradicts the retrieved context. A higher faithfulness score indicates that the response is more aligned with the context. The score ranges from 1 to 5, with 5 being the highest faithfulness.
38+
39+
### User Input - Response
40+
- **Satisfaction**: Evaluates how satisfied the user would be with the generated response. The score ranges from 1 to 5, with 1 a response that does not address the user query and 5 a response that fully addresses and answers the user query.

0 commit comments

Comments
 (0)