Cannot tokenize byte sequences that are not valid UTF-8 due to design flaw
Open
- Dominant language
- Rust
- Stars
- 134
- Forks
- 24
- Avg merge
- 16h 27m
- Merged PRs (30d)
- 11
Description
Hello,
The BPE algorithm is capable of tokenizing any byte sequence, and LLMs generally accept any sequence of tokens and use token dictionaries that can successfully represent any byte sequence, but the encode method in bpe-openai accepts a type that has to be valid UTF-8. So there are lots of byte sequences, many of which are only 1 byte long, which you cannot tokenize using this library.
Contributor guide
Research direction
Start by inspecting the bpe-openai encode method and the input type it accepts. Determine how the library should expose arbitrary byte sequences, then add coverage for invalid UTF-8 inputs and verify that all byte sequences can be tokenized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100