Reinforcement Learning and Language Model Alignment (VTR UGE 21), day 1 of 5
Prof. Dr. Utku Kose, Süleyman Demirel University
Part A repeats the choices of greedy, epsilon-greedy and the upper confidence bound of the lecture step by step, with sliders for its numbers. Part B is a bandit game in which you play against the strategies of the day. Part C names the ingredients of a decision problem. Part D computes a discounted return and a Bellman backup by hand. Part E repeats value iteration on a corridor step by step, also with sliders. In Parts A and E every intermediate value is rounded, and the next step continues with the rounded value, as in a calculation by hand. Part F lets you design the reward of a robot vacuum and shows the behaviour that the best policy for this reward produces.
The worked example of the lecture: three arms, their pulls and their rewards, and the decision of greedy, of epsilon-greedy and of the upper confidence bound (UCB) for the next pull. The sliders set the pulls and the rewards of each arm, \(\varepsilon\) and the constant \(c\). The figure stacks the bonus of each arm on its estimate.
Back to the lecture: Bandits: exploration against exploitation, where the text continues after the box of this part.
Five slot machines pay a reward with hidden probabilities. You have fifty pulls: Click a machine to pull it. An algorithm plays the same machines with the same number of pulls. At the end the true probabilities are revealed and the game is added to the scoreboard. Can you beat the algorithm?
The three opponents are the strategies of the lecture, where their formulas are given. Epsilon-greedy plays the machine with the best record so far and tries a random one in one pull out of ten. UCB, the upper confidence bound, adds a bonus to machines that it has tried rarely. Thompson sampling draws a guess for every machine from what it has seen and plays the best guess.
| Game | Opponent | Your reward | Its reward | Your regret | Its regret |
|---|
Back to the lecture: Bandits: exploration against exploitation. The lecture continues there with Section 1 of the Colab notebook: Open it from the next orange box.
Name the ingredient that each description refers to.
Back to the lecture: Values and the Bellman equation, where the text continues after the box of this part.
An episode gives the rewards 0, 0 and 1, in this order, and the discount factor is 0.9. In another state, an action leads with probability 0.8 to a state of value 10 and with probability 0.2 to a state of value 0, and every step costs 1.
Back to the lecture: Values and the Bellman equation, where the text continues after the box of this part.
The corridor of the lecture: two cells, A and B, and a goal behind B, with the actions forward and wait. Each sweep computes the values of B and A from the values of the previous sweep, rounded to three decimals. The sweeps stop when no value changes by more than 0.001. The sliders set the probability that forward moves the agent, the discount factor and the reward of a step that does not reach the goal.
Back to the lecture: Values and the Bellman equation, where the text continues after the box of this part.
The robot vacuum of the lecture starts next to its dock, and its battery lasts 40 steps. It should clean the three dirty spots and then return to the dock. Design its reward: a reward for a cleaned spot, paid once or at every visit, a reward at the dock and a cost for every step. The lab computes the best policy for your reward by value iteration, with \(\gamma = 0.99\), and the robot follows it. Find a reward with which the robot cleans all three spots and docks within the 40 steps. The controls start with the reward of the lecture that pays at every visit. Then answer the question below by hand.
The policy of the lecture with a reward of 1 per spot, paid once, 5 at the dock and a cost of 0.04 per step needs 23 steps: It cleans the spots at steps 3, 10 and 14 and docks at step 23.
Back to the lecture: Values and the Bellman equation. The lecture continues there with Section 3 of the Colab notebook: Open it from the next orange box.
Answer each question, rate your confidence and check the answer. Results stay in this browser.
Write a short answer to each question. The text is saved in this browser and is included when you export the learning log.