All articles
  • Absolute Intelligence
  • Data analysis

How to work effectively with GPT-4o and GPT-4o-mini

4 minute read

When working with language models such as GPT-4o and GPT-4o-mini, it is important to know their specifics, their strengths and suitable ways of phrasing prompts. Below we summarise the key recommendations that will help you get the best results when using these models in practice.

Summary

  • The recommendations for GPT-4o and GPT-4o-mini begin with language: the models understand English prompts better and use fewer tokens.
  • Prompts should be structured, with one instruction per sentence, and more complex tasks are helped by step-by-step instructions with JSON output.
  • GPT-4o suits more complex and multi-step tasks, while GPT-4o-mini is the faster and cheaper choice for simpler or high-volume prompts.

Choosing the language for prompts

Czech vs. English

  • English is more effective: Most models understand English better than other languages, Czech included. This applies especially to technical or specific prompts.
    • Example:
      • ❌ “Najdi přeškrtnutý text.”
      • ✅ “Find strikethrough text.”
  • Lower costs: Prompts and answers in English use fewer tokens, which saves money when working with the model.

Writing effective prompts

The structure of the prompt decides

  • Writing style matters – Models react sensitively to formatting. You will often get the best results with a structured format, for example Markdown.
    • A clearly organised prompt helps the model understand even simple logical relationships better.
      • ❌ “Do A, which is perhaps somewhere above, and then do B”
      • ✅ “Do A. Do B.”
    • Emphasising the key instructions increases the accuracy of the answer.
      • ❌ “Process the task for each paragraph”
      • ✅ “**Process the task for each paragraph**”

Keep it simple

  • Use simple, clear sentences.
  • Each sentence should be one instruction.
    • ❌ “List the total amounts as a list of values in a format with thousands separated by a space. If you do not find the amount, write 'NULL'.”
    • ✅ “List total amount. Format 1 000. If none, write 'NULL'.”

Step-by-step instructions

  • For more complex tasks, use a multi-step prompt:
"
1. Write `f1`: "A"
   1. If `f1` is "A", write `g1`: 1
   2. If `f1` is not "A", write `g1`: 2
2. Write `f2`: "B"
3. Join the attributes `f1` and `f2` and write them to `f1_f2`. Separator: space.
"
  • Output in JSON format:
{
  "f1": "A",
  "g1": 1,
  "f2": "B",
  "f1_f2": "A B"
}

Abbreviations and JSON output

  • Using abbreviations for attributes can reduce the number of tokens in the output.
  • Structured JSON output has a number of advantages:
    • Faster answers.
    • Lower processing costs.
    • Greater consistency in further automatic processing of the data.

Which model to use when

  • GPT-4o
    • Suitable for more complex tasks and long or multi-step prompts.
    • Its advantages are high accuracy and a better grasp of context.
    • Higher costs can be a disadvantage.
  • GPT-4o-mini
    • A light, fast model at a lower price.
    • Ideal for simpler or short prompts.
    • On more complex tasks (especially of a logical nature) it may achieve worse results.

Testing and tuning prompts

  • An iterative approach is key – it is rare to write a perfect prompt the first time. Do not be afraid to test different wordings, shuffle the order of instructions or try the prompt first on a smaller sample of data.
  • Prompt versioning: If you use an LLM in a company or in applications, we recommend introducing prompt versioning. It helps with tuning and with tracing back why the outputs changed.

Evaluating outputs

  • Automated tests: For repeated tasks it pays to build a set of inputs and expected outputs and to compare the model’s results continuously (for example through string comparison or fuzzy matching).
  • Manual validation: For creative tasks or complex transformations we cannot yet do without human oversight – it is important to evaluate with the context in mind.

Costs and optimisation

  • Batching: If you process several requests at once, some APIs allow savings through batch processing (for example several prompts in one request).
  • Shortening the context: The shorter the input (and output), the lower the cost. Let the model “breathe”, but avoid unnecessary padding.
  • Tokens ≠ characters: A token is not the same as a character or a word. Numbers, spaces or emoji, for example, are counted differently. Knowing how tokenisation works can save you money.

Integration into applications

  • If you plan to deploy the models in company processes or systems, watch out for:
    • response latency – some models can be slower.
    • API stability – open-source models or cloud services can change without warning.
    • security and auditability – the model’s output can be unpredictable, which has to be handled above all in sensitive domains.
    • Token limits – on input and output alike. If you expect an answer (for example JSON) where the structure is clearly defined.

Protection against hallucinations

  • The model can “hallucinate” – that is, state with confidence things that are not true.
  • What helps:
    • Limiting creative instructions.
    • Validating the output with further rules or a follow-up prompt (for example “If you cannot find the value, write 'NULL'.”).
    • RAG: combining the model with your own knowledge base, from which the model “pulls out” verified information.

Summary

Key principles for working with LLMs:

  1. Write in English – the models understand English better and more economically.
  2. Be brief and unambiguous – each instruction should be clear and self-contained.
  3. Structure is key – use bullets, Markdown or JSON, which the model finds easier to follow.

Choosing a model:

GPT-4o-mini is fast and cheap, ideal for simpler or high-volume tasks. If you need an exact understanding, work with conditions or more complex logic, however, it pays to use GPT-4o – it is more robust and understands step-by-step instructions and context better.

Get in touch

A few sentences about what you are working on will help us prepare.

We describe how we handle personal data in our privacy policy.

You can also call us on +420 228 227 418 or email us at info@datera.cz.