> For the complete documentation index, see [llms.txt](https://academy.gooey.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.gooey.ai/ai-for-impact/module-5/tips-for-prompting-based-on-llm.md).

# Tips for prompting based on LLM

| Feature / Style                 | OpenAI (GPT-4, GPT-3.5)                                                                  | LLaMA (LLaMA 2 & 3)                                                        | Mistral (Mistral 7B, Mixtral)                                            |
| ------------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| **Role Structure**              | Uses `system`, `user`, and `assistant` roles explicitly                                  | No native role handling, but you can simulate it using text cues           | No role handling, but follows text cues and prompt templates             |
| **System Prompt Support**       | ✅ Full support — allows defining model behavior (e.g., `"You are a helpful assistant."`) | 🚫 No native support; must embed in user prompt manually                   | 🚫 No native support; simulate via prompt prefix                         |
| **Formatting Style**            | Natural conversation, JSON-compatible, markdown-friendly                                 | Structured, requires consistent formatting for few-shot and instruct modes | Concise and direct; works well with bullet lists, steps, or templates    |
| **Few-shot Learning**           | Highly effective with few-shot examples                                                  | Effective, especially with CodeLLaMA and LLaMA-Instruct variants           | Can benefit from few-shot, though prefers minimal examples               |
| **Chain-of-Thought Reasoning**  | Strong performance with "Let's think step by step" style prompts                         | Improves performance significantly with explicit CoT instructions          | Supports CoT well, especially in instruct-tuned variants                 |
| **Prompt Length Handling**      | Handles long prompts well (especially GPT-4-1 with large context windows)                | Medium capacity; recent models like LLaMA 3 support longer prompts         | Smaller context (e.g., 32K tokens), favors concise prompts               |
| **Fine-tuning Response Format** | Easily aligns to JSON, tables, and multi-part instructions                               | Needs more specificity to get consistent formatting                        | Consistent if given strict format constraints                            |
| **Use of Delimiters**           | Often uses `"""` or `###` to separate instructions from input                            | Suggested to separate examples and instructions clearly                    | Benefits from template-like structures, including consistent line breaks |
| **Multimodal Input Handling**   | GPT-4o supports images and audio                                                         | LLaMA 3 (future) may add modalities; current LLaMA is text-only            | Mistral is text-only for now                                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://academy.gooey.ai/ai-for-impact/module-5/tips-for-prompting-based-on-llm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
