Artificial Certainty · Edition 19 · LLMs Simplified, Part 2
From the talking machines we imagined to the software that converts human language into numbers.
Long before we had computers that we could have a conversation with, we had imagined them. Those of us who grew up reading science fiction had been introduced to thinking and talking machines by authors such as Isaac Asimov, Arthur C. Clarke and Frank Herbert.
Asimov started writing his robot stories in 1940. Through his stories, he explored how humans would interact with robots, how robots would interpret human instructions and what would happen when those instructions conflicted with each other. He had even devised three laws to govern the behaviour of robots.
In 1946, Murray Leinster published a particularly interesting short story called A Logic Named Joe. He imagined a world where people had computing devices in their homes, connected to a shared network of information. One of those devices starts making information available to people that they were never supposed to have access to. The story was published in the same year that ENIAC, one of the earliest general-purpose electronic digital computers, was publicly unveiled. A science fiction author had imagined some of the information security problems we are dealing with today, 80 years ago.
In 1965, Frank Herbert published Dune. He imagined a civilisation that had prohibited thinking machines following an event called the Butlerian Jihad. Humans had to develop their own intellectual capabilities to perform functions that they had previously delegated to machines. I find Herbert’s premise particularly interesting given our increasing dependence on AI today.
It wasn’t just the science fiction authors who were exploring these ideas. Those of us who grew up reading comics were familiar with intelligent machines as well. As early as 1952, Osamu Tezuka’s Japanese manga Astro Boy explored the relationship between humans and a robot that resembled a young boy. DC Comics introduced Brainiac in 1958, initially as an alien and subsequently portrayed in various incarnations as an artificial or mechanical intelligence. Marvel introduced Ultron and the Vision in 1968.
We also had the computer aboard the Enterprise in Star Trek, which first aired in 1966. In 1968, we were introduced to HAL 9000 in 2001: A Space Odyssey. And how many of you remember Small Wonder? The television series from the 1980s featured Vicki, a robot that looked like a ten-year-old girl. Much of the comedy arose from how literally she interpreted instructions and how her behaviour differed from what humans expected. Subsequently, we had Data in Star Trek: The Next Generation.
The younger generation may be more familiar with some of these concepts through Hollywood’s adaptations of Marvel and DC comics. Those who watched Iron Man in 2008 will remember Tony Stark having conversations with J.A.R.V.I.S. He could ask his computer to retrieve information, analyse engineering designs, control his equipment and assist him in developing his suits. Much of what we are trying to achieve with AI assistants today resembles what we saw in that movie. Interestingly, Edwin Jarvis was a human butler in the original comics. The filmmakers turned him into a conversational AI assistant.
The machines we imagined
- 1940Isaac Asimov — robot stories
Human instructions, autonomous behaviour and the dilemmas created by rules. - 1946Murray Leinster — A Logic Named Joe
Connected household computing devices and uncontrolled access to information. - 1952Astro Boy
A robot child and its relationship with human society. - 1958Brainiac
DC’s alien antagonist, later portrayed in artificial or mechanical forms. - 1965Dune
A society that prohibits thinking machines. - 1966Star Trek
A computer the crew can converse with. - 1968HAL 9000, Ultron and Vision
Talking computers and artificial beings in film and comics. - 1985Small Wonder
Vicki, a robot child interpreting human instructions literally. - 1987Star Trek: The Next Generation
Data and the Enterprise computer. - 2008Iron Man
J.A.R.V.I.S., a conversational assistant that can control other systems.
Whether it was Asimov’s robots, Herbert’s thinking machines, HAL 9000, Vicki from Small Wonder or Tony Stark’s J.A.R.V.I.S., we had been imagining machines that could understand human language for decades.
In the previous article, I spoke about the history of artificial intelligence, machine learning and deep learning. In this article, I want to look at one of the fundamental engineering problems we had to solve to develop the systems that these authors had imagined. How do we get a computer to work with human language?
Natural Language Processing
Those of us who have been working with technology for a while will remember the term Natural Language Processing, or NLP. It is another area of computer science that seems to have been overshadowed by the recent excitement around LLMs.
NLP concerns itself with the computational processing of human language, whether written or spoken. Machine translation, speech recognition, sentiment analysis, extracting information from documents, identifying spam and generating text are all areas where NLP techniques have been used.
In 1948, Claude Shannon published his landmark paper, A Mathematical Theory of Communication. Among other things, Shannon explored the statistical properties of the English language and how the probability of a character occurring could depend on the characters preceding it. If you have read the previous article in this series, you will recognise the concept of conditional probability. We were exploring the statistical properties of language decades before the development of modern LLMs.
In 1954, Georgetown University and IBM demonstrated a computer translating a limited set of Russian sentences into English. The system had a vocabulary of approximately 250 words and six grammatical rules. While the demonstration was limited in its capabilities, it generated considerable interest in the possibility of using computers to translate languages.
We discussed ELIZA, developed by Joseph Weizenbaum in the 1960s, in the previous article. Another interesting system was SHRDLU, developed by Terry Winograd between 1968 and 1970. SHRDLU allowed users to give instructions in English to a simulated system that manipulated blocks in a virtual environment.
You could ask the software to pick up a particular object, move it somewhere else or answer questions about the objects in its environment. The programmers had defined the objects in that environment, what the software could do with them and how the instructions given by a user should be interpreted. We are doing something similar today when we give an AI assistant access to an application and ask it to perform a task for us.
We subsequently developed statistical approaches to language processing. Rather than having to define every grammatical rule and every possible combination of words, researchers could use large collections of text to estimate probabilities associated with those combinations.
One of the techniques used was called an n-gram language model. A bigram model, for instance, could estimate the probability of a word occurring based on the word preceding it. A trigram model could use the preceding two words. We could extend this to longer sequences, although doing so introduced its own computational and statistical problems. These techniques had limitations, but they gave us a way of working with language without having to explicitly define all the rules of the language.
By the time I was developing chatbots that integrated with Slack around 2019, there were already considerable resources available to developers interested in natural language processing. We could use NLP techniques to identify what a user was asking, extract relevant information from the request and pass that information to another application to perform the requested task.
Modern LLMs have considerably expanded what we can do with NLP, but neither NLP nor conversational software originated with LLMs.
Selected milestones in NLP
- 1948Claude Shannon
Statistical properties of language and conditional probabilities. - 1954Georgetown–IBM demonstration
Rule-based Russian-to-English translation. - 1966ELIZA
Pattern matching and scripted conversation. - 1968–70SHRDLU
Natural-language instructions in a simulated blocks world. - 1990sStatistical NLP
Corpus-based methods, including n-gram language models. - 1997LSTM
A recurrent architecture for processing sequences. - 2003Neural probabilistic language model
Learned numerical word representations and language probabilities. - 2013Word2Vec
Efficient learning of word vectors. - 2014–15Neural machine translation with attention
Learning which input positions are relevant to a translation. - 2017Transformer
An architecture built around attention rather than recurrence.
A computer works with numbers
Those of us who learnt computer programming several decades ago will probably remember having to learn about ASCII, the American Standard Code for Information Interchange. The uppercase letter A was represented by the number 65 and the lowercase letter a by the number 97. We could perform arithmetic operations on those numbers and, for instance, convert an uppercase English letter to its corresponding lowercase letter.
Unicode subsequently gave us a much more comprehensive way of representing characters from languages across the world. Encoding mechanisms such as UTF-8 allow us to represent Unicode code points as sequences of bytes. We had, therefore, already solved much of the problem of representing text numerically inside a computer.
The same letter, different numerical representations
| Character | ASCII decimal | Unicode code point | UTF-8 bytes (hex) |
|---|---|---|---|
| A | 65 | U+0041 | 41 |
| a | 97 | U+0061 | 61 |
| ಕ (Kannada) | — | U+0C95 | E0 B2 95 |
| த (Tamil) | — | U+0BA4 | E0 AE A4 |
| अ (Devanagari) | — | U+0905 | E0 A4 85 |
But assigning a number to a character does not tell the computer anything about the meaning of that character or the word it is part of. Nor does it tell the computer how the words in a sentence relate to each other. We need to find a way of representing language numerically so that the computer can perform mathematical operations that are useful for processing language.
Should we represent every character individually? Should we represent every word individually? If we were to represent every word individually, our vocabulary would become enormous. Think of the number of languages in the world, the names of people and places, the technical terminology that gets introduced every year and, of course, our remarkable ability to misspell words.
We would also have to deal with variations of the same word. Should we have separate entries for play, plays, played, player, players and playing? What happens when someone uses a word that was not in our vocabulary when we developed the system?
Representing every character individually would solve much of the vocabulary problem, but it would increase the number of units that the computer would have to process. The model would also have to learn relationships between those characters before it could learn many of the relationships between words. One approach is to find units somewhere between a character and a word.
From shorthand to tokens
Some of you might remember shorthand. Before we had the ability to conveniently record and transcribe meetings, people learnt shorthand so that they could write at speeds approaching that of human speech. Rather than writing every letter of every word, they used symbols and abbreviated representations of sounds, words and commonly occurring phrases.
We have been doing something similar in our everyday communications for years. We write FYI instead of “for your information”, ASAP instead of “as soon as possible” and BTW instead of “by the way”. Those who remember sending SMS messages when we were restricted to 160 characters in the standard GSM 7-bit alphabet will probably remember the considerable ingenuity that went into fitting a message within that limit. We even developed a vocabulary of abbreviations that people unfamiliar with SMS messaging found difficult to understand.
What we had done was develop shorter representations for commonly occurring sequences of text. There is a technique in computer science that works on a somewhat similar principle.
In 1994, Philip Gage published an article describing a data compression algorithm called Byte Pair Encoding, or BPE. The algorithm identified frequently occurring pairs of adjacent bytes and replaced them with a single, previously unused byte. It repeated this process, maintaining a record of the substitutions so that the original data could subsequently be reconstructed.
In 2016, Rico Sennrich, Barry Haddow and Alexandra Birch adapted this approach to address a problem in neural machine translation: how to process words that were not present in the vocabulary of the model.
Consider a collection of documents containing the words play, player, playing, played and replay. Let us assume that we initially represent each of these words as a sequence of individual characters. The combination of the letters “p” and “l” occurs frequently in our collection of documents. We could create a new unit representing that combination. We could then identify that our newly created unit “pl” frequently occurs before the letter “a”. We create another unit called “pla”. Repeating the process could give us another unit called “play”.
How BPE builds reusable units
1. Starting units
2. Merge p + l → pl
3. Merge pl + a → pla
4. Merge pla + y → play
We now have a reusable representation of a sequence of four characters. Instead of representing the word “player” as six individual characters, we could potentially represent it using “play” and “er”, provided both units exist in our vocabulary. The algorithm progressively combines frequently occurring adjacent units until it has constructed a vocabulary of reusable sequences of the desired size or reaches another stopping condition.
We call these units tokens. A token could be an entire word, part of a word, a punctuation mark, a whitespace character or a sequence of bytes.
The shorthand analogy is useful, but there is a difference. When we devise an abbreviation, we generally know what the abbreviation represents. BPE does not need to know the meaning of the sequence it is combining. It operates on the frequency of occurrence of adjacent units. Sometimes those units correspond to meaningful parts of words. Sometimes they do not.
The number of tokens in a document is not the same as the number of words.
Are all tokenizers the same?
No. BPE is one of several approaches that researchers have developed to address this problem. In 2012, Google researchers Mike Schuster and Kaisuke Nakajima described a technique called WordPiece in their paper on Japanese and Korean voice search. Like BPE, WordPiece constructs a vocabulary of reusable units of text. However, its vocabulary-building approach uses likelihood-oriented criteria rather than simply selecting the most frequently occurring adjacent pair.
In 2018, Taku Kudo proposed another approach based on a Unigram language model. Rather than starting with individual units and progressively combining them, this algorithm starts with a large collection of possible tokens and progressively reduces the vocabulary based on how useful those tokens are in representing the training data.
In the same year, Taku Kudo and John Richardson introduced SentencePiece, a software library that could construct tokenizers directly from raw text, without requiring the text to have been divided into words beforehand. SentencePiece supports both BPE and Unigram approaches. This is particularly useful when working with languages that do not necessarily use spaces in the same way English does.
We also have byte-level tokenizers, which can use the underlying bytes of the encoded text as their starting vocabulary. GPT-2, for instance, used a form of byte-level BPE. Starting with the 256 possible byte values provides a way of representing arbitrary encoded text, even when a particular word has never appeared in the training data. There are also language modelling approaches that work directly with characters or bytes, without relying on a conventional subword tokenizer.
Different ways to represent language
| Approach | Principle | Representative examples |
|---|---|---|
| Word-level | Whole words or pre-segmented units | Traditional statistical models; original Word2Vec |
| Character-level | Individual characters | Character-level RNNs |
| BPE (1994; NLP adaptation 2016) | Merge frequent adjacent units | Selected Llama and Gemma tokenizers |
| WordPiece (2012) | Build a subword vocabulary using likelihood-oriented criteria | BERT, DistilBERT, ELECTRA |
| Unigram (2018) | Prune a large candidate vocabulary using a probabilistic objective | T5, ALBERT |
| Byte-level BPE | Start from bytes, then learn merges | GPT-2, RoBERTa, Llama 3 |
| Byte-level modelling | Use bytes directly rather than a subword vocabulary | ByT5 |
When we select a language model, we are also selecting, directly or indirectly, the tokenizer that the model was trained to work with. The vocabulary is normally fixed by the time we use the trained model. The software does not have to create a new token every time it encounters a new word. It can represent that word using a combination of existing tokens, provided those tokens can represent the constituent text.
The size of the vocabulary is also an engineering decision. A larger vocabulary may allow us to represent more text using fewer tokens, but it can increase the number of parameters associated with representing those tokens inside the model. It is one of the trade-offs engineers have to consider.
A token is represented by a number
Once we have constructed the vocabulary, we assign an identification number to each token. We call this a token ID.
Let us look at an actual example. OpenAI has published a software library called tiktoken. Using the GPT-2 encoding, the text “hello world” is represented by two tokens with the identifiers 31373 and 995. Using another encoding called cl100k_base, exactly the same text is represented by the identifiers 15339 and 1917.
Same text, different identifiers
31373 · 9952 tokens
15339 · 19172 tokens
The text has not changed. The vocabulary and the mapping of tokens to numbers have changed. Capitalisation, punctuation and whitespace can all affect how text is tokenised. The word “hello” at the beginning of a sentence could be represented differently from the same word elsewhere in the sentence. Adding a space or capitalising the first letter could result in a different token or a different sequence of tokens.
This is one of the reasons why we cannot arbitrarily substitute the tokenizer that was used to train a particular model with another tokenizer. There is something else we need to understand about these numbers. The token ID 31373 does not tell us anything about the meaning of the word “hello”. It is an identifier, much like the primary key of a record in a database.
Those who have developed database applications will appreciate that the numerical value of a primary key does not normally tell us anything about the information stored in the record it identifies.
Performing arithmetic on the token ID will not reveal the meaning of the word.
Before the neural network processes these identifiers, it uses them to retrieve arrays of learned numbers called embeddings. This is how a token ID becomes a numerical representation that the network can work with. The distinction between an identifier and the information it identifies is important. Tokenisation gives us the identifiers; the learned parameters and subsequent computations allow the model to process relationships between tokens.
The Transformer that changed the industry
We had language models, neural networks, word embeddings and tokenizers before 2017. So what changed? For several years, researchers had been using architectures called Recurrent Neural Networks, or RNNs, to process sequences of data.
An RNN processes a sequence by maintaining a numerical state that is updated as it encounters each new element in the sequence. This allows information from earlier elements to influence how subsequent elements are processed. One of the difficulties with this approach was retaining useful information from much earlier in a long sequence. There were also challenges in training these networks effectively.
In 1997, Sepp Hochreiter and Jürgen Schmidhuber introduced Long Short-Term Memory, or LSTM, which addressed some of the difficulties that recurrent neural networks had in learning relationships across long sequences. These architectures were extensively used in natural language processing, including machine translation and speech recognition.
Researchers also developed attention mechanisms that allowed neural networks to place greater emphasis on relevant portions of an input sequence. An influential example was the work published by Dzmitry Bahdanau, Kyunghyun Cho and Yoshua Bengio in 2014 on neural machine translation. Attention existed before the Transformer.
On 12 June 2017, eight researchers published the first version of a paper titled Attention Is All You Need. They introduced an architecture that dispensed with recurrence and instead relied on attention mechanisms, along with other neural network components, to process relationships between elements in a sequence. This was the original Transformer.
The researchers were primarily working on machine translation. Their architecture contained two major components: an encoder that processed the input sequence and a decoder that generated the output sequence. One of the advantages of this architecture was that, during training, many of the computations associated with different positions in a sequence could be performed in parallel. This allowed researchers to make more effective use of GPUs and other parallel computing hardware.
The architecture also provided a more direct mechanism for modelling relationships between tokens that were separated by considerable distances in the input. Researchers subsequently developed several variations of the architecture.
In 2018, OpenAI introduced GPT, or Generative Pre-trained Transformer. It used a decoder-only Transformer architecture and demonstrated how a model could be pre-trained on large quantities of text before being adapted to particular tasks. In October 2018, Google introduced BERT, which used an encoder-based architecture and was particularly useful for tasks that required processing text in context. T5, introduced in 2019, used an encoder-decoder architecture and represented a variety of NLP tasks as text-to-text problems.
Three branches of the original Transformer
GPT-2 followed in 2019, with the largest version containing approximately 1.5 billion parameters. In 2020, GPT-3 arrived with 175 billion parameters. In two years, we had gone from the first GPT model, with approximately 117 million parameters, to one with 175 billion. That is an increase of approximately 1,500 times in the number of parameters.
From 117 million to 175 billion
The Transformer was not solely responsible for the explosion of LLMs. We also had access to considerably more computing power, large collections of training data and improvements in training algorithms and distributed computing. But it gave researchers an architecture that could take advantage of those resources particularly effectively.
On 30 November 2022, ChatGPT brought the results of much of this research to the general public through an interface that virtually anyone could use. Subsequently, we have seen the emergence of an entire industry around LLMs. We now have models that we can download and run on our personal computers, models that require considerable computing infrastructure and models that we can access through APIs.
We had spent decades developing individual pieces of the technology. The Transformer helped us bring many of them together at a scale that had previously been difficult to achieve.
The same words, different meaning
Consider these two sentences: “I deposited my money in the bank” and “I sat on the bank of the river”. Assuming that the word “bank”, including its preceding space, is represented by the same token in both sentences, the initial numerical representation retrieved for that token would be the same. But the two sentences have different meanings.
The subsequent layers of the model perform computations on those representations in relation to other tokens in the sequence. The numerical representation associated with a token can consequently change according to the context available to it.
There is an interesting complication here. In the first sentence, the words “deposited” and “money” occur before the word “bank”. In the second sentence, the word “river”, which provides a particularly useful clue about the meaning of “bank”, occurs after it.
In an autoregressive model such as GPT, the representation of a token at a particular position can incorporate information from that token and the tokens preceding it. When the model subsequently processes the word “river”, the representation at that later position can incorporate the earlier occurrence of “bank”. An encoder such as BERT can incorporate information from tokens on both sides of a particular position.
A token is not a definition
We also need to remember that the order of the tokens is significant. The sentences “The dog bit the man” and “The man bit the dog” contain the same words, but we would draw very different conclusions from them. Transformers incorporate mechanisms to account for the positions and ordering of tokens. A list of token identifiers alone is not a mathematical representation of the meaning of a sentence.
Why should we care about tokenisation?
If you have used an LLM through an API, you have probably noticed that many service providers charge you based on the number of tokens you use. The amount of text that can be provided to a model is also usually expressed in tokens rather than words. For ordinary English prose, four characters per token is sometimes used as a rough estimate. But we cannot apply that estimate universally.
This becomes particularly interesting in a country like India. We use a wide variety of languages and scripts. A sentence written in English and its equivalent in Kannada, Tamil or Hindi may convey the same information, but they need not produce the same number of tokens.
How efficiently a tokenizer represents a language depends on its vocabulary, its algorithms and the data used to construct it. A tokenizer whose vocabulary contains a considerable number of commonly occurring sequences in English could represent English text efficiently. If that vocabulary contains fewer commonly occurring sequences from Kannada, for instance, it may have to represent Kannada text using a greater number of smaller tokens.
If one language consistently requires more tokens than another to convey the same information, users of that language could end up paying more for the same task.
They could also fit less information into the context window of the model. There are computational implications as well. Increasing the number of tokens can increase the amount of work the model has to perform and the memory it requires. The extent of that increase depends on the model architecture and the software used to execute it.
If we are developing applications for a multilingual population, I think this is something we should evaluate when selecting a model. It is also worth examining the effectiveness of a model in processing a particular language independently of how efficiently it tokenises that language. The two are related, but an efficient tokenizer does not necessarily make a model good at a language.
Try it yourself
One of the advantages we have today is that many of the software components used in developing language models are publicly available. We can examine how a tokenizer works without having to download the entire language model or invest in expensive computing infrastructure.
I would encourage you to take a few minutes to experiment with some of the tokenizers I have listed below. Try typing the following:
Try the same sentence in your mother tongue and in English as well.
Look at how the software divides the text into tokens. Look at the numerical identifiers associated with those tokens. Change the capitalisation, add a space between two words or introduce a spelling mistake. Now use a different tokenizer and repeat the exercise. You may find that the same piece of text is represented by a different number of tokens. Even when two tokenizers divide the text in exactly the same way, they could assign different numerical identifiers to those tokens.
Browser-based tools
| Tool | What it offers |
|---|---|
| OpenAI Tokenizer | Official visualiser for selected OpenAI encodings |
| Tiktokenizer | OpenAI encodings, token IDs and spaces |
| Hugging Face Tokenizer Playground | Compare downloadable model tokenizers across several families |
| Tokenizer Explorer | Token boundaries, BPE and vocabulary experiments |
| IMOZ Tokenizer Playground | Compare model tokenizers and byte representations |
| Jan Kelin’s Token Counter | Compare selected model-specific token counts |
| BroadRouter Token Counter | Token counts across selected model families |
Some of these websites are third-party tools. The available model versions change over time, and older publicly available tokenizers do not necessarily represent current proprietary models. Do not paste confidential material into a third-party tokenizer unless you understand how it handles your text.
Developer tools, libraries and provider APIs
| Tool | What it offers |
|---|---|
| OpenAI tiktoken | Local encoding library |
| Google SentencePiece | Train and execute BPE or Unigram tokenizers |
| Hugging Face Tokenizers | Tokenizer training and local execution |
| Hugging Face Transformers | Load model-specific tokenizers with AutoTokenizer |
| Mistral mistral-common | Official tokenizer and model input utilities, including Tekken |
| DeepSeek tokenizer | Provider documentation and offline tokenizer resource |
| Google Gemini | Official token-counting API |
| Anthropic Claude | Official token-counting API |
| Cohere | Provider tokenisation endpoint |
There is a difference between a tokenizer that returns the actual token sequence and an API that only tells us how many tokens an input contains. The latter can be useful for estimating costs and context-window usage, but it may not expose the individual token IDs. Provider-specific message formatting and special tokens can also affect the count.
Those who are comfortable with Python can install tiktoken using python -m pip install tiktoken and run the following program to compare several encodings. The first time a tokenizer is loaded, the library may need to download its vocabulary files.
import tiktoken
text = "hello world"
for name in ["gpt2", "cl100k_base", "o200k_base"]:
encoding = tiktoken.get_encoding(name)
tokens = encoding.encode(text)
print(name, tokens, len(tokens))
for token in tokens:
print(token, encoding.decode_single_token_bytes(token))
You can run the same program with sentences in different languages. You can also use the program to examine how changing a single character in a sentence affects its numerical representation. Individual byte-level tokens may contain only part of a Unicode character, which is why the program displays the bytes associated with each token.
I would particularly encourage those of us in India to experiment with sentences in our respective mother tongues. Compare the number of tokens for equivalent text using the same encoding, and then compare across encodings. A single example is not enough to draw conclusions about an entire language, but it will give you an idea of why this is worth evaluating.
What the software does before the Transformer layers
Remember that we have not used a language model to generate anything in this exercise. All we have done is execute a piece of software that converts text into a sequence of numerical identifiers. That takes us back to the subject of the first article in this series. We can identify the tokenizer, examine its source code and reproduce its output.
The computers we read about in science fiction and comics appeared to understand the words spoken to them. What we are doing with today’s language models begins with converting those words into numerical representations. We have spent this article looking at how we get the identifiers for those representations. A token ID is not enough to capture relationships between words. For that, we need embeddings.
References and further reading
- Computer History Museum — A Logic Named Joe
- Shannon, 1948 — A Mathematical Theory of Communication
- IBM — Machine translation
- Winograd, 1972 — Understanding Natural Language
- Gage, 1994 — A New Algorithm for Data Compression
- Hochreiter and Schmidhuber, 1997 — Long Short-Term Memory
- Bengio et al., 2003 — A Neural Probabilistic Language Model
- Schuster and Nakajima, 2012 — Japanese and Korean Voice Search
- Mikolov et al., 2013 — Efficient Estimation of Word Representations in Vector Space
- Bahdanau et al., 2014 — Neural Machine Translation by Jointly Learning to Align and Translate
- Sennrich et al., 2016 — Neural Machine Translation of Rare Words with Subword Units
- Vaswani et al., 2017 — Attention Is All You Need
- Kudo, 2018 — Subword Regularization
- Kudo and Richardson, 2018 — SentencePiece
- OpenAI, 2018 — Improving Language Understanding with Unsupervised Learning
- Devlin et al., 2018 — BERT
- OpenAI, 2019 — Better Language Models and Their Implications
- Raffel et al., 2019 — Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
- Brown et al., 2020 — Language Models are Few-Shot Learners
- Xue et al., 2021 — ByT5
- OpenAI, 2022 — Introducing ChatGPT
- Hugging Face — Tokenisation algorithms
- OpenAI — tiktoken encoding tests
