# Eksploracja przez próbkowanie hipotez (posterior sampling)

EN: **Posterior sampling and randomised value functions** · id `posteriorsampling` · aliases: posterior sampling for RL, PSRL, Thompson sampling in RL, randomized value functions, próbkowanie Thompsona

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie ze wzmocnieniem i decyzje](https://aiatlasgraph.com/t/decisions.md) › [Strategie eksploracji w RL](https://aiatlasgraph.com/t/rlexploration.md) › Eksploracja przez próbkowanie hipotez (posterior sampling)

## Description

- PL: Próbkowanie Thompsona w RL: agent losuje model lub funkcję wartości z rozkładu a posteriori i działa według niej przez cały epizod.
- EN: Thompson sampling for RL: the agent samples a model or value function from the posterior and acts greedily on it for a whole episode.

## In one sentence

- PL: Program trzyma kilka różnych przypuszczeń o świecie i przez cały epizod działa według jednego, wylosowanego z nich.
- EN: The program keeps several guesses about the world and acts on one randomly chosen guess for a whole episode.

## Problem it solves

- PL: Losowe pojedyncze ruchy nie wystarczą, gdy żeby coś odkryć, trzeba konsekwentnie iść w jednym kierunku przez wiele kroków.
- EN: Random single moves are not enough when discovery requires heading one way consistently for many steps.

## What it does

- PL: Jak detektyw, który przez cały dzień sprawdza jedną teorię do końca, a jutro inną, zamiast skakać między nimi co chwilę.
- EN: Like a detective who follows one theory all day to the end, and another tomorrow, instead of hopping between them.

## Everyday example

- PL: Asystent zakupowy przez tydzień konsekwentnie testuje jedną hipotezę o twoich gustach, a potem zmienia ją, jeśli się nie sprawdza.
- EN: A shopping assistant tests one hypothesis about your tastes all week, then switches if it does not hold.

## This concerns you if you…

- PL: agent potrzebuje długiej, konsekwentnej eksploracji, a nie losowych ruchów
- PL: chcesz, by niepewność modelu kierowała próbowaniem nowego
- EN: your agent needs long, consistent exploration, not random moves
- EN: want model uncertainty to steer what gets tried

## Keywords

PSRL · Thompson sampling · Bootstrapped DQN · ensemble Q-networks · randomized prior functions · epistemic uncertainty · deep exploration

## How it works

- PL: W PSRL na początku epizodu losuje się MDP z rozkładu a posteriori i wykonuje jego optymalną politykę. Bootstrapped DQN przybliża to w sieciach: wspólny korpus ma kilka głów Q, każda uczona na innej bootstrapowej próbce danych; agent wybiera jedną głowę na epizod, a rozbieżność głów odzwierciedla niepewność.
- EN: In PSRL an MDP is drawn from the posterior at the start of each episode and its optimal policy is followed. Bootstrapped DQN approximates this in networks: a shared body with several Q heads, each trained on a different bootstrap sample; the agent follows one head per episode, and head disagreement reflects uncertainty.

## Limits

- PL: Dokładny rozkład a posteriori jest nieosiągalny w złożonych środowiskach, a przybliżenia zespołowe mogą niedoszacować niepewności. Kilka głów lub modeli zwiększa koszt obliczeń i pamięci.
- EN: Exact posteriors are intractable in complex environments, and ensemble approximations can underestimate uncertainty. Multiple heads or models increase compute and memory costs.

## Key terms

- PL: **rozkład a posteriori**: Rozkład przekonań o świecie po uwzględnieniu zebranych danych.
- PL: **próbkowanie Thompsona**: Działanie według losowo wybranej, wiarygodnej hipotezy.
- PL: **bootstrap**: Losowanie danych ze zwracaniem, by uzyskać różne wersje modelu.
- EN: **posterior**: The distribution of beliefs about the world after seeing data.
- EN: **Thompson sampling**: Acting on a randomly drawn, plausible hypothesis.
- EN: **bootstrap**: Resampling data with replacement to get varied model versions.

## Know first

- [Twierdzenie Bayesa i wnioskowanie bayesowskie (Bayes' theorem and Bayesian inference)](https://aiatlasgraph.com/t/bayesinference.md)
- [Wielorękie bandyty: eksploracja kontra eksploatacja (Multi-armed and contextual bandits)](https://aiatlasgraph.com/t/bandits.md)

## Sources

- [Deep Exploration via Bootstrapped DQN](<https://arxiv.org/abs/1602.04621>) `bootstrapped-dqn-2016` · by Ian Osband; Charles Blundell; Alexander Pritzel; Benjamin Van Roy

---

AI Atlas revision 128 (2026-11-04) · HTML: https://aiatlasgraph.com/t/posteriorsampling · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-11-04
