Instructions to use tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2", max_seq_length=2048, )
Qwen2.5-14B-LoRA-NYCU-DL-HW2
Model Description
This model is a Supervised Task Finetuned (SFT) version of Qwen2.5-14B-Instruct, specifically trained with reasoning information (Chain-of-Thought) to tackle complex multiple-choice questions.
It was developed as part of the Deep Learning HW2 coursework at National Yang Ming Chiao Tung University (NYCU).
- Developed by: 謝宗穎(Zong-Ying Shieh) 314706019
- Base Model:
unsloth/Qwen2.5-14B-Instruct-bnb-4bit - Task: Multiple-Choice Question Answering & Logical Reasoning
- Language(s): Traditional Chinese (zh-TW), English
- License: Apache 2.0
Performance
- Kaggle Public Leaderboard Score:
0.72340 - Evaluation Method: The reported score is achieved by coupling this SFT model with a highly optimized Test-Time Compute inference strategy: 3-Pass Self-Consistency (SC) combined with Softmax Logits Soft-Voting.
How to Use (Inference)
To achieve the maximum performance, it is highly recommended to use the Logits Extraction method rather than standard text generation. Below is a basic snippet to load the model using unsloth:
from unsloth import FastLanguageModel
import torch
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2",
max_seq_length = 4096,
dtype = None,
load_in_4bit = True
)
FastLanguageModel.for_inference(model)
System Prompt used during training
SYSTEM_PROMPT = "你是一個專業且中立的選擇題解題專家。請針對題目進行嚴密的邏輯推理,客觀分析每個選項,最後明確給出你的答案。"
Training Details
Hardware & Environment
- Hardware: 1x NVIDIA GeForce RTX 5090 (32GB VRAM)
- raining Framework: unsloth, trl, transformers
- Memory Optimization: Overcame Out-of-Memory (OOM) constraints on a single 32GB GPU by utilizing PyTorch's expandable_segments:True, drastically reducing the per_device_train_batch_size to 1, and compensating with gradient_accumulation_steps=16 to maintain a stable effective batch size.
Hyperparameters
LoRA Rank (r): 32
LoRA Alpha: 64
Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Epochs: 2 (To prevent catastrophic forgetting and overfitting on the public LB)
Learning Rate: 1e-4
Optimizer: adamw_8bit
Inference Strategy
The true potential of this model is unlocked during the inference phase. Instead of relying on vulnerable Regex text parsing, the final submission utilizes:
Dynamic Chain-of-Thought (do_sample=True, temp=0.6): Forcing the model to explore 3 distinct reasoning paths for the same question.
Logits Soft-Voting: Extracting the raw neural network logits for tokens A, B, C, and D at the final layer, normalizing them via Softmax into confidence probabilities, and accumulating these scores across the 3 iterations. This effectively mitigates the 14B model's "hallucination" and locks in the most logically sound answer.
Model tree for tony-shieh/Qwen2.5-14B-LoRA-NYCU-DL-HW2
Base model
Qwen/Qwen2.5-14B