4AI / LS-LLaMA

A Simple but Powerful SOTA NER Model | Official Code For Label Supervised LLaMA Finetuning
https://arxiv.org/abs/2310.01208
MIT License
131 stars 20 forks source link

Do you train only linear classification head or finetune the whole Llama model? #22

Closed ngthanhtin closed 2 months ago

ngthanhtin commented 2 months ago

Hi, Thank you, guys, for providing us with the code, it is very useful for my research.

I have a few questions about your training: Screenshot 2024-06-21 at 1 36 20 PM

1/ Here, what is the prompt for LS-LLaMA-2-7B? and where can I find this? 2/ Do you train only the linear classification head or fine-tune the whole Llama model? 3/Could you provide us with the zero and few-shot Llama code?

I hope you can answer my question, it is fascinating to find out these.

Best, Tin

SeanLee97 commented 2 months ago

hi @ngthanhtin , sorry for the delayed reply.

1) For all LS-* models, we did not use a prompt. 2) We train the linear head and use LoRA for efficient tuning. 3) For the zero or few shot settings, here is our prompt template:

You are an intelligent text classification system; please help me with the classification task.
Task: identify the classification label from the given sentence.
Only support {{ labels|length }} labels, including: {{ labels|join(', ') }}.
{% if hint is not none %}
Explanation and examples: {{ hint }}
{% endif %}
Output format: label.

Following is the given sentence: {{ text }}
Output:
ngthanhtin commented 2 months ago

Thank you so much! @SeanLee97