You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Systematic analysis of LoRA fine-tuning hyperparameters across
45 combinations (5 ranks x 3 alpha ratios x 3 target_modules)
on Alpaca-GPT4-zh and ShareGPT datasets using Qwen2-7B as base model.
Experiment Setup
Variable
Values
Base Model
Qwen2-7B
rank (r)
4, 8, 16, 32, 64
alpha/rank ratio
0.5x, 1.0x, 2.0x, 4.0x
target_modules
QKV only, Attention (QKV+O), All Linear
Datasets
Alpaca-GPT4-zh, ShareGPT
Training
3 epochs, lr=2e-4, cosine schedule, BF16
Key Finding 1: Rank Selection
Rank
Trainable Params
BLEU
% of Best
4
0.85M
18.2
84.3%
8
1.7M
19.8
91.7%
16
3.4M
21.1
97.8%
32
6.7M
21.4
99.1%
64
13.4M
21.6
100%
Recommendation: r=16 delivers 97.8% of the best performance with
only 25% of the trainable parameters compared to r=64.
Key Finding 2: Alpha/Rank Ratio
Ratio
Training Stability
BLEU (r=16)
Recommendation
< 1.0
Unstable, high gradient variance
19.1
Avoid
1.0 - 2.0
Stable, good convergence
21.1 - 21.3
Recommended
> 4.0
Diminishing returns
21.4
Not worth the overhead
Key Finding 3: Target Modules
Target
Params (M)
BLEU
Training Time
QKV only
1.7
17.5
1.0x (baseline)
Attention only
2.3
19.9
1.03x
All Linear
3.4
21.1
1.08x
Key Finding 4: Dataset Size Effect
Small dataset (< 1000 samples): More sensitive to rank selection;
r >= 16 strongly recommended
Medium dataset (1000-5000 samples): r=8~16 range stable