Skip to content

Add blog post: No Token Left Behind — TITO in Miles#335

Open
Shi-Dong wants to merge 15 commits into
lm-sys:mainfrom
Shi-Dong:shi/tito-blog
Open

Add blog post: No Token Left Behind — TITO in Miles#335
Shi-Dong wants to merge 15 commits into
lm-sys:mainfrom
Shi-Dong:shi/tito-blog

Conversation

@Shi-Dong
Copy link
Copy Markdown

Summary

  • Adds a new blog post under blog/2026-05-13-no-token-left-behind.md titled "No Token Left Behind: Demystifying Token-In-Token-Out in Miles", explaining the TITO design principle and its implementation in the Miles RL framework.
  • The post walks through three common ways TITO breaks (detokenize-retokenize mismatch, chat-template cut-thinking, lossy chat-template re-rendering) and the four-component Miles implementation: inference session server, append-only enforcement at three levels, a pluggable TITO tokenizer with per-model splice-point patches (Qwen3, GLM-4.7), and a token-sequence comparator with CI verification.
  • Adds 7 supporting diagrams under public/images/blog/tito/.

Test plan

  • npm run dev locally and verify the new post renders correctly on /blog/no-token-left-behind.
  • Confirm the previewImg (/images/blog/tito/definition.png) shows on the blog index.
  • Inline math ($n$, $x_t$, $\pi(x_t|\mathbf{x})$) renders.
  • All seven embedded images load.
  • External links to the Miles repo and Hugging Face chat-template playground resolve.

Shi Dong added 3 commits May 13, 2026 07:16
Introduces the Token-In-Token-Out (TITO) design principle in the
Miles RL framework: three common failure modes (detokenize-retokenize
mismatch, chat-template cut-thinking, lossy re-rendering) and the
four-component implementation (inference session server, append-only
enforcement at three levels, pluggable TITO tokenizer with per-model
splice-point patches, and a token-sequence comparator with CI
verification).
@Shi-Dong Shi-Dong changed the title Add blog post: No Token Left Behind — TITO in Miles [DO NOT MERGE] Add blog post: No Token Left Behind — TITO in Miles May 13, 2026
Comment thread blog/2026-05-13-no-token-left-behind.md
Comment thread blog/2026-05-13-no-token-left-behind.md
Comment thread blog/2026-05-13-no-token-left-behind.md Outdated
Comment thread blog/2026-05-13-no-token-left-behind.md
Comment thread blog/2026-05-13-no-token-left-behind.md Outdated
Comment thread blog/2026-05-13-no-token-left-behind.md Outdated

## Supported Models

The TITO pipeline currently supports the following models natively (thinking & non-):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

What does non- mean here?

Comment thread blog/2026-05-13-no-token-left-behind.md Outdated
The TITO pipeline currently supports the following models natively (thinking & non-):

- **Qwen**: Qwen3, Qwen3.5, Qwen3-Next
- **GLM**: GLM-4.7, GLM-5
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think GLM-5.1 is also supported. Add it here.

Comment thread blog/2026-05-13-no-token-left-behind.md Outdated
- **Kimi**: Kimi-K2, Kimi-K2.5, Kimi-K2.6
- **Nemotron**: Nemotron-3
- **Minimax**: Minimax-M2.5, Minimax-M2.7
- **Deepseek**: Deepseek-v3.2, Deepseek-v4 (only the `tool` role is supported for v4)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

(only the tool role is supported for v4)

I think it is strange to put this note here. Consider moving it below.

Comment thread blog/2026-05-13-no-token-left-behind.md Outdated
- **Deepseek**: Deepseek-v3.2, Deepseek-v4 (only the `tool` role is supported for v4)
- **Deepseek**: Deepseek-v3.2, Deepseek-v4

For each model, TITO is verified to handle the following combinations of message roles a harness may append after the first assistant turn:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Perhaps note "(except Deepseek-v4)" here.

@Shi-Dong Shi-Dong changed the title [DO NOT MERGE] Add blog post: No Token Left Behind — TITO in Miles Add blog post: No Token Left Behind — TITO in Miles Jun 5, 2026
Comment thread blog/2026-05-13-no-token-left-behind.md Outdated

Deepseek-v4 currently supports only the `{tool}` surface.

Adding a new model is usually a fixed Jinja template plus a small [`merge_tokens`](https://github.com/radixark/miles/blob/3270915550fcd69dce788f382fa8c12548a63618/miles/utils/chat_template_utils/tito_tokenizer.py) override.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

  1. Combine this with the previous paragraph.
  2. Should convey the idea that supporting a model is easy.
  3. Currently it feels that the blog post is cut off. Make the blog post properly ended.

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.

1 participant