# Issue with XLM-RoBERTa tokenizer

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissue-with-xlm-roberta-tokenizer%2F38311%3E%5C
**Category:** 🤗Tokenizers\
**Created:** [May 1, 2023, 2:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissue-with-xlm-roberta-tokenizer%2F38311 "2023-05-01T14:57:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozanarmagan](https://avatars.discourse-cdn.com/v4/letter/o/bc8723/32.png) [@ozanarmagan](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fozanarmagan)%5C
**Post date:** [May 1, 2023, 2:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissue-with-xlm-roberta-tokenizer%2F38311%2F1 "2023-05-01T14:57:25Z")

</div>

Hi;

I have a problem with encoding with XLM-RoBERTa sentencepiece tokenizer. Why is the hugging face encoding 1 greater compared to the google sentencepiece encoding?

Example

```auto
## Hugging Face:
tokenizer_xlmroberta.encode("I don't understand why",add_special_tokens=False)

```

Output: [87, 2301, 25, 18, 28219, 15400]

```auto
## Sentencepiece:
tokenizer_xlmroberta_.encode_as_ids("I don't understand why")

```

Output: [86, 2300, 24, 17, 28218, 15399]

---

<div class="post-metadata">

**Author:** ![stryptsTester99](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@stryptsTester99](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FstryptsTester99)%5C
**Post date:** [August 15, 2024, 7:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissue-with-xlm-roberta-tokenizer%2F38311%2F2 "2024-08-15T19:11:54Z")

</div>

Hey  
I am having the same issue, have you found any solution?  
Kind regards
