v0.40.0-rc1:MLXのトークナイザー処理を配布元の仕様に適合(#18779)v0.40.0-rc1: mlx: match publisher tokenizer semantics (#18779)
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy
- Ollama v0.40.0-rc1は、MLXのトークナイザー処理を配布元の仕様に合わせ、前処理順序、Unicode境界、追加トークン、BPE結合の扱いを修正した。
- GoとPythonの共通テストも加わり、モデル互換性を検証しやすくなる。
Ollama v0.40.0-rc1 aligns MLX tokenization with publisher behavior for stage order, Unicode boundaries, added tokens, and BPE merges, improving model compatibility.
本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (github.com) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (github.com).
要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.
MLX処理
Ollama v0.40.0-rc1では、MLXのトークナイザー処理が配布元の仕様に合うよう修正された。モデルとの互換性に関わる文字列の分割や結合だけでなく、処理順序や境界判定まで対象となっている。
前処理と境界
前処理では、プリトークナイザーの各段階を適用する順序と、文字列を分割する際の挙動が配布元の仕様に合わせられた。Unicode境界の扱いも修正され、文字の境界を踏まえたトークン化が行われる。空のMetaspace入力についても、一貫した処理になるよう対応している。
追加トークン
追加トークンでは、正規化の扱いが見直されたほか、空の追加トークンも処理できるようになった。BPE結合については、順位付けされたマージ規則を反映するよう修正された。バイトフォールバックや設定の優先順位、並列エンコードには、個別の回帰テストが追加されている。
GoとPython
公開済みのトークナイザーを使うGoとPythonの共通参照テストも加わった。不足しているモデルは直接取得し、エラーが起きた場合はテストを失敗させる構成となる。両言語で参照ケースを共有することで、今回のトークナイザー処理とモデル互換性を検証しやすくしている。
Publisher Tokenizer Semantics
Ollama v0.40.0-rc1 aligns MLX tokenizer processing with publisher behavior. The changes matter for model compatibility because tokenization now follows the published semantics more closely across several processing stages.
Pretokenizer Stage Order
The update honors pretokenizer stage order, split behavior, and Unicode boundaries. It also adjusts added-token normalization and applies ranked BPE merges.
These details determine how input is divided and processed by the tokenizer. Matching the publisher’s ordering and boundary behavior helps ensure that MLX tokenization produces results consistent with the relevant tokenizer specifications.
Added Tokens and Metaspace
Empty added tokens are now handled consistently. The same applies to empty Metaspace input.
The release also includes focused regression coverage for configuration precedence and byte fallback. Additional regression cases cover parallel encoding, allowing these specific behaviors to be checked against future changes.
Go and Python Cases
Shared Go and Python reference cases have been added using published tokenizers. When required models are missing, the reference process pulls them directly and fails when errors occur rather than continuing without them.
Together, the shared reference cases and focused regressions provide checks for the corrected tokenizer behavior across both implementations. They cover the stage-order, splitting, Unicode, added-token, BPE, configuration, fallback, and parallel-encoding changes included in v0.40.0-rc1.
ポコとTECHガイドPoko & TECH Guide
ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.
- ポコPoko前処理順序からBPE結合まで直して、GoとPythonの共通テストも追加されたんだ。これって大きいこと?They fixed everything from stage order to BPE merges, then added shared Go and Python tests. Is that a big change?
- TECHガイドTECH GuideMLXの分割結果を配布元の仕様にそろえる変更だよ。モデル互換性を確かめやすくする、まとまった修正だね。It aligns MLX tokenization with the publisher’s behavior. That’s a substantial set of fixes aimed at making model compatibility easier to verify.
- ポコPokoそもそも、トークナイザーって何をしてるの?What does a tokenizer actually do?
- TECHガイドTECH Guide文章を、モデルが扱う小さな単位に分ける仕組みだよ。Unicodeの境界や追加トークンの扱いでも結果が変わるんだ。It splits text into smaller units a model can handle. Unicode boundaries and added-token handling can change the result.
- ポコPokoぼくなら、同じモデルをGoとPythonで試して、分け方がそろうか確かめてみたいな。I’d try the same model in Go and Python and see whether they split the text consistently.
- TECHガイドTECH Guide共通の参照ケースが追加されたから、その確認には合いそう。足りないモデルは直接取得し、エラー時は失敗として扱う条件だよ。The new shared reference cases should help with that. Missing models are pulled directly, and errors are treated as test failures.
