Technical notes by KbWen

Notes on AI, machine learning, Python, and data engineering, plus tools I build.

Latest posts

AI Systems

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.

2026-10-20 · 4 min read · 764 words · KbWen · EN
AI Systems

DeepSeek-V3 的 Multi-head Latent Attention 如何壓縮 KV 快取

我們來看看 DeepSeek-V3 如何利用 MLA 的低維潛在向量壓縮 KV 快取,解決長序列推論時的記憶體瓶頸。

2026-10-20 · 3 min read · 1116 words · KbWen · ZH
Python

CPython's dict layout

A look at how CPython lays out a dict in memory.

2026-10-20 · 4 min read · 695 words · KbWen · EN
Python

Python dict 的優化

從 Python 3.6 dict 的改寫,來看看插入順序如何跟著記憶體優化。

2026-10-20 · 3 min read · 1235 words · KbWen · ZH

Latest by category

More posts

AI Systems

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.

2026-10-12 · 5 min read · 894 words · KbWen · EN
AI Systems

JSON schema 怎麼限制 LLM 的輸出

我們用 xgrammar 看看給了 JSON schema 之後,模型會受到甚麼影響。

2026-10-12 · 3 min read · 1351 words · KbWen · ZH
Python

Python __slots__ and class attribute defaults

Let's see what happens when an attribute listed in __slots__ is given a default value.

2026-10-12 · 3 min read · 605 words · KbWen · EN
Python

Python 的 __slots__ 能省下多少記憶體

兩個只差在 __slots__ 這個區塊的 class,量量看最後的差別是什麼。

2026-10-12 · 3 min read · 1160 words · KbWen · ZH
AI Systems

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.

2026-10-05 · 4 min read · 706 words · KbWen · EN
AI Systems

Claude API 串流時的工具呼叫與不完整的 JSON

用 Claude API 開串流的時候,參數會是一段段字串。這篇簡單的看這些片段長什麼樣子,以及程式該怎麼接手處理。

2026-10-05 · 2 min read · 982 words · KbWen · ZH