Files
myWiki/concepts/dqw.md

56 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Difficulty-Aware Question-Level Weighting (DQW)"
created: 2026-05-12
updated: 2026-05-12
type: concept
tags: ["grpo", "difficulty-aware", "importance-weighting"]
sources: ["arxiv:2601.20614"]
---
# Difficulty-Aware Question-Level Weighting (DQW)
**DQW** 是 [[dgpo|DGPO]] 的第二步组件,在 [[dgae|DGAE]] 平衡更新幅度的基础上,通过 softmax 温度加权**显式优先学习更难的问题**。
## 公式
$$\lambda_s = B_v \cdot \frac{\exp(D_s/T)}{\sum_{s'=1}^{B_v} \exp(D_{s'}/T)}, \quad D_s = -\text{mean}(\{r_{si}\}_{i=1}^G)$$
其中:
- $D_s$:问题难度分数 = 负平均正确率(越高越难)
- $T$:温度参数(控制分布锐度,默认 2.0
- $B_v$batch 中有效问题数量
## 设计原则
### Balance-then-Reweight
DQW 遵循**先平衡再加权**的原则:
1. [[dgae|DGAE]]:消除 GRPO 固有的更新幅度不平衡
2. DQW在平衡基础上显式加权
相比直接对优势进行难度重加权(如 GRPO-AD这种两步法具有更好的**可解释性**和**可控性**。
### 仅对有效问题加权
只有**有效问题**(非全对/全错)才参与 DQW 加权:
- 全对问题:$D_s = -1$,梯度为零(已完全掌握)
- 全错问题:$D_s = 0$,无正样本可供学习
### DQW 与组合方法
DGPO 与 DAPO 组合时DQW 的难度分数 $D_s$ **仅基于 accuracy reward** 计算,排除 length penalty 等辅助奖励。这确保问题加权反映的是**逻辑难度**而非回答长度偏好。
## 与相关方法的对比
| 方法 | 机制 | 复杂度 |
|------|------|--------|
| **DQW** | Softmax 温度加权 | 低1 个超参数 T |
| GRPO-AD | 优势重加权 | 高(多超参数) |
## 相关概念
- [[dgae|DGAE]] — 第一步:难度平衡
- [[dgpo|DGPO]] — 算法整体
- [[mathforge]] — 完整框架
- [[dai-mathforge-2026|论文页面]]