You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TorchSharp text trainers (TextClassification, SentenceSimilarity, NER, QA) drop every input character above U+00FF — non-Latin text reaches the model as nothing #7858
The tokenizer every NAS-BERT / RoBERTa trainer in Microsoft.ML.TorchSharp builds (TokenizerExtensions.GetInstance(IChannel) — an EnglishRobertaTokenizer created with unsupported characters filtered) removes every input character above U+00FF on encode, before BPE. No <unk> id is produced; the characters vanish silently, so nothing during training reports it. Affected: TextClassificationTrainer, SentenceSimilarityTrainer, NerTrainer, QATrainer.
#7749 covers the decode side of the same filter (QA answers); this is the input side.
A character-by-character check over U+0021–U+2FFF: a character is kept exactly when it is ≤ U+00FF.
Impact
On Korean news, dialogue and sentence corpora, 82–89% of non-space characters (73–81% of words) are removed before the model sees them. Text classification, sentence similarity and NER then train on the digits, Latin letters and punctuation that are left, and report ordinary-looking metrics.
Either byte-level encoding of characters outside Latin-1 (what GPT-2/RoBERTa byte-level BPE does by design), or an explicit error/warning when input text loses characters — plus documentation that these trainers are Latin-1-only until then.
Activity
docs: link the upstream tokenizer reports (dotnet/machinelearning#7858,…
svick commentedon Oct 29, 2026
Triage: this looks like a bug, we'll take a look when we have time.
We should investigate a correction compatible with the pretrained models and existing saved models.