Bytes and Characters

A visible character and the bytes used to store it are not always the same unit. That distinction affects how much text a model receives and whether its representation can handle unfamiliar writing.

14 sections · 15 questions · 4 coding challenges

1 / 14

How Could One Encoding Carry Text from Many Languages?

BOTIE

A computer stores bytes, but a written character is not necessarily one byte. Small character encodings could not represent every writing system, and simply making all characters wider would disrupt software built around existing byte-oriented text.

Ken Thompson and Rob Pike developed UTF-8 for Plan 9 in 1992. It provided a variable-length representation compatible with ASCII for its existing characters. The encoding allowed a wider range of character values while retaining useful properties for processing byte streams.

This separates three things we should not confuse: stored bytes, Unicode code points, and the characters a reader perceives. One visible character may involve several code points, and a code point may require several UTF-8 bytes. A byte tokenizer can represent unfamiliar text without a word vocabulary, but it usually creates more positions for the model to process.

Sources for this history