4

I'd like to translate user requests into tickets in some sort of structured data format, e.g. JSON. For example:

  • User: I want to order two chairs and a desk with three drawers on the left side.
  • Output:
{
    "type": "furniture",
    "items": [
        { "type": "desk", "qty": 1, "included_items": [{ "type": "drawer", "qty": 3, "position": "left" }] },
        { "type": "chair", "qty": 2 }
    ]
}

It looks like GPT-3 itself is not very-well suited for this task, because output is not in the form of natural language, however Codex might be? But I can't find in OpenAI API docs how I can (if it's possible at all?) to create a custom / fine-tuned model for OpenAI API Codex models?

3 Answers 3

2

@xara Codex does not support a way to fine tune their model.

What you can do is prompt engineering.

Provide the model some demonstrations and try out whether Codex can perovide you with expected output.

1
0

If your JSON is not too involved, you may simply need creative prompt engineering. In this example, I started by giving ChatGPT your prompt to show a standard input and response and then set it up as a completion task. This is the exact prompt I used:

Please complete the following:
User: I want to order two chairs and a desk with three drawers on the left side.
Output:
```json
{
    "type": "furniture",
    "items": [
        { "type": "desk", "qty": 1, "included_items": [{ "type": "drawer", "qty": 3, "position": "left" }] },
        { "type": "chair", "qty": 2 }
    ]
}
```
User: I want three chairs and a desk with 2 drawers on the left and a desk with 3 drawers on the right.
Output:
```

Note that I concluded with three tick marks to indicate that it should immediately begin with the code

ChatGPT returned the following:

{
    "type": "furniture",
    "items": [
        { "type": "desk", "qty": 1, "included_items": [{ "type": "drawer", "qty": 2, "position": "left" }] },
        { "type": "desk", "qty": 1, "included_items": [{ "type": "drawer", "qty": 3, "position": "right" }] },
        { "type": "chair", "qty": 3 }
    ]
}
-3

It is currently in beta, but you can fine-tune the OpenAI codex model on your custom dataset for a charge to improve its performance. Please refer to the following link for details instruction: https://beta.openai.com/docs/guides/fine-tuning

1
  • 6
    The text-based GPT-3 models can be fine-tuned, Codex cannot (as of Dec 1, 2022). Dec 1, 2022 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.