Prompt Template Design For Semi-Structured Data Inputs

First, thanks for the great course! I have a use case where I am trying to include some semi-structured key value data from a data store as part of a prompt, which might look something like this, where the {context} variable has retrieved key value data:

### Instruction:

### Context:

### Response:

This {context} data might look something like:

  "age": 24,
  "color": "blue",
  "ready": false

My question is, what is the best way to include semi-structured key value data in an input into a fine-tuned LLM? If a base model is fine tuned to expect JSON as input, will that perform well? Does XML work better? I know RAG patterns might retrieve sections of documents as free text, but the data I am looking to include naturally has structure.

An experience or tips would be greatly appreciated!

1 Like