by BiteCode_dev · 3y ago · 0 comments
One for context, one for rules, one for output format, one for input data, etc.
Also, you can as for a structured output (gpt spits out JSON fine) but you need to be super explicit about each field possible values and the conditions they appear in.
Templating prompts with jinja goes a long way for testing.
And you will need a lot of testing, if for nothing else than remove variability in answers.
It's funny because people keep saying gpt will removing all values from having writer skills, but being a good writer helps a lot with crafting good prompts.
So I've been writing the translation examples (few-shot examples [not my favorite term]) as TypeScript, transpiling to JS and compiling with other examples and a prelude, and using the same method to build the translation examples as to build future prompts. It saves a lot of silly mistakes!
JavaScript has less tokens than TypeScript, so it seems more economical to convert to JS beforehand instead of passing TS to the LLM! I wouldn't be surprised if TS resulted in better solutions, though... add it to the endless list of things to test out...
This is pretty similar to the approach used in the Toolformer paper, other than sample-and-vote, which I believe is novel.