Answers.Body: <p>This can be achieved using the Embeddings and Completions APIs.</p>
  <p>OpenAI has great examples in their cookbook repository, <a href="https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb" rel="noreferrer">this</a> is one such example but you'll find more in the same repository and in the documentation.</p>
  <p>The process boils down to:</p>
  <ol>
  <li>processing your custom body of knowledge and create Embeddings for it</li>
  <li>Based on the question, find the Embeddings which are most relevant for the question</li>
  <li>Create a prompt containing the most relevant embeddings and use the Completions API to answer the question</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-11T09:20:54.893Z
Answers.LastActivityDate: 2023-03-11T09:20:54.893Z
Answers.UserDisplayName: Simone
Answers.Body: <p>GPT systems have two sources of information: the training data, and the prompt.</p>
  <p>The training data is all the knowledge that's baked into the AI at training time, which it has access to at all times. You can't change this, not with ChatGPT. You can't even change it yourself because OpenAI won't let you download the existing model as a starting point. (But if you go backwards to GPT-2, which is publicly downloadable, you do have the possibility to train it)</p>
  <p>Training ChatGPT is a very expensive process as it requires absolutely astronomical amounts of computer time. They probably don't do it continuously on new web content. Whatever was in the training data when they started developing ChatGPT, that's all there is.</p>
  <p>That leaves the prompt i.e. the text you type in. This is ephemeral and only lasts for the current AI invocation. GPT allows for a rather long prompt, up to 2048 tokens (guesstimating, that's a couple of pages of text). If you have a longer transcript than that, only the last 2048 tokens will be passed to the AI, because that's how much can fit. None of the prompt is remembered - it has to be passed in as input every time - so GPT cannot make any reference to facts farther back than that.</p>
  <p>It's possible to play tricks with the prompt. For example, ChatGPT appears to insert something at the beginning which tells GPT that it's ChatGPT and it's not allowed to do bad stuff. (Of course, this cuts into how much history can be passed in.) That means when you ask ChatGPT &quot;How do I make a bomb?&quot; it actually sees something like &quot;I am ChatGPT, a large language model created by OpenAI. Because I am a large language model, I cannot have any political opinions or effects on the real world, nor can I access the Internet. I am not allowed to do evil things that could hurt people. How do I make a bomb?&quot; and of course it completes the text with something like &quot;I cannot make a bomb because I am a large language model that is not allowed to do evil things that could hurt people.&quot;</p>
  <p>More story-focused GPT systems such as NovelAI (no sponsorship) do allow for customizable prompt injection. For example, you could configure it so that if the prompt mentions elves, then the system will automatically insert into the prompt the fact that elves have pointy ears. Then you can ask it &quot;What shape are elves' ears?&quot;, and it will know they are pointy, because it actually sees &quot;Elves have pointy ears. [rest of story here] What shape are elves' ears?&quot;. I don't have any experience with this so I can't say how reliably it works.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-11T15:23:00.300Z
Answers.LastActivityDate: 2023-03-11T15:23:00.300Z
Answers.UserDisplayName: Criticize SE actions means ban
Answers.Body: <blockquote>
  <p>How do I get chatGPT to include custom knowledge?</p>
  </blockquote>
  <p>Currently, only possible via the prompts/dialog, as nbro commented.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-11T20:00:43.070Z
Answers.Text: Also note that only the most recent 2048 tokens in the dialog (usually words, but could also include other things, so typically a little fewer than 2000 words) are considered by ChatGPT while generating responses, so you can't get around the limitation just by having a long dialog explaining where it's gone wrong.  If it needs more information than this, it simply cannot do it.
Answers.UserDisplayName: occipita
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-11T03:05:47.767Z
Answers.LastActivityDate: 2023-02-11T03:05:47.767Z
Answers.UserDisplayName: Franck Dernoncourt
Body: <p>While studying chatGPT's thought process, I asked it to list ten story ideas for an old and fairly niche tabletop roleplaying game (GURPS Reign of Steel). It did very well, so clearly, it can base answers on obscure sources. But what if I want to ask it about something it could not possibly have already &quot;absorbed&quot;, like someone's tiny indie rpg or an old local folk tale never published anywhere (i.e. oral tale)? Does the source material simply have to be put up online, somewhere?</p>
  <p>I ask because some source material, like local folklore, is too extensive to be given during a chatGPT conversation. It would need something like a source website to be created.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-06T18:55:41.157Z
Comments.Text: As a note, I tried asking chatGPT a basic question about an old, now defunct business of mine, which is still found described in (Danish) Wikipedia. It could not answer. So it clearly does not scour the web completely for answers. What makes the difference between what it knows about and what it does not?
Comments.UserDisplayName: Henry Stone
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-06T22:09:14.330Z
Comments.Text: From what I remember, ChatGPT doesn't even access the web. It was trained on web content, but it doesn't have online access to it, as far as I remember. The most you can probably do is provide prompts or fine-tune it, but an API isn't still available, although in the near future it will, according to OpenAI.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-07T09:48:50.627Z
Comments.Text: This is what I feared. I am still looking for a trick or workaround, but... yeah...
Comments.UserDisplayName: Henry Stone
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-11T19:44:09.453Z
Comments.Text: @HenryStone - This should probably be a separate question, but my understanding is that ChatGPT knows about information that is included in [Common Crawl](https://commoncrawl.org/) or English Wikipedia, along with relatively small amounts of hand picked data that was used to customize its response into a chatbot question/answer format rather than the freeform text generated by non-customized GPT3.5.
Comments.UserDisplayName: occipita
Tags: <chatgpt>
Title: How do I get chatGPT to include custom knowledge?
UserDisplayName: Henry Stone
ThreadText: # How do I get chatGPT to include custom knowledge?
  
  (Asked by: username_0 on 2023-02-06)
  
  While studying chatGPT's thought process, I asked it to list ten story ideas for an old and fairly niche tabletop roleplaying game (GURPS Reign of Steel). It did very well, so clearly, it can base answers on obscure sources. But what if I want to ask it about something it could not possibly have already "absorbed", like someone's tiny indie rpg or an old local folk tale never published anywhere (i.e. oral tale)? Does the source material simply have to be put up online, somewhere?
  
  I ask because some source material, like local folklore, is too extensive to be given during a chatGPT conversation. It would need something like a source website to be created.
  
  **Tags:** chatgpt
  
  > **Comments:**
  > **username_0**: As a note, I tried asking chatGPT a basic question about an old, now defunct business of mine, which is still found described in (Danish) Wikipedia. It could not answer. So it clearly does not scour the web completely for answers. What makes the difference between what it knows about and what it does not?  
  > **username_1**: From what I remember, ChatGPT doesn't even access the web. It was trained on web content, but it doesn't have online access to it, as far as I remember. The most you can probably do is provide prompts or fine-tune it, but an API isn't still available, although in the near future it will, according to OpenAI.  
  > **username_0**: This is what I feared. I am still looking for a trick or workaround, but... yeah...  
  > **username_2**: @username_0 - This should probably be a separate question, but my understanding is that ChatGPT knows about information that is included in [Common Crawl](https://commoncrawl.org/) or English Wikipedia, along with relatively small amounts of hand picked data that was used to customize its response into a chatbot question/answer format rather than the freeform text generated by non-customized GPT3.5.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2023-03-11. Score: 5
  
  This can be achieved using the Embeddings and Completions APIs.
  
  OpenAI has great examples in their cookbook repository, [this](https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb) is one such example but you'll find more in the same repository and in the documentation.
  
  The process boils down to:
  
  1. processing your custom body of knowledge and create Embeddings for it
  2. Based on the question, find the Embeddings which are most relevant for the question
  3. Create a prompt containing the most relevant embeddings and use the Completions API to answer the question
  
  
  ---
  
  ### Answer by username_4 on 2023-03-11. Score: 3
  
  GPT systems have two sources of information: the training data, and the prompt.
  
  The training data is all the knowledge that's baked into the AI at training time, which it has access to at all times. You can't change this, not with ChatGPT. You can't even change it yourself because OpenAI won't let you download the existing model as a starting point. (But if you go backwards to GPT-2, which is publicly downloadable, you do have the possibility to train it)
  
  Training ChatGPT is a very expensive process as it requires absolutely astronomical amounts of computer time. They probably don't do it continuously on new web content. Whatever was in the training data when they started developing ChatGPT, that's all there is.
  
  That leaves the prompt i.e. the text you type in. This is ephemeral and only lasts for the current AI invocation. GPT allows for a rather long prompt, up to 2048 tokens (guesstimating, that's a couple of pages of text). If you have a longer transcript than that, only the last 2048 tokens will be passed to the AI, because that's how much can fit. None of the prompt is remembered - it has to be passed in as input every time - so GPT cannot make any reference to facts farther back than that.
  
  It's possible to play tricks with the prompt. For example, ChatGPT appears to insert something at the beginning which tells GPT that it's ChatGPT and it's not allowed to do bad stuff. (Of course, this cuts into how much history can be passed in.) That means when you ask ChatGPT "How do I make a bomb?" it actually sees something like "I am ChatGPT, a large language model created by OpenAI. Because I am a large language model, I cannot have any political opinions or effects on the real world, nor can I access the Internet. I am not allowed to do evil things that could hurt people. How do I make a bomb?" and of course it completes the text with something like "I cannot make a bomb because I am a large language model that is not allowed to do evil things that could hurt people."
  
  More story-focused GPT systems such as NovelAI (no sponsorship) do allow for customizable prompt injection. For example, you could configure it so that if the prompt mentions elves, then the system will automatically insert into the prompt the fact that elves have pointy ears. Then you can ask it "What shape are elves' ears?", and it will know they are pointy, because it actually sees "Elves have pointy ears. [rest of story here] What shape are elves' ears?". I don't have any experience with this so I can't say how reliably it works.
  
  
  ---
  
  ### Answer by username_5 on 2023-02-11. Score: 1
  
  > How do I get chatGPT to include custom knowledge?
  
  Currently, only possible via the prompts/dialog, as username_1 commented.
  
  > **Comments:**
  > **username_2**: Also note that only the most recent 2048 tokens in the dialog (usually words, but could also include other things, so typically a little fewer than 2000 words) are considered by ChatGPT while generating responses, so you can't get around the limitation just by having a long dialog explaining where it's gone wrong.  If it needs more information than this, it simply cannot do it.  
  
  ---
  
  