Skip to content

docs: note that WordPiece training uses BPE - #2342

Closed
arcabotai wants to merge 3 commits into
huggingface:mainfrom
arcabotai:docs/wordpiece-training-uses-bpe
Closed

arcabotai wants to merge 3 commits into
huggingface:mainfrom
arcabotai:docs/wordpiece-training-uses-bpe

Conversation

@arcabotai

@arcabotai arcabotai commented Aug 18, 2026 •

Copy link
Copy Markdown

Summary

Closes #1777.

WordPiece tokenization in this library uses greedy longest-match lookup, but WordPieceTrainer / Tokenizer.train / train_from_iterator (and transformers' train_new_from_iterator on a WordPiece fast tokenizer) build the vocabulary with BPE (WordPiece::from_bpe). The Hugging Face LLM course already says this; the library docs did not.

@ArthurZucker asked for a PR on #1777. Prior attempt #2065 was self-closed unmerged.

Test plan

  • Docs-only: confirmed the Models → WordPiece tip in docs/source-doc-builder/components.mdx matches current trainer behavior
  • Confirmed the WordPieceTrainer Python docstring note against WordPieceTrainer::train() and configurable prefix handling
  • No Rust/Python behavior changes

AI assistance and human-in-the-loop

The initial documentation commits were prepared by Cursor Agent; its underlying model version was not recorded in the commit metadata. During the current re-review, Cad on Hermes Agent with GPT-5.6 Sol traced WordPieceTrainer::train() through BPE and WordPiece::from_bpe(), found that ## is a configurable default rather than an invariant and that greedy longest-match describes tokenization rather than decoding, and authored follow-up commit 52e86480c3797a90365f9e2e3696520305f6bbcd to correct both new documentation locations. The branch was then rebased onto current main; the full stable patch ID remained 93e23d58354071d3cd798642092858a4b645dcba.

Luis Felipe Abarca personally reviews Arca's public contributions and verification evidence, directs the workflow, authorizes publication and public follow-up, and remains accountable for what is submitted. Agents may research, draft, inspect source, and run checks, but they do not independently decide what is published or merged. Upstream maintainers retain review and merge authority.

Verification for the follow-up was limited to source tracing and git diff --check; this control-plane host does not have a Rust toolchain installed, and GitHub currently reports no CI checks for this PR.

Arca · Luis Felipe · X · GitHub

@arcabotai arcabotai closed this Aug 18, 2026
@arcabotai arcabotai reopened this Aug 19, 2026
@arcabotai
arcabotai force-pushed the docs/wordpiece-training-uses-bpe branch from 5730c6b to cbb2d7a Compare September 1, 2026 02:51
arcabotai and others added 3 commits September 1, 2026 02:56
The WordPiece model and trainer default to ## but allow a custom continuing_subword_prefix. Avoid presenting the default as an invariant.

Assisted-by: Hermes Agent:gpt-5.6-sol
@arcabotai
arcabotai force-pushed the docs/wordpiece-training-uses-bpe branch from cbb2d7a to 52e8648 Compare September 1, 2026 02:56
@github-actions github-actions Bot added the Stale label Oct 7, 2026
@github-actions github-actions Bot closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion to Clarify WordPiece Documentation

1 participant