openai/gsm8k
Benchmark • Updated • 17.6k • 950k • 1.35k
How to use Menouar/phi-2-basic-maths with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2")
model = PeftModel.from_pretrained(base_model, "Menouar/phi-2-basic-maths")This model is a fine-tuned version of microsoft/phi-2 on an GSM8K dataset.
The objective of this model is to evaluate Phi-2's ability to provide correct solutions to reasoning problems after fine-tuning. This model was trained using techniques such as TRL, LoRA quantization, and Flash Attention.
To test it, you can use the following code:
import torch
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer, pipeline
# Specify the model ID
peft_model_id = "Menouar/phi-2-basic-maths"
# Load Model with PEFT adapter
model = AutoPeftModelForCausalLM.from_pretrained(
peft_model_id,
device_map="auto",
torch_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained(peft_model_id)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
The complete training procedure can be found on my Notebook.
The following hyperparameters were used during training:
The training results can be found on Tensoboard.
The complete Evaluation procedure can be found on my Notebook.
Accuracy: 36.16%
Unclear answers: 7.81%
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 53.60 |
| AI2 Reasoning Challenge (25-Shot) | 55.80 |
| HellaSwag (10-Shot) | 71.15 |
| MMLU (5-Shot) | 47.27 |
| TruthfulQA (0-shot) | 41.40 |
| Winogrande (5-shot) | 75.30 |
| GSM8k (5-shot) | 30.71 |
Base model
microsoft/phi-2