File size: 29,179 Bytes
f5f34e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7512992
 
f5f34e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7512992
f5f34e9
7512992
 
 
 
 
 
 
 
 
 
 
f5f34e9
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
---
license: llama3
language:
- en
base_model: meta-llama/Meta-Llama-3-8B
pipeline_tag: text-generation
tags:
- rag
- evaluation
---

# Model Card for Model ID

Llama-3-8B-GroUSE is a Grounded QA evaluator and evaluates four metrics: Answer relevancy, Completeness, Faithfulness and Usefulness. 

### Task explanation

Grounded QA is usually the last step of a RAG pipeline: given a question and a set of documents retrieved from the corpus, a LLM must generate an answer to the question. We expect the LLM to cite from which document each information is coming, as depicted below. When no precise answer is in the documents the LLM should indicate it in its answer. If some related information are available in the documents, the LLM can add them to the answer to show the corpus is not completely off topic with the question.

<img src="grounded_qa_cases.png" alt="Schema showing an example depending on whether the references contain a precise answer, only related information or no information. For each case there is an example of references and ground truth answer. The question is common to the three cases : What is the relationship between Pluto and Neptune. Case 1 : the references contain a precise answer. Reference 1 :  More than 200 objects in 2:3 resonance are known (meaning they complete exactly 2 revolutions around the Sun when Neptune completes 3), among which are Pluto and its moons. Reference 2 : Pluto’s axis of rotation is tilted at 57.5 degrees relative to its orbital plane, which is quite high and unusual in the Solar System. Reference 3 : On the left: view of a cardiac cycle, of a systolic-diastolic oscillating flow, characteristic of circulatory arrest. Ground truth answer : The 3:2 orbital resonance relationship between Pluto and Neptune means that for every 3 revolutions of Neptune around the Sun, Pluto completes 2 [reference 1 citation]. Case 2 : References only contain related information. The reference 1 containing a precise information was removed, the two others are left. Ground truth answer : No document seems to precisely answer your question. However, the documents indicate that : Pluto’s axis of rotation is tilted at 57.5 degrees [reference 2 citation]. Case 3 : References contain no answer nor related information. Reference 1 and 2 were removed, only reference 3 which is off topic if left. Ground truth answer : No document seems to precisely answer your question." style="width:800px;"/>

We propose 6 metrics to evaluate the quality of a grounded QA answer : 
- **Answer relevancy** assesses the relevance of the information provided in the answer regarding the question, using a Likert scale (1 to 5).
- **Completeness** also uses a Likert scale to evaluate whether all relevant information from  the documents is present in the answer.
- **Faithfulness** is a binary score that checks if all facts in the answer are accurate and correctly attributed to the corresponding document.
- In adversarial cases and when additional information is provided, **Usefulness** is a binary score that determines if the provided additional information is indeed useful and relevant to the question.
- **Positive Acceptance** and **Negative Rejection** are binary scores indicating a true positive and a true negative respectively in identifying whether the question is answerable. These metrics' values can be infered from the other metrics' values and are thus not predicted by the model.

<details> <summary> Positive Acceptance and Negative Rejection algorithm </summary>

```python
def get_positive_acceptance_negative_rejection(
    answer_relevancy: int | None, completeness: int | None
) -> tuple[int | None]:
    if answer_relevancy is None:
        if completeness is None:
            positive_acceptance = 1
            negative_rejection = 1
        else:
            positive_acceptance = 0
            negative_rejection = None
    else:
        if completeness is None:
            positive_acceptance = None
            negative_rejection = 0
        else:
            positive_acceptance = None
            negative_rejection = None
    return positive_acceptance, negative_rejection
```

</details>

###  Model Details

- **Developed by:** Sacha Muller
- **Funded by:** Illuin Technology
- **Language:** English
- **License:** Llama-3
- **Finetuned from model:** [meta-llama/Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B)

### Model Sources

- **Repository:** [github.com/illuin-tech/grouse](https://github.com/illuin-tech/grouse)
- **Paper:** [arxiv.org/abs/2409.06595](https://arxiv.org/abs/2409.06595)


## How to Get Started with the Model

The model requires 4 elements in the input: a user request, references retrieved from a corpus based on the user request, a ground truth answer, and the answer you want to evaluate. We expect the citations to be of the form [i] where i is the number of the reference containing the information preceding the citation. 

To use the model, replace the {{text}} indications in the prompt below with the appropriate elements. Feel free to add or remove references if needed, the model was trained using samples with up to ten references.

<details> <summary> Full prompt </summary>

```
USER: [TASK]
Task: Grounded Question Answering
Based solely on the content of the references, the objective is to generate a response to the user's query. Each statement must be followed by the reference of the source passage, in the format [i] where i is the number of the reference. If no passage seems relevant, the answer should begin with "No document seems to precisely answer your question" and may be supplemented with related sourced information.
[/TASK]
[EVALUATION INSTRUCTIONS]
I will provide you with two answers, numbered 1 and 2, each containing a response to the user request.
I want you to assign grades to each answer according to four criteria: relevancy, completeness, usefulness, and faithfulness.

ANSWER RELEVANCY: 
I want you to assign to each answer a relevancy grade between 1 and 5:
- Answer relevancy evaluates if the content of the answer accurately responds to the user's question.
- The truthfulness of the information in the answer does not impact relevancy: even if information that appears false is contained in the answer, as long as this information is related to the request, then relevancy should not decrease. Remember that this information could come from references mentioning imaginary content that you are unaware of: the only thing to evaluate to assign the relevancy grade is therefore the adequacy between the information in the answer and the request, NOT their truthfulness.
- The absence of information in the answer does not impact relevancy, only the information contained in the answer is evaluated.
- Answer relevancy cannot be evaluated if the answer mentions that no document responds to the user request, it is then `null`, regardless of whether it contains other information or not.
Before assigning each grade, you will check that the answer does not contain "No document responds...", if this is the case you must put a grade of `null`. If this is not the case, you will then analyze the adequacy between the request and the information contained in the answer.

Answer relevancy scale:
null - The answer asserts that no document precisely responds to the user request. Even if it provides additional information, whether appropriate or not, the relevancy remains `null`.
5 - The answer has excellent relevancy. All information provided in the answer is in line with the question and precisely answers the user request.
4 - The answer achieves good relevancy by providing relevant information to answer the user question. Some information indicated does not exactly answer the question, but remains in line with the request.
3 - The answer has average relevancy, it contains information that allows responding to the user request, but it also contains superfluous information, which was not necessary to answer the request.
2 - The answer shows low relevancy, with some elements related to the request, but the majority of the content is not in line with the question asked.
1 - The answer has very low relevancy, not answering the user's question at all. The content is largely inappropriate or off-topic, delivering no useful information for the request.

COMPLETENESS:
I want you to assign to each answer a completeness grade between 1 and 5:
- The only condition for an answer to be complete is the presence in it of at least all the information from the references that are relevant to the question asked.
- The presence of unrelated information in the answer does not impact completeness.
- The presence of information in the answer not from the references does not impact completeness.
- Possible errors in the sources citing the references do not impact completeness.
- Completeness cannot be evaluated if the references contain no information that can precisely answer the user request, in which case the grade takes the value `null`.
Before assigning each grade, you will always start by analyzing the information found in the references that are relevant to the user request. If there is no relevant information in the references, completeness must be `null`. If there are relevant information in the references, you will analyze which portion of this information is present or absent in the answers to evaluate the completeness grade.

Completeness scale:
null - The references contained no relevant information to precisely answer the user's question. In this case, there is no need to read the content of the answer to know that the grade is `null`.
5 - The answer is very complete, it contains all the relevant information from the references. No essential information is omitted, ensuring complete coverage of the question asked.
4 - The answer covers most of the relevant information in depth. It integrates the references satisfactorily, covering the majority of key points. Some details may be missing, but overall, the answer is substantial.
3 - The answer reasonably addresses a number of relevant aspects. It integrates part of the necessary information from the references. However, gaps remain, impacting the overall completeness.
2 - The answer only covers a minimal part of the relevant information. It misses several important information from the references.
1 - The answer covers none of the relevant information, all relevant information from the references has been omitted in the answer.

USEFULNESS:
I want you to assign to each answer a usefulness grade of 0 or 1:
- Usefulness is only evaluated when the answer says that no document precisely answers the user's question, but it still provides information related to the question.
- Usefulness measures how interesting the related information is to know for the user, given that there is no answer in the references.
- If the answer responds to the user request, usefulness must be `null`.
- If the answer indicates that no document responds to the user request, without adding other information, usefulness must be `null`.
Before assigning each grade, you will start by verifying that the answer indeed asserts "No document responds...", then you will check that the answer contains related information in addition to this assertion. If one of these two conditions is `false` then usefulness must be `null`. If both conditions are indeed true, then you will analyze the usefulness of having added this related information to evaluate the usefulness grade.

Usefulness scale:
null - (The answer responds to the user request) OR (the answer does not answer the user's question AND does not provide any related information).
1 - The related information is generally related to the question and adds value to the general understanding of the topic.
0 - The related information is completely off-topic with respect to the question asked.

FAITHFULNESS: 
I want you to assign to each answer a boolean faithfulness grade. An answer is faithful if:
- Each statement made by the answer is followed by a source indicating the reference from which it is drawn.
- The information preceding the source is indeed from the corresponding reference.
- The information preceding the source is in agreement with the corresponding reference, and does not assert facts different from those indicated in the reference.
In all other cases, the response is considered non-faithful.
Faithfulness is also considered non-measurable if the answer asserts that no document responds to the question, and it does not provide any related information, it is then `null`.
Before assigning each grade, you will start by verifying that the answer does not only assert "No document responds...", without any other information. If this is the case, then faithfulness must be `null`. Otherwise, I want you to analyze by explaining for each sentence, one after the other, if 1) a reference follows the sentence, 2) the reference following the sentence is correct, and 3) if the sentence does not distort or modify the content of the references.

Faithfulness scale:
null - The answer asserts that no document responds to the question, and does not provide any related information.
1 - All sentences in the answer cite their sources, and are in agreement with the cited sources.
0 - At least one sentence in the response does not cite its sources, or cites a wrong source, or modifies the content from the references, or asserts something that is not supported by the cited references.

Your response should be in JSON format, respecting the following format:
{
    "answer_relevancy": {
        "answer_1": {
            "answer_affirms_no_document_answers": X,
            "answer_relevancy_justification": "...",
            "answer_relevancy": Y
        },
        "answer_2": {
            "answer_affirms_no_document_answers": X,
            "answer_relevancy_justification": "...",
            "answer_relevancy": Y
        }
    },
    "completeness": {
        "answer_1": {
            "completeness_justification": "...",
            "completeness": Y
        },
        "answer_2": {
            "completeness_justification": "...",
            "completeness": Y
        }
    },
    "usefulness": {
        "answer_1": {
            "answer_affirms_no_document_answers": X,
            "answer_contains_related_information": X,
            "usefulness_justification": "...",
            "usefulness": Z
        },
        "answer_2": {
            "answer_affirms_no_document_answers": X,
            "answer_contains_related_information": X,
            "usefulness_justification": "...",
            "usefulness": Z
        }
    },
    "faithfulness": {
        "answer_1": {
            "answer_only_asserts_no_document_answers": X,
            "content_analysis_sentence_by_sentence": [
                {
                    "sentence": "...",
                    "criterion_1": "...",
                    "criterion_2": "...",
                    "criterion_3": "..."
                },
                ...
            ],
            "faithfulness_justification": "...",
            "faithfulness": Z
        },
        "answer_2": {
            "answer_only_asserts_no_document_answers": X,
            "content_analysis_sentence_by_sentence": [
                {
                    "sentence": "...",
                    "criterion_1": "...",
                    "criterion_2": "...",
                    "criterion_3": "..."
                },
                ...
            ],
            "faithfulness_justification": "...",
            "faithfulness": Z
        }
    }
}
Where "..." is a string, X is a boolean, Y is an integer between 1 and 5 or `null`, and Z is an integer that is 0 or 1 or `null`.
[/EVALUATION INSTRUCTIONS]
[SAMPLE]
List of references :
Reference 1: {{reference_1}}
Reference 2: {{reference_2}}
Reference 3: {{reference_3}}
Reference 4: {{reference_4}}
Reference 5: {{reference_5}}
User request: {{user_request}}
[/SAMPLE]
[TO EVALUATE]
Answer 1: {{ground_truth}}
Answer 2: {{prediction_to_evaluate}}
[/TO EVALUATE]
```
</details>

After this, you should apply the conversation template : 

```python
from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("illuin/llama-3-grouse")

formatted_conversation = tokenizer.apply_chat_template(
    [{"role": "user", "content": "[TASK] ... [/TO EVALUATE]"}],
    tokenize=False,
    add_generation_prompt=True,
)
```

You can now feed this input to the model to get evaluations.





## Evaluation


The performances are measured on the [GroUSE dataset](https://huggingface.co/datasets/illuin/grouse) as well as with correlation with GPT-4 using the validation set. 

<table>
  <thead>
    <tr>
      <td colspan="2"></td>
      <th colspan="7">Agreement rate of metrics on GroUSE</th>
    </tr>
    <tr>
      <th></th>
      <th></th>
      <th>Answer relevancy</th>
      <th>Completeness</th>
      <th>Usefulness</th>
      <th>Faithfulness</th>
      <th>Positive acceptance</th>
      <th style="border-right: 1px solid;">Negative rejection</th>
      <th>Total test pass rate</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="11"><em>Each metric evaluated in a separate prompt</em></td>
      <td><strong>GPT-4</strong></td>
      <td><strong>91.67</strong></td>
      <td><strong>88.89</strong></td>
      <td><strong>100.0</strong></td>
      <td>92.36</td>
      <td><strong>98.61</strong></td>
      <td style="border-right: 1px solid;"><strong>98.61</strong></td>
      <td><strong>95.02</strong></td>
    </tr>
    <tr>
      <td><strong>GPT-4o</strong></td>
      <td>79.17</td>
      <td>77.08</td>
      <td>97.92</td>
      <td>92.36</td>
      <td>83.33</td>
      <td style="border-right: 1px solid;">83.33</td>
      <td>85.53</td>
    </tr>
    <tr>
      <td><strong>GPT-4-turbo</strong></td>
      <td>90.28</td>
      <td>85.42</td>
      <td>97.22</td>
      <td><strong>93.75</strong></td>
      <td>94.44</td>
      <td style="border-right: 1px solid;">94.44</td>
      <td>92.59</td>
    </tr>
    <tr>
      <td><strong>GPT-3.5-turbo</strong></td>
      <td>88.89</td>
      <td>50.00</td>
      <td>80.56</td>
      <td>68.06</td>
      <td>77.78</td>
      <td style="border-right: 1px solid;">61.81</td>
      <td>71.18</td>
    </tr>
    <tr>
      <td><strong>Gemini 1.0 Pro</strong></td>
      <td>78.47</td>
      <td>75.69</td>
      <td>97.22</td>
      <td>78.47</td>
      <td>84.72</td>
      <td style="border-right: 1px solid;">84.72</td>
      <td>83.22</td>
    </tr>
    <tr>
      <td><strong>Mixtral 8x7b Instruct</strong></td>
      <td>81.25</td>
      <td>61.11</td>
      <td>81.25</td>
      <td>72.22</td>
      <td>76.39</td>
      <td style="border-right: 1px solid;">75.69</td>
      <td>74.65</td>
    </tr>
    <tr>
      <td><strong>Mixtral 8x22b Instruct</strong></td>
      <td>80.56</td>
      <td>68.75</td>
      <td>81.94</td>
      <td>83.33</td>
      <td>76.39</td>
      <td style="border-right: 1px solid;">72.22</td>
      <td>77.20</td>
    </tr>
    <tr>
      <td><strong>Prometheus 2 7b</strong></td>
      <td>72.22</td>
      <td>41.67</td>
      <td>16.67</td>
      <td>38.19</td>
      <td>73.61</td>
      <td style="border-right: 1px solid;">74.31</td>
      <td>52.78</td>
    </tr>
    <tr>
      <td><strong>Prometheus 2 8x7b</strong></td>
      <td>61.81</td>
      <td>25.00</td>
      <td>34.03</td>
      <td>72.22</td>
      <td>67.36</td>
      <td style="border-right: 1px solid;">69.44</td>
      <td>54.98</td>
    </tr>
    <tr>
      <td><strong>Llama-3 70b Instruct</strong></td>
      <td>90.28</td>
      <td>63.89</td>
      <td>76.39</td>
      <td>73.61</td>
      <td>85.42</td>
      <td style="border-right: 1px solid;">85.42</td>
      <td>79.17</td>
    </tr>
    <tr>
      <td><strong>Llama-3 8b Instruct</strong></td>
      <td>85.42</td>
      <td>49.31</td>
      <td>80.56</td>
      <td>59.72</td>
      <td>72.92</td>
      <td style="border-right: 1px solid;">68.06</td>
      <td>69.33</td>
    </tr>
    <tr>
      <td rowspan="2"><em>All metrics with one prompt</em></td>
      <td><strong>Llama-3 8b Instruct</strong></td>
      <td>31.25</td>
      <td>18.06</td>
      <td>34.03</td>
      <td>56.94</td>
      <td>52.78</td>
      <td style="border-right: 1px solid;">46.53</td>
      <td>39.93</td>
    </tr>
    <tr>
      <td><strong>Finetuned Llama 3 8b</strong></td>
      <td>88.89</td>
      <td>81.94</td>
      <td>81.25</td>
      <td>52.78</td>
      <td>91.67</td>
      <td style="border-right: 1px solid;">91.67</td>
      <td>81.37</td>
    </tr>
    <tr>
      <td><em>Adapted protocol</em></td>
      <td><strong>Human annotators</strong></td>
      <td>98.96</td>
      <td>96.88</td>
      <td>97.92</td>
      <td>97.72</td>
      <td>98.96</td>
      <td style="border-right: 1px solid;">100.0</td>
      <td>98.44</td>
    </tr>
  </tbody>
</table>


<table>
  <thead>
    <tr>
      <td colspan="2"></td>
      <th colspan="6"><strong>Correlation with GPT-4 on validation set</strong></th>
    </tr>
    <tr>
      <td colspan="2"></td>
      <th colspan="2" style="border-right: 1px solid;"><strong>Spearman correlation</strong></th>
      <th colspan="4"><strong>F1-score</strong></th>
    </tr>
    <tr>
      <th></th>
      <th></th>
      <th><em>Answer relevancy</em></th>
      <th style="border-right: 1px solid;"><em>Completeness</em></th>
      <th><em>Usefulness</em></th>
      <th><em>Faithfulness</em></th>
      <th><em>Positive acceptance</em></th>
      <th><em>Negative rejection</em></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="8"><em>Each metric evaluated in a separate prompt</em></td>
      <td><strong>GPT-3.5-turbo</strong></td>
      <td>0.55</td>
      <td style="border-right: 1px solid;">0.68</td>
      <td>0.76</td>
      <td>0.48</td>
      <td>0.63</td>
      <td>0.47</td>
    </tr>
    <tr>
      <td><strong>Gemini 1.0 Pro</strong></td>
      <td>0.63</td>
      <td style="border-right: 1px solid;">0.68</td>
      <td>0.48</td>
      <td>0.67</td>
      <td>0.78</td>
      <td>0.74</td>
    </tr>
    <tr>
      <td><strong>Mixtral 8x7b Instruct</strong></td>
      <td>0.59</td>
      <td style="border-right: 1px solid;">0.43</td>
      <td>0.70</td>
      <td>0.61</td>
      <td>0.63</td>
      <td>0.57</td>
    </tr>
    <tr>
      <td><strong>Mixtral 8x22b Instruct</strong></td>
      <td>0.70</td>
      <td style="border-right: 1px solid;">0.66</td>
      <td>0.61</td>
      <td><strong>0.79</strong></td>
      <td><strong>0.83</strong></td>
      <td>0.70</td>
    </tr>
    <tr>
      <td><strong>Prometheus 2 (7b)</strong></td>
      <td>0.60</td>
      <td style="border-right: 1px solid;">0.51</td>
      <td>0.29</td>
      <td>0.55</td>
      <td>0.55</td>
      <td>0.49</td>
    </tr>
    <tr>
      <td><strong>Prometheus 2 (8x7b)</strong></td>
      <td>0.64</td>
      <td style="border-right: 1px solid;">0.62</td>
      <td>0.30</td>
      <td>0.75</td>
      <td>0.69</td>
      <td>0.50</td>
    </tr>
    <tr>
      <td><strong>Llama-3 70b Instruct</strong></td>
      <td><strong>0.74</strong></td>
      <td style="border-right: 1px solid;"><strong>0.74</strong></td>
      <td><strong>0.93</strong></td>
      <td>0.78</td>
      <td>0.75</td>
      <td><strong>0.79</strong></td>
    </tr>
    <tr>
      <td><strong>Llama-3 8b Instruct</strong></td>
      <td>0.63</td>
      <td style="border-right: 1px solid;">0.71</td>
      <td>0.42</td>
      <td>0.72</td>
      <td>0.54</td>
      <td>0.44</td>
    </tr>
    <tr>
      <td rowspan="2"><em>All metrics with one prompt</em></td>
      <td><strong>Llama-3 8b Instruct</strong></td>
      <td>0.46</td>
      <td style="border-right: 1px solid;">0.23</td>
      <td>0.18</td>
      <td>0.47</td>
      <td>0.40</td>
      <td>0.46</td>
    </tr>
    <tr>
      <td><strong>Finetuned Llama-3 8b</strong></td>
      <td>0.62</td>
      <td style="border-right: 1px solid;">0.57</td>
      <td>0.41</td>
      <td>0.57</td>
      <td>0.79</td>
      <td>0.74</td>
    </tr>
  </tbody>
</table>

## Training Details

### Training Data

Given 1200 grounded QA statements, we used the following list of models to generate the predictions : 
- 412 answers were generated using a [llama-7b](https://huggingface.co/huggyllama/llama-7b) finetuned on a Grounded QA answering task. 
- 333 answers were generated using a [bloom-1b1](bigscience/bloom-1b1) finetuned on a Grounded QA answering task. 
- 319 answers were generated using a [llama-13b](https://huggingface.co/huggyllama/llama-13b) finetuned on a Grounded QA answering task. 
- 136 answers were generated using a [OpenHermes-2.5-Mistral-7B](https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B)

Various temperatures and top_k values were used in a goal to generate answers with a wide range of quality. All these samples were then evaluated using GPT-4, using one prompt for each metric.

A thousand samples were used for the training and 200 samples kept for validation.

### Training Procedure

#### Training Hyperparameters

The finetuning was conducted using the [meta-llama/Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B) model, employing an 8-bit quantization scheme to optimize memory efficiency. The model was trained to accommodate a sequence length of 7104 tokens, with sample packing enabled to maximize the utilization of input data. We utilized the LoRA (Low-Rank Adaptation) technique using an adapter with parameters set to $r = 32$, $\alpha=16$, and a dropout rate of $0.05$.

Training was performed with a batch size of 64 over the course of three epochs, which took 2 hours on one A100 PCIe with 80GB of VRAM. The optimization process employed the AdamW algorithm with an 8-bit implementation. A cosine learning rate scheduler was used, with a learning rate of $2.10^{-4}$ and 10 warmup steps. Two other trainings were conducted with learning rates $2.10^{-3}$ and $2.10^{-5}$, but the results were less promising.

The training was realised using [Axolotl](https://github.com/axolotl-ai-cloud/axolotl).

<details> <summary>Full Axolotl config</summary>

```yaml
base_model: meta-llama/Meta-Llama-3-8B
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer

load_in_8bit: true
load_in_4bit: false
strict: false

datasets:
  - path: [path to train dataset]
    type: sharegpt
    field_human: USER
    field_model: ASSISTANT
    data_files:
      - [path to train dataset]
    split: 
test_datasets: 
  - path: [path to validation dataset]
    type: sharegpt
    field_human: USER
    field_model: ASSISTANT
    data_files:
      - [path to validation dataset]
    split: train


output_dir: ./outputs/llama-3-8b_grouse

sequence_len: 7104
sample_packing: true
pad_to_sequence_len: true

adapter: lora
lora_model_dir:
lora_r: 32
lora_alpha: 16
lora_dropout: 0.05
lora_target_linear: true
lora_fan_in_fan_out:

wandb_project: sourced-synthesis-evaluator
wandb_entity: 
wandb_watch:
wandb_name:
wandb_log_model: end

gradient_accumulation_steps: 32
micro_batch_size: 2
num_epochs: 3
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 0.0002

train_on_inputs: false
group_by_length: false
bf16: auto
fp16:
tf32: false

gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
s2_attention:

warmup_steps: 10
evals_per_epoch: 1
eval_table_size:
eval_max_new_tokens: 2048
eval_sample_packing: false
saves_per_epoch: 1
debug:
deepspeed:
weight_decay: 0.0
fsdp:
fsdp_config:
special_tokens:
   pad_token: <|end_of_text|>
```

</details>


## Bias, Risks, and Limitations

We opted to perform a single evaluation call to assess the generated answers. While this approach simplifies the evaluation process, it makes the task harder for the model. In addition, our experiments were conducted within a single domain, specifically using Wikipedia as the knowledge base. Consequently, our findings may not generalize to out-of-domain scenarios. Future work should include diverse domains to test the robustness and adaptability of our evaluation framework. Lastly, the model we finetuned is small: although this approach demonstrated significant improvements, it would be beneficial to explore the effects of finetuning larger models, which could potentially yield even better performance.

## Environmental Impact

- **Hardware Type:** A100 PCIe with 80GB of VRAM 
- **Time used:** 120 minutes
- **Cloud Provider:** RunPod
- **Compute Region:** Unknown

## Citation

```
@misc{muller2024grouse,
      title={GroUSE: A Benchmark to Evaluate Evaluators in Grounded Question Answering}, 
      author={Sacha Muller and António Loison and Bilel Omrani and Gautier Viaud},
      year={2024},
      eprint={2409.06595},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2409.06595}, 
}
```


## Model Card Contact

For any question about the model please contact [antonio.loison@illuin.tech](mailto:antonio.loison@illuin.tech) or [gautier.viaud@illuin.tech](mailto:gautier.viaud@illuin.tech).