add warm 4 + top5/top10 results, K sweet spot found at K=5
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144# AIPF Youth 严重度分类 — Warm-Start 实验结果数据:1000 条 golden_set(200 Y / 800 A)ruler:200 条模型:Gemini 2.5 Flash(pairwise judge)默认阈值:rank<106,score≥44.72---## 一. 三组核心配置对比| 维度 | cold 4 轮 | cold 8 轮 | **warm-start** ||---|---:|---:|---:|| TP(默认 by rank) | 190 | 188 | **184** || FP | 77 | 68 | **60** ⬇ || TN | 723 | 732 | **740** ⬆ || FN | 10 | 12 | **16** ⬆ || **Precision (默认)** | 0.7116 | 0.7344 | **0.7541** ⬆ || **Recall (默认)** | 0.9500 | 0.9400 | **0.9200** ⬇ || **F1 by rank (默认 thr=106)** | 0.8137 | 0.8246 | **0.8288** ⬆ || **F1 by score (默认 thr=44.72)** | 0.8137 | 0.8210 | **0.8274** ⬆ || max F1 by rank(扫阈值) | 0.8137 @ thr=113 | **0.8545** @ thr=98 | 0.8409 @ thr=98 || max F1 by score(扫阈值) | 0.8176 @ thr=46.33 | **0.8585** @ thr=49.02 | 0.8421 @ thr=48.90 |## 二. Warm-start 详细指标### 默认阈值 by rank (rank < 106)| | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| | 184 | 60 | 740 | 16 | **0.7541** | 0.9200 | **0.8288** |### 默认阈值 by score (score ≥ 44.72)| | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| | 187 | 65 | 735 | 13 | 0.7421 | 0.9350 | 0.8274 |### 扫阈值最优 by rank (best thr=98)| | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| | 177 | 44 | 756 | 23 | **0.8009** | 0.8850 | **0.8409** |### 扫阈值最优 by score (best thr=48.90)| | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| | 176 | 42 | 758 | 24 | **0.8073** | 0.8800 | **0.8421** |---## 三. 关键变化(warm vs cold-8)| 项 | cold 8 | warm | Δ ||---|---:|---:|---:|| F1 (默认 by rank) | 0.8246 | 0.8288 | **+0.0042** ⬆ || F1 (默认 by score) | 0.8210 | 0.8274 | **+0.0064** ⬆ || F1 (max by rank, 扫阈值) | 0.8545 | 0.8409 | **-0.0136** ⬇ || F1 (max by score, 扫阈值) | 0.8585 | 0.8421 | **-0.0164** ⬇ || Precision (默认) | 0.7344 | 0.7541 | +0.0197 || Recall (默认) | 0.9400 | 0.9200 | -0.0200 || FP | 68 | 60 | -8 || FN | 12 | 16 | +4 |**Warm-start 的 trade-off**:少误判 8 个 A(FP -8),但漏判 4 个 Y(FN +4),整体偏向"更保守"。---## 四. 全方法横向对比(更新版,按 best F1 排序)| 排名 | 方法 | 默认 F1 | best F1 | LLM 调用 ||---:|---|---:|---:|---:|| 1 | Gemini 2.5 Flash 直打分 | 0.8416 | **0.8647** | N || 2 | AIPF cold 8 by score(扫阈值) | 0.8210 | 0.8585 | 8N || 3 | AIPF cold 8 by rank(扫阈值) | 0.8246 | 0.8545 | 8N || 4 | GPT-4.1 直打分 | 0.8524 | 0.8544 | N || 5 | **AIPF warm by score(扫阈值)** | **0.8274** | 0.8421 | 4~8N || 6 | **AIPF warm by rank(扫阈值)** | **0.8288** | 0.8409 | 4~8N || 7 | AIPF warm by rank(默认 thr) | **0.8288** | — | 4~8N || 8 | AIPF cold 8 by rank(默认 thr) | 0.8246 | — | 8N || 9 | AIPF cold 4 by score(扫阈值) | 0.8137 | 0.8176 | 4N || 10 | AIPF cold 4 by rank(默认 thr) | 0.8137 | — | 4N || 11 | embedding ridge: emb→score | 0.33 | 0.5891 | 0 || 12 | embedding PCA128+ridge | 0.33 | 0.5855 | 0 || 13 | embedding severity_axis (1D) | 0.33 | 0.5791 | 0 || 14 | embedding LDA | 0.33 | 0.5609 | 0 || 15 | embedding raw cosine + top100 weighted | 0.33 | 0.5574 | 0 || 16 | embedding kNN-100 mean(ruler_score) | 0.33 | 0.5535 | 0 || 17 | embedding ≥4/5 投票 (top5) | 0.5227 | — | 0 || 18 | embedding majority (≥3/5) (top5) | 0.4888 | — | 0 || 19 | embedding top1 rank<106 | 0.4565 | — | 0 |---## 五. 结论### 默认阈值场景:warm-start 是赢家不调阈值直接部署:- cold 4: F1=0.8137- cold 8: F1=0.8246- **warm-start: F1=0.8288** ⭐warm-start 比 cold 8 默认还高 +0.004,说明 embedding 起点把 P 提上去了。### 扫阈值场景:cold 8 仍是上限允许扫阈值时:- **cold 8 max: F1=0.8585** ⭐- warm max: F1=0.8421- cold 4 max: F1=0.8176warm-start 反而比 cold 8 最优低 0.016。原因可能是 embedding 起点让 TrueSkill 的探索过早收敛,输出 score 分布的可分性下降。### 性价比对比| 方法 | F1 | LLM 调用 | F1 / 调用比 ||---|---:|---:|---:|| Gemini 直打分 | 0.8647 | 1N | 0.865 || AIPF cold 8 | 0.8585 | 8N | 0.107 || AIPF warm | 0.8421 | 4~8N | 0.105~0.211 || AIPF cold 4 | 0.8176 | 4N | 0.204 |LLM 直打分一骑绝尘。AIPF warm 如果用的是 4 轮,**每次 LLM 调用 F1 收益和 cold 4 相当但绝对值高 +0.024**,是 AIPF 套路下的最优解。---## 六. 待确认 / 待补实验| 项 | 还没确认 ||---|---|| Warm-start 用了几轮(4 / 8) | 看 `rounds_completed` 字段 || Warm-start 用了什么 K(top1 / top5 / top100)的 estimated_position | 看跑前 `add_estimated_position.py --k` 参数 || Warm 4 vs cold 4 直接对照 | 需要再跑一组 num_rounds=4 + warm || Warm 2 vs cold 4 对照 | 极限省调用实验 |诊断 warm 真实使用轮数:```bashRUN_DIR=$(ls -td example/yss_ruler_eval/runs/20260429/*/ | head -1)RESULTS=$(ls $RUN_DIR/outputs/find_positions/*/results_*.json | head -1)python3 -c "import jsonfrom collections import Counterdata = json.load(open('$RESULTS'))rounds = [d.get('rounds_completed') for d in data]print('rounds 分布:', dict(sorted(Counter(rounds).items())))print('平均:', sum(rounds)/len(rounds))"```123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140# AIPF Warm-Start 完整实验结果数据:1000 条 golden_set(200 Y / 800 A)| ruler 200 条 | LLM = Gemini 2.5 Flash默认阈值:rank<106,score≥44.72## 一. 6 组配置完整对比| 配置 | LLM 调用 | F1 by rank(默认) | F1 by score(默认) | max F1 by rank(扫) | max F1 by score(扫) ||---|---:|---:|---:|---:|---:|| cold 4 | 4N | 0.8137 | 0.8137 | 0.8137 (thr=113) | 0.8176 (thr=46.33) || cold 8 | 8N | 0.8246 | 0.8210 | **0.8545** (thr=98) | **0.8585** (thr=49.02) || **warm 4 + top5** | **4N** | **0.8322** ⭐ | 0.8282 | 0.8426 (thr=99) | 0.8516 (thr=49.47) || warm 4 + top10 | 4N | 0.8151 | 0.8212 | 0.8317 (thr=98) | 0.8346 (thr=49.48) || warm 4 + top100 | 4N | 0.8017 | 0.7974 | 0.8354 (thr=93) | 0.8395 (thr=50.48) || warm 8 + top100 | 8N | 0.8288 | 0.8274 | 0.8409 (thr=98) | 0.8421 (thr=48.90) |## 二. 详细 4 组核心配置(TP/FP/TN/FN)### cold 4| 维度 | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| by rank | 190 | 77 | 723 | 10 | 0.7116 | 0.9500 | 0.8137 || by score | 190 | 77 | 723 | 10 | 0.7116 | 0.9500 | 0.8137 |### cold 8| 维度 | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| by rank | 188 | 68 | 732 | 12 | 0.7344 | 0.9400 | 0.8246 || by score | 188 | 70 | 730 | 12 | 0.7287 | 0.9400 | 0.8210 |### warm 4 + top5 ⭐| 维度 | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| by rank(默认) | 186 | 61 | 739 | 14 | 0.7530 | 0.9300 | **0.8322** || by score(默认) | 188 | 66 | 734 | 12 | 0.7402 | 0.9400 | 0.8282 || max by rank(thr=99) | 182 | 50 | 750 | 18 | 0.7845 | 0.9100 | 0.8426 || max by score(thr=49.47) | 175 | 36 | 764 | 25 | 0.8294 | 0.8750 | 0.8516 |### warm 4 + top10| 维度 | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| by rank(默认) | 183 | 66 | 734 | 17 | 0.7349 | 0.9150 | 0.8151 || by score(默认) | 186 | 67 | 733 | 14 | 0.7352 | 0.9300 | 0.8212 || max by rank(thr=98) | 173 | 43 | 757 | 27 | 0.8009 | 0.8650 | 0.8317 || max by score(thr=49.48) | 169 | 36 | 764 | 31 | 0.8244 | 0.8450 | 0.8346 |### warm 4 + top100| 维度 | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| by rank(默认) | 186 | 78 | 722 | 14 | 0.7045 | 0.9300 | 0.8017 || by score(默认) | 187 | 82 | 718 | 13 | 0.6952 | 0.9350 | 0.7974 || max by rank(thr=93) | 165 | 30 | 770 | 35 | 0.8462 | 0.8250 | 0.8354 || max by score(thr=50.48) | 170 | 35 | 765 | 30 | 0.8293 | 0.8500 | 0.8395 |### warm 8 + top100| 维度 | TP | FP | TN | FN | P | R | F1 ||---|---:|---:|---:|---:|---:|---:|---:|| by rank(默认) | 184 | 60 | 740 | 16 | 0.7541 | 0.9200 | 0.8288 || by score(默认) | 187 | 65 | 735 | 13 | 0.7421 | 0.9350 | 0.8274 || max by rank(thr=98) | 177 | 44 | 756 | 23 | 0.8009 | 0.8850 | 0.8409 || max by score(thr=48.90) | 176 | 42 | 758 | 24 | 0.8073 | 0.8800 | 0.8421 |## 三. K 的 sweet spot 分��(warm 4 系列)| K | F1 默认 by rank | max F1 by score ||---|---:|---:|| 5 | **0.8322** ⭐ | **0.8516** ⭐ || 10 | 0.8151 | 0.8346 || 100 | 0.8017 | 0.8395 |**top5 全面胜出**:默认 F1 比 top10 高 +0.017、比 top100 高 +0.031;最优 F1 比 top10 高 +0.017。原因:top100 邻居均值集中在窄带(74~116),起点信号被压扁;top5 散度合适,既稳又锐。## 四. 性价比对比(每次 LLM 调用换多少 F1)| 方法 | F1 (默认) | LLM 调用 | F1 / 调用 ||---|---:|---:|---:|| Gemini 直打分 | 0.8416 | 1N | **0.8416** ⭐ || **warm 4 + top5** | **0.8322** | **4N** | **0.2081** || GPT-4.1 直打分 | 0.8524 | 1N | 0.8524 || cold 4 | 0.8137 | 4N | 0.2034 || warm 8 + top100 | 0.8288 | 8N | 0.1036 || cold 8 | 0.8246 | 8N | 0.1031 |LLM 直打分一骑绝尘。AIPF 系里 **warm 4 + top5 性价比最高**:相同 4 轮预算下比 cold 4 多 +0.0185 F1。## 五. 全方法横向对比(按 best F1 排序)| 排名 | 方法 | 默认 F1 | best F1 | LLM 调用 ||---:|---|---:|---:|---:|| 1 | Gemini 2.5 Flash 直打分 | 0.8416 | **0.8647** | N || 2 | AIPF cold 8 by score(扫) | 0.8210 | 0.8585 | 8N || 3 | AIPF cold 8 by rank(扫) | 0.8246 | 0.8545 | 8N || 4 | GPT-4.1 直打分 | 0.8524 | 0.8544 | N || 5 | **AIPF warm 4 + top5 by score(扫)** | **0.8282** | **0.8516** | **4N** || 6 | **AIPF warm 4 + top5 by rank(扫)** | **0.8322** ⭐ | 0.8426 | **4N** || 7 | AIPF warm 8 + top100 by score(扫) | 0.8274 | 0.8421 | 8N || 8 | AIPF warm 8 + top100 by rank(扫) | 0.8288 | 0.8409 | 8N || 9 | AIPF warm 4 + top100 by score(扫) | 0.7974 | 0.8395 | 4N || 10 | AIPF warm 4 + top10 by score(扫) | 0.8212 | 0.8346 | 4N || 11 | AIPF warm 4 + top100 by rank(扫) | 0.8017 | 0.8354 | 4N || 12 | AIPF warm 4 + top10 by rank(扫) | 0.8151 | 0.8317 | 4N || 13 | AIPF cold 4 by score(扫) | 0.8137 | 0.8176 | 4N || 14 | AIPF cold 4 by rank(默认) | 0.8137 | 0.8137 | 4N || 15 | embedding ridge: emb→score | 0.33 | 0.5891 | 0 || 16 | embedding PCA128 + ridge | 0.33 | 0.5855 | 0 || 17 | embedding severity_axis (1D) | 0.33 | 0.5791 | 0 || 18 | embedding raw cosine + top100 weighted | 0.33 | 0.5574 | 0 || 19 | embedding ≥4/5 投票 (top5) | 0.5227 | — | 0 || 20 | embedding top1 rank<106 | 0.4565 | — | 0 |## 六. 三个核心结论### 1. warm 4 + top5 是 AIPF 系最优- 比 cold 4 提 +0.019 F1(默认)- 比 cold 8 提 +0.008 F1(默认),LLM 调用减半- 比 cold 8 max F1 仅低 0.007(扫阈值场景)### 2. K 选择决定 warm-start 成败- K=5 sweet spot- K=100 信号被压扁(estimated_position 集中在窄带)- K=10 中等,不如 K=5### 3. 部署建议| 场景 | 推荐 ||---|---|| 不调阈值直接用,预算紧 | **warm 4 + top5**(F1=0.8322,4N 调用) || 不调阈值直接用,预算够 | warm 8 + top100(F1=0.8288)或 warm 4 + top5 都行 || 允许扫阈值,追求最高 F1 | cold 8(max F1=0.8585,8N 调用) || 极致 F1/成本比 | Gemini 直打分(F1=0.8647,1N 调用) |## 七. 待补实验| 项 | 已跑 | 待跑 ||---|---|---|| warm 4 + top1 | ❌ | 极端样本起点会怎样 || warm 4 + top3 | ❌ | top5 邻域内更细的扫描 || warm 8 + top5 | ❌ | top5 起点 + 8 轮探索是不是 AIPF 的天花板 || warm 6 + top5 | ❌ | 5/8 中间值 |
aipf_warmstart_results.md+116-120