# Programowa optymalizacja promptów

EN: **Programmatic prompt optimisation** · id `promptopt` · aliases: prompt optimization, automatic prompt optimization, APO, optymalizacja promptów, automatyczna optymalizacja promptów

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Aplikacje LLM i agenci](https://aiatlasgraph.com/t/applications.md) › [Prompty i kontekst](https://aiatlasgraph.com/t/prompting.md) › Programowa optymalizacja promptów

## Description

- PL: Automatyczne dobieranie promptów, a czasem wag, pod wynik ewaluacji.
- EN: Automatically tuning prompts, and sometimes weights, against an evaluation score.

## In one sentence

- PL: To automatyczne szukanie poleceń i przykładów, które pomagają modelowi lepiej wykonywać wybrane zadanie.
- EN: This automatically searches for instructions and examples that help a model perform a chosen task better.

## Problem it solves

- PL: Ręczne poprawianie poleceń zajmuje czas, a trudno ocenić, które zmiany rzeczywiście pomagają.
- EN: Editing instructions by hand takes time, and it is hard to tell which changes actually help.

## What it does

- PL: Program próbuje różne wersje instrukcji na zadaniach testowych i wybiera te, które najlepiej spełniają przyjęte kryterium.
- EN: A program tests instruction variants on sample tasks and keeps those that perform best under a chosen scoring rule.

## Everyday example

- PL: Asystent źle sortuje wiadomości; program porównuje wersje jego polecenia na wcześniej oznaczonych przykładach i wybiera skuteczniejszą.
- EN: An assistant misfiles messages, so a program compares instruction variants on previously labelled examples and picks one that scores better.

## This concerns you if you…

- PL: wiele razy poprawiasz polecenie do powtarzalnego zadania
- PL: masz przykłady, na których możesz sprawdzać odpowiedzi
- EN: repeatedly edit instructions for the same task
- EN: have examples you can use to check answers

## Keywords

DSPy · MIPROv2 · BootstrapFewShot · GEPA · OPRO · EvoPrompt · Promptbreeder · Bayesian optimization · demonstration selection

## How it works

- PL: Optymalizator uruchamia program z różnymi instrukcjami lub przykładami i porównuje wyniki według zadanej metryki. Wybiera konfigurację na zbiorze rozwojowym, a niektóre metody dodatkowo dostrajają modele używane w poszczególnych modułach.
- EN: An optimizer runs a program with different instructions or demonstrations and compares results using a defined metric. It selects a configuration on development data, and some methods additionally fine-tune models used in individual modules.

## Limits

- PL: Optymalizacja może przeuczyć konfigurację na zbiorze rozwojowym lub wykorzystać lukę w metryce. Wymaga niezależnego testu, budżetu wywołań i ponownej oceny po zmianie modelu lub danych.
- EN: Optimization can overfit a configuration to development data or exploit a metric's weakness. It requires an independent test, a call budget and reevaluation after model or data changes.

## Key terms

- PL: **metryka celu**: Wartość używana do porównywania kandydatów podczas optymalizacji.
- PL: **demonstracja**: Przykład poprawnego wykonania dołączany do kontekstu modelu.
- PL: **zbiór rozwojowy**: Przypadki używane do wyboru konfiguracji przed końcowym testem.
- EN: **objective metric**: A value used to compare candidates during optimization.
- EN: **demonstration**: An example of correct execution included in a model's context.
- EN: **development set**: Cases used to select a configuration before the final test.

## Know first

- [Zbiory testowe i regresje (Evaluation datasets and regression tests)](https://aiatlasgraph.com/t/evalsets.md)
- [Strojenie hiperparametrów (Hyperparameter tuning)](https://aiatlasgraph.com/t/hptuning.md)

## Examples

- PL: DSPy · optymalizacja pod metrykę ewaluacji
- EN: DSPy · optimising against an eval metric

## Related topics

Untyped, symmetric "see also" links.

- [Ewolucja z modelami językowymi (LLM-guided evolutionary search)](https://aiatlasgraph.com/t/llmevolution.md)
- [Przeszukiwanie lokalne (wspinaczka, wyżarzanie) (Local search (hill climbing, simulated annealing))](https://aiatlasgraph.com/t/localsearch.md)
- [Zbiory testowe i regresje (Evaluation datasets and regression tests)](https://aiatlasgraph.com/t/evalsets.md)

## Sources

- [LLM Course (Maxime Labonne)](<https://github.com/mlabonne/llm-course>) `mlabonne-llm-course` · by Maxime Labonne

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/promptopt · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
