Clean up OLMo 3.X tokenizer docs, create instruct-release tokenizer#1487
Clean up OLMo 3.X tokenizer docs, create instruct-release tokenizer#1487natolambert merged 14 commits intomainallenai/open-instruct:mainfrom docs-olmo3-tokenizer-cleanupallenai/open-instruct:docs-olmo3-tokenizer-cleanupCopy head branch name to clipboard
Conversation
- Rewrite the OLMo 3.X section into clear per-stage bullet points (Think SFT, Think eval, Think release, Instruct release) - Note plan to fix the <think> masking bug workaround - Add TODO to consider renaming think-dev/release since they include function calling (differs from original OLMo 3 think tokenizers) - Create allenai/olmo-3-tokenizer-instruct-release on HuggingFace (instruct-dev + Olmo identity system prompt) - Update TLDR section to reference the four canonical tokenizer names Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @natolambert, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the clarity and standardization of tokenizer usage for OLMo 3.X models. It refines the documentation to provide a structured guide for different stages of model development and deployment, introduces a new release-ready tokenizer, and addresses potential ambiguities in tokenizer naming and functionality. The changes aim to streamline the process of working with OLMo 3.X tokenizers for both training and inference. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the clarity and organization of the OLMo 3.X tokenizer documentation. The changes, including rewriting a key section into a clear bulleted list and updating the TLDR with canonical tokenizer names, make the information much more accessible. The addition of the instruct-release tokenizer is also noted. I have one minor suggestion to update a placeholder in the changelog before merging.
Documentation Changes Detected📄
|
Documentation Changes Detected📄
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57c3e10be6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The think tokenizers include function calling (unlike original OLMo 3 think tokenizers), so rename to 3.2 to make this clear. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The TLDR bullet for Think incorrectly suggested using think-dev for all training including SFT. Think SFT must use instruct-dev to avoid the <think> masking bug. think-dev is only for evaluation and post-SFT stages (DPO, RL). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
Documentation Changes Detected📄
|
- Add scripts/utils/diff_tokenizers.py for comparing HF tokenizer repos file-by-file with pretty-printed chat_template diffs - Reference the tool in the docs - Verified all four tokenizer pairs: dev vs release differs only in the system prompt as expected Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- export_chat_template.py: export chat template to Jinja file - test_chat_templates.py: render canned examples with a chosen template - visualize_tokenization.py: visualize SFT tokenization masking - render_chat_template_examples.py: render chat template outputs for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
Documentation Changes Detected📄
|
Pretty-print Jinja templates with proper indentation (one statement per line, nested blocks indented). Skip the unreadable raw tokenizer_config.json diff and only show the formatted version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
Add --rev-a and --rev-b flags to diff_tokenizers.py so you can compare a single repo across commits, e.g.: python scripts/tokenizers/diff_tokenizers.py allenai/olmo-3.2-tokenizer-think-dev --rev-a abc123 --rev-b main Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
Documentation Changes Detected📄
|
- Add allow_patterns filter so snapshot_download only fetches tokenizer files, not model weights (safe to run on full model repos) - Add chat_template.jinja to downloaded files and pretty-print its diff Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
When both exist in a HF repo, transformers loads the .jinja file. Documented this to avoid subtle mismatches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
Supports loading real HuggingFace dataset rows (streaming, no full download). Auto-detects SFT (messages key) and DPO (chosen/rejected keys), rendering each conversation separately. Lazy-imports open_instruct to avoid torch segfault on shutdown. Usage: uv run python scripts/tokenizers/test_chat_templates.py --model-name allenai/OLMo-3.2-Hybrid-7B-Instruct-SFT --dataset allenai/Dolci-Instruct-DPO --row-idx 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documentation Changes Detected📄
|
saumyamalik
left a comment
There was a problem hiding this comment.
looks great! Thanks for adding this!
Documentation Changes Detected📄
|
Summary
<think>masking bug workaround.olmo-3toolmo-3.2since they include function calling (differs from original OLMo 3 think tokenizers).allenai/olmo-3-tokenizer-instruct-releaseon HuggingFace (same asinstruct-devbut with Olmo identity system prompt).instruct-dev(notthink-dev).scripts/tokenizers/:diff_tokenizers.py,export_chat_template.py,test_chat_templates.py,visualize_tokenization.py,render_chat_template_examples.py.--rev-a/--rev-bflags todiff_tokenizers.pyfor comparing the same repo at two different commits.toolsis an empty list[], the template now correctly omits<functions>(previously only checked fornone, so[]would render<functions>[]</functions>).Tokenizer matrix
olmo-3-tokenizer-instruct-devolmo-3-tokenizer-instruct-release(new)olmo-3.2-tokenizer-think-dev(renamed)olmo-3.2-tokenizer-think-release(renamed)Test plan
instruct-releasediffers frominstruct-devonly in system prompt viadiff_tokenizers.pythink-releasediffers fromthink-devonly in system prompt viadiff_tokenizers.pytools=[]fix via--rev-a/--rev-bdiff on each tokenizeruv run mkdocs serve🤖 Generated with Claude Code