Skip to content

Record PLM tokenizer normalization blocker - #662

Merged
justinchuby merged 3 commits into
mainfrom
justinchuby-exact-plm-gguf
Aug 27, 2026
Merged

Record PLM tokenizer normalization blocker#662
justinchuby merged 3 commits into
mainfrom
justinchuby-exact-plm-gguf

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • pins PLM-Team/PLM-1.8B-Instruct-gguf@7bec6546983bcf0d99526c943580bd49e2237445 and artifact SHA-256 b38570ee56ebec82a1e9ef45ab408c0d8230ececef1d7f1b267c49cff35638b8
  • pins official tokenizer source PLM-Team/PLM-1.8B-Instruct@62d188c7d58843d7013d5b3ffe198db448787860
  • records exact 151,936-token / 151,387-merge header closure, 151,646 source tokens plus 290 deterministic padding IDs, special IDs, token types, assets, chat template, and pipeline hashes
  • commits all 72 multilingual, whitespace, Unicode, adversarial-special, BOS-mode, and ID-level llama.cpp outputs; network-free tests reconstruct every ordered case and recompute corpus, overall-result, and per-mode hashes
  • binds corpus SHA-256 0f3c77d24208f2ac0833668128cb2a00adcb7e6b4b4eedc6e4783e3ec7b41f5a and result SHA-256 66513168812575ccac974ecb454e916def5f4492d558c1866b8811d4f587a41d to llama.cpp 8d9af256337d1a501250f9bbf4c0859a654bddd6
  • fails closed for this PLM artifact: official NFC maps decomposed to token 963, while pinned llama.cpp preserves it as tokens 68 and 53839

Tests

  • python -m pytest src/mobius/integrations/gguf/_tokenizer_evidence_test.py src/mobius/integrations/gguf/_docs_test.py -q --tb=short (36 passed)
  • python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k "not phi4mm and not apply_weights_unknown" --tb=short (8,471 passed, 62 skipped, 12 deselected)
  • lintrunner f --output oneline --all-files

Review

GPT-5.6 Sol, medium reasoning: final review found no code/evidence issue; its sole observation was to commit the already validated concise generated-doc changes, now included in c0749bef.

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 26, 2026 20:34
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 57f1db4c0749be

Model Sub-model Changes Status

No architecture changes detected.


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing 57f1db4c0749be

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0%
bert (feature-extraction) num_nodes 68 68 +0.0%
falcon model_size_bytes 364 KB 364 KB +0.0%
falcon num_nodes 66 66 +0.0%
gemma2 model_size_bytes 428 KB 428 KB +0.0%
gemma2 num_nodes 105 105 +0.0%
gpt2 model_size_bytes 324 KB 324 KB +0.0%
gpt2 num_nodes 54 54 +0.0%
llama model_size_bytes 425 KB 425 KB +0.0%
llama num_nodes 60 60 +0.0%
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0%
llama (static-cache) num_nodes 56 56 +0.0%
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0%
mamba (ssm-text-generation) num_nodes 94 94 +0.0%
phi3 model_size_bytes 421 KB 421 KB +0.0%
phi3 num_nodes 58 58 +0.0%
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0%
phi3 (static-cache) num_nodes 54 54 +0.0%
qwen2 model_size_bytes 425 KB 425 KB +0.0%
qwen2 num_nodes 60 60 +0.0%
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0%
qwen2 (static-cache) num_nodes 56 56 +0.0%
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0%
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0%
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0%
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0%
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0%
qwen3_5_vl (hybrid-qwen-vl) num_nodes 450 450 +0.0%
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0%
t5 (seq2seq) num_nodes 176 176 +0.0%
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0%
whisper (speech-to-text) num_nodes 128 128 +0.0%

No performance regressions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “fail-closed” evidence path for GGUF tokenizer materialization, capturing a pinned PLM GGUF artifact whose embedded tokenizer behavior (llama.cpp qwen2 handling of decomposed Unicode) is provably incompatible with the official HuggingFace tokenizer, and ensuring the pipeline errors with a precise, evidenced reason instead of silently producing a mismatched tokenizer.

Changes:

  • Introduces GGUFTokenizerBlockerEvidence and a small blocker registry, plus selection logic in matching_tokenizer_evidence() that raises an explicit “materialization is blocked” error on an exact identity match.
  • Adds a pinned llama.cpp oracle JSON fixture + unit tests binding the blocker record to the fixture and asserting the fail-closed behavior.
  • Extends generated/public GGUF docs to include a “Fail-closed tokenizer evidence” table.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/data/gguf_plm_qwen2_tokenizer_blocker.json Adds pinned oracle fixture describing the normalization mismatch witness and case hashes.
src/mobius/integrations/gguf/_tokenizer_evidence.py Adds blocker evidence dataclass + registry and enforces fail-closed behavior on exact identity matches.
src/mobius/integrations/gguf/_tokenizer_evidence_test.py Adds tests validating blocker scoping, fixture binding, and the explicit error message path.
src/mobius/integrations/gguf/_docs.py Renders a new fail-closed tokenizer evidence table into the generated GGUF API documentation.
docs/api/build_from_gguf.md Updates published docs with the new fail-closed evidence section/table.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Pin the official PLM GGUF and tokenizer identities, preserve complete header/token closure evidence, and bind a multilingual/adversarial llama.cpp oracle to the pinned dispatch revision. Fail closed for the exact PLM artifact because the official NFC normalizer diverges from llama.cpp qwen2 behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d7199b2-384e-4547-8c01-1a71172ce681
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Commit every pinned llama.cpp tokenization result and derive the corpus, full-result, and per-mode hashes in network-free tests. Bind the corpus digest into the architecture-scoped blocker evidence so input changes cannot preserve qualification by count alone.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d7199b2-384e-4547-8c01-1a71172ce681
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Render fail-closed tokenizer evidence as compact entries so the generated support document remains within its enforced line budget after rebasing onto current main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0d7199b2-384e-4547-8c01-1a71172ce681
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby
justinchuby force-pushed the justinchuby-exact-plm-gguf branch from 5b650ea to c0749be Compare August 27, 2026 05:31
@justinchuby
justinchuby merged commit cc3647e into main Aug 27, 2026
23 of 24 checks passed
@justinchuby
justinchuby deleted the justinchuby-exact-plm-gguf branch August 27, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants