返回列表

8th Place Solution

673. MAP - Charting Student Math Misunderstandings | map-charting-student-math-misunderstandings

开始: 2025-07-10 结束: 2025-10-15 个性化学习 数据算法赛
第 8 名解决方案 - Takashi Someya
作者: Takashi Someya (Grandmaster)
发布时间: 2025-10-16
竞赛排名: 第 8 名
获赞数: 37

第 8 名解决方案

非常感谢 Kaggle 团队和组织者举办如此有趣的竞赛。我很高兴能获得个人金牌。

概述

  • 使用 vLLM + 多个模型集成加速推理
  • 将问题的答案选项添加到提示词中
  • 搜索最佳学习率和批量大小
  • 为样本少或难以预测的标签创建合成数据

模型

  • 任务类型:选择为因果语言模型(Causal LM),因为它易于使用 vLLM 加速。
  • 架构:根据我的实验,Qwen2.5 和 Qwen3 在我探索的架构中表现最好。
  • 最终使用的模型:
    • Qwen/Qwen2.5-7B
    • Qwen/Qwen2.5-14B-Instruct-AWQ
    • Qwen/Qwen3-8B
    • Qwen/Qwen3-14B-AWQ
  • 训练:所有模型均使用 LoRA 训练。

提示词工程 (Prompting)

这个讨论 中,我发现学生是通过从 a–d 中选择一个选项来回答的。

Math Question Example

因此,我从 StudentExplanation 重构了 MC_Answer 与选项 a–d 之间的对应关系,并按如下方式修改了 QuestionText

Which number is the greatest? (a) 6 (b) 6.2 (c) 6.079 (d) 6.0001

我相信这有助于预测,因为它允许模型将学生的 MC_Answer 与其他选项进行比较,并识别相应的 Misconception(误解)。

最终提示词如下:

You are a specialist in identifying the types of misunderstandings that arise from students'answers to math problems.
Based on the information provided below, please determine what kind of misunderstanding the student has.

Question: What fraction of the shape is not shaded? Give your answer in its simplest form. [Image: A triangle split into 9 equal smaller triangles. 6 of them are shaded.] (a) 1/3 (b) 3/6 (c) 3/8 (d) 3/9
Answer: 1/3
Correct: Yes
Student Explanation: 0ne third is equal to tree nineth
Type of Misunderstanding:

为了在后续合成数据创建和 EDA 期间提高可读性,我从 QuestionTextMC_Answer 中删除了 LaTeX 符号(注意:这对分数没有影响)。

这个 notebook 的启发,我将目标标签映射到以下符号并生成单个 token。

special_character_list = [
    '■', '□', '▲', '△', '▼', '▽', '◆', '◇', '○', '●', '★', '☆',
    '♦', '♥', '♠', '♣', '§', '†', '‡', '※', '∞', '±', '≠', '≈', '√',
    '∑', '∏', '∆', 'Ω', 'μ', '∂','→', '←', '↑', '↓', '↔', '↕', '〈', '〉',
    '『', '』', '│', '─', '┌', '┐', '└', '┘', '┼', '█', '▓', '▒','£',
    '¥', '€', '₩', '©', '®', '™', '♪','♫', '☀', '☁', '☂', '☃', '☎'
]

special_token = [tokenizer(i, add_special_tokens=False).input_ids[0] for i in special_character_list]

这些符号中的每一个都对应 Qwen 分词器中的单个 token。

训练

  • Epochs: 3
  • Optimizer: AdamW (weight_decay = 0.01)
  • Scheduler: cosine (warmup_ratio = 0.03)
  • Batch size: 12
  • Learning rate: 0.0002
  • LoRA 配置
    • r: 16
    • alpha: 16
    • dropout: 0.05
    • target_modules:
      • q_proj
      • k_proj
      • v_proj
      • o_proj
      • gate_proj
      • up_proj
      • down_proj

我在超参数试验期间注意到,批量大小和学习率的微小变化可能会导致 CV 分数大幅波动。因此,我仔细调整了这两个参数并搜索了最佳组合。
改变 LoRA 的 ralpha 并没有带来分数的有意义提升。
与全参数微调相比,LoRA 在我的运行中实现了更好的 CV(可能是因为我在全参数训练方面的调整不足)。

数据

由于竞赛标签显示出不平衡和预测难度的差异,我尝试使用生成式 AI(gpt-5o3)创建合成数据。
我首先在竞赛数据上训练了一个模型,并使用 MAP@3 计算折外 (OOF) 预测。然后,我聚合了每个 (QuestionId, Category, Misconception) 对的平均 MAP@3 和样本数量。对于平均 MAP@3 低或样本少的对,我使用竞赛数据作为少样本示例生成合成数据。生成提示词包括 CategoryMisconception 描述,并指示模型创建最多 50 个新样本。少样本示例要么是均匀随机采样,要么是随机从 OOF 分数低的项目中采样。我重复生成多次,总共获得约 30,000 个合成样本。

我使用不同的合成数据配置训练模型,并将它们用于集成。合成数据的贡献似乎适中——在 leaderboard 上可能 ≤ 0.001。(如果 leaderboard 精度提高,我计划更详细地调查这一点。)

最终提交

  • 集成: 10 个实验设置(每个设置训练 5 折 → 总共 10 × 5 = 50 个模型)
  • 最终提交: 选择了 LB 最佳集成和 CV 最佳集成;LB 最佳在私有 LB 上表现更好。
  • 权重: 根据 LB 和 CV 结果应用权重

LB 最佳结果

公共 LB: 0.951, 私有 LB: 0.948

模型 合成数据 公共 LB (排名) 私有 LB 权重
Qwen/Qwen2.5-7B 0.949 (#7) 0.944 0.5
Qwen/Qwen2.5-7B 0.949 (#8) 0.945 0.5
Qwen/Qwen2.5-7B 0.949 (#1) 0.946 1.5
Qwen/Qwen2.5-14B-Instruct-AWQ 0.949 (#6) 0.946 1.5
Qwen/Qwen3-8B 0.949 (#5) 0.945 1.0
Qwen/Qwen3-8B 0.949 (#4) 0.945 1.0
Qwen/Qwen3-8B 0.949 (#9) 0.944 0.5
Qwen/Qwen3-8B 0.949 (#10) 0.946 0.5
Qwen/Qwen3-14B-AWQ 0.949 (#3) 0.945 1.5
Qwen/Qwen3-14B-AWQ 0.949 (#2) 0.945 1.5

*排名表示当提交页面按公共 LB 排序时提交的位置。

同比赛其他方案