Files
myWiki/concepts/dynamic-token-limit.md

1.6 KiB
Raw Blame History

title, created, updated, type, tags, sources
title created updated type tags sources
动态 Token 限制 (Dynamic Token Limit) 2026-06-18 2026-06-18 concept
token-efficiency
hybrid-reasoning
reward-hacking
gan-thinking-based-non-thinking-2026

动态 Token 限制 (Dynamic Token Limit)

动态 Token 限制是 TNT 的核心技术:为每个查询单独设定非思考模式响应的最大 token 使用量而非所有查询使用统一上限Gan et al., 2026

为什么需要动态限制

统一上限的失败AdaptThink 方案)

Zhang et al. (2025) 的 AdaptThink 为所有查询设定同一个较小的 max token

  • 简单查询的思考模式 solution 可能少于 100 tokens
  • 复杂查询的自然非思考回答可能需要 300+ tokens
  • 统一上限要么漏检简单查询的 reward hacking要么误伤复杂查询的合法非思考响应

TNT 的动态方案

L_N^x = ω × mean(solution_length of thinking_mode_responses for x)
  • 简单查询 → L_N^x 小 → 严格检测 reward hacking
  • 复杂查询 → L_N^x 大 → 给予合法非思考响应足够空间
  • ω = 2 提供 2 倍容错边界,防止轻微偏差被误判

实现细节

  • 每次训练步对每个 prompt x 采样 K 个响应
  • 从思考模式响应集合 M_T^x 计算平均 solution 长度
  • 若 M_T^x 为空on-policy 采样未产生思考响应),回退到 L_∅ = 1000
  • 使用 token 级策略梯度GRPO进行训练

参考