Qwen2.5-Math-Distill-1.5b-Sens

Đây là mô hình Qwen2.5 1.5B được tạo bằng cách merge:

  • Math model: Qwen2.5-Math-1.5B
  • Distill model: DeepSeek-R1-Distill-Qwen-1.5B
  • Phương pháp: Sens Merging (layer-wise sensitivity-weighted task arithmetic)

Model được xuất dưới dạng checkpoint Transformers đầy đủ (model.safetensors, tokenizer và các file cấu hình). Đây là model causal language model cho suy luận toán học bằng tiếng Anh.

Phương pháp merge

Quy trình Sens Merging được sử dụng trong project:

  1. Với mỗi model, chạy forward/backward trên calibration examples và tính sensitivity của tham số theo dạng abs(weight) * abs(gradient).
  2. Cộng sensitivity theo từng layer, chuẩn hóa vector sensitivity và tạo trọng số layer-wise cho math model và distill model.
  3. Trộn hai trọng số layer-wise bằng softmax với temperature 3.0, hệ số scaling 0.4 và coefficient multiplier 2.0.
  4. Áp dụng weighted task arithmetic: giữ math model làm điểm xuất phát và cộng task vector của distill model với hệ số theo layer.

Các tham số trên tương ứng với cấu hình Sens cho model 1.5B trong pipeline của project. Merge được thực hiện trên CPU sau khi đã tính sensitivity.

Calibration data

Hai biến thể calibration được tạo từ các file Parquet S1K trong project, sau đó chuyển sang JSON:

  • calibration/s1k.json: 1.000 mẫu, mỗi record gồm questioncot_solution. Đây là biến thể ngắn/task-oriented.
  • calibration/s1k-1.1.json: 630 mẫu, mỗi record gồm question, thinkingcot_solution; chỉ giữ các record có deepseek_grade == "Yes". Đây là biến thể reasoning/distillation.

Calibration dùng format question_cot. Khi chạy sensitivity analysis, pipeline lấy 100 mẫu đầu tiên của file calibration tương ứng.

Kết quả đánh giá

Tất cả kết quả dưới đây chỉ đánh giá trên 100 mẫu đầu tiên của mỗi dataset, với temperature 0.0 và greedy decoding. Avg Acc là trung bình các dataset có kết quả; dấu nghĩa là không có kết quả trong bảng.

Qwen2.5 1.5B: baseline và các phương pháp merge

Model / phương pháp college_math gsm8k math minerva_math olympiadbench Avg Acc (%) Avg Tokens
Qwen2.5-Math-1.5B 23.5 46.5 70.0 11.5 11.5 32.6 505
DeepSeek-R1-Distill-Qwen-1.5B 64.0 76.0 70.5 19.0 15.0 48.9 1383
aim 17.1 21.7 17.3 4.8 11.7 14.5 3960
average 11.1 28.2 13.5 6.6 4.7 12.8 3724
Sens (model này) 62.9 81.4 81.0 22.4 35.0 56.5 691
task arithmetic 56.5 74.1 66.9 18.4 27.7 48.7 1336
TIES 50.9 75.9 76.2 21.0 33.6 51.5 907

Sử dụng

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "quangdung/Qwen2.5-Math-Distill-1.5b-Sens"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype="auto",
    device_map="auto",
)

prompt = "Solve this problem step by step: What is 2 + 2?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Hạn chế

Đây là checkpoint nghiên cứu được tối ưu cho các bài toán trong benchmark thực nghiệm. Kết quả chỉ là đánh giá giới hạn trên 100 mẫu đầu tiên, không đại diện cho toàn bộ test set. Model có thể tạo lời giải sai hoặc suy luận dài; cần kiểm tra đáp án trước khi dùng trong ứng dụng thực tế.

Downloads last month
484
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support