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?

Rubén
  • 34,714
  • 9
  • 70
  • 166
xaxa
  • 1,057
  • 1
  • 24
  • 53

3 Answers3

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.

Exploring
  • 2,493
  • 11
  • 56
  • 97
  • 2
    See https://community.openai.com/t/fine-tuning-for-codex/10689/17 for the feature request to support fine-tuning for Codex – leopold.talirz Dec 01 '22 at 14:59
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 }
    ]
}
Brian Risk
  • 1,244
  • 13
  • 23
-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

Al-Alamin
  • 1,438
  • 2
  • 15
  • 34