openai/gsm8k
Benchmark β’ Updated β’ 17.6k β’ 1.62M β’ 1.61k
Run CrystalRaindropsFall/phi2-gsm8k-curriculum-answer-length on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/CrystalRaindropsFall/phi2-gsm8k-curriculum-answer-length. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/CrystalRaindropsFall/phi2-gsm8k-curriculum-answer-length on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use CrystalRaindropsFall/phi2-gsm8k-curriculum-answer-length with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("experiment_results/curriculum_answer_length_phi2_gsm8k_20251112_200451/stage_2_normal/merged_model")
model = PeftModel.from_pretrained(base_model, "CrystalRaindropsFall/phi2-gsm8k-curriculum-answer-length")This is a LoRA adapter for microsoft/phi-2 fine-tuned on the GSM8K dataset for mathematical reasoning.
LoRA adapter for PHI-2 trained with curriculum learning (answer length method)
This model was trained using curriculum learning, where the model is exposed to progressively harder problems:
The curriculum was determined based on answer length (number of solution steps).
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"microsoft/phi-2",
device_map="auto",
torch_dtype="auto"
)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "CrystalRaindropsFall/phi2-gsm8k-curriculum-answer-length")
# Inference
prompt = "Question: Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market?\nAnswer:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from transformers import pipeline
from peft import PeftModel, AutoPeftModelForCausalLM
# Load model with adapter
model = AutoPeftModelForCausalLM.from_pretrained(
"YOUR_USERNAME/REPO_NAME",
device_map="auto"
)
# Create pipeline
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
# Generate
result = pipe("Question: A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?\nAnswer:")
print(result[0]['generated_text'])
Evaluated on GSM8K test set (512 samples):
| Metric | Score |
|---|---|
| Exact Match | 59.38% |
| Format Correct | 100% |
Apache 2.0 (following base model license)
Base model
microsoft/phi-2