Assistance Games

*Act alongside an agent whose goal you cannot see — how to engage with a human to solve a problem.

Example

Collaborative writing: humans writing one part of a joint report, and assistant writes another part.

Definition

components

  • human preference \(\theta\)
  • human action space \(\mathcal{A}_{H}\)
  • assistant action space \(\mathcal{A}_{A}\)
  • reward function \(r: \mathcal{A}_{H} \times \mathcal{A} \times \theta \to [0,1]\)

timing

  • get human preference \(\theta \in \Theta\)
  • humans select choice \(a_{H} \in \mathcal{A}_{H}\), according to \(\pi_{H}: \Theta \to \mathcal{A}_{H}\)
  • assistant observation and action: assistant sees \(a_{H}\), and then chooses action \(a_{A}\)

Setup

Previously: humans, based on some hidden parameters \(\theta\), chooses some actions \(\pi\qty(a | s, \theta)\). And the robots aims to induce retest rewards through observing choices.

Now: robots and humans can both take actions. \(\pi_{h}\qty(a_{h} | s, \theta)\), \(\pi_{r}\qty(a_{r} | h_{t})\) where humans and robots both take actions.

Solutions

Bayesian Inference

Humans acts by a known choice \(\pi_{h}\qty(a_{h}| s, \theta)\). The robot’s unknown to \(\theta\), and we start with a prior belief \(b_{r}\qty(\theta)\) of the unknown.

So, what is our updated belief given some human action \(a_{h}\)?

\begin{equation} b_{r}\qty(\theta | s) \propto \pi\qty(a_{h} \mid s, \theta) b\qty(\theta | s) \end{equation}

Thus every human action is a data point about \(\theta\). Don’t read th

For non-observable state, let’s cast it to a POMDP

(or a MOMDP)

  • fix human policy \(\pi_{h}\)
  • hidden state \(\theta\)
  • observed state \(s\)
  • robot observes \(s, a\)

belief update: \(b_{r}\qty(\theta | s) \propto \pi\qty(a | s, \theta) b\qty(\theta|s)\) (this maps to \(P(o|b,a,s’) P(s’ | b,a)\) in filter).

best response: we’d like to maximize discounted future utility \(\mathbb{E}[\sum_{t}^{} \gamma^{t} r]\).

Moving from recommendation to assistance

\begin{equation} p\qty(Y=1) = \sigma \qty(U^{T}_{i} V_{j}) \end{equation}

Recommendation: a factor model as above. But how do we know what actions to elicit or measure?

Reward Elicitation

Ok suppose our underlying belief \(\theta\) is how much the user likes item \(a\) given \(s\), how do we best choose things to elicit it?

Human Just RespondsHuman is an Actor
fully observed reward: \(R\qty(a_{R}, a_{H})\)“contextual bandit”“coordination problems”
reward not fully observed: \(R\qty(a_{R}, a_{H} \mid \theta)\)“assisted bandit”assistance games

Bandits

Each round \(t\), choose arm \(a_{t}\), and observe reward \(r_{t}\).

Each arm has an unknown mean reward \(\mu_{a} = \mathbb{E}\qty [r_{t} | a]\), and we want to minimize regret:

\begin{equation} \text{Reg}\qty(T) = T \mu^{*} - \sum_{t}^{} \mu_{a_{t}} \end{equation}

Contextual bandits sees some user context \(x_{t}\) first.

Explore Exploit trade-off

epsilon-greedy

Where we are

Assistance Games (fr)

Every human action gives some information about what the human goals are, and we are trying to maximize this reward.

example

  • goal \(\theta\): build
  • reward: change in edit distance to \(\theta\)
  • information: humans only see \(\theta\), robots only sees history
  • actions: humans and robots can both build something

naive fails

Well if you think about it PPO will just fail, since one best way to help the human build the house is to do nothing,

algorithm

  1. Network \(\phi\) gives policy \(\pi_{\phi}\) and value function \(V_{\phi}\)
  2. they run MCTS with \(\pi_{\phi}\) and \(v_{\phi}\)
  3. we then get the tree policy \(\pi^{(\phi)}_{\text{mcts}}\)
  4. train \(\pi_{\phi}\) towards \(\pi^{(\phi)}_{\text{mct}}\) and \(v_{\phi}\) towards the return

PiKL

architecture

  1. behavioral cloning first against humans
  2. then do the algorithm above with PPOish thing
  3. …with KL penalty against behavior cloned method

assistance games

Pretraining / SFT against episodes seem to actually help build the house as well

assistance games does much better: (\(26\%\))

lecture goals

  • assistance game + belief update
  • say when its a contextual bandit (when the thing has no unobservability)
  • explain why PPO fails in minecraft assistance games
  • compare rational, imitation, and hybrid human models

learning assistance game

contextual bandit

For each round, humans chooses \(a_{h}\), assistant chooses \(a_{a}\), and receives reward \(r\qty(\theta)\)

Optimal policy:

\begin{equation} \max_{\pi_{A}} \mathbb{E} \qty [ \sum_{t=1}^{T} r\qty(a_{H}^{(t)}, \pi_{A}\qty(a_{H}^{(t)}), \theta^{(t)})] \end{equation}

Emprecial policy:

\begin{equation} \sum_{t=1}^{T} r\qty(a_{H}^{(t)}, a_{A}^{(t)}, \theta^{(t)}) \end{equation}

and the “contextual” regret is:

\begin{equation} R_{T}\qty(a_{H}) = \max_{\pi_{A}} \mathbb{E} \qty [ \sum_{t=1}^{T} r\qty(a_{H}^{(t)}, \pi_{A}\qty(a_{H}^{(t)}), \theta^{(t)})] - \sum_{t=1}^{T} r\qty(a_{H}^{(t)}, a_{A}^{(t)}, \theta^{(t)}) \end{equation}

regret minimization

We can choose actions based on UCB 1. Let’s write:

\begin{equation} \qty [\mu_{n}\qty(a_{A}) - \sqrt{\frac{2 \log T}{N_{n}\qty(a_{A})}}, \mu_{n}\qty(a_{A}) + \sqrt{\frac{2 \log T}{N_{n}\qty(a_{A})}}] \end{equation}

as the confidence interval. where \(\mu\qty(a_{A})\) which is between all the rounds fro which an action is selected, what were the overage reward.

The selection of action will take the one with the highest upper confidence bound:

\begin{equation} \mu_{n}\qty(a_{A}) + \sqrt{\frac{2 \log T}{N_{n}\qty(a_{A})}} \end{equation}

intutition: first term promotes exploitation, second term promotes exploration.

Human and Agent Joint Optimisation

  • Its beneficial to optimize human policy
  • finding jointly optimal human and assistant policy is computationally hard
  • so we should find approximately optimal joint policy

As an example, we can make our regret jointly between

\begin{equation} R_{T}\qty(\theta) = \max_{\pi_{A}, \pi_{h}} \mathbb{E} \qty [ \sum_{t=1}^{T} r\qty(\pi_{H}\qty(\theta_{t}), \pi_{A}\qty(\pi_{H}(\theta_{t})), \theta^{(t)})] - \sum_{t=1}^{T} r\qty(a_{H}^{(t)}, a_{A}^{(t)}, \theta^{(t)}) \end{equation}

which does not induce a simple sublinear regret like UCB above (that is sublinear because you are lower bounded in failure). You can instead approximate via a greedy algorithm pairwise by learning humans -> learning robot etc.