Body: <p>I think the vocabulary size in LLMs makes two trade-offs:</p>
  <ul>
  <li>The bigger tokens you have, the less frequent they will be.</li>
  <li>The more tokens you have, the more parameters you dedicate to input and output.</li>
  </ul>
  <p>I'm looking for a chart of the effect of the tokenizer vocabulary size on some quality metric. It could be a chart with a fixed number of total parameters, so both trade-offs have an impact on quality. Or it could be a chart where the architecture is fixed and the number of parameters grows with vocabulary size, to only show the first trade-off.</p>
  <p>The best I could find is this chart from <a href="https://ar5iv.labs.arxiv.org/html/2204.08832" rel="nofollow noreferrer">Impact of Tokenization on Language Models: An Analysis for Turkish</a>. But it only shows increasing quality. Surely at some point increasing the vocabulary starts to have a negative effect on quality?</p>
  <p><a href="https://i.sstatic.net/8jg41.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8jg41.png" alt="chart from Impact of Tokenization on Language Models: An Analysis for Turkish" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-18T19:04:58.183Z
Comments.Text: Why is your intuition that vocabularly would have a negative impact on quality rather than just asymtotically less benefit?
Comments.UserDisplayName: Bruce Adams
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-19T15:14:16.473Z
Comments.Text: If we grow the vocabulary by growing tokens, then more and more tokens will appear only once in the whole corpus. (Imagine if this comment were a single token.) At that point it's impossible to predict anything about that token and the part of the corpus covered by these low-frequency tokens is effectively lost. I suppose this extreme is very far. If you keep the total number of parameters fixed, however, then as tokens use more parameters you will have fewer left for internal layers. This would also cripple the model. At some point all parameters are used by tokens.
Comments.UserDisplayName: Daniel Darabos
Tags: <large-language-models>
Title: How does vocabulary size affect quality?
UserDisplayName: Daniel Darabos
ThreadText: # How does vocabulary size affect quality?
  
  (Asked by: username_0 on 2023-06-16)
  
  I think the vocabulary size in LLMs makes two trade-offs:
  
  * The bigger tokens you have, the less frequent they will be.
  * The more tokens you have, the more parameters you dedicate to input and output.
  
  I'm looking for a chart of the effect of the tokenizer vocabulary size on some quality metric. It could be a chart with a fixed number of total parameters, so both trade-offs have an impact on quality. Or it could be a chart where the architecture is fixed and the number of parameters grows with vocabulary size, to only show the first trade-off.
  
  The best I could find is this chart from [Impact of Tokenization on Language Models: An Analysis for Turkish](https://ar5iv.labs.arxiv.org/html/2204.08832). But it only shows increasing quality. Surely at some point increasing the vocabulary starts to have a negative effect on quality?
  
  [![chart from Impact of Tokenization on Language Models: An Analysis for Turkish](https://i.sstatic.net/8jg41.png)](https://i.sstatic.net/8jg41.png)
  
  **Tags:** large-language-models
  
  > **Comments:**
  > **username_1**: Why is your intuition that vocabularly would have a negative impact on quality rather than just asymtotically less benefit?  
  > **username_0**: If we grow the vocabulary by growing tokens, then more and more tokens will appear only once in the whole corpus. (Imagine if this comment were a single token.) At that point it's impossible to predict anything about that token and the part of the corpus covered by these low-frequency tokens is effectively lost. I suppose this extreme is very far. If you keep the total number of parameters fixed, however, then as tokens use more parameters you will have fewer left for internal layers. This would also cripple the model. At some point all parameters are used by tokens.  
  
  ---
  
  ## 0 answers
  
  