Answers.Body: <ol>
  <li>it samples from such distribution, thus would wither sample the one-hot for dog or for cat</li>
  <li>then what's the point of using it if it's not human interpretable?</li>
  <li>no, we feed the sampled token to the transformer because it cannot know wether we sampled (in you example) cat or dog. Feeding back the whole distribution would give him no more information than not giving it none</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-03T15:55:20.960Z
Answers.LastActivityDate: 2024-04-03T15:55:20.960Z
Answers.UserDisplayName: Alberto
Body: <p>As I understand it, GPT-style LLMs take a sequence of tokens as input and output a token probability vector. The first thing that happens to an input token is that it goes through
  the input embedding, which can be thought of multiplying the embedding matrix with a one-hot token vector.</p>
  <p>If that is correct, nothing is stopping us from using a probability vector in place of a one-hot vector as input to the LLM.</p>
  <p>Question 1:
  What happens when the input to the LLM contains probability vectors instead of discrete tokens?
  For example if the token &quot;dog&quot; was [0,0,1,0,0,0,0] and the token &quot;cat&quot; was [0,0,0,1,0,0,0], what if the input instead contained the pseudo-token [0,0,0.5,0.5,0,0,0]?</p>
  <p>Question 2: When generating a text, we turn the output probability distribution into a single token by sampling and append the new token. What if we don't sample and instead append the probability vector itself? Of course, this would not produce human-readable text.</p>
  <p>When using Chain-of-Thought prompting, we want the model to slowly reason through the problem, but could it not be helpful to let it output full probability vectors at this stage instead of forcing it to discretize into human-readable tokens?</p>
  <p>Or would none of this produce meaningful results because models are only trained on discrete tokens?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-05T08:35:05.553Z
Comments.Text: LLM may not greedily chose only the next token with highest probability (depending on temperature), but use a kind of beam search to look at further tokens as well and only keep the most promising beams. However this is much more costly.
Comments.UserDisplayName: Lelouch
Tags: <machine-learning><large-language-models>
Title: Could LLMs perform the autoregressive generation with probability vectors instead of choosing a discrete token every time?
UserDisplayName: MelonDude
ThreadText: # Could LLMs perform the autoregressive generation with probability vectors instead of choosing a discrete token every time?
  
  (Asked by: username_0 on 2024-04-03)
  
  As I understand it, GPT-style LLMs take a sequence of tokens as input and output a token probability vector. The first thing that happens to an input token is that it goes through
  the input embedding, which can be thought of multiplying the embedding matrix with a one-hot token vector.
  
  If that is correct, nothing is stopping us from using a probability vector in place of a one-hot vector as input to the LLM.
  
  Question 1:
  What happens when the input to the LLM contains probability vectors instead of discrete tokens?
  For example if the token "dog" was [0,0,1,0,0,0,0] and the token "cat" was [0,0,0,1,0,0,0], what if the input instead contained the pseudo-token [0,0,0.5,0.5,0,0,0]?
  
  Question 2: When generating a text, we turn the output probability distribution into a single token by sampling and append the new token. What if we don't sample and instead append the probability vector itself? Of course, this would not produce human-readable text.
  
  When using Chain-of-Thought prompting, we want the model to slowly reason through the problem, but could it not be helpful to let it output full probability vectors at this stage instead of forcing it to discretize into human-readable tokens?
  
  Or would none of this produce meaningful results because models are only trained on discrete tokens?
  
  **Tags:** machine-learning, large-language-models
  > **Comments:**
  > **username_1**: LLM may not greedily chose only the next token with highest probability (depending on temperature), but use a kind of beam search to look at further tokens as well and only keep the most promising beams. However this is much more costly.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-04-03. Score: 1
  
  1. it samples from such distribution, thus would wither sample the one-hot for dog or for cat
  2. then what's the point of using it if it's not human interpretable?
  3. no, we feed the sampled token to the transformer because it cannot know wether we sampled (in you example) cat or dog. Feeding back the whole distribution would give him no more information than not giving it none
  
  
  ---
  
  