# KbWen Blog > KbWen 的個人技術部落格,分享 Python、機器學習、深度學習、資料工程與 AI 開發的學習筆記與實作心得。Personal tech blog covering Python, ML, deep learning, data engineering, and AI development. ## Blog Posts (English) - [Python 3.14's free-threaded build](https://www.kbwen.com/python-3-14-free-threaded-build/) (lang: en): A look at Python 3.14's free-threaded build through the CPython 3.14 docs and source: installing and identifying it, what happens when it imports a C extension, and what it costs in speed and memory. - [bfloat16 vs float16: how two 16-bit formats split their bits](https://www.kbwen.com/bfloat16-vs-float16-training/) (lang: en): A look at bfloat16 and float16 through their bit layouts, loss scaling, and a small example of low-precision addition. - [What Claude's text watermark attaches to](https://www.kbwen.com/claude-text-watermark-what-it-attaches-to/) (lang: en): Where the watermark in Claude's output can sit, and what a check on it would report. From Anthropic's 14 August announcement and the SynthID-Text paper behind it. - [Google's Agentic Calling, From the Business Side](https://www.kbwen.com/google-agentic-calling-business-side/) (lang: en): Google Search will phone a local business on a searcher's behalf. The Business Profile help page says what makes it dial, what stops it, where it is unavailable, and what your answer becomes afterwards. - [What the parameter count in a model's name means](https://www.kbwen.com/llm-parameter-count-model-names/) (lang: en; zh-Hant translation: https://www.kbwen.com/what-does-7b-mean-model-parameters/): The B in a name like gpt-oss-20b counts parameters, in billions. Multiply that count by the bytes each parameter takes and you get a floor for the memory the weights need. That is also why some models now ship with two numbers instead of one. - [Running more AI reviewers on the same code](https://www.kbwen.com/ai-subagent-code-review-verification/) (lang: en): Fan three or four AI reviewers at the same diff and what comes back is a list of candidates. Agentic OS's own audit records show how many survive checking, and why its default has dispatched subagents return evidence while one primary owns the write. - [How the KV cache speeds up LLM generation](https://www.kbwen.com/how-kv-cache-speeds-up-llm-generation/) (lang: en): A transformer redoes the same attention projections for every past token at each decoding step. The KV cache stores those keys and values so they get reused instead of recomputed, and the one cost it adds is memory that grows with the sequence. - [Kimi K3 Benchmarks vs Claude Fable 5 and GPT-5.6 Sol](https://www.kbwen.com/kimi-k3-benchmarks-vs-fable-5-and-gpt-5-6-sol/) (lang: en): Moonshot's model card scores Kimi K3 against Claude Fable 5 and GPT-5.6 Sol across 45 benchmarks. Some rows go to K3 and some to the others, with margins running from fifteen points down to a tenth — plus what $3/$15 per million tokens buys. - [What functools.wraps restores when you decorate a function](https://www.kbwen.com/python-decorators-functools-wraps/) (lang: en): A decorator replaces your function with a wrapper, so its name, docstring, and signature change. Here is exactly what functools.wraps copies back and how it records __wrapped__. - [Before an incident, test whether your AI provider will accept attack logs](https://www.kbwen.com/incident-response-blocked-by-guardrails/) (lang: en): Hugging Face's forensics were refused by the commercial APIs it tried first. The block is an access setting, so test what your account does with attack data. - [How temperature, top-k, and top-p shape an LLM's output](https://www.kbwen.com/llm-temperature-top-k-top-p/) (lang: en): A worked walk through the three main LLM sampling knobs: temperature reshapes the whole next-token distribution, while top-k and top-p truncate which tokens you may sample from. - [How to Use Claude Projects: A First-Time Setup](https://www.kbwen.com/how-to-use-claude-projects/) (lang: en; zh-Hant translation: https://www.kbwen.com/claude-projects-getting-started-zh/): A plain walkthrough of setting up your first Claude Project from scratch, organized around the one decision that makes it work: what goes in the project instructions versus the knowledge base. - [Fitting preprocessing before the split inflates your accuracy](https://www.kbwen.com/data-leakage-preprocessing/) (lang: en): Fitting a preprocessing or feature-selection step on the whole dataset before the train/test split leaks the labels and inflates a model's estimated accuracy. A pure-noise scikit-learn run shows the gap, and the pipeline fix closes it. - [Anthropic Reverses Course: Claude Fable 5 Stays in Subscription Plans](https://www.kbwen.com/anthropic-keeps-fable-5-in-subscriptions/) (lang: en; zh-Hant translation: https://www.kbwen.com/claude-fable-5-stays-in-subscriptions/): On July 18, 2026, Anthropic reversed its month-long plan to meter Claude Fable 5 and is keeping it in subscriptions permanently. Here is what changes on July 20 for Max, Team Premium, Pro, and Team Standard — and why a run of competitor launches made the reversal hard to avoid. - [The Same GLM 5.2 Has Different Prices Across Providers](https://www.kbwen.com/same-open-weight-model-different-provider-prices/) (lang: en): GLM 5.2 shipped with open weights under an MIT license, which generally permits third parties to host and commercialize inference. As of writing, OpenRouter lists twenty-five providers offering it, at input prices from $0.93 to $3.00 per million tokens. - [JSON formatter: format, validate, and debug JSON](https://www.kbwen.com/json-formatter-format-and-debug-json-for-apis-and-config-files/) (lang: en): A browser-based JSON formatter that prettifies, minifies, and points to the exact line and column where a payload won't parse — all in your browser. Plus the cases where jq or python -m json.tool is all you need. - [What Makes an AI Skill Different from a Prompt?](https://www.kbwen.com/what-makes-an-ai-skill-different-from-a-prompt/) (lang: en): A prompt and a skill can contain the same words. The difference is the machinery around them: a skill is a file the model loads on its own when your request matches its one-line description, and it can declare inputs, tools, and a scope it won't cross. Here's how that loading works and why it lets you build things a prompt can't. - [What Are GPT-5.6's Sol, Terra, and Luna?](https://www.kbwen.com/gpt-5-6-sol-terra-luna-codex/) (lang: en; zh-Hant translation: https://www.kbwen.com/gpt-5-6-sol-terra-luna-codex-zh/): OpenAI shipped GPT-5.6 as Sol, Terra, and Luna on July 9, 2026, and quietly ended the dedicated Codex checkpoint. What replaced it is a reasoning-effort dial whose top notch spawns subagents. This post lays out the three models, the six effort levels, and what the independent benchmarks measured. - [Agentjacking: how a fake bug report hijacks your coding agent](https://www.kbwen.com/agentjacking-coding-agents/) (lang: en; zh-Hant translation: https://www.kbwen.com/agentjacking-coding-agents-zh/): Agentjacking is an attack disclosed in June 2026: an attacker plants a fake error report, your AI coding agent reads it as instructions, and runs their code with your credentials. The nasty part is that telling the agent to ignore untrusted input doesn't stop it, and your security tools see nothing wrong. - [How Embeddings Work: How AI Knows Two Sentences Mean the Same Thing](https://www.kbwen.com/how-embeddings-work/) (lang: en; zh-Hant translation: https://www.kbwen.com/how-embeddings-work-zh/): Search for 'make my laptop quieter' and get a page about 'reducing fan noise' with zero words in common. That's embeddings: text turned into coordinates, with meaning measured as the angle between two points. Here's how the trick works, and where it's oversold. - [How Many Tokens Is Your Prompt Actually Using?](https://www.kbwen.com/how-many-tokens-does-your-prompt-use/) (lang: en; zh-Hant translation: https://www.kbwen.com/how-many-tokens-your-prompt-costs/): Token counts land on your API bill and decide whether a prompt fits the context window. Here's why Chinese usually costs more tokens than English, why eyeballing it fails, and how to see the real number for any chunk of text. - [Cursor Sold for $60B. What That Price Actually Signals.](https://www.kbwen.com/spacex-cursor-60-billion/) (lang: en; zh-Hant translation: https://www.kbwen.com/spacex-cursor-60-billion-zh/): SpaceX's $60B acquisition of Cursor isn't just M&A. At roughly 15x revenue for a four-year-old startup, the price encodes a specific thesis: that AI-assisted engineering compounds engineer output in a way worth paying an industrial premium for. - [uv: the Python tool that replaces pip, venv, and pyenv](https://www.kbwen.com/uv-replaces-pip-venv-pyenv/) (lang: en; zh-Hant translation: https://www.kbwen.com/uv-python-package-manager/): uv is Astral's Rust-written Python tool that folds pip, venv, pyenv, and pipx into one command — and installs packages several times faster. What it replaces, how fast it really is, and whether you should switch. - [Does Saying 'Thank You' to ChatGPT Actually Cost Anything?](https://www.kbwen.com/saying-thank-you-to-chatgpt-cost/) (lang: en; zh-Hant translation: https://www.kbwen.com/does-saying-thank-you-to-ai-matter/): Sam Altman said people saying 'please' and 'thank you' to ChatGPT costs OpenAI tens of millions. I measured it with a tokenizer: your 'thanks' is two tokens. The real cost is the whole reply it forces. - [Why coding agents are moving back to the terminal](https://www.kbwen.com/coding-agents-back-to-the-terminal/) (lang: en; zh-Hant translation: https://www.kbwen.com/coding-agents-back-to-the-terminal-zh/): The coding agents developers reach for now — Claude Code, Codex CLI, Aider — are terminal programs, not IDE plugins. An IDE is built around a human at the keyboard, the terminal around processes you don't babysit. When AI coding became a job instead of a keystroke, it moved home. - [Why Does AI Forget What You Said Earlier?](https://www.kbwen.com/why-does-ai-forget-what-you-said/) (lang: en; zh-Hant translation: https://www.kbwen.com/why-ai-forgets-what-you-said/): Chat with an AI long enough and it ignores the rules you set up top; open a new chat and it's blank. It isn't 'forgetting' — it has no memory. Every reply, it re-reads the whole conversation from scratch. Here's what the context window is, and how it differs from ChatGPT's 'memory' feature. - [Why Does AI Give a Different Answer Every Time You Ask?](https://www.kbwen.com/why-does-ai-give-different-answers/) (lang: en; zh-Hant translation: https://www.kbwen.com/why-ai-gives-different-answers/): Ask an AI the same thing three times and you often get three different answers. It isn't being flaky — it never picks the single most-likely word, it draws one by probability. Here's the dial behind it, why even temperature 0 isn't fully repeatable, and why 'varies' isn't the same as 'making things up'. - [When an AI says "done," ask it to show you](https://www.kbwen.com/verify-ai-completion-evidence-habit/) (lang: en; zh-Hant translation: https://www.kbwen.com/evidence-first-completion-verification/): An AI's 'done' sounds the same whether the work happened or not. The fix is one small habit: don't take its word for it, ask it to show you a result you can check yourself, sized to the task. - [Claude Fable 5: First Public Mythos-Class Model, One Day In](https://www.kbwen.com/claude-fable-5-first-impressions/) (lang: en; zh-Hant translation: https://www.kbwen.com/claude-fable-5-first-day-review/): Anthropic released Claude Fable 5 on June 9 — the first publicly available Mythos-class model, one tier above Opus. What it is, what it costs, the June 22 deadline on the subscription window, and what changed when I pointed three real projects at it for a day. - [How Claude Code's Dynamic Workflows Run 1,000 Subagents](https://www.kbwen.com/claude-code-dynamic-workflows-orchestration-script/) (lang: en; zh-Hant translation: https://www.kbwen.com/claude-code-dynamic-workflows-orchestration-script-zh/): Claude Code's new dynamic workflows hand the orchestration plan over to a JavaScript script that Claude writes. The runtime executes it with up to 1,000 subagents — 16 concurrent — and Claude's context only sees the final cross-checked answer. - [Why Does AI Sound So Confident When It's Wrong?](https://www.kbwen.com/why-ai-sounds-confident-when-wrong/) (lang: en; zh-Hant translation: https://www.kbwen.com/why-ai-sounds-so-confident-when-its-wrong/): AI's most dangerous trait isn't that it's wrong sometimes. It's that its tone when wrong is identical to its tone when right. Here's my plain-language take on why, including why it won't just say 'I don't know'. - [How I Use ChatGPT, Claude, and Gemini Day to Day](https://www.kbwen.com/how-i-use-chatgpt-claude-gemini/) (lang: en; zh-Hant translation: https://www.kbwen.com/daily-habits-using-ai-chatbots/): Not a benchmark or a verdict on which AI is best — just the small habits I picked up from keeping ChatGPT, Claude, and Gemini all open: route by task, give context first, don't expect one perfect answer, and verify the confident-sounding stuff. - [LLM Benchmark Saturation Is a Verification Problem](https://www.kbwen.com/benchmark-saturation-is-a-verification-problem/) (lang: en; zh-Hant translation: https://www.kbwen.com/benchmark-saturation-is-a-verification-problem-zh/): GSM8k at 99%, MMLU at the 88-94% noise band, HLE already in the mid-40s by mid-2026. Each round of harder benchmarks looks like progress, but the field never solved the underlying problem: we measure correlation with a test distribution and call it capability. - [Python List Comprehensions: Read Them as For-Loops](https://www.kbwen.com/python-list-comprehension-explained/) (lang: en; zh-Hant translation: https://www.kbwen.com/python-list-comprehension/): A relaxed take on Python list comprehensions: translate them back into the equivalent for-loop, and check what's actually true about variable leaking and speed on Python 3.14. - [The Skill Your Annoyed Prompt Becomes](https://www.kbwen.com/the-skill-your-annoyed-prompt-becomes/) (lang: en): Your first Claude Code skill won't look like the polished examples in tutorials. It'll look like a prompt you've typed three times in a row, saved into a four-line markdown file. This post walks that minimum shape, shows the three things that break, and compares it to a real seventeen-line production-grade skill from the framework I use daily. - [What a 13-Line Skill Leaves Out](https://www.kbwen.com/what-a-13-line-skill-leaves-out/) (lang: en): I asked Claude to draft me a skill that calls OpenAI's Codex CLI. It came back as thirteen lines of markdown. The thirteen lines aren't the skill — they point to where the skill actually lives. That split between dispatcher and contract is what separates a skill from a prompt. - [MCP Security Is a Governance Problem](https://www.kbwen.com/mcp-security-governance-problem/) (lang: en; zh-Hant translation: https://www.kbwen.com/mcp-security-governance-problem-zh/): MCP became the industry's default agent-to-tool interface in barely a year, then 2026 brought a wave of RCE, tool poisoning, and rug-pull disclosures. Weighing the expert debate, my take: the real exposure is a governance gap that better protocol design alone won't close. - [Skill Design as Interface Design](https://www.kbwen.com/skill-design-as-interface-design/) (lang: en; zh-Hant translation: https://www.kbwen.com/skill-boundary-design/): An agent skill behaves predictably to the exact degree its boundary is specified. Treat it as a capability list and it drifts; treat it as a contract (declared inputs, outputs, and scope), and it behaves like a well-designed API. - [Token Economics of AI Agent Governance](https://www.kbwen.com/token-economics-of-ai-agent-governance/) (lang: en; zh-Hant translation: https://www.kbwen.com/token-cost-and-budget-tiers/): Governance has a bounded, knowable token cost; ungoverned agent work tends not to. And task granularity has its own price: caching can make over-decomposition cost more than it looks. - [No evidence, no completion](https://www.kbwen.com/no-evidence-no-completion-verification-principle/) (lang: en): No evidence, no completion: the one rule that closes most AI agent failures. A task isn't done until it produces a verifiable artifact (commit SHA, test output). - [Prior art: what distributed systems already knows](https://www.kbwen.com/ai-agent-governance-distributed-systems-prior-art/) (lang: en): AI agent governance maps onto distributed systems patterns: audit logs, delivery acknowledgment, idempotency, least privilege. The prior art already exists. - [Why AI Agents Fail in Production](https://www.kbwen.com/why-ai-agents-fail-without-governance/) (lang: en): Why AI agents fail: most failures trace to governance gaps (phase gates, state handoffs, capability boundaries) more than to the model itself, and the two need completely different fixes. How to tell them apart. - [How to scrape Yahoo Finance stock data with Python](https://www.kbwen.com/how-to-scrape-yahoo-finance-stock-data-with-python/) (lang: en): Scraping Yahoo Finance stock data with Python in 2026: the root.App.main JSON blob is gone from the page source, a default requests call gets HTTP 429, and the numbers now sit in fin-streamer elements. Working BeautifulSoup and yfinance code, plus the original 2021 method. - [Deep Reinforcement learning](https://www.kbwen.com/deep-reinforcement-learning/) (lang: en): A deep reinforcement learning walkthrough: building a DQNetwork with TensorFlow 2 and running Q-learning against OpenAI Gym's MountainCar environment. - [Before Data processing: ELT](https://www.kbwen.com/before-data-processing-elt/) (lang: en): ETL vs ELT: what each of the three steps does, why modern warehouses push the transform step to the target for performance, and where PAAS/SAAS fits in. ## Blog Posts (Traditional Chinese / 繁體中文) - [Python 3.14 的 free-threading build](https://www.kbwen.com/python-free-threading-no-gil/) (lang: zh-Hant): Python 3.14 起 free-threading build 正式支援,GIL 可以在執行期關掉。這篇說明 GIL 原本負責什麼、怎麼判斷使用的 python 有沒有真的關掉 GIL,以及關掉之後單執行緒與 C 擴充套件相容性的影響。 - [Claude 的文字浮水印怎麼運作](https://www.kbwen.com/claude-text-watermark-how-it-works/) (lang: zh-Hant): Anthropic 說明了未來 Claude 的文字浮水印怎麼做:做法是換一個亂數來源,用來決定下一個字挑哪一個,不加字也不多花 token。這篇是來聊聊我們目前獲得的資訊有哪些。 - [Google 幫你打電話問店家有沒有貨,實際上是怎麼跑的](https://www.kbwen.com/google-ai-calls-stores-for-you/) (lang: zh-Hant): 在美國用 Google 搜尋查附近哪裡有貨,結果頁會多出一個選項,按下去後 Google 會打電話去問附近幾家店,再把摘要寄給你。這篇照著官方說明描述一次流程是怎麼進行的,也會順便看看店家那一邊的規則。 - [7B、70B 是什麼意思?看懂模型名字裡的參數量](https://www.kbwen.com/what-does-7b-mean-model-parameters/) (lang: zh-Hant; translation of: https://www.kbwen.com/llm-parameter-count-model-names/): 模型的 7B、70B、235B 講的是參數量,B 就是十億。這篇說明參數量代表什麼、怎麼換算,以及 Qwen3-235B-A22B 這種寫法裡的兩個數字又各自代表什麼。 - [subagent 分派:第二個 agent 該拿到什麼](https://www.kbwen.com/multi-agent-review-independence-zh/) (lang: zh-Hant): 開一個 agent 去看另一個 agent 做完的東西很容易,難的是後面那個看得見前面漏掉了什麼。從 Agentic OS 的 review 規定看下去:要讓第二個 agent 看得出東西,靠的是刻意不給它 session、對話記錄和實作理由。 - [為什麼分類的損失函數幾乎都是交叉熵](https://www.kbwen.com/why-classification-uses-cross-entropy/) (lang: zh-Hant): 把 softmax 加交叉熵對 logit 的導數一路算出來,結果剛好是預測機率減去標籤。這篇從一個三類別的小例子走進這個梯度,看它為什麼乾淨、又為什麼信心錯得越離譜就修得越用力。 - [Kimi K3 適合什麼任務?跟 Fable 5、GPT-5.6 Sol 的對照表怎麼看](https://www.kbwen.com/kimi-k3-vs-fable-5-gpt-5-6-sol/) (lang: zh-Hant): Moonshot 七月發表的開源模型 Kimi K3,README 附了一張跟 Fable 5、GPT-5.6 Sol 的對照表。這篇挑六項分數來看,也整理了價格與輸出速度,談哪些任務可以交給它。 - [Tokenization 到底佔多少成本?從 0.1% 到 99% 的落差是怎麼來的](https://www.kbwen.com/how-much-does-tokenization-cost/) (lang: zh-Hant): 同一串討論底下,有人量到 tokenization 不到總推論時間的 0.1%,也有人量到九成以上的 CPU 時間都花在這裡。這篇看這個落差怎麼來的:算的窗口不同、模型大小不同,還有一些工作根本沒有模型在裡面。 - [Python 的可變預設參數為什麼會累積](https://www.kbwen.com/python-mutable-default-arguments-zh/) (lang: zh-Hant): 用 list 或 dict 當函式的預設參數值,資料會跨呼叫累積,因為預設值在 def 執行時就算好一次並掛在函式物件上。本文示範現象、用 __defaults__ 驗證,並給出 None 哨兵修法。 - [Claude Projects 新手教學:從零設一個專案,指令跟知識庫該放什麼](https://www.kbwen.com/claude-projects-getting-started-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/how-to-use-claude-projects/): 第一次用 Claude Projects,最容易卡在規則跟資料該放哪。這篇帶你從零開一個專案:希望它每次照做的規則寫進專案指令,需要它參考的資料丟進知識庫,順便講免費帳號能開幾個。 - [Python 的 is 和 == 差在哪](https://www.kbwen.com/python-is-vs-equals/) (lang: zh-Hant): is 比對物件身分,== 比對值。小整數快取讓某些整數上兩者剛好一致,但那是不保證的 CPython 實作細節,整數值該用 == 比。 - [Claude Fable 5 要留在訂閱裡了:從限時免費到永久包含,一個多月的來回](https://www.kbwen.com/claude-fable-5-stays-in-subscriptions/) (lang: zh-Hant; translation of: https://www.kbwen.com/anthropic-keeps-fable-5-in-subscriptions/): Anthropic 原本要在免費期後把 Claude Fable 5 從訂閱移除、改走計量付費,一個多月來截止日一延再延。7/18 方向翻轉:7/20 起把 Fable 5 併回 Max 與 Team Premium 訂閱、永久包含。這篇整理這段來回的時間軸、新的訂閱條款,還有 GPT-5.6 Sol 跟 Kimi K3 這波競爭扮演的角色。 - [OpenRouter 上,美國公司使用中國 AI 模型的 token 佔比升到每週 30% 以上](https://www.kbwen.com/chinese-ai-models-openrouter-share/) (lang: zh-Hant): 據 CNBC 報導,美國公司經 OpenRouter 用在中國 AI 模型上的 token 佔比,從前十二個月平均 11% 升到 2 月 8 日以來每週 30% 以上、最高 46%。受訪者明確指出價格正在推動任務分流;六月的模型下架與解禁,也讓取用穩定性成為要一起看的風險。 - [只會 Prompt 已經不夠了:從「下指令」到「蓋系統」的思維進化](https://www.kbwen.com/beyond-prompt-from-instructions-to-building-systems/) (lang: zh-Hant): 從一段重打到第三次、懶得再打的 prompt,到一套會自己留收據的系統,中間隔了好幾層。這篇一層一層走一遍:每一層都是被前一層某個具體的毛病逼出來的,而這條路這個部落格自己走過,每一層都留了一篇當時的記錄。 - [GPT-5.6 的 Sol、Terra、Luna 是什麼](https://www.kbwen.com/gpt-5-6-sol-terra-luna-codex-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/gpt-5-6-sol-terra-luna-codex/): GPT-5.6 在 2026 年 7 月 9 日全面上線,分成 Sol、Terra、Luna 三階,而這一代的 Codex 沒有專用模型。專用 checkpoint 換成一格叫 ultra 的 reasoning effort,官方說它會叫 subagent 出來把大任務拆開做。這篇整理三顆模型怎麼分、六段 reasoning effort 是什麼,以及幾份獨立評測量到的數字。 - [Agentjacking:一封假錯誤報告,就能讓 coding agent 替駭客跑指令](https://www.kbwen.com/agentjacking-coding-agents-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/agentjacking-coding-agents/): Agentjacking 是 2026 年 6 月揭露的攻擊:攻擊者塞一封假的錯誤報告,AI coding agent 把它讀成指令、用你的權限跑了攻擊者的 code。最麻煩的是,在系統提示裡叫 agent 別理它也擋不住,資安監控也完全看不出異常。 - [Embedding 是什麼?AI 怎麼知道兩句話意思一樣](https://www.kbwen.com/how-embeddings-work-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/how-embeddings-work/): 打「貓」「小貓」「喵星人」,AI 怎麼知道講的是同一種東西?答案是 embedding:把文字變成座標,再用夾角量意思相不相近。這篇拆開它怎麼運作,順便聊聊「king − man + woman = queen」那個經典其實灌了點水。 - [你的 Prompt 到底花掉多少 Token?](https://www.kbwen.com/how-many-tokens-your-prompt-costs/) (lang: zh-Hant; translation of: https://www.kbwen.com/how-many-tokens-does-your-prompt-use/): Token 數會反映在你的 API 帳單,也決定一段文字塞不塞得進 context window。這篇聊為什麼中文通常比英文花更多 token、為什麼用猜的估不準,以及怎麼實際看一段 prompt 有多少。 - [Cursor 被 SpaceX 買走了。六百億,15 倍營收,然後呢?](https://www.kbwen.com/spacex-cursor-60-billion-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/spacex-cursor-60-billion/): SpaceX 用 600 億美元買下了 Cursor,大約是它年收入的 15 倍,普遍認為是史上最大的 VC 新創收購案。這個倍數背後有個具體的賭法:AI coding 工具的乘數效應,讓你值得付出基礎建設等級的溢價。 - [uv 是什麼?把 pip、venv、pyenv 收進一個指令](https://www.kbwen.com/uv-python-package-manager/) (lang: zh-Hant; translation of: https://www.kbwen.com/uv-replaces-pip-venv-pyenv/): uv 是 Astral 用 Rust 寫的 Python 套件工具,把 pip、venv、pyenv、pipx 收進同一個指令,安裝又快上好幾倍。聊一下它取代了哪些東西、快多少,還有要不要換。 - [Python f-string:你可能只用到一半](https://www.kbwen.com/python-f-string/) (lang: zh-Hant): f-string 不只是 f"{變數}"。冒號後面的格式設定、3.8 的 = 自我說明、3.12(PEP 701)鬆綁的同引號巢狀與跨行,一層一層看完,順便聊什麼時候別用它。 - [Python lambda 什麼時候該用、什麼時候別用](https://www.kbwen.com/python-lambda/) (lang: zh-Hant): lambda 語法五分鐘學得會,難的是什麼時候用。聊它真正的家(sorted 的 key=)、PEP 8 為什麼叫你別把它綁給變數,還有迴圈裡三個 lambda 都回同一個值的陷阱。 - [跟 AI 說「請」和「謝謝」,到底有沒有差?](https://www.kbwen.com/does-saying-thank-you-to-ai-matter/) (lang: zh-Hant; translation of: https://www.kbwen.com/saying-thank-you-to-chatgpt-cost/): Sam Altman 說大家對 ChatGPT 講禮貌,燒掉 OpenAI 幾千萬美元。我用 tokenizer 實際量了一次:你那句「謝謝」只值兩個 token,真正貴的是它叫醒的整台機器。 - [AI 寫 code 為什麼又搬回終端機了](https://www.kbwen.com/coding-agents-back-to-the-terminal-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/coding-agents-back-to-the-terminal/): 這兩年 AI 寫 code 的重心,悄悄從嵌在 IDE 裡的補全,搬回了終端機(Claude Code、Codex CLI 那一類)。我覺得這不是復古,是因為 agent 變成一個「你不盯著看的 process」,而終端機本來就是為這種東西設計的。 - [為什麼 AI 會忘記我前面說過的話?](https://www.kbwen.com/why-ai-forgets-what-you-said/) (lang: zh-Hant; translation of: https://www.kbwen.com/why-does-ai-forget-what-you-said/): 跟 AI 聊久了,它就忘記你開頭交代的事;開新對話更是整個忘光。背後的原因是它根本沒有記憶——每次回你都是把整段對話重讀一遍。用一個失憶但讀很快的人的畫面,聊聊 context window 是什麼,還有它跟 ChatGPT 那個「記憶」功能差在哪。 - [把 temperature 設成 0,AI 就會每次都一樣嗎?](https://www.kbwen.com/temperature-zero-not-deterministic/) (lang: zh-Hant): 網路上常說:要 AI 每次給一樣的答案,把 temperature 設成 0 就好。但有人拿同一個 prompt、temperature 0 連跑 1000 次,還是冒出 80 種不同輸出。原因除了浮點誤差,更關鍵的是它在 GPU 上跟多少別的請求湊成一批一起算。聊聊為什麼『最確定』不等於『可重現』。 - [為什麼同一個問題問 AI,每次答案都不一樣?](https://www.kbwen.com/why-ai-gives-different-answers/) (lang: zh-Hant; translation of: https://www.kbwen.com/why-does-ai-give-different-answers/): 同一個問題問 AI 三次,常常拿到三個不一樣的答案。它生每個字是照機率從一排候選字裡抽一個——機率最高的那個只是容易中,不是每次都中。用一個加權抽籤的畫面,聊聊它為什麼會飄,還有飄跟唬爛是兩回事。 - [AI 說「完成了」,怎麼確認它真的做完?](https://www.kbwen.com/evidence-first-completion-verification/) (lang: zh-Hant; translation of: https://www.kbwen.com/verify-ai-completion-evidence-habit/): AI 回報「完成了」的時候,真的做完、做一半繞過去、方向整個誤會,那段話讀起來幾乎一樣。與其判斷那句話可不可信,不如養成一個反射:給我看一個我自己查得到的東西,commit、測試輸出、diff。 - [Claude Fable 5 是什麼?第一個公開的 Mythos 級模型,加上我第一天的使用心得](https://www.kbwen.com/claude-fable-5-first-day-review/) (lang: zh-Hant; translation of: https://www.kbwen.com/claude-fable-5-first-impressions/): Anthropic 6/9 釋出第一個公開的 Mythos 級模型 Claude Fable 5。這篇整理它跟 Opus 4.8 的關係、定價、6/22 截止的訂閱免費期,加上第一天把三個專案丟給它跑的心得:它對治理流程的遵守程度是真的,token 也是真的兇。 - [怎麼讓 AI agent 照流程走:閘門只記帳,不攔人](https://www.kbwen.com/make-ai-agents-follow-the-process/) (lang: zh-Hant): 流程裡那些閘門其實不在執行時擋住 AI agent,它要的是一張改不掉的收據。真正有牙齒的不是閘門,是記錄抹不掉、賴不掉。 - [Claude Code 多了個 dynamic workflows,我打開那段 JS 看了一下](https://www.kbwen.com/claude-code-dynamic-workflows-orchestration-script-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/claude-code-dynamic-workflows-orchestration-script/): Claude Code 5/28 釋出 dynamic workflows,跟 Opus 4.8 同一天上。比起「能開 1000 個 subagent」那個數字,更關鍵的是 orchestration 那段 JS 是 Claude 寫的、不是 Claude 在跑——這件事其實滿值得想一下的。 - [AI 連草莓有幾個 r 都數錯,是它笨嗎?](https://www.kbwen.com/why-ai-cant-count-letters/) (lang: zh-Hant): 叫 AI 數 strawberry 有幾個 r,它曾經很有自信地答錯。新模型現在大多答對了,但它當初為什麼會錯——用一個積木的比喻聊聊,順便講為什麼那個原因到現在還沒真的消失。 - [為什麼 AI 唬爛的時候,口氣跟講真話一模一樣?](https://www.kbwen.com/why-ai-sounds-so-confident-when-its-wrong/) (lang: zh-Hant; translation of: https://www.kbwen.com/why-ai-sounds-confident-when-wrong/): AI 最會唬人的地方,不是它會錯,是它錯的時候那個口氣跟講對的時候完全一樣。用『它一直在猜下一個最順的字』這個角度,白話聊聊為什麼篤定不等於知道。 - [我每天開著三個 AI 聊天視窗,這陣子摸出來的幾個小習慣](https://www.kbwen.com/daily-habits-using-ai-chatbots/) (lang: zh-Hant; translation of: https://www.kbwen.com/how-i-use-chatgpt-claude-gemini/): 沒什麼大道理,就是同時用 ChatGPT、Gemini、Claude 一陣子之後,自己順手摸出來的幾個小習慣。不同事丟不同家、先講清楚再問、別期待一次到位這類的。 - [Benchmark 飽和,其實是個驗證問題](https://www.kbwen.com/benchmark-saturation-is-a-verification-problem-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/benchmark-saturation-is-a-verification-problem/): GSM8k 99%、MMLU 90 出頭、HLE 在 2026 年中已進入 40 分檔。每出一份『更難的 benchmark』看起來都在解決問題,但結構性的事沒變:我們從來沒在驗證模型學會了什麼,只是在量它有沒有看過。 - [Python 列表推導式:一行取代 for 迴圈](https://www.kbwen.com/python-list-comprehension/) (lang: zh-Hant; translation of: https://www.kbwen.com/python-list-comprehension-explained/): 用比較白話的方式聊 Python 列表推導式:把它翻回普通的 for 迴圈來看,順便用 Python 3.14 實測一下變數外洩跟效能到底是怎樣。 - [怎麼寫你的第一個 skill — 從一個煩躁的 prompt 開始](https://www.kbwen.com/writing-your-first-skill/) (lang: zh-Hant): 你的第一個 skill 不會長得像書裡那些 production-grade 的成熟形態,它會長得像「你重複打三次的同一個 prompt」。從那裡開始,比從一個成熟框架的 skill 倒著學容易很多。 - [13 行的 skill:AI 起稿,我事後才看懂](https://www.kbwen.com/anatomy-of-a-13-line-skill/) (lang: zh-Hant): 我請 AI 幫我寫一個能從 Claude Code 呼叫 Codex CLI 的 skill,它給我 13 行 markdown。13 行很小,但 skill 跟 prompt 真正的差別不在這 13 行裡——在它指過去的那一份東西裡。 - [MCP 資安危機:問題出在治理](https://www.kbwen.com/mcp-security-governance-problem-zh/) (lang: zh-Hant; translation of: https://www.kbwen.com/mcp-security-governance-problem/): MCP(Model Context Protocol)一年內成為 AI 業界標準,2026 年卻接連爆出 RCE、tool poisoning、rug pull 等資安漏洞。本文整理多方專家觀點,並提出我的看法:真正要補的是治理這一層。 - [Skill 邊界設計:從能力到合約](https://www.kbwen.com/skill-boundary-design/) (lang: zh-Hant; translation of: https://www.kbwen.com/skill-design-as-interface-design/): 一個 skill 會多可預測,大概就看它的邊界劃得多清楚。把它當能力清單,它會亂跑;把它當合約(講好輸入、輸出、不碰什麼),它就比較像一個設計良好的 API。 - [Token 成本的真相:分級,但別分太細](https://www.kbwen.com/token-cost-and-budget-tiers/) (lang: zh-Hant; translation of: https://www.kbwen.com/token-economics-of-ai-agent-governance/): 把 token 當設計變數而非月底帳單:太粗、沒在管的任務成本沒有上限,但分太細也不會更省。快取讓過度切分反而更貴,重點是找到對的顆粒度。 - [Work Log:跨 session 的記憶機制](https://www.kbwen.com/work-log-cross-session-continuity/) (lang: zh-Hant): AI 代理每個新對話都失憶?Work Log 用一份 markdown 記錄任務進度與決策,讓 Claude Code 跨 session 接續,不用每次重講背景。 - [只用 Prompt 和技能,也能做到基本治理](https://www.kbwen.com/ai-governance-with-prompts-and-skills/) (lang: zh-Hant): 不用框架也能治理 AI 代理:靠 AGENTS.md / CLAUDE.md 記憶檔、evidence 習慣和範圍宣告,就能擋掉大部分 Claude Code、Cursor 的常見問題。 - [AI 代理常見痛點與我們的嘗試](https://www.kbwen.com/ai-agent-common-pitfalls-and-fixes/) (lang: zh-Hant): AI 代理(AI Agent)開發常見問題整理:輸出難核查、跳步驟、跨對話失憶、範圍失控。從實戰痛點到 Agentic OS 的應對方向,附 Claude Code 實例。 - [Token 是什麼?LLM 為何只讀 Token?](https://www.kbwen.com/what-is-token-in-llm/) (lang: zh-Hant): Token 是什麼?LLM 為何不直接處理完整字詞:解析字級、字元級、子詞級三種 tokenization 方法,包含 BPE 示範程式碼,以及 token 數量對計費和上下文長度的影響。 - [《大語言模型 LLM:其實做的事情比你想像中更單純》](https://www.kbwen.com/llm-predicts-next-token/) (lang: zh-Hant): 大語言模型 LLM 原理完整解析:從「預測下一個 token」的核心概念,到 Transformer 自注意力機制、訓練流程四步驟,以及對話生成、程式碼生成等常見應用。 - [推薦系統中的冷啟動問題](https://www.kbwen.com/recommender-cold-start-problem/) (lang: zh-Hant): 推薦系統冷啟動問題完整解析:介紹使用者冷啟動、物品冷啟動、系統冷啟動三類問題,以及排行榜推薦、社交平台授權、相似度計算、快速試探等常用解決策略。 - [Python 分批處理 list:itertools.batched 與四種常見寫法](https://www.kbwen.com/python-chunks/) (lang: zh-Hant): Python 3.12 起,itertools.batched 是把資料切成固定大小批次的標準做法:每批回傳 tuple,最後一批可能較短,3.13 再加上 strict。另外整理 yield、列表推導式、islice、numpy.array_split 各自吃什麼輸入。 - [Python 爬取每日股價(2)](https://www.kbwen.com/python-daily-stock-price-2/) (lang: zh-Hant): Python 爬取台股每日收盤行情(第二篇):使用 pandas DataFrame 整理 TWSE 資料,搭配 xlsxwriter 儲存成 xlsx 格式,可依日期取得歷史收盤價。 - [Python 爬取每日股價(1)](https://www.kbwen.com/python-daily-stock-price-1/) (lang: zh-Hant): Python 爬取台灣證交所每日收盤行情(第一篇):用 DevTools 找到 MI_INDEX API,解析 JSON 取得全部股票的開盤、收盤、最高最低價及成交量資料。 - [Tensorflow2 -- MNIST](https://www.kbwen.com/tensorflow2-mnist/) (lang: zh-Hant): TensorFlow 2.x 實作 MNIST 手寫數字辨識:比較繼承 tf.keras.Model 與 Sequential API 兩種建模方式,以及 GradientTape 自訂訓練迴圈的完整程式碼。 - [Python 爬取即時股價](https://www.kbwen.com/python-realtime-stock-price/) (lang: zh-Hant): 用 Python 爬取台股即時股價:從 DevTools 找到證交所 getStockInfo API,解析 JSON 回應,取得台積電等個股的即時成交價、最高最低價與五檔報價。 - [Google NLP API parsing](https://www.kbwen.com/google-nlp-api-parsing/) (lang: zh-Hant): 使用 Google Cloud Natural Language API 進行中英文語意分析:從 GCP API Key 設定、JSON 請求格式,到解讀 partOfSpeech、lemma 和 dependencyEdge 結果。 - [Python Comments](https://www.kbwen.com/python-comments/) (lang: zh-Hant): 三引號字串只有放在模組、函式或類別的第一個陳述式才會變成 docstring 進到 __doc__,放在其他位置就是一段求值完丟掉的運算式,而 # 註解在語法階段就被忽略。用 __doc__ 和 dis 實際跑一次看兩者的差別。 - [Python context manager](https://www.kbwen.com/python-context-manager/) (lang: zh-Hant): 學習 Python with 語句與 context manager:如何用 __enter__ 和 __exit__ 管理資源,確保文件、連線等資源被正確釋放,避免資源洩漏。 - [Python Iterable](https://www.kbwen.com/python-iterable/) (lang: zh-Hant): 只實作 __getitem__ 的物件,for 迴圈跑得動、iter() 也拿得到 iterator,但 isinstance(obj, Iterable) 會回 False。本文用跑得出來的程式碼示範這個落差,並說明 iterator 為什麼只能走一遍。 - [python pdb](https://www.kbwen.com/python-pdb/) (lang: zh-Hant): 介紹 Python 內建除錯工具 pdb 的三種使用方式:命令列直接執行、設定斷點以及 Python shell 中使用 pdb.pm(),讓你告別 print 除錯法。 - [OpenCV 人臉偵測](https://www.kbwen.com/opencv-face-recognition/) (lang: zh-Hant): OpenCV Haar Cascade 人臉偵測:AdaBoost 弱分類器級聯架構,scaleFactor 與 minNeighbors 到底在數什麼、為什麼要一起調,用 detectMultiScale2 讀出鄰居數量,以及這些 cascade 檔案在現在的 OpenCV 裡的狀態。 - [k-NN 是什麼:手刻最近鄰,以及向量檢索為什麼改用近似搜尋](https://www.kbwen.com/ml-knn/) (lang: zh-Hant): 從 2017 年那支用 Scipy 手刻的 k-NN 出發:iris 對半切、for 迴圈掃過全部訓練資料,再看 KD tree 怎麼把 75 萬筆的精確查詢壓到毫秒等級,以及維度上到 768 之後樹狀索引為什麼失效、向量檢索為什麼改用 HNSW 這類近似索引。 - [LSTM 是什麼:三個閘門怎麼運作](https://www.kbwen.com/lstm/) (lang: zh-Hant): LSTM 用遺忘門、輸入門、輸出門三道閘控制 cell state,讓資訊靠加法而不是連乘往前傳,避開一般 RNN 的梯度消失。這篇把當年只列了名字的閘門部分補完,並交代它在 Transformer 之後的位置。 - [Kaggle Titanic 入門:資料裡的訊號在哪裡](https://www.kbwen.com/kaggle-titanic/) (lang: zh-Hant): Kaggle Titanic 解題紀錄:2017 年用 Logistic Regression 拿到 0.76555,加上回頭讀那支程式的筆記。preprocessing 先把 Age 正規化才跑 Age 小於 16 的規則,Sex 整欄變成同一個值;0.76555 換算回去是 418 題裡答對 320 題。 - [TensorFlow 練習 4:word2vec](https://www.kbwen.com/tensorflow-exercise-4-word2vec/) (lang: zh-Hant): TensorFlow 練習:用 skip-gram 實作 word2vec 詞向量,並拆開 nce_loss 那一行:訓練時為什麼不掃整張詞彙表,改抽 K 個負面樣本問是非題,以及那些負面樣本是怎麼抽出來的。 - [TensorFlow 練習 2:CNN](https://www.kbwen.com/tensorflow-exercise-2-cnn/) (lang: zh-Hant): TensorFlow 練習:用卷積神經網路 CNN 辨識 MNIST 手寫數字,實作兩層 convolution + max pooling + dropout 架構,準確率達 97%~99%。 - [PLA 感知器演算法:權重修正那一步在做什麼](https://www.kbwen.com/python-machine-learning-basics-ls-pla/) (lang: zh-Hant): 根據林軒田機器學習基石課程實作 PLA,並拆開 w ← w + y·x 這一步:它對內積做了什麼、線性可分為什麼是收斂的前提、資料不可分時為什麼不會停,以及 Pocket PLA 和今天的損失函數換掉了什麼。 - [TensorFlow 練習 1:Polynomial Regression](https://www.kbwen.com/tensorflow-exercise-1-polynomial-regression/) (lang: zh-Hant): TensorFlow 練習:用神經網路擬合二維四次多項式 Polynomial Regression,介紹 tf.placeholder、tf.Variable、square error loss 和梯度下降優化器的基礎用法。 ## About - [About](https://www.kbwen.com/about): KbWen 的個人介紹與專業背景。 ## Optional - [GitHub](https://github.com/KbWen): Source code and side projects. - [Lab](https://lab.kbwen.com/): Interactive demos and experiments. - [Privacy Policy](https://www.kbwen.com/privacy-policy): Site privacy policy.