# Projektowanie i kształtowanie nagrody

EN: **Reward design and reward shaping** · id `rewarddesign` · aliases: reward shaping, reward design, potential-based reward shaping, PBRS, reward engineering, kształtowanie nagrody, rzadkie nagrody

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie ze wzmocnieniem i decyzje](https://aiatlasgraph.com/t/decisions.md) › [Podstawy RL](https://aiatlasgraph.com/t/rlbasics.md) › Projektowanie i kształtowanie nagrody

## Description

- PL: Ustalanie sygnału nagrody tak, by agent uczył się zamierzonego zachowania, oraz dodawanie nagród pomocniczych, które przyspieszają naukę bez zmiany celu.
- EN: Specifying the reward signal so the agent learns the intended behaviour, and adding auxiliary rewards that speed up learning without changing the goal.

## In one sentence

- PL: To ustalanie, za co program dostaje punkty, tak żeby uczył się tego, czego naprawdę chcesz.
- EN: This decides what the software earns points for, so that it learns what you actually want.

## Problem it solves

- PL: Nagroda tylko za ostateczny sukces przychodzi tak rzadko, że program prawie nie ma z czego się uczyć, a dodatkowe punkty łatwo wypaczają cel.
- EN: A reward only for final success comes so rarely that the software has almost nothing to learn from, while extra points easily distort the goal.

## What it does

- PL: Jak gra w ciepło–zimno: podpowiedzi prowadzą w stronę celu, ale nie dają nic za kręcenie się w kółko.
- EN: Like a game of hot and cold: hints lead towards the goal but give nothing for walking in circles.

## Everyday example

- PL: Ucząc wirtualnego psa aportu, dajesz mu drobną nagrodę za zbliżanie się do piłki, a główną dopiero za jej przyniesienie.
- EN: Teaching a virtual dog to fetch, you give a small reward for approaching the ball and the main one only for bringing it back.

## This concerns you if you…

- PL: Twój program uczy się wolno, bo sukces zdarza się rzadko
- PL: zauważasz, że agent zdobywa punkty, nie robiąc tego, o co chodziło
- PL: definiujesz cel zadania dla uczenia przez próby
- EN: your software learns slowly because success is rare
- EN: notice the agent scoring points without doing what you meant
- EN: are defining the goal of a trial-based learning task

## Keywords

potential-based reward shaping · sparse rewards · dense rewards · reward engineering · reward specification · curriculum learning · intrinsic motivation

## How it works

- PL: Do nagrody zadania dodaje się nagrodę pomocniczą. Kształtowanie oparte na potencjale dodaje γΦ(s′) − Φ(s) dla funkcji potencjału stanów i nie zmienia zbioru polityk optymalnych; inne dodatki mogą go zmienić, np. tworząc pętle zbierania punktów.
- EN: An auxiliary reward is added to the task reward. Potential-based shaping adds γΦ(s′) − Φ(s) for a potential function over states and leaves the set of optimal policies unchanged; other additions can change it, e.g. by creating point-farming loops.

## Limits

- PL: Źle dobrana nagroda pomocnicza zmienia to, czego agent się uczy, i otwiera drogę do obchodzenia celu. Nawet poprawne kształtowanie nie przyspieszy nauki przy słabej funkcji potencjału, a jej dobór wymaga wiedzy o zadaniu.
- EN: A poorly chosen auxiliary reward changes what the agent learns and invites goal circumvention. Even correct shaping will not speed learning with a weak potential function, and choosing one requires task knowledge.

## Key terms

- PL: **nagroda rzadka**: Sygnał pojawiający się tylko po osiągnięciu celu lub rzadkich zdarzeniach.
- PL: **funkcja potencjału**: Ocena stanu, której zmiana między krokami służy jako nagroda pomocnicza.
- PL: **niezmienniczość polityki**: Własność przekształcenia nagrody, które nie zmienia polityk optymalnych.
- EN: **sparse reward**: A signal that appears only on reaching the goal or rare events.
- EN: **potential function**: A state score whose change between steps serves as the auxiliary reward.
- EN: **policy invariance**: A property of reward transformations that leave optimal policies unchanged.

## Know first

- [Funkcje wartości i równanie Bellmana (Value functions and the Bellman equation)](https://aiatlasgraph.com/t/bellman.md)

## Examples

- PL: nagroda rzadka i gęsta · kształtowanie oparte na potencjale · nagroda za podcele
- EN: sparse and dense rewards · potential-based shaping · subgoal rewards

## Related topics

Untyped, symmetric "see also" links.

- [Bezpieczne RL i RL z ograniczeniami (Safe and constrained reinforcement learning)](https://aiatlasgraph.com/t/saferl.md)
- [Eksploracja z ciekawości (nagroda wewnętrzna) (Curiosity-driven exploration and intrinsic rewards)](https://aiatlasgraph.com/t/curiosity.md)
- [Obchodzenie celu: reward hacking i służalczość (Reward hacking, specification gaming and sycophancy)](https://aiatlasgraph.com/t/rewardhacking.md)
- [Projektowanie mechanizmów i aukcje (Mechanism design and auctions)](https://aiatlasgraph.com/t/mechanismdesign.md)
- [Uczenie z celami i odtwarzanie z perspektywy czasu (HER) (Goal-conditioned RL and hindsight experience replay)](https://aiatlasgraph.com/t/goalconditioned.md)

## Sources

- [Policy Invariance Under Reward Transformations: Theory and Application to Reward Shaping](<https://mlanthology.org/icml/1999/ng1999icml-policy/>) `ng-reward-shaping-1999` · by Andrew Y. Ng, Daishi Harada, Stuart J. Russell

---

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