EP228: How SSH Works
Secure Shell (SSH) 從建立 TCP connection 開始,在不安全的網路中提供對遠端機器的安全存取。Client 與 server 會協商密碼演算法,並各自獨立計算出相符且絕不會在線路傳輸的 session keys。當 client 對照 known_hosts 檔案檢查 server 的 public key 時,即進行 host verification。當 server 根據 authorized_keys 檔案驗證由 client 的 private key 所生成的數位簽章時,驗證便告完成。大規模 serving 大型語言模型(LLM)的運算成本極高,需要針對性的技術來最佳化效率並降低 latency。六種主流方法包括 streaming、quantization、continuous batching、prefix caching、paged KV cache 以及 speculative decoding。採用這些技術可以減少 memory footprint、降低 GPU idle time,並改善實際與使用者感知到的 response times。AI agent 本質上運作如同一個反覆迭代的 while-loop,由底層的 LLM 主導決策、執行 actions 並評估結果,直到任務完成。關鍵的架構組件包括作為決策大腦的 LLM、將複雜目標拆解的 planning strategies,以及與環境互動的 tool integrations。此外,agent 依賴劃分的 short-term 與 long-term memory 系統來隨時間維持 context。像 sandboxing 和 token limits 這類系統 guardrails,對於規範自主執行並防止失敗至關重要。
閱讀原文 ↗目錄
SSH 的運作原理
Secure Shell (SSH) 從建立 TCP connection 開始,在不安全的網路中提供對遠端機器的安全存取。Client 與 server 會協商密碼演算法,並各自獨立計算出相符且絕不會在線路傳輸的 session keys。當 client 對照 known_hosts 檔案檢查 server 的 public key 時,即進行 host verification。當 server 根據 authorized_keys 檔案驗證由 client 的 private key 所生成的數位簽章時,驗證便告完成。
- SSH 從在 SSH client 與 SSH server 之間建立 TCP connection 開始。
- 兩台機器會協商密碼演算法,並執行 key exchange protocol 以各自獨立衍生出 session keys。
- Session keys 絕不會在網路線路上傳輸。
- SSH server 的 public host key 會對照 client 的 known_hosts 檔案進行驗證。
- Client authentication 利用 public-key cryptography,並對照 server 的 authorized_keys 檔案進行驗證,而 private key 則永遠不會離開 client 端機器。
讓你的 AI 系統高效運作的 6 大關鍵技術
大規模 serving 大型語言模型(LLM)的運算成本極高,需要針對性的技術來最佳化效率並降低 latency。六種主流方法包括 streaming、quantization、continuous batching、prefix caching、paged KV cache 以及 speculative decoding。採用這些技術可以減少 memory footprint、降低 GPU idle time,並改善實際與使用者感知到的 response times。
- Streaming 會在 token 生成後立即傳送,將感知延遲降低至 time-to-first-token。
- Quantization 將 model weights 轉換為 FP8 等較低精度的格式,以降低記憶體消耗與 hosting 成本。
- Continuous batching 會動態利用傳入的 requests 填補空缺的 slots,將 GPU idle time 降至最低。
- Prefix caching 透過重用已識別 prompt prefixes 的快取計算結果,避免重複運算。
- Paged KV cache 以固定大小的 blocks 動態分配記憶體,而不是預先保留連續的記憶體區塊。
- Speculative decoding 使用較小的 speculator model 來提議 tokens,並由 primary model 在單次 pass 中完成驗證。
AI Agent 的架構剖析
AI agent 本質上運作如同一個反覆迭代的 while-loop,由底層的 LLM 主導決策、執行 actions 並評估結果,直到任務完成。關鍵的架構組件包括作為決策大腦的 LLM、將複雜目標拆解的 planning strategies,以及與環境互動的 tool integrations。此外,agent 依賴劃分的 short-term 與 long-term memory 系統來隨時間維持 context。像 sandboxing 和 token limits 這類系統 guardrails,對於規範自主執行並防止失敗至關重要。
- AI agent 的運作方式是一個反覆迭代的 while-loop,由 LLM 驅動來決定 actions,而不僅僅是生成文字。
- 諸如 Chain of Thought、Tree of Thoughts 和 Reflexion 等 planning 機制,能將複雜目標拆解為離散的 actions。
- Tools 透過外部 functions(如 APIs、web search、code execution 和 browsers)來擴展 agent 能力,通常透過 MCP 進行標準化。
- Agent memory 分為短期 context windows 以及包含 vector stores、files 與 knowledge bases 的長期儲存空間。
- 諸如 human checks、sandboxing 與 token limits 等 Guardrails 是約束 autonomous behavior 所必需的。
你如何知道自己的 AI app 是否真的能正常運作?
有效評估 AI applications 遵循一套明確的三步驟方法,而非模糊不清的流程。首先,團隊選擇要評估的特定 task 或能力,例如 safety、math、grounding 或 retrieval。其次,他們收集 evaluation data,將 inputs 與預期的 answers 或 behaviors 進行配對。第三,開發者建立一個 grading 系統,結合用於確定性檢查的 code-based graders、用於大規模評估的 model-based graders,以及用於處理細微 edge cases 的 human graders。
- 一個穩健的 AI evaluation framework 包含三個步驟:選擇 task、收集 evaluation data 以及開發 grader。
- Evaluation datasets 必須將 input prompts 與 ground truth answers 或預期 behaviors 配對,例如將不安全的 prompts 與 refusals 配對。
- Code-based graders(例如 unit tests)最適合用於對具有明確正確答案的 outputs 進行低成本的檢查。
- Model-based graders(LLM-as-judge)能在大規模環境下處理如 safety 等主觀維度的評估。
- Human graders 則保留用於 throughput 為次要考量的 edge cases 和高度細微(high-nuance)的情境。
- Production AI evaluation pipelines 通常會結合 code-based、model-based 與 human graders。
🚀 新課程:AI Evals in Practice 將於 10 月 7 日開課
ByteByteGo 與 Salesforce 資深總監 Manjeet Singh 合作推出了名為「AI Evals in Practice」的線上直播課程,將於 10 月 7 日開課。課程核心聚焦於在 production 環境中為 AI agents 設計與實作 evaluation 系統。重點主題包括 LLM-as-a-Judge 系統、agent red-teaming、CI/CD 整合以及評估 multi-agent interactions。
- ByteByteGo 與 Salesforce 的 Manjeet Singh 合作,於 10 月 7 日起提供「AI Evals in Practice」課程。
- 該課程探討如何在 quality、safety、reliability、cost 與 latency 等維度評估 AI agents。
- 重點技術主題包括設計 LLM-as-a-Judge frameworks,以及針對 jailbreaks 和 prompt injections 進行 agent red-teaming。
- 學員將學習如何將 evaluation pipelines 整合至 CI/CD workflows 與 production 中,以及時捕捉 drift 和 regressions。
- 課程內容涵蓋 RAG systems、tool use、multi-step execution 以及 multi-agent handoffs 的評估。