[DO NOT MERGE] Add blog post: No Token Left Behind — TITO in Miles#335
Open
Shi-Dong wants to merge 4 commits into
Open
[DO NOT MERGE] Add blog post: No Token Left Behind — TITO in Miles#335Shi-Dong wants to merge 4 commits into
Shi-Dong wants to merge 4 commits into
Conversation
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
commented
May 13, 2026
Shi-Dong
commented
May 13, 2026
|
|
||
| An *inference session* is a single trajectory's interaction with the inference engine — the sequence of turns belonging to the same task, sharing one growing token buffer. The [inference session server](https://github.com/radixark/miles/blob/3270915550fcd69dce788f382fa8c12548a63618/miles/rollout/session/session_server.py#L24) is a thin server layer that maintains per-trajectory state, keyed by session id. Under each id it holds a growing token buffer `P` that is appended in place every turn. The token buffer preserves each sample's exact token-level info (logprobs, routed experts), so it can be sent directly to training. | ||
|
|
||
|  |
Author
There was a problem hiding this comment.
Note for Shi: update this diagram.
Shi-Dong
commented
May 14, 2026
| @@ -0,0 +1,188 @@ | |||
| --- | |||
| title: "No Token Left Behind: Demystifying Token-In-Token-Out in Miles" | |||
| author: "Miles Team" | |||
Author
There was a problem hiding this comment.
Author: Jiajun Li, Yanbin Jiang, Mao Cheng, Shi Dong, Yusheng Su, Yueming Yuan, Zhichen Zeng, Banghua Zhu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
blog/2026-05-13-no-token-left-behind.mdtitled "No Token Left Behind: Demystifying Token-In-Token-Out in Miles", explaining the TITO design principle and its implementation in the Miles RL framework.public/images/blog/tito/.Test plan
npm run devlocally and verify the new post renders correctly on/blog/no-token-left-behind./images/blog/tito/definition.png) shows on the blog index.$n$,$x_t$,$\pi(x_t|\mathbf{x})$) renders.