0
$\begingroup$

I use LLMs for QA tasks. The following prompt sent to Llama-2-13b-chat-hf:

Give a precise answer to the question based on the context. Don't be verbose.
CONTEXT: .....
QUESTION: what is the commission rate?
ANSWER:

It gives me the answer like:

The commission rate is 20%

How to prompt so that it can give the answer without a full sentence like:

20%
$\endgroup$

2 Answers 2

0
$\begingroup$

I just tried this prompt, and changed it very slightly and it seems to have achieved the desired result.

Have you tried something like this?

"Give a precise answer to the question based on the context without stating so. Don't be verbose."

$\endgroup$
0
$\begingroup$

Try with few-shot prompting:

Give a precise answer to the question based on the context. Don't be verbose.
CONTEXT: .....
QUESTION: what is the commission rate?
ANSWER: 20%
CONTEXT: I have 2 balls, you have 1 ball
QUESTION: how many balls do you have?
ANSWER: 1
CONTEXT: .....
QUESTION: what is the tax rate?
ANSWER:
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .