Can I create a fine-tuned model for OpenAI API Codex models?

2.9k views Asked by At

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

There are 3 answers

1
Exploring On

@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.

0
Brian Risk On

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 }
    ]
}
1
Al-Alamin On

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