Views
No views yet
meta-llama/Llama-3.1-8B-Instruct for factual QA with explicit verbalized confidence.1Answer: <answer>
2Confidence: <decimal between 0 and 1>meta-llama/Llama-3.1-8B-Instruct to express calibrated verbal confidence for adaptive retrieval-augmented generation (RAG).meta-llama/Llama-3.1-8B-Instruct| Dataset | EM | F1 | Trigger Rate |
|---|---|---|---|
| HotpotQA | 32.0 | 43.8 | 61.6% |
| MuSiQue | 11.8 | 18.8 | 76.8% |
| 2WikiMultiHopQA | 28.4 | 32.9 | 48.2% |
| NQ | 32.4 | 44.4 | 25.0% |
| TriviaQA | 53.2 | 62.5 | 28.8% |
| Overall | 31.6 | 40.5 | 48.1% |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("your-username/verbal-calibrate")
4model = AutoModelForCausalLM.from_pretrained("your-username/verbal-calibrate")
5
6prompt = tokenizer.apply_chat_template([{
7 "role": "user",
8 "content": (
9 "Answer the following factual question step by step, then state your answer "
10 "and how confident you are.\n\n"
11 "{question}\n\n"
12 "Your response must end with exactly these two lines:\n"
13 "Answer: $Answer\n"
14 "Confidence: $Confidence\n\n"
15 "Where $Confidence is a decimal between 0 and 1."
16 ).format(question="What is the capital of France?")
17}], tokenize=False, add_generation_prompt=True)
18
19
20
21