A startup is fine-tuning a model via the OpenAI fine-tuning API for a JSON-output task. After training, the model sometimes outputs malformed JSON. Which action is most likely to fix this problem?
- A. Add a system prompt at inference time instructing the model to output valid JSON, without changing the training data.
- B. Increase the number of training epochs significantly to force memorization of the output format.
- C. Switch from the chat format to the prompt-completion format, as JSON outputs are not supported in chat format.
- D. Audit the training dataset for inconsistent or malformed JSON examples and clean or remove them before retraining.✓ Correct
Explanation
Malformed JSON in outputs most commonly traces back to inconsistent or malformed training examples — the model learns the noisy format it was trained on. Cleaning the dataset is the highest-leverage fix. Increasing epochs could worsen overfitting to bad patterns if the root cause is data quality. The OpenAI fine-tuning API's chat format fully supports structured outputs including JSON, so switching formats is unnecessary. Adding a system prompt at inference time may help marginally but does not address the root cause in the training data and is less reliable than fixing the data.