Moving from RAG Apps to RAG Systems Engineering
本節概述了 hands-on RAG Systems 課程新增的四個部分,將焦點從基礎 RAG 應用轉向進階 RAG systems engineering。涵蓋主題包括 model-driven dynamic retrieval policies、在長時間運行的 agent 中管理 context windows、backend vector consistency 與 storage 選擇,以及將 vector search indices 擴展至超出記憶體限制的數百萬筆項目。新增內容著重於跨特定架構層診斷系統故障,涵蓋 retrieval policies、context management、synchronization 與 storage infrastructure。NVIDIA 推出了 Dory1.0-4B,這是一款 looped transformer 模型,透過重複使用中間層疊(middle stack of layers),將參數量與模型深度解耦。該架構包含一個 8-block 輸入模組、一個執行 1 至 4 次的 20-block recurrent section,以及一個 8-block 輸出模組。Looping 大幅提升了在 reasoning 與 agentic benchmarks 上的表現,在生成更少 output tokens 的同時,達到或超越了規模更大的標準模型。然而,looping 強化的是 reasoning 而非 internal knowledge,在純 factual benchmarks 上並未帶來 accuracy 上的提升。
從 RAG apps 邁向 RAG systems engineering
本節概述了 hands-on RAG Systems 課程新增的四個部分,將焦點從基礎 RAG 應用轉向進階 RAG systems engineering。涵蓋主題包括 model-driven dynamic retrieval policies、在長時間運行的 agent 中管理 context windows、backend vector consistency 與 storage 選擇,以及將 vector search indices 擴展至超出記憶體限制的數百萬筆項目。新增內容著重於跨特定架構層診斷系統故障,涵蓋 retrieval policies、context management、synchronization 與 storage infrastructure。
- Part 16 著重於 retrieval policy 設計,讓 model 能夠動態選擇 search type 並重構 query,而非使用靜態的 top-k 呼叫。
- Part 17 探討 context engineering,涵蓋 history summarization、sub-agent isolation 以及 external note store 等方法,以防止 context window overflow。
- Part 18 探討 backend 挑戰,包含 transactional outbox、version guard,以及 pgvector 與專用 vector database 之間的一致性管理。
- Part 19 涵蓋使用 quantization 技術(PQ、SQ、RaBitQ)、index 格式(IVF、HNSW)以及 disk-backed retrieval 的大規模 vector search infrastructure。
- 對 production RAG 系統進行 debug 需要將 failure 定位至正確的層級:retrieval policy、context management、data synchronization 或 index storage layout。
NVIDIA 發表了全新的 looped transformer:
NVIDIA 推出了 Dory1.0-4B,這是一款 looped transformer 模型,透過重複使用中間的一組 layer 將 parameter count 與 model depth 解耦。該架構由一個 8-block 的 input module、一個執行 1 到 4 次的 20-block recurrent section,以及一個 8-block 的 output module 組成。Looping 顯著提升了在 reasoning 與 agentic benchmark 上的效能,在生成較少 output token 的同時,表現媲美甚至超越更大型的標準 model。然而,looping 增強的是 reasoning 而非 internal knowledge,在純 factual benchmark 上並未帶來 accuracy 的提升。
- Dory1.0-4B 儲存了 36 個 block 的 weight,但能透過 recurrence 執行高達 96 個 block(192 個 physical layer)。
- 在每次 recurrent pass 之前,初始 hidden state 會被加回當前 state 並進行 L2-normalized。
- 在 SWE-bench Verified 上,將 loop 次數從 1 增加到 4,可將 score 從 50.3 提升至 61.8。
- 執行 2 次 loop 的 end-to-end compute 僅為 1 次 loop 的 1.03 倍至 1.25 倍,因為 model 在 agentic task 上產生的 output token 減少了 1.3 倍至 2.5 倍。
- Looping 最多可能使 KV cache memory 增加 4 倍,但僅保留最後一個 loop 的 cache 即可在幾乎不損失 accuracy 的情況下恢復標準的 memory footprint。
- Looping 不會增加 model knowledge,在 AA-Omniscience 等 factual test 中,跨不同 loop 設定所得到的 score 皆完全相同。