Repository navigation
Rework evaluation and metrics calculation for Haystack 2.x - #5794
Conversation
ZanSara
left a comment
There was a problem hiding this comment.
Looks solid, I like this! Left a bunch of nitpicks and questions, nothing blocking.
|
Very cool! Let's move fast here!
|
Yeah, I'll add a more detailed example. 👍
Yes, that's right. We can provide some helpers to make it easier to manipulate evalsets into a format that our evaluation understand but it would still require some effort from the user if their In the future when we'll have some ready-made |
| The requirements are: | ||
|
|
||
| - compare the performance of different pipelines on level of pipeline outputs (user perspective, integrated eval) | ||
| - while running the full pipeline we can store intermediate results and calculate metrics for each component that returns answers or documents |
There was a problem hiding this comment.
Is it feasible(and makes sense?) to support pipeline replicas for larger evaluations? One potential strategy could be to have the evaluation process stateless, thereby preventing the storage of interim results within a pipeline and ensuring all results from components are propagated through the pipeline.
There was a problem hiding this comment.
I'm not sure if I'm understanding this correctly. Pipelines in version 2.x will work much differently from 1.x so a component will receive only the inputs that it asks for. So in a sense it's impossible to propagate all results through the Pipeline.
Making it stateless is not possible either I think, we can't know whether a component has some internal state or not when running a Pipeline so we creating replicas could be dangerous. It also depends on how we actually replicate a Pipeline.
| - evaluate pipelines that return GenerativeAnswers | ||
| - evaluate hallucinations (check generated answers are backed up by retrieved documents) | ||
| - evaluate pipelines with PromptNodes and arbitrary PromptTemplates (for example with Semantic Answer Similarity or BLEU, ROUGE (metrics from machine translation and summarization) if I provide labels) | ||
| - load evaluation data for example from BEIR |
There was a problem hiding this comment.
Do we plan to make the load interface generic? This can help with implementing your own custom loaders, e.g., loading data from an annotation tool, or, from HF datasets.
There was a problem hiding this comment.
I think my response to Malte's comment answers this.
| ### `EvaluationResult` | ||
|
|
||
| `EvaluationResult` won't contain partial metrics anymore as it does in v1.x but it will keep track of all the information used by `eval()`. | ||
| This way we'll be able to save all the necessary information to a single file. That information will probably be: |
There was a problem hiding this comment.
As long as we keep EvaluationResult agnostic of when and how it's stored on disk, I think we'll be fine. We can think of a generic marshaller that's easy to change/extend that accepts EvaluationResults and takes care of storing them. Then we could provide a default marshaller using a "haystack binary file format" (e.g. an sqlite db) but users could easily extend it and use Pickle instead.
anakin87
left a comment
There was a problem hiding this comment.
Great work!
I have two (related) questions about emerging LLM evaluation practices.
(they may be out of context)
- How do you imagine supporting the hallucination evaluation?
- I have noticed a growing interest in using Language Models to compute metrics and perform evaluation.
Ragas can be considered an interesting example.
Will we be able to easily support/implement metrics based on LLM calls (see some examples)?
|
|
||
| ### `EvaluationResult` | ||
|
|
||
| `EvaluationResult` won't contain partial metrics anymore as it does in v1.x but it will keep track of all the information used by `eval()`. |
There was a problem hiding this comment.
Actually I think there's one major source of information that this design doesn't take into account, which is the Document Store's content. It is the main input of a Retriever for example, and yet EvaluationResult won't store any information about it, making replication of the same experiment impossible with this object and the Pipeline alone.
I don't think we should address the problem in this setting, but let's add a note stating we're aware of the limitation.
There was a problem hiding this comment.
I think addressing this problem would be close to impossible. The only information we should provide about a DocumentStore is number of documents stored in it. Providing the content would mean copying the whole DocumentStore data and it can snowball easily. It could work with 10 Documents, what about 100? Or 100.000?
Also in the proposal when talking about reproducibility I'm not talking about the evaluation experiment but the metrics. The goal is that it should be easy to recalculate metrics without making it necessary to rerun the Pipeline.
I didn't about think to be fair, but I believe this would depend on the metric that the user decides to calculate. It's important though that we provide all the informations necessary to do so.
I believe this should be possible given the approach proposed. As I've shown in the examples above the idea is to make it flexible enough so it's easy to extend with new ways to calculate metrics. |
|
This has received enough positive feedback so I'm counting this as approved even if it has not received the required number of approvals. Merging and approving. |
Proposed Changes:
This PR introduces a new proposal to define at an high level how evaluation and metrics calculation should work in the upcoming Haystack version 2.x.