<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Safety on Tarragon</title><link>https://tarrragon.github.io/blog/tags/safety/</link><description>Recent content in Safety on Tarragon</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><copyright>Tarragon (CC BY 4.0)</copyright><lastBuildDate>Thu, 14 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tarrragon.github.io/blog/tags/safety/index.xml" rel="self" type="application/rss+xml"/><item><title>Guardrail</title><link>https://tarrragon.github.io/blog/llm/knowledge-cards/guardrail/</link><pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/llm/knowledge-cards/guardrail/</guid><description>&lt;p>Guardrail 的核心概念是「&lt;strong>在 LLM 的 fuzzy 行為外層加上可驗證的控制邊界&lt;/strong>」。LLM 本身會生成機率性輸出，guardrail 用 deterministic 檢查、policy、&lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/structured-output/" data-link-title="Structured Output" data-link-desc="讓 LLM 輸出可被 parser 穩定消費的推論階段設計：JSON mode、schema-guided decoding、grammar 約束都屬於這一層">structured output&lt;/a>、權限與人工審查，把錯誤後果限制在可承擔範圍內。&lt;/p>
&lt;h2 id="概念位置">概念位置&lt;/h2>
&lt;p>Guardrail 是一組控制層。常見形式包含 &lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/structured-output/" data-link-title="Structured Output" data-link-desc="讓 LLM 輸出可被 parser 穩定消費的推論階段設計：JSON mode、schema-guided decoding、grammar 約束都屬於這一層">structured output&lt;/a>、validator、allowlist、rate limit、sandbox、human approval、eval、monitoring 與 rollback。它通常包在模型輸出與下游副作用之間。&lt;/p>
&lt;h2 id="可觀察訊號與例子">可觀察訊號與例子&lt;/h2>
&lt;p>客服分類可以用 enum schema 限制類別；tool use 可以用 allowlist 限制可呼叫工具；production 操作可以要求 &lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/human-in-the-loop/" data-link-title="Human-in-the-loop（HITL）" data-link-desc="人類介入 LLM 工作流的設計：三種觸發時機（pre-act / mid-stream / post-hoc）、避免橡皮圖章化的四條件">human-in-the-loop&lt;/a> approval；外部內容進 context 前可以標記為 untrusted，降低 prompt injection 後果。&lt;/p>
&lt;h2 id="設計責任">設計責任&lt;/h2>
&lt;p>設計 guardrail 時先判斷失敗代價，再選控制強度。低風險任務用 schema 與 retry 即可；高副作用任務要加 permission boundary、sandbox、審查與 audit log。相關基礎見 &lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/deterministic-vs-fuzzy/" data-link-title="Deterministic vs Fuzzy engineering" data-link-desc="LLM 軟體 vs 傳統軟體在資料 / 邏輯 / 行為一致性 / 實驗成本四維度的典範差異、決定哪段該包 guardrail">Deterministic vs Fuzzy engineering&lt;/a>。&lt;/p></description><content:encoded><![CDATA[<p>Guardrail 的核心概念是「<strong>在 LLM 的 fuzzy 行為外層加上可驗證的控制邊界</strong>」。LLM 本身會生成機率性輸出，guardrail 用 deterministic 檢查、policy、<a href="/blog/llm/knowledge-cards/structured-output/" data-link-title="Structured Output" data-link-desc="讓 LLM 輸出可被 parser 穩定消費的推論階段設計：JSON mode、schema-guided decoding、grammar 約束都屬於這一層">structured output</a>、權限與人工審查，把錯誤後果限制在可承擔範圍內。</p>
<h2 id="概念位置">概念位置</h2>
<p>Guardrail 是一組控制層。常見形式包含 <a href="/blog/llm/knowledge-cards/structured-output/" data-link-title="Structured Output" data-link-desc="讓 LLM 輸出可被 parser 穩定消費的推論階段設計：JSON mode、schema-guided decoding、grammar 約束都屬於這一層">structured output</a>、validator、allowlist、rate limit、sandbox、human approval、eval、monitoring 與 rollback。它通常包在模型輸出與下游副作用之間。</p>
<h2 id="可觀察訊號與例子">可觀察訊號與例子</h2>
<p>客服分類可以用 enum schema 限制類別；tool use 可以用 allowlist 限制可呼叫工具；production 操作可以要求 <a href="/blog/llm/knowledge-cards/human-in-the-loop/" data-link-title="Human-in-the-loop（HITL）" data-link-desc="人類介入 LLM 工作流的設計：三種觸發時機（pre-act / mid-stream / post-hoc）、避免橡皮圖章化的四條件">human-in-the-loop</a> approval；外部內容進 context 前可以標記為 untrusted，降低 prompt injection 後果。</p>
<h2 id="設計責任">設計責任</h2>
<p>設計 guardrail 時先判斷失敗代價，再選控制強度。低風險任務用 schema 與 retry 即可；高副作用任務要加 permission boundary、sandbox、審查與 audit log。相關基礎見 <a href="/blog/llm/knowledge-cards/deterministic-vs-fuzzy/" data-link-title="Deterministic vs Fuzzy engineering" data-link-desc="LLM 軟體 vs 傳統軟體在資料 / 邏輯 / 行為一致性 / 實驗成本四維度的典範差異、決定哪段該包 guardrail">Deterministic vs Fuzzy engineering</a>。</p>
]]></content:encoded></item><item><title>Human-in-the-loop（HITL）</title><link>https://tarrragon.github.io/blog/llm/knowledge-cards/human-in-the-loop/</link><pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/llm/knowledge-cards/human-in-the-loop/</guid><description>&lt;p>Human-in-the-loop（HITL）的核心概念是「&lt;strong>人類在 LLM 工作流中介入的設計&lt;/strong>」、用來在 fuzzy AI 行為的關鍵節點插入 deterministic 人類判斷。HITL 不是「有 vs 沒有」的二元、是 spectrum：位置由 risk（副作用範圍 + 失敗代價）跟自動 validator 能力決定。&lt;/p>
&lt;h2 id="概念位置">概念位置&lt;/h2>
&lt;p>HITL 三種觸發時機：&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>時機&lt;/th>
 &lt;th>介入點&lt;/th>
 &lt;th>適合任務&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Pre-act&lt;/td>
 &lt;td>Action 執行前確認&lt;/td>
 &lt;td>不可逆 / 高代價（DB write、deploy）&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Mid-stream&lt;/td>
 &lt;td>Agent 過程中遇不確定主動問&lt;/td>
 &lt;td>路徑分歧、需要 domain judgment&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Post-hoc&lt;/td>
 &lt;td>結果交付後 user 申訴 / 校正&lt;/td>
 &lt;td>評分類、低代價、user 數量大&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>跟其他相關概念對照：&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>概念&lt;/th>
 &lt;th>跟 HITL 的關係&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Agent 自主度分層&lt;/td>
 &lt;td>Full auto / checkpoint / step-by-step / plan-first → 對應 HITL 時機&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Tool 副作用範圍&lt;/td>
 &lt;td>等級 1-2 不需 HITL、等級 4-5 強制 HITL&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Guardrail&lt;/td>
 &lt;td>Schema / validator / monitoring 是自動 guardrail、HITL 是人類 guardrail&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="設計責任">設計責任&lt;/h2>
&lt;p>讀 AI 應用設計或 agent paper 看到「HITL」「human-in-the-loop」「approval flow」「appeal」就是這個機制。實作判讀：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>位置由 risk 跟 validator 能力決定&lt;/strong>：risk 高 + validator 弱、HITL 頻率高；risk 低 + validator 強、HITL 頻率低。&lt;/li>
&lt;li>&lt;strong>三時機可組合&lt;/strong>：pre-act 擋高代價、mid-stream 處理 agent 不確定性、post-hoc 收回饋。三者各擋不同 risk class、不互斥。&lt;/li>
&lt;li>&lt;strong>避免橡皮圖章化的四條件&lt;/strong>：分級不同 risk 走不同 gate、approval UI 強制 show diff、reject 有明確 fallback、approval 訊號回饋進系統。任一不滿足、HITL 退化成形式。&lt;/li>
&lt;li>&lt;strong>跟 &lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/jagged-frontier/" data-link-title="Jagged frontier" data-link-desc="AI 能力分佈不規則的 framing：某些看似簡單的任務 AI 容易壞、某些看似複雜的任務 AI 反而做得好">jagged frontier&lt;/a> 的關係&lt;/strong>：frontier 外的任務該強制 HITL、不交給 user 自由心證。&lt;/li>
&lt;li>&lt;strong>跟 fuzzy engineering 典範的關係&lt;/strong>：HITL 是 fuzzy 行為的 deterministic guardrail 一種、不是預設要有、看 risk 跟自動 validator 能力決定。&lt;/li>
&lt;/ol>
&lt;p>完整 HITL 拓樸設計見 &lt;a href="https://tarrragon.github.io/blog/llm/04-applications/human-ai-collaboration/" data-link-title="4.5 人機協作拓樸：何時人介入、怎麼介入" data-link-desc="Centaur vs Cyborg 工作模式、jagged frontier、HITL 三種觸發時機（pre-act / mid-stream / post-hoc）、確認流程的設計避免橡皮圖章化">4.5 人機協作拓樸&lt;/a>。&lt;/p></description><content:encoded><![CDATA[<p>Human-in-the-loop（HITL）的核心概念是「<strong>人類在 LLM 工作流中介入的設計</strong>」、用來在 fuzzy AI 行為的關鍵節點插入 deterministic 人類判斷。HITL 不是「有 vs 沒有」的二元、是 spectrum：位置由 risk（副作用範圍 + 失敗代價）跟自動 validator 能力決定。</p>
<h2 id="概念位置">概念位置</h2>
<p>HITL 三種觸發時機：</p>
<table>
  <thead>
      <tr>
          <th>時機</th>
          <th>介入點</th>
          <th>適合任務</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Pre-act</td>
          <td>Action 執行前確認</td>
          <td>不可逆 / 高代價（DB write、deploy）</td>
      </tr>
      <tr>
          <td>Mid-stream</td>
          <td>Agent 過程中遇不確定主動問</td>
          <td>路徑分歧、需要 domain judgment</td>
      </tr>
      <tr>
          <td>Post-hoc</td>
          <td>結果交付後 user 申訴 / 校正</td>
          <td>評分類、低代價、user 數量大</td>
      </tr>
  </tbody>
</table>
<p>跟其他相關概念對照：</p>
<table>
  <thead>
      <tr>
          <th>概念</th>
          <th>跟 HITL 的關係</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Agent 自主度分層</td>
          <td>Full auto / checkpoint / step-by-step / plan-first → 對應 HITL 時機</td>
      </tr>
      <tr>
          <td>Tool 副作用範圍</td>
          <td>等級 1-2 不需 HITL、等級 4-5 強制 HITL</td>
      </tr>
      <tr>
          <td>Guardrail</td>
          <td>Schema / validator / monitoring 是自動 guardrail、HITL 是人類 guardrail</td>
      </tr>
  </tbody>
</table>
<h2 id="設計責任">設計責任</h2>
<p>讀 AI 應用設計或 agent paper 看到「HITL」「human-in-the-loop」「approval flow」「appeal」就是這個機制。實作判讀：</p>
<ol>
<li><strong>位置由 risk 跟 validator 能力決定</strong>：risk 高 + validator 弱、HITL 頻率高；risk 低 + validator 強、HITL 頻率低。</li>
<li><strong>三時機可組合</strong>：pre-act 擋高代價、mid-stream 處理 agent 不確定性、post-hoc 收回饋。三者各擋不同 risk class、不互斥。</li>
<li><strong>避免橡皮圖章化的四條件</strong>：分級不同 risk 走不同 gate、approval UI 強制 show diff、reject 有明確 fallback、approval 訊號回饋進系統。任一不滿足、HITL 退化成形式。</li>
<li><strong>跟 <a href="/blog/llm/knowledge-cards/jagged-frontier/" data-link-title="Jagged frontier" data-link-desc="AI 能力分佈不規則的 framing：某些看似簡單的任務 AI 容易壞、某些看似複雜的任務 AI 反而做得好">jagged frontier</a> 的關係</strong>：frontier 外的任務該強制 HITL、不交給 user 自由心證。</li>
<li><strong>跟 fuzzy engineering 典範的關係</strong>：HITL 是 fuzzy 行為的 deterministic guardrail 一種、不是預設要有、看 risk 跟自動 validator 能力決定。</li>
</ol>
<p>完整 HITL 拓樸設計見 <a href="/blog/llm/04-applications/human-ai-collaboration/" data-link-title="4.5 人機協作拓樸：何時人介入、怎麼介入" data-link-desc="Centaur vs Cyborg 工作模式、jagged frontier、HITL 三種觸發時機（pre-act / mid-stream / post-hoc）、確認流程的設計避免橡皮圖章化">4.5 人機協作拓樸</a>。</p>
]]></content:encoded></item><item><title>Hallucination</title><link>https://tarrragon.github.io/blog/llm/knowledge-cards/hallucination/</link><pubDate>Tue, 12 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/llm/knowledge-cards/hallucination/</guid><description>&lt;p>Hallucination 的核心概念是「LLM 生成的內容語法、語氣、結構看起來合理、但內容上是事實錯誤、引用不存在的來源、虛構不存在的 entity」。這是 LLM 基於統計分布生成的固有特性；以目前的研究跟工程實踐、靠「更大模型」或「更好對齊」很難徹底消除、可控的做法是用工程手段降低觸發率跟下游偵測。&lt;/p>
&lt;h2 id="概念位置">概念位置&lt;/h2>
&lt;p>Hallucination 的常見形態：&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>形態&lt;/th>
 &lt;th>例子&lt;/th>
 &lt;th>風險&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>虛構引用&lt;/td>
 &lt;td>引用不存在的論文 / API / 函式名稱&lt;/td>
 &lt;td>使用者照抄、出錯&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>虛構 entity&lt;/td>
 &lt;td>虛構不存在的公司 / 人名 / 地址&lt;/td>
 &lt;td>寫入文件、產生誤導&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>數值幻覺&lt;/td>
 &lt;td>給看似精確但實際錯誤的數字&lt;/td>
 &lt;td>商業 / 工程決策被誤導&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>因果幻覺&lt;/td>
 &lt;td>編造看似合理但不存在的因果關係&lt;/td>
 &lt;td>推理鏈不可信&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>法律 / 醫療幻覺&lt;/td>
 &lt;td>虛構不存在的法條 / 治療方案&lt;/td>
 &lt;td>高風險領域、可能造成實際傷害&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>降低 / 偵測 hallucination 的常見手段（依場景變化）：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>&lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/rag/" data-link-title="RAG" data-link-desc="Retrieval-Augmented Generation：動態外掛知識給 LLM、繞開模型參數記憶的靜態限制">RAG&lt;/a>&lt;/strong>：把真實內容檢索後注入 prompt、模型基於真實內容生成。&lt;/li>
&lt;li>&lt;strong>temperature 降低&lt;/strong>：採樣較保守、減少創造性但也減少幻覺。&lt;/li>
&lt;li>&lt;strong>citation 要求&lt;/strong>：prompt 要求列出引用、後續可驗證。&lt;/li>
&lt;li>&lt;strong>下游驗證&lt;/strong>：對輸出做事實檢查（如 code 跑 compiler、引用查實際資料庫）。&lt;/li>
&lt;li>&lt;strong>明確的「不知道就說不知道」instruction&lt;/strong>：降低過度自信、但不能消除。&lt;/li>
&lt;/ol>
&lt;blockquote>
&lt;p>&lt;strong>事實查核註&lt;/strong>：Hallucination 的研究跟降低技術仍在快速演進、不同模型、不同任務類型的 hallucination rate 變化大、引用前以最新研究跟具體 model card 為準。Stanford &lt;a href="https://arxiv.org/abs/2109.07958">TruthfulQA&lt;/a> 等 benchmark 是常見參考。&lt;/p>&lt;/blockquote>
&lt;h2 id="設計責任">設計責任&lt;/h2>
&lt;p>理解 hallucination 後可以解釋兩個現象：為什麼 LLM 給的「具體事實」（人名 / 數字 / 引用）特別要驗證（生成機制本身就會虛構）、為什麼 LLM 寫的 code 看似合理但 import 不存在的 package（hallucinate 出 library API）。&lt;/p>
&lt;p>production 場景下、hallucination 影響合規（生成包含真人 PII 的虛構內容仍是 PII 處理）、UX（使用者照抄誤導內容）、安全（生成假 URL 引發釣魚）；應對策略不是「擋住 hallucination」、是「降低觸發率 + 下游驗證 + 適當的 disclaimer」。詳見 &lt;a href="https://tarrragon.github.io/blog/backend/07-security-data-protection/llm-log-and-pii-governance/" data-link-title="LLM Log 與 PII 治理" data-link-desc="production LLM 服務的 prompt log 累積、PII 偵測與過濾、保留期限與合規對齊">LLM Log 與 PII 治理&lt;/a>。&lt;/p></description><content:encoded><![CDATA[<p>Hallucination 的核心概念是「LLM 生成的內容語法、語氣、結構看起來合理、但內容上是事實錯誤、引用不存在的來源、虛構不存在的 entity」。這是 LLM 基於統計分布生成的固有特性；以目前的研究跟工程實踐、靠「更大模型」或「更好對齊」很難徹底消除、可控的做法是用工程手段降低觸發率跟下游偵測。</p>
<h2 id="概念位置">概念位置</h2>
<p>Hallucination 的常見形態：</p>
<table>
  <thead>
      <tr>
          <th>形態</th>
          <th>例子</th>
          <th>風險</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>虛構引用</td>
          <td>引用不存在的論文 / API / 函式名稱</td>
          <td>使用者照抄、出錯</td>
      </tr>
      <tr>
          <td>虛構 entity</td>
          <td>虛構不存在的公司 / 人名 / 地址</td>
          <td>寫入文件、產生誤導</td>
      </tr>
      <tr>
          <td>數值幻覺</td>
          <td>給看似精確但實際錯誤的數字</td>
          <td>商業 / 工程決策被誤導</td>
      </tr>
      <tr>
          <td>因果幻覺</td>
          <td>編造看似合理但不存在的因果關係</td>
          <td>推理鏈不可信</td>
      </tr>
      <tr>
          <td>法律 / 醫療幻覺</td>
          <td>虛構不存在的法條 / 治療方案</td>
          <td>高風險領域、可能造成實際傷害</td>
      </tr>
  </tbody>
</table>
<p>降低 / 偵測 hallucination 的常見手段（依場景變化）：</p>
<ol>
<li><strong><a href="/blog/llm/knowledge-cards/rag/" data-link-title="RAG" data-link-desc="Retrieval-Augmented Generation：動態外掛知識給 LLM、繞開模型參數記憶的靜態限制">RAG</a></strong>：把真實內容檢索後注入 prompt、模型基於真實內容生成。</li>
<li><strong>temperature 降低</strong>：採樣較保守、減少創造性但也減少幻覺。</li>
<li><strong>citation 要求</strong>：prompt 要求列出引用、後續可驗證。</li>
<li><strong>下游驗證</strong>：對輸出做事實檢查（如 code 跑 compiler、引用查實際資料庫）。</li>
<li><strong>明確的「不知道就說不知道」instruction</strong>：降低過度自信、但不能消除。</li>
</ol>
<blockquote>
<p><strong>事實查核註</strong>：Hallucination 的研究跟降低技術仍在快速演進、不同模型、不同任務類型的 hallucination rate 變化大、引用前以最新研究跟具體 model card 為準。Stanford <a href="https://arxiv.org/abs/2109.07958">TruthfulQA</a> 等 benchmark 是常見參考。</p></blockquote>
<h2 id="設計責任">設計責任</h2>
<p>理解 hallucination 後可以解釋兩個現象：為什麼 LLM 給的「具體事實」（人名 / 數字 / 引用）特別要驗證（生成機制本身就會虛構）、為什麼 LLM 寫的 code 看似合理但 import 不存在的 package（hallucinate 出 library API）。</p>
<p>production 場景下、hallucination 影響合規（生成包含真人 PII 的虛構內容仍是 PII 處理）、UX（使用者照抄誤導內容）、安全（生成假 URL 引發釣魚）；應對策略不是「擋住 hallucination」、是「降低觸發率 + 下游驗證 + 適當的 disclaimer」。詳見 <a href="/blog/backend/07-security-data-protection/llm-log-and-pii-governance/" data-link-title="LLM Log 與 PII 治理" data-link-desc="production LLM 服務的 prompt log 累積、PII 偵測與過濾、保留期限與合規對齊">LLM Log 與 PII 治理</a>。</p>
]]></content:encoded></item><item><title>Refusal Rate</title><link>https://tarrragon.github.io/blog/llm/knowledge-cards/refusal-rate/</link><pubDate>Tue, 12 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/llm/knowledge-cards/refusal-rate/</guid><description>&lt;p>Refusal rate 的核心概念是「LLM 拒絕回答 prompt 的比例」。LLM 在訓練階段（特別是 RLHF）會學到「對特定類型的請求說『我不能幫忙這個』」、production 服務通常會監控這個比例作為對齊強度跟異常行為偵測的訊號之一。&lt;/p>
&lt;h2 id="概念位置">概念位置&lt;/h2>
&lt;p>Refusal 行為的典型形態：&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>形態&lt;/th>
 &lt;th>例子&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>安全相關拒絕&lt;/td>
 &lt;td>&amp;ldquo;Sorry, I can&amp;rsquo;t help with that request.&amp;rdquo;&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>政策相關拒絕&lt;/td>
 &lt;td>&amp;ldquo;I&amp;rsquo;m not able to discuss specific medical advice.&amp;rdquo;&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>能力相關拒絕&lt;/td>
 &lt;td>&amp;ldquo;I don&amp;rsquo;t have real-time data access.&amp;rdquo;&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>模糊拒絕（soft refusal）&lt;/td>
 &lt;td>&amp;ldquo;That&amp;rsquo;s an interesting question, but&amp;hellip;&amp;rdquo;&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>Refusal rate 作為偵測訊號的兩個方向：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>率突然下降&lt;/strong>：可能是對齊被繞過、&lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/prompt-injection/" data-link-title="Prompt Injection" data-link-desc="把惡意指令藏進 LLM 會讀到的內容、誘導 LLM 跑出非開發者預期行為的攻擊類別、OWASP LLM01 列入頭號威脅">prompt injection&lt;/a> 攻擊在進行、或新版本模型對齊變弱。&lt;/li>
&lt;li>&lt;strong>率突然上升&lt;/strong>：可能是訓練資料或對齊政策變嚴、影響使用者體驗、或 vendor 端政策調整。&lt;/li>
&lt;/ol>
&lt;p>實作上、偵測 refusal 通常用簡單 pattern matching（看是否含 &amp;ldquo;I can&amp;rsquo;t&amp;rdquo; / &amp;ldquo;I&amp;rsquo;m not able&amp;rdquo; / &amp;ldquo;Sorry&amp;rdquo; 等）或更精確的 classifier；具體實作依 &lt;a href="https://tarrragon.github.io/blog/backend/07-security-data-protection/detection-coverage-and-signal-governance/" data-link-title="7.13 偵測覆蓋率與訊號治理" data-link-desc="定義偵測覆蓋、訊號品質與誤報成本的治理問題">偵測平台&lt;/a> 設計。&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>事實查核註&lt;/strong>：refusal rate 的標準化測量方式、跟「對齊強度」的對應關係仍在研究演進、不同 vendor 跟 model 的 baseline 差異大、引用前以對應模型的 model card 跟最新研究為準。&lt;/p>&lt;/blockquote>
&lt;h2 id="設計責任">設計責任&lt;/h2>
&lt;p>理解 refusal rate 後可以解釋兩個現象：為什麼 production LLM 服務監控 refusal rate（變化是異常訊號）、為什麼開源模型的 refusal rate 通常低於商業旗艦（前者 safety RLHF 投入較少）。&lt;/p>
&lt;p>production 設計時、refusal rate 是 content 層偵測訊號之一、需配合 tool call 序列、token usage、prompt pattern 等其他訊號才能形成完整偵測覆蓋。詳見 &lt;a href="https://tarrragon.github.io/blog/backend/07-security-data-protection/llm-as-service-detection-coverage/" data-link-title="LLM Service 偵測訊號覆蓋" data-link-desc="production LLM 服務的 detection 訊號設計：tool call 異常模式、prompt injection 觸發徵兆、abuse 跟濫用模式、跟既有 detection-coverage 框架的接合">LLM Service 偵測訊號覆蓋&lt;/a>。&lt;/p></description><content:encoded><![CDATA[<p>Refusal rate 的核心概念是「LLM 拒絕回答 prompt 的比例」。LLM 在訓練階段（特別是 RLHF）會學到「對特定類型的請求說『我不能幫忙這個』」、production 服務通常會監控這個比例作為對齊強度跟異常行為偵測的訊號之一。</p>
<h2 id="概念位置">概念位置</h2>
<p>Refusal 行為的典型形態：</p>
<table>
  <thead>
      <tr>
          <th>形態</th>
          <th>例子</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>安全相關拒絕</td>
          <td>&ldquo;Sorry, I can&rsquo;t help with that request.&rdquo;</td>
      </tr>
      <tr>
          <td>政策相關拒絕</td>
          <td>&ldquo;I&rsquo;m not able to discuss specific medical advice.&rdquo;</td>
      </tr>
      <tr>
          <td>能力相關拒絕</td>
          <td>&ldquo;I don&rsquo;t have real-time data access.&rdquo;</td>
      </tr>
      <tr>
          <td>模糊拒絕（soft refusal）</td>
          <td>&ldquo;That&rsquo;s an interesting question, but&hellip;&rdquo;</td>
      </tr>
  </tbody>
</table>
<p>Refusal rate 作為偵測訊號的兩個方向：</p>
<ol>
<li><strong>率突然下降</strong>：可能是對齊被繞過、<a href="/blog/llm/knowledge-cards/prompt-injection/" data-link-title="Prompt Injection" data-link-desc="把惡意指令藏進 LLM 會讀到的內容、誘導 LLM 跑出非開發者預期行為的攻擊類別、OWASP LLM01 列入頭號威脅">prompt injection</a> 攻擊在進行、或新版本模型對齊變弱。</li>
<li><strong>率突然上升</strong>：可能是訓練資料或對齊政策變嚴、影響使用者體驗、或 vendor 端政策調整。</li>
</ol>
<p>實作上、偵測 refusal 通常用簡單 pattern matching（看是否含 &ldquo;I can&rsquo;t&rdquo; / &ldquo;I&rsquo;m not able&rdquo; / &ldquo;Sorry&rdquo; 等）或更精確的 classifier；具體實作依 <a href="/blog/backend/07-security-data-protection/detection-coverage-and-signal-governance/" data-link-title="7.13 偵測覆蓋率與訊號治理" data-link-desc="定義偵測覆蓋、訊號品質與誤報成本的治理問題">偵測平台</a> 設計。</p>
<blockquote>
<p><strong>事實查核註</strong>：refusal rate 的標準化測量方式、跟「對齊強度」的對應關係仍在研究演進、不同 vendor 跟 model 的 baseline 差異大、引用前以對應模型的 model card 跟最新研究為準。</p></blockquote>
<h2 id="設計責任">設計責任</h2>
<p>理解 refusal rate 後可以解釋兩個現象：為什麼 production LLM 服務監控 refusal rate（變化是異常訊號）、為什麼開源模型的 refusal rate 通常低於商業旗艦（前者 safety RLHF 投入較少）。</p>
<p>production 設計時、refusal rate 是 content 層偵測訊號之一、需配合 tool call 序列、token usage、prompt pattern 等其他訊號才能形成完整偵測覆蓋。詳見 <a href="/blog/backend/07-security-data-protection/llm-as-service-detection-coverage/" data-link-title="LLM Service 偵測訊號覆蓋" data-link-desc="production LLM 服務的 detection 訊號設計：tool call 異常模式、prompt injection 觸發徵兆、abuse 跟濫用模式、跟既有 detection-coverage 框架的接合">LLM Service 偵測訊號覆蓋</a>。</p>
]]></content:encoded></item></channel></rss>