Views
No views yet
meta-llama/Llama-3.2-3B-Instruct. This model was trained with SFT using Adaption's AutoScientist on the math_word_problem_sub_2 dataset.
meta-llama/Llama-3.2-3B-Instruct
| Evaluation | Sample size | Base | Adapted | Change |
|---|---|---|---|---|
| Win-rate on training distribution | 200 held-out datapoints | 42 | 58 | +16 |
| Math Win-rate (Adaption held-out) | 100 unseen datapoints across Math tasks | 51 | 50 | –1 |
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5BASE = "meta-llama/Llama-3.2-3B-Instruct"
6ADAPTER = "Minutor/adaption_math_word_problem_sub_2"
7
8device = "cuda" if torch.cuda.is_available() else "cpu"
9dtype = torch.bfloat16 if device == "cuda" else torch.float32
10
11base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=dtype, device_map="auto")
12model = PeftModel.from_pretrained(base, ADAPTER)
13# Optional: merge for faster inference
14# model = model.merge_and_unload()
15
16tokenizer = AutoTokenizer.from_pretrained(BASE)
17
18messages = [
19 {"role": "user", "content": "A store sells apples for $2 each and oranges for $3 each. If a customer buys 4 apples and 3 oranges, how much do they pay in total?"}
20]
21
22text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
23inputs = tokenizer(text, return_tensors="pt").to(model.device)
24
25with torch.inference_mode():
26 outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
27
28print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))1{
2 "job_id": "dfdd2990-1ef7-41e4-829d-2924d668ab65",
3 "training_experiment_id": "19aa2607-d5ad-43b7-90b2-5e7d3745b627",
4 "original_model_name": "meta-llama/Llama-3.2-3B-Instruct",
5 "trained_model_name": "adaption_math_word_problem_sub_2",
6 "training_method": "sft",
7 "training_type": "lora",
8 "data_format": "chat",
9 "hyperparams": {
10 "lora": "true",
11 "lora_r": 16,
12 "n_evals": 5,
13 "n_epochs": 3,
14 "batch_size": "max",
15 "lora_alpha": 32,
16 "lora_dropout": 0,
17 "min_lr_ratio": 0.1,
18 "warmup_ratio": 0.1,
19 "weight_decay": 0,
20 "learning_rate": 0.00001,
21 "max_grad_norm": 2,
22 "base_model_size": "3B",
23 "train_on_inputs": "false",
24 "training_method": "sft",
25 "lr_scheduler_type": "cosine",
26 "scheduler_num_cycles": 0.5,
27 "lora_trainable_modules": "all-linear"
28 }
29}