Max R
Max R

Reputation: 11

OpenAI GPT API pre-tokenizing?

I am trying to make a "personal assistant" chatbot (using GPT AI API) that can answer questions about myself when others ask it things. In order to do so, I have to give it a lot of information about myself, which I am currently doing in the prompt.

Example: Screenshot of my prompt

This means that every time someone asks a question, the prompt includes all of the information about me, which means that it gets tokenized every single time a question is asked. Is there a way to "pre-tokenize" the information about myself or store it in some other way? I ask this because the information about myself is what is costing me the most, as it sucks up a lot of tokens.

Upvotes: -1

Views: 770

Answers (1)

Kane Hooper
Kane Hooper

Reputation: 1909

There are a couple of ways around this.

  1. You could use the Playground to summarise your information, but this might lose some of the meaning. This is the simplest approach.

  2. Probably the most effective approach would be to fine-tune your own model that already has the data. This is more time consuming.

https://platform.openai.com/docs/guides/fine-tuning

This is from the OpenAI website:

Fine-tuned models. Create your own custom models by fine-tuning our base models with your training data. Once you fine-tune a model, you’ll be billed only for the tokens you use in requests to that model.

Upvotes: 1

Related Questions