3

I have multiple pieces of information to include in the prompt. There are various ways that I can separate them. I can separate them using XML tags or put the data in JSON or some ad-hoc format (e.g., start with a paragraph heading, a colon, then the text, then a blank line before the next piece of information).

Is there any experience about which method of structuring data in the input to a LLM is most effective? If the answer varies by LLM, I'd be interested in learning the answer for GPT-4, Llama 3, and any other LLM where the answer is known.

1 Answer 1

0

The most effective method for structuring data input to a Large Language Model (LLM) can vary, but generally:

JSON: Preferred for its clarity and ease of parsing. XML: Useful for complex hierarchical data. Ad-hoc Format: Simple and quick but less structured. For GPT-4, JSON and clear headings with colons are effective. The effectiveness may vary slightly for other LLMs like Llama 3, but JSON is widely recommended across models for its structured and readable format

Your Answer

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

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