673. MAP - Charting Student Math Misunderstandings | map-charting-student-math-misunderstandings
非常感谢组织者和 Kaggle 工作人员,祝贺所有获奖者。
这次竞赛让我学到了很多——我很高兴能获得我的第一枚金牌!
方法
分数
模型
Qwen/Qwen2.5-32B-Instructdeepseek-ai/DeepSeek-R1-Distill-Qwen-32B推理时间
参考实现:
https://www.kaggle.com/code/sinchir0/lb-0-942-train-fullft-qwen3-8b-by-sfttrainer
将 65 个标签转换为特殊 tokens。
使用 SFTTrainer + AutoModelForCausalLM 配合 QLoRA 进行微调。
超参数
Qwen/Qwen2.5-32B-Instruct
epoch=2, lr=1e-4, per_device_batch_size=8, gradient_accumulation_steps=2r=32, α=64, lora_dropout=0.01, target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"], modules_to_save=["lm_head"], trainable_token_indices={"embed_tokens": target_label_ids}DeepSeek-R1-Distill-Qwen-32B
epoch=2, lr=8e-5, per_device_batch_size=8, gradient_accumulation_steps=2r=64, α=128, lora_dropout=0.01, target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"], modules_to_save=["lm_head"], trainable_token_indices={"embed_tokens": target_label_ids}环境
训练时间
def wrong_corrections(df: pd.DataFrame) -> pd.DataFrame:
false_to_true_ids = [12878, 12901, 13876, 14089, 14159, 14185]
df["MC_Answer"] = np.where(
df["row_id"].isin(false_to_true_ids),
df["MC_Answer"].str.replace(r"\( 6 \)", r"\( 9 \)"),
df["MC_Answer"]
)
true_to_false_ids = [14280, 14305, 14321, 14335, 14338, 14352, 14355, 14403, 14407, 14412, 14413, 14418]
df["MC_Answer"] = np.where(
df["row_id"].isin(true_to_false_ids),
df["MC_Answer"].str.replace(r"\( 9 \)", r"\( 6 \)"),
df["MC_Answer"]
)
return df
def replace_duplicate_misc(df: pd.DataFrame) -> pd.DataFrame:
df["Misconception"] = df["Misconception"].replace({"Wrong_Fraction": "Wrong_fraction"})
return df
prompt_format = """Question: {QuestionText}
Answer: {MC_Answer}
Correct: {Correct}
Student Explanation: {StudentExplanation}
Label: """
| 模型 / 设置 | 验证集 (Valid) | 公开排行榜 (Public LB) | 私有排行榜 (Private LB) |
|---|---|---|---|
| Qwen2.5-32B-Instruct (fold0) | 0.950182 | 0.946 | 0.944 |
| Qwen2.5-32B-Instruct (5-fold) | 0.950 | 0.946 | |
| DeepSeek-R1-Distill-Qwen-32B (fold0) | 0.947956 | 0.948 | 0.945 |
| DeepSeek-R1-Distill-Qwen-32B (5-fold) | 0.950 | 0.946 | |
| 5-fold × 2 集成 | 0.950 | 0.948 |
https://huggingface.co/Qwen/Qwen2.5-32B-Instruct
https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
https://www.kaggle.com/code/sinchir0/lb-0-942-train-fullft-qwen3-8b-by-sfttrainer
https://huggingface.co/docs/peft/main/en/developer_guides/lora#efficiently-train-tokens-alongside-lora