I have a classification task. There is a list of labels with a short description of each. There are a few examples of classification. Then each individual task will be to classify ~100 strings following this prompt.
What is the best way to encode this? I’ve tried:
-
Chat API, where for each of the ~100 strings, I give the prompt with examples, then ask to classify a single string. Very inefficient due to repeating the large prompt+examples for every string.
-
Chat API, where a single ‘user’ message lists ~100 strings, then the assistant echoes back each string, plus the label. This sorta works, but it’s inefficient (strings much longer than labels), and the model sometimes hallucinates when echoing back the strings.
-
Chat API, as above, but where the assistant outputs a list of 100 labels. This doesn’t work very well; the model gets confused about where it is in the task, i.e. which strings it’s labelling. Numbering the strings and labels helps a little, but not much.
-
Chat API, where a single ‘user’ message lists one string, then the assistant echoes back its label, repeated ~100 times. Works, but just a worse version of solution 0, because I’m just paying for useless chat history that’s not used for the task.
What I want is an API where I provide a single pre-prompt, then N prompts, and get back N completions, where completion j is the completion following the pre-prompt plus prompt j.
Is this structure possible? Is there some other way? Should I be looking at the deprecated classification API, or fine-tuning?