Selected posts
More selected posts →Latest posts
DeepSeek-V3's auxiliary-loss-free load balancing and multi-token prediction
A look at how DeepSeek-V3 keeps load even across its experts during training, and what its multi-token prediction module is for.
DeepSeek-V3 的 Multi-head Latent Attention 如何壓縮 KV 快取
我們來看看 DeepSeek-V3 如何利用 MLA 的低維潛在向量壓縮 KV 快取,解決長序列推論時的記憶體瓶頸。
CPython's dict layout
A look at how CPython lays out a dict in memory.
Python dict 的優化
從 Python 3.6 dict 的改寫,來看看插入順序如何跟著記憶體優化。
Latest by category
More posts
How constrained decoding works for JSON
Let's see how a JSON schema, or a plain JSON mode, changes what a model is able to write.
JSON schema 怎麼限制 LLM 的輸出
我們用 xgrammar 看看給了 JSON schema 之後,模型會受到甚麼影響。
Python __slots__ and class attribute defaults
Let's see what happens when an attribute listed in __slots__ is given a default value.
Python 的 __slots__ 能省下多少記憶體
兩個只差在 __slots__ 這個區塊的 class,量量看最後的差別是什麼。
How tool call arguments stream in the Claude API
A look at the input_json_delta events that carry a tool call's arguments in a streamed Claude API response, and what changes when a tool streams them eagerly.
Claude API 串流時的工具呼叫與不完整的 JSON
用 Claude API 開串流的時候,參數會是一段段字串。這篇簡單的看這些片段長什麼樣子,以及程式該怎麼接手處理。