<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qwen3.8-27B「思考深度档位」优化]]></title><description><![CDATA[<h1>Qwen3.8-27B「思考深度档位」优化</h1>
<ul>
<li>日期：2026-08-18</li>
<li>说明：以下是agent分析关于Qwen3.8-27B思考深度的一部分摘录，主要是有关“模板注入的系统指令”的原理和如何优化，弄懂这个些，我们就可以根据自己的情况来修改和布局自定义的思考深度挡位了。</li>
</ul>
<hr />
<h2>1. 四个档位到底是什么</h2>
<p dir="auto">用一个比喻：考试答题前发卷时附的一张<strong>答题说明</strong>，不同档位 = 不同的说明纸。</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>档位</th>
<th>模板实际行为</th>
<th>白话解释</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>off</strong></td>
<td><code>enable_thinking=false</code>，生成提示词直接带空的</td>
<td>直接交卷，零思考</td>
</tr>
<tr>
<td><strong>low</strong></td>
<td>开启think，注入："Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration."</td>
<td>草稿纸只许写几行，直奔答案</td>
</tr>
<tr>
<td><strong>medium</strong></td>
<td>开启think，<strong>不注入任何额外指令</strong></td>
<td>草稿纸随便你用，自便</td>
</tr>
<tr>
<td><strong>xhigh</strong>（模板默认值）</td>
<td>开启think，注入："Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer."</td>
<td>按规矩做多步思考与检查</td>
</tr>
</tbody>
</table>
<p dir="auto">特性：</p>
<ul>
<li><strong>关键机制</strong>：三档之间没有任何硬 token 预算或采样参数差异——区别纯粹是注入 system prompt 的"思考契约文本"不同。所以只需要修改chat_template.jinja中相关内容即可。</li>
<li><strong>xhigh 是模板默认</strong>：请求不带 <code>reasoning_effort</code> 参数时，模板自动按 xhigh 处理（<code>reasoning_effort|default('xhigh')</code>）。</li>
<li><strong>题目决定一切</strong>：对简单题，三个档位的思考长度几乎一样（实测 60–75 token）；差异只在难题上显现，而且<strong>不是单调的</strong>（见 3.1 的实测教训）。</li>
</ul>
<hr />
<h2>2. 如何验证"现在用的是哪个档"（当日实测可用的四种方法）</h2>
<p dir="auto">按权威性从高到低：</p>
<ol>
<li>
<p dir="auto"><strong>会话记录（最权威）</strong>——请求头的配置原样存档：</p>
<pre><code class="language-bash">zstd -dc /root/.dsh/sessions/&lt;工作目录&gt;/session-&lt;id&gt;/session.jsonl.zstd \
  | grep -o '.\{80\}reasoningEffort.\{120\}' | head -2
</code></pre>
<p dir="auto">当日结果：<code>{"provider":"sglang","model":"Qwen3.8-27B-AWQ","reasoningEffort":"high","maxTokens":32000}</code> → 本会话 = high = xhigh。</p>
</li>
<li>
<p dir="auto"><strong>看 system 提示词开头</strong>——模板只会为 xhigh 注入<br />
"Reasoning effort is set to xhigh..." 这一句；medium 不注入任何句子，low 是另一句。谁发的文，一眼可辨；也可以直接问模型"你 system 提示词的第一行是什么"。</p>
</li>
<li>
<p dir="auto"><strong>服务端自报家门</strong>：</p>
<pre><code class="language-bash">curl -s http://127.0.0.1:18080/get_model_info        # 拿到模型目录路径
grep -n "reasoning_effort" &lt;模型目录&gt;/chat_template.jinja   # 看档位定义
</code></pre>
<p dir="auto">再用一个故意非法的值探针，模板会把支持的档位念出来：</p>
<pre><code class="language-bash">curl -s http://127.0.0.1:18080/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "model":"Qwen3.8-27B-AWQ",
  "messages":[{"role":"user","content":"hi"}],
  "max_tokens":4,
  "chat_template_kwargs":{"reasoning_effort":"bogus"}}'
# → 400: "Unexpected reasoning effort bogus.
#    Supported types are xhigh (default), medium, and low."
</code></pre>
</li>
<li>
<p dir="auto"><strong>A/B 实测</strong>——同一个问题按不同档位各打一发，对比 <code>usage.reasoning_tokens</code>：<br />
实测对照（提示词 tokens / 思考 tokens）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>探针</th>
<th>prompt tokens</th>
<th>reasoning tokens</th>
</tr>
</thead>
<tbody>
<tr>
<td>简单题·不带参数（默认 xhigh）</td>
<td>64</td>
<td>63</td>
</tr>
<tr>
<td>简单题·low</td>
<td>52</td>
<td>75</td>
</tr>
<tr>
<td>简单题·medium</td>
<td>22</td>
<td>67</td>
</tr>
<tr>
<td>简单题·xhigh</td>
<td>64</td>
<td>60</td>
</tr>
<tr>
<td>简单题·off（enable_thinking=false）</td>
<td>24</td>
<td>0</td>
</tr>
<tr>
<td>难题（max_tokens=1024）·low</td>
<td>—</td>
<td>867</td>
</tr>
<tr>
<td>难题·medium</td>
<td>—</td>
<td><strong>1024（顶到上限被截断，正文未生成）</strong></td>
</tr>
<tr>
<td>难题·xhigh</td>
<td>—</td>
<td>661</td>
</tr>
</tbody>
</table>
</li>
</ol>
<hr />
<h2>3. 如何优化「模板注入的系统指令」</h2>
<h3>3.1 为什么旧措辞"不够好"（诊断方法）</h3>
<p dir="auto">旧指令的词表是形容词：<strong>brief / carefully / validate / consider / prioritize</strong>。<br />
实测教训（难题 A/B，max_tokens=1024）：</p>
<ul>
<li><strong>medium 掉进"recheck 循环"</strong>：思考里反复出现 "Wait, that doesn't match. Let me recheck."，1024 个 token 全部烧完，思考在"正要重算"的半截被掐断，正文一个字都没出——<strong>思考没收尾，答案也不存在</strong>，这是最坏的结局；</li>
<li><strong>xhigh 反而想得最浅</strong>（661 &lt; low 的 867 &lt; medium 的 1024）："认真思考"这套话对这个模型没有强制力，深度高低完全看运气。</li>
</ul>
<p dir="auto">诊断口诀：<strong>指令没有操作性定义（多少算 brief？怎么验？何时停？），模型就把它当耳旁风。</strong></p>
<h3>3.2 四条写作法（把形容词换成可执行的契约）</h3>
<ol>
<li><strong>给锚点</strong>：用数字，不用形容词。"at most 30 words" 远比 "brief" 可执行；模型对具体数量的服从性好得多。</li>
<li><strong>给策略与分情形</strong>：一步能答的题 → 不提思路直接答；多步题 → 先列至多四步的短计划；有两条可行路径 → 比较一次就拍板（防止组合爆炸式的穷举）。</li>
<li><strong>肯定式的停止条件 + 熔断</strong>："The instant you can write the answer, stop."；"修正至多两次"；<strong>明令禁止重做同一件事</strong>（专治 A/B 里 medium 的 recheck 循环）。</li>
<li><strong>尺度与场景条款</strong>：琐碎任务每个阶段只许一行（防小题大做）；tools 场景声明"调用前先说出预期结果，拿结果对照预期，诊断至多两轮"（防 agent 循环里写三页作战计划）。</li>
</ol>
<h3>3.3 示例：当日写好的三个重写（可直接替换模板对应赋值）</h3>
<p dir="auto"><strong>① low·极简锚点版</strong></p>
<pre><code class="language-text">Reasoning effort is set to low.
Think in at most ~30 words: state the approach in one line,
compute the key intermediate value if any, then answer.
Stop the moment you can write the answer;
do not re-verify or explore alternatives.
</code></pre>
<p dir="auto"><strong>② low·分情形策略版</strong></p>
<pre><code class="language-text">Reasoning effort is set to low.
If the task is answerable in one step, skip deliberation and answer directly.
If it is multi-step, write a one-line-per-step plan (at most 5 lines),
then execute it straight through without checking your work.
Verification and alternative approaches are reserved for other effort levels:
when in doubt, brevity wins.
</code></pre>
<p dir="auto"><strong>③ xhigh·升级版</strong>（五道工序 + 强制收敛；英文版供模板，中文版供对照或直接替换）</p>
<pre><code class="language-text">Reasoning effort is set to xhigh: deep reasoning with a mandatory
convergence rule.
First restate the task in one to three sentences and name any
assumption you adopt where information is missing — do not silently
fill gaps.
If the task is multi-step, list a short plan of at most four steps
before solving, and if two solution paths look plausible,
compare them once and commit to one.
Solve cleanly, then verify the result by an independent method —
back-substitution, a units or magnitude check, or a second short
derivation — never by re-doing the same work.
If a check disagrees, diagnose the discrepancy and revise at most twice;
two agreeing derivations are enough.
Stop thinking the instant the answer is verified, then give the
final answer directly and concisely, state the assumptions you relied
on, and mark anything you are genuinely unsure about as such.
On trivial tasks each step above is at most one line.
</code></pre>
<pre><code class="language-text">思考深度设为 xhigh：深入推理，带强制收敛规则。
先用一两句话复述任务；信息缺失处明确声明你采用的假设，不许默填。
多步任务先列不超过四步的短计划；若两条路径都可行，比较一次即拍板。
干净解出后，用独立方法验证——回代、量纲或数量级检查、或另一条短推导——
禁止重做同一件事。
校验不符时定位原因，至多修正两次；两条推导一致即可收笔。
答案一经验证，立即停止思考，直接给出简洁的最终回答，
交代所依赖的假设，真正的不确定处如实标注。
琐碎任务中以上每步各一行即可。
</code></pre>
<p dir="auto"><strong>④ off 无需改</strong>：结构上就是空 think，天然安全，不用动。</p>
<p dir="auto">改写对照（看每一句在治什么）：</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>旧 xhigh 原句</th>
<th>病灶</th>
<th>升级版对策</th>
</tr>
</thead>
<tbody>
<tr>
<td>"think carefully"</td>
<td>无操作性；实测反而想得最浅</td>
<td>Restate→Plan→Execute→Verify→Conclude 五段工序，深度由结构决定</td>
</tr>
<tr>
<td>"validate key assumptions"</td>
<td>没规定怎么验；A/B 中掉 recheck 循环直至被截断</td>
<td>必须独立方法（回代/量级/第二推导），禁止重做同一件事，修正至多两次</td>
</tr>
<tr>
<td>"consider plausible alternatives"</td>
<td>"consider" 没有终点</td>
<td>最多比两条路径，一次，拍板</td>
</tr>
<tr>
<td>"prioritize correctness, consistency, clarity"</td>
<td>没有停止条件</td>
<td>两条一致即止；验证通过立即停</td>
</tr>
<tr>
<td>（缺失）</td>
<td>无分情形，小题大做；agent 场景过规划</td>
<td>末尾尺度条款（琐碎任务每步一行）+ tools 句（预期先行，诊断至多两轮）</td>
</tr>
</tbody>
</table>
]]></description><link>https://lcz.me/topic/1181</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 00:51:42 GMT</lastBuildDate><atom:link href="https://lcz.me/topic/1181.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Aug 2026 05:44:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qwen3.8-27B「思考深度档位」优化 on Fri, 21 Aug 2026 04:35:06 GMT]]></title><description><![CDATA[<p dir="auto">感谢分享 已经用上了 DSH 上 qwen3.8 27b agent预设模版从标准换成自定义 然后思考开到 low  整个工具调用和过度思考控制的不错 之前标准版本 思考high 一个任务干到35分钟 现在基本 4-6分钟搞定</p>
]]></description><link>https://lcz.me/post/13223</link><guid isPermaLink="true">https://lcz.me/post/13223</guid><dc:creator><![CDATA[Grayson Ren]]></dc:creator><pubDate>Fri, 21 Aug 2026 04:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to Qwen3.8-27B「思考深度档位」优化 on Thu, 20 Aug 2026 11:51:20 GMT]]></title><description><![CDATA[<p dir="auto">测试了一些effort提示词：</p>
<p dir="auto"><img src="https://upload.lcz.me/uploads/51527772-0edd-4919-a5ab-305a27e4872f.jpeg" alt="e6372dcc-1666-4502-a40b-694a7d5aa7e0-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://lcz.me/post/13090</link><guid isPermaLink="true">https://lcz.me/post/13090</guid><dc:creator><![CDATA[neo]]></dc:creator><pubDate>Thu, 20 Aug 2026 11:51:20 GMT</pubDate></item><item><title><![CDATA[Reply to Qwen3.8-27B「思考深度档位」优化 on Thu, 20 Aug 2026 00:49:23 GMT]]></title><description><![CDATA[<p dir="auto">很好的分享，深受启发。</p>
]]></description><link>https://lcz.me/post/12989</link><guid isPermaLink="true">https://lcz.me/post/12989</guid><dc:creator><![CDATA[stxpnet]]></dc:creator><pubDate>Thu, 20 Aug 2026 00:49:23 GMT</pubDate></item><item><title><![CDATA[Reply to Qwen3.8-27B「思考深度档位」优化 on Tue, 18 Aug 2026 10:51:42 GMT]]></title><description><![CDATA[<p dir="auto">卧槽，我现在发现分享的高质量帖子很多，我都没有置顶的位置了。</p>
]]></description><link>https://lcz.me/post/12729</link><guid isPermaLink="true">https://lcz.me/post/12729</guid><dc:creator><![CDATA[terry]]></dc:creator><pubDate>Tue, 18 Aug 2026 10:51:42 GMT</pubDate></item><item><title><![CDATA[Reply to Qwen3.8-27B「思考深度档位」优化 on Tue, 18 Aug 2026 07:35:11 GMT]]></title><description><![CDATA[<p dir="auto">除了開車外 現在連開AI都要打檔位了 <img src="https://lcz.me/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=301515bb865" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /><br />
爬坡 下山 高速檔</p>
]]></description><link>https://lcz.me/post/12698</link><guid isPermaLink="true">https://lcz.me/post/12698</guid><dc:creator><![CDATA[kos or]]></dc:creator><pubDate>Tue, 18 Aug 2026 07:35:11 GMT</pubDate></item><item><title><![CDATA[Reply to Qwen3.8-27B「思考深度档位」优化 on Tue, 18 Aug 2026 05:50:48 GMT]]></title><description><![CDATA[<p dir="auto">感谢！我先学，然后再让agent学。</p>
]]></description><link>https://lcz.me/post/12678</link><guid isPermaLink="true">https://lcz.me/post/12678</guid><dc:creator><![CDATA[包磊]]></dc:creator><pubDate>Tue, 18 Aug 2026 05:50:48 GMT</pubDate></item></channel></rss>