Answers.Body: <p>LLMs like GPT-3 typically use subword tokenization, for example, Byte Pair Encoding for GPT models. These methods break down words into smaller pieces so that the model doesn't just work with whole words but also with parts of words (subwords), which are commonly seen in training. Afterwards LLMs generate embeddings for these tokens.</p>
  <p>Therefore if you type in a made-up or novel word, ChatGPT might still generate something that seems reasonable because the underlying model knows the typical expected words formation (e.g., prefixes, suffixes, or common word parts) and subword tokens association in a probabilistic way, and uses this knowledge to predict the likely continuation of the text. For example, if a typo like &quot;rel8ivity&quot; appears in a prompt at inference time, the model after tokenization still recognizes &quot;rel&quot;,&quot;8&quot;, and &quot;ivity&quot; as distinct tokens associated to &quot;relativity&quot; due to similar subword representations in LLM's enormous training corpus, most likely from &quot;rel&quot; and &quot;ivity&quot; tokens. This allows LLMs to further see through minor typos and still associate the most probable relevant meanings.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-12-09T05:27:16.330Z
Answers.LastActivityDate: 2024-12-09T05:27:16.330Z
Answers.UserDisplayName: cinch
Body: <p>It is my understanding that LLM's are trained with tokenizing text, and creating embeddings of those tokens and internally deal with those embeddings.</p>
  <p>To me, it suggests that you can't feed words that didn't exist in training data. It should also suggest LLMs can't generate words that were not in training data.</p>
  <p>However, in this screenshot from Chat GPT it seems like it can handle random words.</p>
  <p>How does Chat GPT achieve this?</p>
  <p><a href="https://i.sstatic.net/G9LMDfQE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/G9LMDfQE.png" alt="enter image description here" /></a></p>
  
Tags: <large-language-models><chatgpt><tokenization>
Title: How do LLM's deal with unknown words?
UserDisplayName: yasar
ThreadText: # How do LLM's deal with unknown words?
  
  (Asked by: username_0 on 2024-12-08)
  
  It is my understanding that LLM's are trained with tokenizing text, and creating embeddings of those tokens and internally deal with those embeddings.
  
  To me, it suggests that you can't feed words that didn't exist in training data. It should also suggest LLMs can't generate words that were not in training data.
  
  However, in this screenshot from Chat GPT it seems like it can handle random words.
  
  How does Chat GPT achieve this?
  
  [![enter image description here](https://i.sstatic.net/G9LMDfQE.png)](https://i.sstatic.net/G9LMDfQE.png)
  
  **Tags:** large-language-models, chatgpt, tokenization
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-12-09. Score: 1
  
  LLMs like GPT-3 typically use subword tokenization, for example, Byte Pair Encoding for GPT models. These methods break down words into smaller pieces so that the model doesn't just work with whole words but also with parts of words (subwords), which are commonly seen in training. Afterwards LLMs generate embeddings for these tokens.
  
  Therefore if you type in a made-up or novel word, ChatGPT might still generate something that seems reasonable because the underlying model knows the typical expected words formation (e.g., prefixes, suffixes, or common word parts) and subword tokens association in a probabilistic way, and uses this knowledge to predict the likely continuation of the text. For example, if a typo like "rel8ivity" appears in a prompt at inference time, the model after tokenization still recognizes "rel","8", and "ivity" as distinct tokens associated to "relativity" due to similar subword representations in LLM's enormous training corpus, most likely from "rel" and "ivity" tokens. This allows LLMs to further see through minor typos and still associate the most probable relevant meanings.
  
  
  ---
  
  