<?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>Eval on Tarragon</title><link>https://tarrragon.github.io/blog/tags/eval/</link><description>Recent content in Eval 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/eval/index.xml" rel="self" type="application/rss+xml"/><item><title>Retrieval Recall</title><link>https://tarrragon.github.io/blog/llm/knowledge-cards/retrieval-recall/</link><pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/llm/knowledge-cards/retrieval-recall/</guid><description>&lt;p>Retrieval recall 的核心概念是「&lt;strong>正確文件或 chunk 是否出現在 retrieval top-k 結果中&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> 的 retrieval 階段從主觀感覺改成 component-level eval，讓 generation 失敗與 retrieval miss 能分開判讀。&lt;/p>
&lt;h2 id="概念位置">概念位置&lt;/h2>
&lt;p>Retrieval recall 位在 retrieval component eval 層。它跟 &lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/reranker/" data-link-title="Reranker" data-link-desc="對 retrieval top-K 結果用 cross-encoder 重新排序的 RAG 第二階段、品質提升顯著但 latency / cost 增加">reranker&lt;/a> 相鄰，因為 reranker 常用來提升 top-k 的排序品質；也跟 &lt;a href="https://tarrragon.github.io/blog/llm/knowledge-cards/query-document-gap/" data-link-title="Query-Document Gap" data-link-desc="使用者 query 與文件語言在詞彙、形態、抽象層級或領域分佈上的落差，是 RAG retrieval miss 的常見原因">query-document gap&lt;/a> 相鄰，因為 gap 太大會讓 expected doc 不進 top-k。&lt;/p>
&lt;h2 id="可觀察訊號與例子">可觀察訊號與例子&lt;/h2>
&lt;p>一組 eval query 事先標出 expected chunk。若 expected chunk 出現在 top-5，記為 hit@5；一百題中 82 題命中，hit_rate@5 是 82%。若 retrieval recall 高但答案錯，問題多半在 generation 或 context packing；若 retrieval recall 低，先修 chunking、embedding、hybrid search 或 query 端增強。&lt;/p>
&lt;h2 id="設計責任">設計責任&lt;/h2>
&lt;p>設計 retrieval recall eval 時要保存 query、expected source、top-k 結果、score 與失敗分類。不要只看 end-to-end answer correctness；否則 retrieval miss 會被 LLM hallucination、judge 偏差或 prompt 問題掩蓋。&lt;/p></description><content:encoded><![CDATA[<p>Retrieval recall 的核心概念是「<strong>正確文件或 chunk 是否出現在 retrieval top-k 結果中</strong>」。它把 <a href="/blog/llm/knowledge-cards/rag/" data-link-title="RAG" data-link-desc="Retrieval-Augmented Generation：動態外掛知識給 LLM、繞開模型參數記憶的靜態限制">RAG</a> 的 retrieval 階段從主觀感覺改成 component-level eval，讓 generation 失敗與 retrieval miss 能分開判讀。</p>
<h2 id="概念位置">概念位置</h2>
<p>Retrieval recall 位在 retrieval component eval 層。它跟 <a href="/blog/llm/knowledge-cards/reranker/" data-link-title="Reranker" data-link-desc="對 retrieval top-K 結果用 cross-encoder 重新排序的 RAG 第二階段、品質提升顯著但 latency / cost 增加">reranker</a> 相鄰，因為 reranker 常用來提升 top-k 的排序品質；也跟 <a href="/blog/llm/knowledge-cards/query-document-gap/" data-link-title="Query-Document Gap" data-link-desc="使用者 query 與文件語言在詞彙、形態、抽象層級或領域分佈上的落差，是 RAG retrieval miss 的常見原因">query-document gap</a> 相鄰，因為 gap 太大會讓 expected doc 不進 top-k。</p>
<h2 id="可觀察訊號與例子">可觀察訊號與例子</h2>
<p>一組 eval query 事先標出 expected chunk。若 expected chunk 出現在 top-5，記為 hit@5；一百題中 82 題命中，hit_rate@5 是 82%。若 retrieval recall 高但答案錯，問題多半在 generation 或 context packing；若 retrieval recall 低，先修 chunking、embedding、hybrid search 或 query 端增強。</p>
<h2 id="設計責任">設計責任</h2>
<p>設計 retrieval recall eval 時要保存 query、expected source、top-k 結果、score 與失敗分類。不要只看 end-to-end answer correctness；否則 retrieval miss 會被 LLM hallucination、judge 偏差或 prompt 問題掩蓋。</p>
]]></content:encoded></item><item><title>模組四：LLM 應用層原理</title><link>https://tarrragon.github.io/blog/llm/04-applications/</link><pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/llm/04-applications/</guid><description>&lt;blockquote>
&lt;p>&lt;strong>狀態&lt;/strong>：大綱階段、部分章節待完成內容。&lt;/p>&lt;/blockquote>
&lt;p>本模組整理 LLM 應用層的核心原理：模型裝起來、能對話之後、要怎麼跟外部世界互動、怎麼組成可用的工作流、怎麼測它跑得對不對。模組零到模組三建立的是「模型本身」的心智模型；本模組建立的是「模型作為系統元件」的心智模型。&lt;/p>
&lt;p>寫這個模組的核心約束是「&lt;strong>只寫不會過時的部分&lt;/strong>」。LangChain、LlamaIndex、aider、Cline 等工具半年一個世代、寫具體 API 半年後就過時；但「retrieval 在做什麼」「為什麼 LLM 需要 tool use」「agent loop 為什麼會失敗」「eval 軸怎麼選」這些原理跨工具世代都成立。本模組刻意避開具體實作教學、把焦點放在跨世代的設計取捨。&lt;/p>
&lt;h2 id="章節列表">章節列表&lt;/h2>
&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;a href="https://tarrragon.github.io/blog/llm/04-applications/prompt-techniques-landscape/" data-link-title="4.0 Prompt 技術光譜：手法分類、取捨、組合模式" data-link-desc="Zero-shot / few-shot、chain-of-thought、role / template、reflection 等 prompt 技術的分類與取捨、何時 stack 何時不要 stack、跟 fine-tune / RAG / chaining 的邊界">4.0&lt;/a>&lt;/td>
 &lt;td>Prompt 技術光譜&lt;/td>
 &lt;td>三軸（context / 推理 / 格式）+ 四維 trade-off + stack 判讀 + 跟 fine-tune/RAG/chaining 的邊界&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/rag-principles/" data-link-title="4.1 RAG 原理：retrieval &amp;#43; augmentation 模式" data-link-desc="為什麼模型需要外掛知識、語意相似 vs 字面相似、chunking 的本質取捨、retrieval 失敗的根本原因">4.1&lt;/a>&lt;/td>
 &lt;td>RAG 原理：retrieval + augmentation 模式&lt;/td>
 &lt;td>為什麼要外掛知識、語意相似 vs 字面相似、chunking 取捨、失敗的根本原因&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/rag-retrieval-enhancements/" data-link-title="4.2 RAG 檢索增強：query rewriting / HyDE / multi-step / context packing" data-link-desc="Query 端增強（rewriting / expansion / HyDE）、multi-step iterative retrieval、retrieve 後的 context packing（dedup / ordering / summarization）、adaptive retrieval：vanilla RAG 不夠時的下一層工具箱">4.2&lt;/a>&lt;/td>
 &lt;td>RAG 檢索增強：query rewriting / HyDE / multi-step / packing&lt;/td>
 &lt;td>四層增強分類、何時 stack 何時不要、adaptive retrieval&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/tool-use-principles/" data-link-title="4.3 Tool use 原理：LLM 跟外部世界互動" data-link-desc="Structured output 是 LLM 跨入工程系統的橋、function calling 取捨、為什麼本地小模型 tool use 表現崩潰">4.3&lt;/a>&lt;/td>
 &lt;td>Tool use 原理：LLM 跟外部世界互動&lt;/td>
 &lt;td>structured output 是橋、function calling 取捨、為什麼小模型 tool use 崩&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/agent-architecture/" data-link-title="4.4 Agent 架構原理" data-link-desc="Agent loop 結構、失敗模式、什麼任務適合 vs 不適合、跟人類審查的協作模型">4.4&lt;/a>&lt;/td>
 &lt;td>Agent 架構原理&lt;/td>
 &lt;td>Agent loop 結構、失敗模式、什麼任務適合 vs 不適合、人類審查模型&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&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;/td>
 &lt;td>人機協作拓樸：何時人介入、怎麼介入&lt;/td>
 &lt;td>Centaur vs Cyborg、jagged frontier、HITL 三時機（pre-act / mid-stream / post-hoc）、避免橡皮圖章化&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/application-protocols/" data-link-title="4.6 應用層協議：function calling / structured output / MCP" data-link-desc="三個常被混為一談的概念：模型能力、sampling 約束、server 協議，三者的層級差異與組合方式">4.6&lt;/a>&lt;/td>
 &lt;td>應用層協議：function calling / structured output / MCP&lt;/td>
 &lt;td>三者層級差異、為什麼出現 MCP、組合工作流&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/workflow-patterns/" data-link-title="4.7 Workflow 編排模式" data-link-desc="Pipeline / router / parallel / reflection：多 LLM call 組合的四種基本模式與退化條件">4.7&lt;/a>&lt;/td>
 &lt;td>Workflow 編排模式&lt;/td>
 &lt;td>Pipeline / router / parallel / reflection 四種基本模式、退化條件&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/multi-agent-topology/" data-link-title="4.8 Multi-Agent 拓樸：flat / hierarchical / agent-as-tool" data-link-desc="從 multi-call workflow 走到 multi-agent system 的判讀、flat vs hierarchical 拓樸、agent-as-tool 的 MCP 視角、specialization 跟 orchestration overhead 的取捨">4.8&lt;/a>&lt;/td>
 &lt;td>Multi-Agent 拓樸&lt;/td>
 &lt;td>Flat / hierarchical / agent-as-tool、specialization gain vs orchestration overhead、特有失敗模式&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/production-resource-planning/" data-link-title="4.9 Production 部署的資源評估原理" data-link-desc="從本地單 user 到 production multi-tenant：concurrent users、cost model、observability、SLA、capacity planning 的設計取捨">4.9&lt;/a>&lt;/td>
 &lt;td>Production 部署的資源評估原理&lt;/td>
 &lt;td>6 個 dimension：concurrency / latency / cost / storage / observability / reliability&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/artifact-management/" data-link-title="4.10 衍生產物管理原理：什麼進 git、什麼不該" data-link-desc="LLM 應用的 source / derived / external 三類產物對應 git / build cache / registry、與 production 部署的 reproducibility / cost / share 取捨">4.10&lt;/a>&lt;/td>
 &lt;td>衍生產物管理原理：什麼進 git、什麼不該&lt;/td>
 &lt;td>Source / derived / external 三分類、&lt;code>.gitignore&lt;/code> 設計模式、prompt + eval 版本管理、production deployment 對接&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/long-context-engineering/" data-link-title="4.11 Long context engineering" data-link-desc="128K / 1M context 模型怎麼用：claimed vs effective context、lost-in-the-middle、context 設計策略、Long context vs RAG 取捨">4.11&lt;/a>&lt;/td>
 &lt;td>Long context engineering&lt;/td>
 &lt;td>claimed vs effective context、lost-in-the-middle、跟 RAG 的取捨&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/embedding-model-internals/" data-link-title="4.12 Embedding model 內部：訓練、選型、in-domain fine-tune" data-link-desc="Embedding model 怎麼訓練（contrastive learning &amp;#43; hard negative mining）、怎麼挑（MTEB / 大小 / domain）、何時該自己 fine-tune">4.12&lt;/a>&lt;/td>
 &lt;td>Embedding model 內部&lt;/td>
 &lt;td>contrastive learning、選型、MTEB、in-domain fine-tune&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/eval-design-framework/" data-link-title="4.13 Eval 設計座標系：三軸、八象限、何時測什麼" data-link-desc="Eval 設計三軸（objective↔subjective / component↔end-to-end / quantitative↔qualitative）、八象限的對應 eval 工具、軸選錯的訊號、跟 benchmarking / LLM-as-judge / tracing 的關係">4.13&lt;/a>&lt;/td>
 &lt;td>Eval 設計座標系：三軸、八象限&lt;/td>
 &lt;td>Objective / component / quantitative 三軸 × 工具選擇、軸誤選的訊號、eval 演化路徑&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/benchmarking-and-evaluation/" data-link-title="4.14 Benchmarking 與評估方法論" data-link-desc="判讀 model card benchmark 數字、做自己工作流的 in-house benchmark、量測本地推論速度的完整方法論">4.14&lt;/a>&lt;/td>
 &lt;td>Benchmarking 與評估方法論&lt;/td>
 &lt;td>capability vs performance、in-house benchmark、&lt;code>llama-bench&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/vision-in-coding-workflow/" data-link-title="4.15 Vision in coding workflow：本地 VLM 怎麼接寫 code" data-link-desc="VLM 在 coding 工作流的 use cases、本地 VLM 選型、跟雲端 VLM 的分工、Continue.dev / Ollama 整合現狀">4.15&lt;/a>&lt;/td>
 &lt;td>Vision in coding workflow&lt;/td>
 &lt;td>VLM 在 coding 場景的 use cases、本地 VLM 選型、IDE 整合現狀&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/static-and-serverless-rag-deployment/" data-link-title="4.16 靜態 / serverless RAG deployment：架構選擇與資安取捨" data-link-desc="沒 backend 的場景怎麼做 RAG：四種 deployment 方案、API key 暴露問題、CORS / abuse / 第三方信任、跟模組六的 routing">4.16&lt;/a>&lt;/td>
 &lt;td>靜態 / serverless RAG deployment&lt;/td>
 &lt;td>沒 backend 的 RAG 四方案、API key 暴露、CORS、abuse、SaaS 供應鏈、跟模組六 routing&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/coding-agent-harness/" data-link-title="4.17 Coding agent harness：scaffold / context engineering / subagent" data-link-desc="Coding agent 的內部設計：scaffold vs harness 分層、context budget 25% 規則、subagent 拓樸、跟 Claude Code / Cursor / Aider 的 mapping">4.17&lt;/a>&lt;/td>
 &lt;td>Coding agent harness&lt;/td>
 &lt;td>Scaffold vs harness 分層、context budget 25% 規則、subagent 設計、跟 Claude Code / Cursor / Aider 的 mapping&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/prompt-caching-engineering/" data-link-title="4.18 Prompt caching 工程實務：cost / latency 最大槓桿" data-link-desc="Prompt cache 怎麼運作、cache_control 設計、coding agent 跟 long-context 的 cache pattern、anti-pattern 跟 cache miss 訊號">4.18&lt;/a>&lt;/td>
 &lt;td>Prompt caching 工程實務&lt;/td>
 &lt;td>Cache breakpoint 設計、coding agent / RAG 場景 pattern、anti-pattern、cost / latency 槓桿&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/agent-memory-architecture/" data-link-title="4.19 Agent memory 分層架構" data-link-desc="Agent 在 context window 之外管理長期狀態的設計：working / short-term / long-term episodic / semantic / procedural 五個層次、寫入時機、retrieval 設計、失敗模式">4.19&lt;/a>&lt;/td>
 &lt;td>Agent memory 分層架構&lt;/td>
 &lt;td>Working / session / episodic / semantic / procedural 四層、寫入時機、retrieval 設計、失敗模式&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/llm-tracing-and-observability/" data-link-title="4.20 LLM tracing 與 observability" data-link-desc="OpenTelemetry GenAI semantic conventions、結構化 span 設計、cost / latency 監控、failure debug 流程、跟 LLM-as-judge eval 的串接">4.20&lt;/a>&lt;/td>
 &lt;td>LLM tracing 與 observability&lt;/td>
 &lt;td>OTel GenAI semconv、cost / latency / failure debug、trace → eval 閉環&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/llm-as-judge/" data-link-title="4.21 LLM-as-Judge 評估方法" data-link-desc="LLM 評估 LLM 的 production eval 方法：rubric design、pairwise / direct scoring、三大 bias 緩解、跟 trace 串接的閉環、calibration">4.21&lt;/a>&lt;/td>
 &lt;td>LLM-as-Judge 評估方法&lt;/td>
 &lt;td>Rubric 設計、pairwise vs direct、三大 bias 緩解、calibration、跟 production trace 的閉環&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/vector-storage-engineering/" data-link-title="4.22 RAG storage 工程：從 pickle 到 vector database 的選型判讀" data-link-desc="RAG storage backend 選型：規模到哪個階段該從 in-memory 升級到 vector DB、dependency chain 如何收窄選項">4.22&lt;/a>&lt;/td>
 &lt;td>RAG storage 工程&lt;/td>
 &lt;td>四層可替換結構、storage 演化階梯、升級判讀訊號、index 生命週期、dependency 約束&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://tarrragon.github.io/blog/llm/04-applications/hands-on/" data-link-title="4.x Hands-on：端到端案例" data-link-desc="把模組四的所有原理串成具體 case study：從 task decomposition、workflow 設計、eval 設計到 iteration loop">Hands-on&lt;/a>&lt;/td>
 &lt;td>端到端案例：把所有原理串成具體 case study&lt;/td>
 &lt;td>Customer support agent 從 task decomposition 到 eval 全流程&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="為什麼這個順序">為什麼這個順序&lt;/h2>
&lt;p>本模組章節順序的設計脈絡：&lt;/p></description><content:encoded><![CDATA[<blockquote>
<p><strong>狀態</strong>：大綱階段、部分章節待完成內容。</p></blockquote>
<p>本模組整理 LLM 應用層的核心原理：模型裝起來、能對話之後、要怎麼跟外部世界互動、怎麼組成可用的工作流、怎麼測它跑得對不對。模組零到模組三建立的是「模型本身」的心智模型；本模組建立的是「模型作為系統元件」的心智模型。</p>
<p>寫這個模組的核心約束是「<strong>只寫不會過時的部分</strong>」。LangChain、LlamaIndex、aider、Cline 等工具半年一個世代、寫具體 API 半年後就過時；但「retrieval 在做什麼」「為什麼 LLM 需要 tool use」「agent loop 為什麼會失敗」「eval 軸怎麼選」這些原理跨工具世代都成立。本模組刻意避開具體實作教學、把焦點放在跨世代的設計取捨。</p>
<h2 id="章節列表">章節列表</h2>
<table>
  <thead>
      <tr>
          <th>章節</th>
          <th>主題</th>
          <th>關鍵收穫</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="/blog/llm/04-applications/prompt-techniques-landscape/" data-link-title="4.0 Prompt 技術光譜：手法分類、取捨、組合模式" data-link-desc="Zero-shot / few-shot、chain-of-thought、role / template、reflection 等 prompt 技術的分類與取捨、何時 stack 何時不要 stack、跟 fine-tune / RAG / chaining 的邊界">4.0</a></td>
          <td>Prompt 技術光譜</td>
          <td>三軸（context / 推理 / 格式）+ 四維 trade-off + stack 判讀 + 跟 fine-tune/RAG/chaining 的邊界</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/rag-principles/" data-link-title="4.1 RAG 原理：retrieval &#43; augmentation 模式" data-link-desc="為什麼模型需要外掛知識、語意相似 vs 字面相似、chunking 的本質取捨、retrieval 失敗的根本原因">4.1</a></td>
          <td>RAG 原理：retrieval + augmentation 模式</td>
          <td>為什麼要外掛知識、語意相似 vs 字面相似、chunking 取捨、失敗的根本原因</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/rag-retrieval-enhancements/" data-link-title="4.2 RAG 檢索增強：query rewriting / HyDE / multi-step / context packing" data-link-desc="Query 端增強（rewriting / expansion / HyDE）、multi-step iterative retrieval、retrieve 後的 context packing（dedup / ordering / summarization）、adaptive retrieval：vanilla RAG 不夠時的下一層工具箱">4.2</a></td>
          <td>RAG 檢索增強：query rewriting / HyDE / multi-step / packing</td>
          <td>四層增強分類、何時 stack 何時不要、adaptive retrieval</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/tool-use-principles/" data-link-title="4.3 Tool use 原理：LLM 跟外部世界互動" data-link-desc="Structured output 是 LLM 跨入工程系統的橋、function calling 取捨、為什麼本地小模型 tool use 表現崩潰">4.3</a></td>
          <td>Tool use 原理：LLM 跟外部世界互動</td>
          <td>structured output 是橋、function calling 取捨、為什麼小模型 tool use 崩</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/agent-architecture/" data-link-title="4.4 Agent 架構原理" data-link-desc="Agent loop 結構、失敗模式、什麼任務適合 vs 不適合、跟人類審查的協作模型">4.4</a></td>
          <td>Agent 架構原理</td>
          <td>Agent loop 結構、失敗模式、什麼任務適合 vs 不適合、人類審查模型</td>
      </tr>
      <tr>
          <td><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></td>
          <td>人機協作拓樸：何時人介入、怎麼介入</td>
          <td>Centaur vs Cyborg、jagged frontier、HITL 三時機（pre-act / mid-stream / post-hoc）、避免橡皮圖章化</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/application-protocols/" data-link-title="4.6 應用層協議：function calling / structured output / MCP" data-link-desc="三個常被混為一談的概念：模型能力、sampling 約束、server 協議，三者的層級差異與組合方式">4.6</a></td>
          <td>應用層協議：function calling / structured output / MCP</td>
          <td>三者層級差異、為什麼出現 MCP、組合工作流</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/workflow-patterns/" data-link-title="4.7 Workflow 編排模式" data-link-desc="Pipeline / router / parallel / reflection：多 LLM call 組合的四種基本模式與退化條件">4.7</a></td>
          <td>Workflow 編排模式</td>
          <td>Pipeline / router / parallel / reflection 四種基本模式、退化條件</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/multi-agent-topology/" data-link-title="4.8 Multi-Agent 拓樸：flat / hierarchical / agent-as-tool" data-link-desc="從 multi-call workflow 走到 multi-agent system 的判讀、flat vs hierarchical 拓樸、agent-as-tool 的 MCP 視角、specialization 跟 orchestration overhead 的取捨">4.8</a></td>
          <td>Multi-Agent 拓樸</td>
          <td>Flat / hierarchical / agent-as-tool、specialization gain vs orchestration overhead、特有失敗模式</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/production-resource-planning/" data-link-title="4.9 Production 部署的資源評估原理" data-link-desc="從本地單 user 到 production multi-tenant：concurrent users、cost model、observability、SLA、capacity planning 的設計取捨">4.9</a></td>
          <td>Production 部署的資源評估原理</td>
          <td>6 個 dimension：concurrency / latency / cost / storage / observability / reliability</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/artifact-management/" data-link-title="4.10 衍生產物管理原理：什麼進 git、什麼不該" data-link-desc="LLM 應用的 source / derived / external 三類產物對應 git / build cache / registry、與 production 部署的 reproducibility / cost / share 取捨">4.10</a></td>
          <td>衍生產物管理原理：什麼進 git、什麼不該</td>
          <td>Source / derived / external 三分類、<code>.gitignore</code> 設計模式、prompt + eval 版本管理、production deployment 對接</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/long-context-engineering/" data-link-title="4.11 Long context engineering" data-link-desc="128K / 1M context 模型怎麼用：claimed vs effective context、lost-in-the-middle、context 設計策略、Long context vs RAG 取捨">4.11</a></td>
          <td>Long context engineering</td>
          <td>claimed vs effective context、lost-in-the-middle、跟 RAG 的取捨</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/embedding-model-internals/" data-link-title="4.12 Embedding model 內部：訓練、選型、in-domain fine-tune" data-link-desc="Embedding model 怎麼訓練（contrastive learning &#43; hard negative mining）、怎麼挑（MTEB / 大小 / domain）、何時該自己 fine-tune">4.12</a></td>
          <td>Embedding model 內部</td>
          <td>contrastive learning、選型、MTEB、in-domain fine-tune</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/eval-design-framework/" data-link-title="4.13 Eval 設計座標系：三軸、八象限、何時測什麼" data-link-desc="Eval 設計三軸（objective↔subjective / component↔end-to-end / quantitative↔qualitative）、八象限的對應 eval 工具、軸選錯的訊號、跟 benchmarking / LLM-as-judge / tracing 的關係">4.13</a></td>
          <td>Eval 設計座標系：三軸、八象限</td>
          <td>Objective / component / quantitative 三軸 × 工具選擇、軸誤選的訊號、eval 演化路徑</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/benchmarking-and-evaluation/" data-link-title="4.14 Benchmarking 與評估方法論" data-link-desc="判讀 model card benchmark 數字、做自己工作流的 in-house benchmark、量測本地推論速度的完整方法論">4.14</a></td>
          <td>Benchmarking 與評估方法論</td>
          <td>capability vs performance、in-house benchmark、<code>llama-bench</code></td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/vision-in-coding-workflow/" data-link-title="4.15 Vision in coding workflow：本地 VLM 怎麼接寫 code" data-link-desc="VLM 在 coding 工作流的 use cases、本地 VLM 選型、跟雲端 VLM 的分工、Continue.dev / Ollama 整合現狀">4.15</a></td>
          <td>Vision in coding workflow</td>
          <td>VLM 在 coding 場景的 use cases、本地 VLM 選型、IDE 整合現狀</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/static-and-serverless-rag-deployment/" data-link-title="4.16 靜態 / serverless RAG deployment：架構選擇與資安取捨" data-link-desc="沒 backend 的場景怎麼做 RAG：四種 deployment 方案、API key 暴露問題、CORS / abuse / 第三方信任、跟模組六的 routing">4.16</a></td>
          <td>靜態 / serverless RAG deployment</td>
          <td>沒 backend 的 RAG 四方案、API key 暴露、CORS、abuse、SaaS 供應鏈、跟模組六 routing</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/coding-agent-harness/" data-link-title="4.17 Coding agent harness：scaffold / context engineering / subagent" data-link-desc="Coding agent 的內部設計：scaffold vs harness 分層、context budget 25% 規則、subagent 拓樸、跟 Claude Code / Cursor / Aider 的 mapping">4.17</a></td>
          <td>Coding agent harness</td>
          <td>Scaffold vs harness 分層、context budget 25% 規則、subagent 設計、跟 Claude Code / Cursor / Aider 的 mapping</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/prompt-caching-engineering/" data-link-title="4.18 Prompt caching 工程實務：cost / latency 最大槓桿" data-link-desc="Prompt cache 怎麼運作、cache_control 設計、coding agent 跟 long-context 的 cache pattern、anti-pattern 跟 cache miss 訊號">4.18</a></td>
          <td>Prompt caching 工程實務</td>
          <td>Cache breakpoint 設計、coding agent / RAG 場景 pattern、anti-pattern、cost / latency 槓桿</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/agent-memory-architecture/" data-link-title="4.19 Agent memory 分層架構" data-link-desc="Agent 在 context window 之外管理長期狀態的設計：working / short-term / long-term episodic / semantic / procedural 五個層次、寫入時機、retrieval 設計、失敗模式">4.19</a></td>
          <td>Agent memory 分層架構</td>
          <td>Working / session / episodic / semantic / procedural 四層、寫入時機、retrieval 設計、失敗模式</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/llm-tracing-and-observability/" data-link-title="4.20 LLM tracing 與 observability" data-link-desc="OpenTelemetry GenAI semantic conventions、結構化 span 設計、cost / latency 監控、failure debug 流程、跟 LLM-as-judge eval 的串接">4.20</a></td>
          <td>LLM tracing 與 observability</td>
          <td>OTel GenAI semconv、cost / latency / failure debug、trace → eval 閉環</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/llm-as-judge/" data-link-title="4.21 LLM-as-Judge 評估方法" data-link-desc="LLM 評估 LLM 的 production eval 方法：rubric design、pairwise / direct scoring、三大 bias 緩解、跟 trace 串接的閉環、calibration">4.21</a></td>
          <td>LLM-as-Judge 評估方法</td>
          <td>Rubric 設計、pairwise vs direct、三大 bias 緩解、calibration、跟 production trace 的閉環</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/vector-storage-engineering/" data-link-title="4.22 RAG storage 工程：從 pickle 到 vector database 的選型判讀" data-link-desc="RAG storage backend 選型：規模到哪個階段該從 in-memory 升級到 vector DB、dependency chain 如何收窄選項">4.22</a></td>
          <td>RAG storage 工程</td>
          <td>四層可替換結構、storage 演化階梯、升級判讀訊號、index 生命週期、dependency 約束</td>
      </tr>
      <tr>
          <td><a href="/blog/llm/04-applications/hands-on/" data-link-title="4.x Hands-on：端到端案例" data-link-desc="把模組四的所有原理串成具體 case study：從 task decomposition、workflow 設計、eval 設計到 iteration loop">Hands-on</a></td>
          <td>端到端案例：把所有原理串成具體 case study</td>
          <td>Customer support agent 從 task decomposition 到 eval 全流程</td>
      </tr>
  </tbody>
</table>
<h2 id="為什麼這個順序">為什麼這個順序</h2>
<p>本模組章節順序的設計脈絡：</p>
<ol>
<li><strong>先 4.0 Prompt 技術光譜</strong>：within-call 增強是後續所有設計的基底、先建立「prompt 層能做什麼、邊界在哪」的座標。</li>
<li><strong>接 4.1 RAG 原理 + 4.2 RAG 檢索增強</strong>：應用層最常見的模式、把「LLM + 外部知識」這個基本組合走過一遍、概念對映到每個讀者都用過的 <code>@codebase</code> 等實務經驗。</li>
<li><strong>再 4.3 Tool use</strong>：RAG 是「LLM 讀外部資料」、Tool use 是「LLM 對外部世界做事」、兩條延伸方向自然接續。</li>
<li><strong>再 4.4 Agent 架構 + 4.5 人機協作</strong>：把 Tool use 從「單次呼叫」延伸到「自主多步」、自然進入 agent；agent 自主後立刻面對人類介入時機問題。</li>
<li><strong>再 4.6 應用層協議</strong>：前面章節涉及 function calling、structured output、MCP 等術語、本章把這三個概念放回正確的層級、避免混為一談。</li>
<li><strong>再 4.7 Workflow + 4.8 Multi-agent</strong>：上層整合、把多 LLM call 跟多 agent 組合的設計模式整理成跨 framework 不變的概念地圖。</li>
<li><strong>4.9 起進入 production / 細節</strong>：部署資源、衍生產物管理、long context、embedding 內部、eval / benchmarking、tracing、judge——每個都是 production 場景遇到的具體議題。</li>
<li><strong>最後 hands-on</strong>：把上述所有原理串成具體案例、看「實際做的時候、原理怎麼落」。</li>
</ol>
<p>每章可以單獨讀、但若你是第一次接觸 LLM 應用層、照順序讀最不容易迷路。</p>
<h2 id="跟其他模組的分工">跟其他模組的分工</h2>
<table>
  <thead>
      <tr>
          <th>模組</th>
          <th>角度</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>模組零</td>
          <td>操作層心智模型：模型放哪、怎麼選工具</td>
      </tr>
      <tr>
          <td>模組一</td>
          <td>工具層：具體裝 Ollama / Continue.dev</td>
      </tr>
      <tr>
          <td>模組二</td>
          <td>數學工具：線性代數、機率、最佳化</td>
      </tr>
      <tr>
          <td>模組三</td>
          <td>理論機制：模型內部運作</td>
      </tr>
      <tr>
          <td>模組四</td>
          <td><strong>應用層原理</strong>：模型作為系統元件、跟外部世界互動的設計取捨</td>
      </tr>
  </tbody>
</table>
<h2 id="適合的讀者">適合的讀者</h2>
<table>
  <thead>
      <tr>
          <th>你的背景</th>
          <th>適合程度</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>寫過 Ollama + Continue.dev、想懂「然後呢」</td>
          <td>直接適合、從 4.0 依序讀</td>
      </tr>
      <tr>
          <td>已經試過 LangChain / aider / Cline、想看原理</td>
          <td>直接適合、本模組補足「為什麼這樣設計」的視角</td>
      </tr>
      <tr>
          <td>想做 LLM 應用開發</td>
          <td>重點讀 4.0、4.1–4.3、4.4–4.5、4.7–4.8、4.13</td>
      </tr>
      <tr>
          <td>只想用本地 LLM 寫 code、不做應用</td>
          <td>跳過本模組無妨、模組零 + 模組一已足夠</td>
      </tr>
  </tbody>
</table>
<h2 id="不在本模組內的主題">不在本模組內的主題</h2>
<ol>
<li><strong>具體 framework 教學</strong>：LangChain、LlamaIndex 等的 API 用法、隨版本變、交給官方文件。</li>
<li><strong>具體 prompt 寫法</strong>：跨模型跨任務不可遷移、本模組 4.0 寫的是 prompt 技術 landscape 的結構、不是具體寫法。</li>
<li><strong>具體 agent 工具配置</strong>：aider、Cline 等的安裝設定、隨工具版本變、見 <a href="/blog/llm/01-local-llm-services/extension-paths/" data-link-title="1.6 延伸方向：Web UI、coding agent、產圖" data-link-desc="日常路徑跑穩後可以玩的延伸：Open WebUI、aider、ComfyUI；先把基底跑穩再進階">1.6 延伸方向</a> 的入口資訊。</li>
<li><strong>訓練 / fine-tuning</strong>：屬於改變模型本身、見 <a href="/blog/llm/03-theoretical-foundations/training-pipeline/" data-link-title="3.4 訓練流程：pre-train → SFT → RLHF" data-link-desc="LLM 的三階段訓練：預訓練、指令微調、人類反饋強化學習；各階段目標與最新替代方案">3.4 訓練流程</a>。</li>
</ol>
]]></content:encoded></item></channel></rss>