Phi-4-Reasoning 技术报告解读:可教学数据过滤与推理能力训练

解读微软 Phi-4-reasoning 的数据工程:从公开网站、已有数据集与合成问题收集种子题库,再按问题是否处于可教学难度区间筛选样本,并梳理其监督微调与强化学习两阶段后训练方案。

Phi-4-reasoning 技术报告摘要

论文:Phi-4-reasoning Technical Report
团队:Microsoft
时间:2025.04(arXiv:2504.21318)
页数:33页


1. 预训练 Recipe

项目详情
本报告不涉及预训练Phi-4-reasoning基于已有Phi-4 (14B)做post-training
基座Phi-4 (14B参数),已在大量创新合成数据上预训练,MATH/GPQA等基准已超GPT-4o

2. 后训练 Recipe (SFT)

训练策略

项目详情
方法Supervised Fine-Tuning on Phi-4
Teachero3-mini 生成高质量reasoning traces作为训练target
数据量1.4M+ prompts with long reasoning traces
核心理念Data-centric approach:关键在数据筛选而非算法创新

关键设计:Seeds Database + “Teachable” Filtering

Seeds收集:

  • 来源:公开网站、已有数据集、licensed collections +合成生成的问题(grounded in高质量web content)
  • 覆盖:STEM reasoning + coding + general QA + alignment/safety

“Teachable” 过滤(核心创新):

  • 问题:Phi-4基础推理能力已很强,很多seed问题已能正确回答,学习价值低
  • 做法:专门筛选”right level of complexity and diversity”的样本——既不太简单(模型已会)也不太难(无法从demonstration中学到)
  • 目标:选出对模型当前能力来说最有教学价值的样本

Training Data构成

项目详情
Response生成用o3-mini为每个seed生成reasoning trace + final answer
格式长chain-of-thought + structured response
SFT目标让Phi-4学会生成extended CoT来利用inference-time compute

3. RL Recipe (Phi-4-reasoning-plus)

训练策略

项目详情
方法Outcome-based Reinforcement Learning (短phase)
基座Phi-4-reasoning (SFT后)
数据量6,400 problems(math-focused, verifiable solutions)
效果显著提升math和reasoning性能,通过生成更长reasoning traces
注意无coding数据,因此LiveCodeBench未获提升

关键设计:Length-Aware Accuracy Reward

Rule-based reward,不使用neural reward model(避免reward hacking)。设计如下:

Correctanswer (R_acc_raw=1):

  • 如果response长度 ≤ L_pos_control(25,600 tokens):reward接近1.0
  • 如果超过L_pos_control:通过cosine scaling从1.0渐降至0.5
  • 意图:鼓励正确时生成简洁输出

Incorrect answer (R_acc_raw=0):

  • 如果response长度 ≥ L_neg_control(3,702 tokens):penalty接近-0.5
  • 如果低于L_neg_control:penalty通过cosine scaling从-0.5降至-1.0
  • 意图:错误时鼓励模型think更多(更长),惩罚思考不足就给出错误答案

Format violations: 手动override reward

额外reward组件:

  • Correctness (binary via answer extraction +\boxed{} tag + LLM verifier)
  • Repetition penalty
  • Excessive length penalty
  • Response formatting reward

Infra设计

项目详情
原文未详述RL Infra-

4. 关键亮点

  1. “Teachable” Data Filtering:选出对模型当前能力最有教学价值的样本,而非盲目大量数据
  2. o3-mini as Teacher:用frontier model生成高质量reasoning traces做SFT
  3. 仅6.4K problems做RL:极少量高质量可验证数学题即可显著提升reasoning(data quality >> quantity)
  4. Length-Aware Reward:正确时鼓励简洁,错误时鼓励多思考的asymmetric设计
  5. 14B参数接近DeepSeek-R1(671B):在AIME/HMMT/OmniMath上接近甚至匹敌
  6. Non-trivial Transfer:reasoning能力提升迁移到general-purpose benchmarks
本文结束 感谢您的阅读