← 回到 Reading
Daily Dose of DS 2026-10-30

RAG vs. Vectorless RAG, clearly explained!

Mirai 展示了在其專為 Apple Silicon 打造的 inference engine「Uzu」中,結合 DFlash 與 Weaver 執行 speculative decoding,在搭載 Qwen3.5 9B 的 M5 MacBook Pro 上達到了每秒 92.1 tokens(92.1 tokens per second)。這相較於 baseline decoding 提升了 4 倍,且比 standard speculative decoding 快了 2.6 倍。Weaver 透過一個 56.7M 參數的 Transformer layer 構建 dependency-aware candidate trees,並在 single pass 中完成驗證,解決了像 DFlash 這類 parallel drafters 的 token-mismatch 限制。Mirai 已在 Uzu 中針對 Apple Silicon 裝置開源了這套 speculative decoding stack。傳統的 vector-based RAG 在處理結構化的長篇文件(如年度報告)時表現不佳,因為 similarity search 經常會混淆不同年份中結構相同的模板,且無法有效處理 cross-references。Vectorless RAG 以 LLM 驅動的 table of contents (ToC) tree index 取代 embeddings 與 vector databases,使其能夠像人類分析師閱讀報告一樣對文件結構進行 reasoning。雖然像 PageIndex 這類 vectorless 方法能提高結構化文件的 retrieval accuracy,但與標準的 vector retrieval 相比,它們會帶來更長的 index-building 時間、更高的 latency 以及更高的 query 成本。Binary Quantization (BQ) 是一種 embedding compression 技術,將 float32 vectors 轉換為 binary vectors,從而在 memory 與 storage 上實現約 32 倍的縮減。Perplexity、Azure Search 和 HubSpot 等主流系統皆採用此方法來提升 retrieval efficiency。在一個示範架構中,LlamaIndex 負責 orchestration,Milvus 作為使用 Hamming distance 的 binary vector database,並由託管於 Groq 上的 Kimi-K2 執行 response generation。在超過 36M+ vectors 的 PubMed dataset 上評估此 pipeline,展示了低於 30ms 的 retrieval 速度,以及不到一秒的 end-to-end response generation。

閱讀原文 ↗
目錄 3 段
  1. 01Speculative decoding,現在在 MacBook 上快了 2.6 倍:
  2. 02RAG vs. Vectorless RAG,清楚解析!
  3. 03讓 RAG 系統的記憶體效率提升 32 倍!
LLM INFERENCE

Speculative decoding,現在在 MacBook 上快了 2.6 倍:

Mirai 展示了在其專為 Apple Silicon 打造的 inference engine「Uzu」中,結合 DFlash 與 Weaver 執行 speculative decoding,在搭載 Qwen3.5 9B 的 M5 MacBook Pro 上達到了每秒 92.1 tokens(92.1 tokens per second)。這相較於 baseline decoding 提升了 4 倍,且比 standard speculative decoding 快了 2.6 倍。Weaver 透過一個 56.7M 參數的 Transformer layer 構建 dependency-aware candidate trees,並在 single pass 中完成驗證,解決了像 DFlash 這類 parallel drafters 的 token-mismatch 限制。Mirai 已在 Uzu 中針對 Apple Silicon 裝置開源了這套 speculative decoding stack。

  • 在 M5 MacBook Pro 上,Qwen3.5 9B 透過 Uzu 中的 DFlash + Weaver 達到 92.1 tokens/s,相較之下,未使用 speculative decoding 時為 22.0 tokens/s,而使用常規 speculative decoding 則為 34.7 tokens/s。
  • DFlash 會跨位置平行生成 token 預測,但各個位置並不會以先前的選擇為條件(condition on preceding choices)。
  • Weaver 是一個 56.7M 參數的單層 Transformer adapter,它會依序從 DFlash 的 top predictions 中構建 candidate tokens 樹狀結構(tree of candidate tokens)。
  • 在 MacBook Pro 上使用 Weaver 讓這款 9B 模型在每個 verification pass 中平均產出 7.5 個 tokens,而非原本的 1 個。
  • 在 Nvidia B200 GPU 上,Weaver 論文指出其在 chat、math 和 code benchmarks 方面相較於 standard decoding 實現了 4.08 倍的 speedup。
  • Mirai 已在 Uzu 中開源了這套 inference stack,Uzu 是一款專為 Apple Silicon 量身打造的 inference engine。
RAG

RAG vs. Vectorless RAG,清楚解析!

傳統的 vector-based RAG 在處理結構化的長篇文件(如年度報告)時表現不佳,因為 similarity search 經常會混淆不同年份中結構相同的模板,且無法有效處理 cross-references。Vectorless RAG 以 LLM 驅動的 table of contents (ToC) tree index 取代 embeddings 與 vector databases,使其能夠像人類分析師閱讀報告一樣對文件結構進行 reasoning。雖然像 PageIndex 這類 vectorless 方法能提高結構化文件的 retrieval accuracy,但與標準的 vector retrieval 相比,它們會帶來更長的 index-building 時間、更高的 latency 以及更高的 query 成本。

  • 標準的 vector RAG 經常在週期性出現的結構化報告(例如年度 10-K 文件)上失敗,因為來自不同年份的 chunks 對 query topic 的匹配程度可能完全相同。
  • Cross-references(例如「見 Appendix G」)會導致標準 vector search 遺漏目標資料,因為被引用的表格內容與 query 的語句措辭並不匹配。
  • Anthropic 的 contextual retrieval 搭配 reranker 將 top-20 的 retrieval 失敗率從 5.7% 降低至 1.9%,但在本質上仍依賴 text similarity。
  • Vectorless RAG 利用文件排版(document layout)構建包含 section titles、page ranges 與 summaries 的 ToC tree index,而非對文字進行 chunking。
  • 在一項針對 NVIDIA 年度報告(FY2022–FY2026)的 PageIndex benchmark 中,tree retrieval 以每 1,000 次 queries 約 110 美元的成本達到了 63 道問題 100% 的正確率,而 top-10 vector search 的最高 accuracy 僅有 76.2%,成本約為每 1,000 次 queries 15 美元。
  • 建立 ToC tree index 相當耗費資源,每份文件需要 2 到 5 分鐘的 LLM calls,因此對於像 support tickets 這類簡短、非結構化的文字,vector search 仍然是更合適的選擇。
HANDS-ON

讓 RAG 系統的記憶體效率提升 32 倍!

Binary Quantization (BQ) 是一種 embedding compression 技術,將 float32 vectors 轉換為 binary vectors,從而在 memory 與 storage 上實現約 32 倍的縮減。Perplexity、Azure Search 和 HubSpot 等主流系統皆採用此方法來提升 retrieval efficiency。在一個示範架構中,LlamaIndex 負責 orchestration,Milvus 作為使用 Hamming distance 的 binary vector database,並由託管於 Groq 上的 Kimi-K2 執行 response generation。在超過 36M+ vectors 的 PubMed dataset 上評估此 pipeline,展示了低於 30ms 的 retrieval 速度,以及不到一秒的 end-to-end response generation。

  • Binary Quantization 將標準的 float32 embeddings 壓縮為 binary vectors,在 memory 與 storage 上實現了 32 倍的縮減。
  • 在 retrieval 過程中,Hamming distance 被用作比對 binary vectors 的 search metric。
  • 該示範 stack 使用 LlamaIndex 進行 orchestration、以 Milvus 作為 vector database,並透過 Groq 託管的 Kimi-K2 進行快速 inference。
  • 在擁有超過 3,600 萬個 vectors 的 PubMed dataset 上測試該架構,實現了低於 30ms 的 retrieval 時間與不到一秒的 generation 時間。
  • 採用 binary quantization 的業界系統包括 Perplexity 搜尋索引(search indexes)、Azure search pipelines 以及 HubSpot AI assistants。