Model Card for Model ID

Phi-3.5-mini GSM8K SFT Adapter

The plain supervised fine-tuning (SFT) adapter from a small GSM8K project: a LoRA adapter for Phi-3.5-mini-instruct trained on the GSM8K training set to write step-by-step solutions that end with #### N. It is the starting point of the project; the later adapters are phi35-mini-gsm8k-rft-lora and the final phi35-mini-gsm8k-dpo-lora, which is the one used with the verifier in the demo.

Model Details

Model Description

Developed by: Naitik (Hugging Face: Naitik-sudo123, Kaggle: naitiksudo), student at Keshav Mahavidyalaya, University of Delhi Model type: LoRA adapter (QLoRA-trained) for a causal language model Language: English License: MIT (same as the base model) Finetuned from: unsloth/phi-3.5-mini-instruct-bnb-4bit, a 4-bit, Llama-architecture repackaging of microsoft/Phi-3.5-mini-instruct

Model Sources [optional]

Demo / write-up: https://huggingface.co/spaces/Naitik-sudo123/gsm8k-generator-verifier Author's GitHub: https://github.com/naitiksaxena-sudo

Uses

Direct Use

generating step-by-step solutions to GSM8K-style arithmetic word problems, and serving as a baseline for the later RFT and DPO adapters.

Downstream Use [optional]

[More Information Needed]

Out-of-Scope Use

anything where a wrong numerical answer has real consequences (finance, medicine, engineering, grading students). It was trained and tested only on GSM8K-style problems.

Bias, Risks, and Limitations

No evaluation reported. This adapter was not evaluated under the project's final evaluation setup, so no accuracy figure is given here. The final DPO adapter's results are on its own card. Narrow training. GSM8K only: English, grade-school arithmetic word problems, one solution style. It is not a general math tutor. 4-bit base. Trained on and intended for the 4-bit quantized base model. Inherited limitations from Phi-3.5-mini-instruct and from GSM8K (possible benchmark contamination in the base model).

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

How to Get Started with the Model

Requires a CUDA GPU and pip install bitsandbytes

from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel

base_id = "unsloth/phi-3.5-mini-instruct-bnb-4bit" # already 4-bit quantized tok = AutoTokenizer.from_pretrained(base_id) base = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto") model = PeftModel.from_pretrained(base, "Naitik-sudo123/phi35-mini-gsm8k-lora")

msgs = [{"role": "user", "content": question}] # training used the chat template text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True) add_special = not (tok.bos_token and text.startswith(tok.bos_token)) inputs = tok(text, return_tensors="pt", add_special_tokens=add_special).to(model.device) out = model.generate(**inputs, max_new_tokens=500, do_sample=False, pad_token_id=tok.eos_token_id) print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

The adapter targets q_proj, k_proj, v_proj, gate_proj and up_proj as separate layers (Llama-format weights), so use the Unsloth repackage above. Microsoft's original checkpoint fuses those layers, and against it only o_proj and down_proj would receive adapter weights.

Training Details

Training Data

The full GSM8K training split (openai/gsm8k, MIT license), 7,473 problems, formatted with the model's chat template (user = question, assistant = worked solution ending in #### N).

Training Procedure

QLoRA with Unsloth and TRL, 1 epoch, 935 steps (batch size 8), learning rate 2e-4, optimizer adamw_8bit, weight decay 0.01, linear schedule, max sequence length 2048, seed 3407. LoRA rank 16, lora_alpha 16, dropout 0, no bias, all seven linear projections (q/k/v/o/gate/up/down_proj). Wall time about 42 minutes.

Preprocessing [optional]

[More Information Needed]

Training Hyperparameters

  • Training regime: [More Information Needed]

Speeds, Sizes, Times [optional]

[More Information Needed]

Evaluation

Testing Data, Factors & Metrics

Testing Data

[More Information Needed]

Factors

[More Information Needed]

Metrics

[More Information Needed]

Results

[More Information Needed]

Summary

Model Examination [optional]

[More Information Needed]

Environmental Impact

Hardware: Kaggle, 2× NVIDIA T4 Compute time: about 42 minutes

Technical Specifications [optional]

Architecture: Phi-3.5-mini-instruct (decoder-only transformer, loaded as LlamaForCausalLM from the Unsloth repackage) + LoRA adapter Software: PEFT 0.21.0 (recorded in the adapter config); trained with Unsloth and TRL in a Kaggle session (their versions were not recorded).

Model Architecture and Objective

[More Information Needed]

Compute Infrastructure

[More Information Needed]

Hardware

[More Information Needed]

Software

[More Information Needed]

Citation [optional]

BibTeX:

[More Information Needed]

APA:

[More Information Needed]

Glossary [optional]

[More Information Needed]

More Information [optional]

[More Information Needed]

Model Card Authors [optional]

[More Information Needed]

Model Card Contact

Hugging Face: Naitik-sudo123

Framework versions

  • PEFT 0.19.1
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Naitik-sudo123/phi35-mini-gsm8k-lora