CD-802-A Reinforcement Learning

Reinforcement Learning (CD-802-A) Important Questions

RGPV · B.Tech · CSE-DS · Semester 8 · Current scheme · 0 papers

  1. Read the answers

    Start with the topics that come every year.

  2. Revise unit notes

    Go through each unit once to score more.

Paperwala Imp Topics - Reinforcement Learning important questions

Download Paperwala Imp Question & Answer (PDF)

Chosen from the syllabus. No past paper of this subject is on this site yet, so repeats could not be counted.

Reinforcement Learning important questions with answers

Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The topics are chosen from the syllabus.

Q1. Reinforcement learning, its applications and relation to other AI problems

From the syllabus · Unit 1

From the papers

  • “Unit 1: State of the art applications in Atari, AlphaGo, relation to other problems in artificial intelligence.” (Syllabus)

The short answer

Reinforcement learning (RL) is learning by trial and error. An agent acts in an environment, receives a reward and learns a policy that maximises the total reward over time.

Write these points

The loop

  • At each step the agent sees a state s and picks an action a.
  • The environment returns a reward r and the next state s'.
  • The goal is to maximise the return, the sum of discounted rewards r1 + g r2 + g^2 r3 + ... where g is the discount factor.
  • There is no teacher giving the right action. The agent finds it from reward alone.
  • Reward may arrive late, so the agent must link an old action to a result that comes much later.

State of the art applications

  • Atari games: a deep network learns to play from raw screen pixels with only the score as reward.
  • AlphaGo: combines tree search with networks trained by self play. It beat top Go players.
  • Robot control, ad placement, traffic signals and chip layout also use RL.

Relation to other problems in AI

Supervised learning has the right answer for every example. RL has only a reward and the data depend on the agent's own actions. Planning and search need a known model. RL can learn without one.

Remember. The Atari and AlphaGo results are named in the syllabus. Exact scores and years are left out because they are not confirmed here.

Real-life example

A student learning to ride a bicycle gets no written rules. Each wobble or fall is a bad reward and each smooth stretch is a good one. After many tries the body learns which handle movement keeps the cycle upright. A cycle taxi driver in Bhopal learns the best lanes in the same way, from the time each trip took.

Diagram: Reinforcement learning, its applications and relation to other AI problems

Same or opposite: reinforcement and supervised learning

PointReinforcement learningSupervised learningSame or opposite
FeedbackReward, often delayedCorrect label for each exampleOpposite
DataCreated by the agent's own actionsFixed datasetOpposite
GoalMaximise long term rewardMinimise prediction errorOpposite
Needs a learning signal from outsideYesYesSame

Exam tip. Draw the agent and environment loop first, with the labels state, action and reward. Then name two applications. Examiners give marks for stating how RL differs from supervised learning.

Back to the topic list

Q2. Markov decision process

From the syllabus · Unit 1

From the papers

  • “Unit 1: Markov Decision Processes (model based): Formulation.” (Syllabus)

The short answer

A Markov Decision Process (MDP) is a tuple (S, A, P, R, g). S is the set of states, A the actions, P(s'|s,a) the transition probability, R(s,a) the reward and g the discount factor.

Write these points

Markov property

The next state depends only on the current state and action, not on the earlier history. This lets one state hold all the information needed to decide.

Objects to define

  • Policy pi(a|s): the rule that picks an action in each state.
  • State value V^pi(s): the expected discounted return from s when following pi.
  • Action value Q^pi(s,a): the expected return after taking a in s, then following pi.
  • Bellman equation: V^pi(s) = sum over a of pi(a|s) [ R(s,a) + g sum over s' of P(s'|s,a) V^pi(s') ].
  • Optimality equation: V*(s) = max over a of [ R(s,a) + g sum over s' of P(s'|s,a) V*(s') ].

A two state MDP used in the next answers.

States A and B, actions 1 and 2, discount g = 0.9, all moves certain.

In A: action 1 stays in A with reward 1. Action 2 goes to B with reward 0.

In B: action 1 stays in B with reward 3. Action 2 goes to A with reward 0.

Always taking action 1 in B gives 3 + 0.9 x 3 + ... = 3 / 0.1 = 30. So V*(B) = 30.

From A, going to B costs one step with reward 0, then 30 follows: 0 + 0.9 x 30 = 27. Staying in A gives 1 / 0.1 = 10. So V*(A) = 27.

Real-life example

Think of a chai stall owner who each morning decides how many cups of milk to buy. The state is the stock left. The action is the quantity bought. Tomorrow's stock depends only on today's stock, today's purchase and random sales, so it is Markov. Profit is the reward and the owner wants the best total profit over the month.

Diagram: Markov decision process

Same or opposite: policy and value function

PointPolicyValue functionSame or opposite
What it givesAn action for each stateA number for each stateOpposite
Depends on the otherChosen using valuesComputed for one policySame
Optimal formpi*V*Same
Used to act directlyYesNo, only to compareOpposite

Exam tip. Write the five parts of the tuple, then the Bellman optimality equation. Use the two state MDP as your example, because it shows the numbers V*(A) = 27 and V*(B) = 30.

Back to the topic list

Q3. Value iteration

From the syllabus · Unit 1

From the papers

  • “Unit 1: Value Iteration (VI).” (Syllabus)

The short answer

Value iteration (VI) finds the best value function by repeating the Bellman backup: V_(k+1)(s) = max over a of [ R(s,a) + g sum of P(s'|s,a) V_k(s') ].

Write these points

Algorithm

  1. Start with any V_0, usually all zeros.
  2. For every state, compute the best backed up value using the old table.
  3. Replace the table with the new values.
  4. Stop when the largest change is below a small number.
  5. Read the policy: in each state pick the action that gives the maximum.

Why it works

  • The backup is a contraction with factor g in the max norm. The error shrinks by at least g at each sweep.
  • So VI reaches a single fixed point, V*, from any start.
  • Each sweep costs O(|S|^2 |A|) operations.

Value iteration on the two state MDP (g = 0.9).

V_1: A = max(1 + 0, 0 + 0) = 1. B = max(3, 0) = 3.

V_2: A = max(1 + 0.9 x 1, 0 + 0.9 x 3) = max(1.9, 2.7) = 2.7. B = max(3 + 0.9 x 3, 0 + 0.9 x 1) = 5.7.

V_3: A = 5.13, B = 8.13. V_4: A = 7.317, B = 10.317. V_5: A = 9.285, B = 12.285.

The values climb toward V*(A) = 27 and V*(B) = 30. The greedy action in A is already 2 (go to B) once V_1 is known.

Remember. All values in the worked examples of Q2 to Q5 come from one two state MDP made for this PDF. The MDP is not from the syllabus or from any paper.

Real-life example

A student planning the best order to revise five subjects can start with a rough guess of how much each chapter is worth. After every pass she improves each guess using what the next chapters are worth. After a few passes the guesses stop changing and the order is clear. That is value iteration.

Diagram: Value iteration

Same or opposite: value iteration and policy iteration

PointValue iterationPolicy iterationSame or opposite
Each sweepOne max backupFull evaluation, then improvementOpposite
Intermediate policyNone storedA real policy at every stepOpposite
Converges to V*YesYesSame
Needs a known modelYesYesSame

Exam tip. Write the update equation, then show two sweeps of numbers as in the example. State the contraction argument in one line, since it earns the convergence mark.

Back to the topic list

Q4. Policy iteration

From the syllabus · Unit 1

From the papers

  • “Unit 1: Policy Iteration (PI).” (Syllabus)

The short answer

Policy iteration (PI) alternates policy evaluation, which computes V^pi, with policy improvement, which makes the policy greedy for that V^pi. It stops when the policy no longer changes.

Write these points

Steps

  1. Start with any policy pi_0.
  2. Evaluate: solve V = R_pi + g P_pi V. This is a linear system, solved directly or by repeated sweeps.
  3. Improve: pi_new(s) = the action a that maximises R(s,a) + g sum of P(s'|s,a) V(s').
  4. If pi_new equals pi, stop. The policy is optimal. Otherwise go back to step 2.

Facts to state

  • Each improvement step gives a policy at least as good as before (the policy improvement theorem).
  • A finite MDP has finitely many policies, so PI stops after a finite number of rounds.
  • In practice PI needs few rounds, but each one needs a full evaluation.

Policy iteration on the two state MDP (g = 0.9).

Start: pi_0 = action 1 in both states (stay).

Evaluate: V(A) = 1 / 0.1 = 10 and V(B) = 3 / 0.1 = 30.

Improve in A: Q(A,1) = 1 + 0.9 x 10 = 10. Q(A,2) = 0 + 0.9 x 30 = 27. Action 2 wins.

Improve in B: Q(B,1) = 30 and Q(B,2) = 9. Action 1 stays.

Evaluate pi_1: V(A) = 27 and V(B) = 30. Improving again changes nothing, so pi_1 is optimal after 2 rounds.

Real-life example

A shop owner follows a fixed plan for restocking. After a month she checks how that plan performed and changes the rule for every item that could have done better. She follows the new plan for another month. Soon the plan stops changing. This cycle of testing a plan and then improving it is policy iteration.

Diagram: Policy iteration

Same or opposite: policy evaluation and policy improvement

PointPolicy evaluationPolicy improvementSame or opposite
InputA policyA value functionOpposite
OutputValues V^piA better policyOpposite
Uses the model P and RYesYesSame
Step typePredictionControlOpposite

Exam tip. Show the loop in a small diagram, then run the numbers of the two state example. State that PI stops after finitely many rounds. Many students forget this.

Back to the topic list

Q5. Linear programming for MDPs

From the syllabus · Unit 1

From the papers

  • “Unit 1: Linear Programming (LP).” (Syllabus)

The short answer

The linear programming (LP) method minimises the sum of V(s) subject to V(s) >= R(s,a) + g sum of P(s'|s,a) V(s') for every s and a. The answer is V*.

Write these points

Why it works

  • Any V that satisfies all the constraints is above V*, because the constraints say V is at least what each action gives.
  • The smallest such V is exactly V*, so minimising the sum picks it.
  • There is one variable per state and one constraint per state-action pair.

Dual form

  • The dual has one variable x(s,a) for each state-action pair. It is the expected discounted number of visits.
  • The best policy picks the action with x(s,a) above zero in each state.
  • This view links MDPs to flow problems and is used for extra constraints.

When to use it

  • Good for small MDPs with side constraints such as a cost budget.
  • Solvers handle thousands of variables. Beyond that VI or PI scale better.

The LP for the two state MDP (g = 0.9).

Minimise V(A) + V(B) subject to four constraints.

V(A) >= 1 + 0.9 V(A) and V(A) >= 0 + 0.9 V(B).

V(B) >= 3 + 0.9 V(B) and V(B) >= 0 + 0.9 V(A).

Check V(A) = 27 and V(B) = 30: all four hold (27 >= 25.3, 27 >= 27, 30 >= 30, 30 >= 24.3). Two are tight. Lowering either value breaks a constraint, so this is the minimum.

Real-life example

A railway planner has a fixed budget of crew hours and wants the best timetable. She writes the limits as equations and asks a solver to find the best plan in one go. MDP planning by LP is the same style. The Bellman rules become the limits and the solver finds the values.

Diagram: Linear programming for MDPs

Same or opposite: LP and value iteration

PointLinear programmingValue iterationSame or opposite
MethodOne optimisation problemRepeated backupsOpposite
Extra constraintsEasy to addHard to addOpposite
Gives V* exactlyYesIn the limitOpposite
Needs a known modelYesYesSame

Exam tip. Write the objective and the constraint with its words. Then check the example values against each constraint. Say that two constraints are tight, as that shows you understand the result.

Back to the topic list

Q6. Curse of dimensionality and representations

From the syllabus · Unit 2

From the papers

  • “Unit 2: Curse of dimensionality, representations.” (Syllabus)

The short answer

The curse of dimensionality means the number of states grows exponentially with the number of state variables, so a table with one entry per state cannot be stored. Function approximation replaces the table by a small formula.

Write these points

Size of the problem

  • A state made of n variables with m values each has m^n states.
  • Every table sweep of VI or PI visits every state, so time grows the same way.
  • Data are also too few: most states are never visited, so a table has nothing to say about them.

Representations used

  • Linear features: V(s) is about w1 f1(s) + w2 f2(s) + ... The features f are chosen by hand, for example distance to goal.
  • State aggregation: group similar states into one cell and keep one value for the cell.
  • Tile coding and radial basis functions: overlapping local features for continuous states.
  • Neural networks: learn the features too. This is the route taken in deep RL.

Price paid

  • The true value may not lie in the chosen family, so some approximation error always stays.
  • Planning algorithms lose their clean contraction guarantee, which the next answers deal with.

How fast the table grows.

10 variables with 10 values each give 10^10 = 10,000,000,000 states.

20 variables give 10^20 states. A linear form with 20 weights stores the same problem in 20 numbers.

Real-life example

A food delivery app tracks the order, rider position, kitchen load and traffic in a city. Writing one table entry for every exact combination of these is impossible. The app instead learns a formula using a few features such as the distance and the number of open orders. The formula can say something about situations the app has never seen.

Diagram: Curse of dimensionality and representations

Same or opposite: table and function approximation

PointTableFunction approximationSame or opposite
MemoryOne entry per stateA few parametersOpposite
Generalises to unseen statesNoYesOpposite
Exact answer possibleYesOnly if the family fitsOpposite
Needs the Bellman backupYesYesSame

Exam tip. Give the m^n count with one numeric case, then list three representations. Mention that approximation brings error. This single remark separates a good answer from an average one.

Back to the topic list

Q7. Approximate value iteration

From the syllabus · Unit 2

From the papers

  • “Unit 2: Approximate value iteration.” (Syllabus)

The short answer

Approximate value iteration (AVI) runs the Bellman backup, then projects the result onto the family V(s) = w^T f(s). Only the weights w are stored.

Write these points

One round

  1. Take the current approximation V_k = F w_k, where F holds the features.
  2. Apply the Bellman optimality operator T at a set of sample states to get targets.
  3. Fit new weights by least squares so that F w_(k+1) is close to those targets.
  4. Repeat until the weights settle or the budget ends.

Facts to state

  • The Bellman backup T is a contraction. The least squares projection alone is also harmless. Their combination may not be a contraction, so AVI can diverge.
  • If the fitting error in each round is at most e, the final gap from V* is at most 2 g e divided by (1 minus g) squared.
  • The bound grows as g nears 1, so long horizons are harder.

Remember. The bound is quoted from memory of the standard result. The constant can differ in your book, so copy the form given in your class notes.

AVI on a 5 state chain, features (1, s), g = 0.9.

Reward 10 only in state 4. Move right each step. Start with V_0 = 0.

Round 1: targets (0, 0, 0, 0, 10). Least squares gives weights (-2.0, 2.0), fit (-2, 0, 2, 4, 6).

Round 2: targets (0, 1.8, 3.6, 5.4, 15.4). Fit (-1.64, 1.8, 5.24, 8.68, 12.12). The line cannot reach 15.4 at the end.

After round 5 the fit is (6.39, 12.15, 17.91, 23.67, 29.43). The exact values are (65.6, 72.9, 81, 90, 100). A line is a poor shape for this value curve.

Real-life example

A bank wants the long term value of every customer type, but there are millions of exact customer profiles. It fits a simple formula on age, income and balance after each round of updates. The formula smooths over details. Its error shows up for rare customers, just like the line above misses the end state.

Diagram: Approximate value iteration

Same or opposite: exact VI and approximate VI

PointExact value iterationApproximate value iterationSame or opposite
Stored valuesOne per stateWeights onlyOpposite
ContractionYesNot assuredOpposite
Final errorGoes to zeroStays within a boundOpposite
Uses the Bellman backupYesYesSame

Exam tip. Write the two steps backup and project, then the error bound with its factor of (1 minus g) squared. Add the chain example if the question carries 10 marks or more.

Back to the topic list

Q8. Approximate policy iteration

From the syllabus · Unit 2

From the papers

  • “Unit 2: Approximate policy iteration.” (Syllabus)

The short answer

Approximate policy iteration (API) keeps both steps of policy iteration but does each in a rough way. It evaluates with a fitted function V = w^T f(s) and then acts greedily on it.

Write these points

Steps

  1. Pick a policy pi_k.
  2. Evaluate roughly: find weights w so that F w is close to V^(pi_k). Use least squares on sampled returns or a projected Bellman equation.
  3. Improve: pi_(k+1) is greedy with respect to F w.
  4. Repeat.

Facts to state

  • The evaluation error can be measured in the max norm. If it is at most e in every round, the final gap between V^(pi_k) and V* is at most 2 g e divided by (1 minus g) squared.
  • The policy sequence may oscillate among several policies and never settle. The bound still holds on the worst policy seen.
  • Evaluation can use samples from the real system, so no model is needed. This is how LSPI (least squares policy iteration) works.

Remember. The error bound is quoted from memory and the constants may differ between textbooks.

Why the policy can flip (illustrative numbers).

Suppose the fitted values give Q(A,1) = 10.2 and Q(A,2) = 10.0 in some state, while true values are 9.8 and 10.0.

The greedy step picks action 1, which is worse. Small fitting errors turn into a wrong choice when two actions are close.

The bound says the loss is at most 2 g e divided by (1 minus g) squared. For e = 0.2 and g = 0.9 this is 2 x 0.9 x 0.2 / 0.01 = 36, a very loose limit.

Real-life example

A cricket coach scores the team's field plan using a few match statistics, not every ball of every match. She adjusts the plan to what the scores say. A slightly wrong score can make her change a good plan. Next season she switches back. This swing is policy oscillation.

Diagram: Approximate policy iteration

Same or opposite: exact PI and approximate PI

PointExact policy iterationApproximate policy iterationSame or opposite
EvaluationSolves the linear systemFits weightsOpposite
Policy improves every roundYes, alwaysNot alwaysOpposite
Stops at a fixed pointYesMay oscillateOpposite
Two step loopYesYesSame

Exam tip. Show the loop with the word approximate on both steps. State the oscillation issue and the error bound. These two points are what the examiner looks for.

Back to the topic list

Q9. Approximate linear program and guarantees

From the syllabus · Unit 2

From the papers

  • “Unit 2: Approximate linear program, approximation and convergence guarantees.” (Syllabus)

The short answer

The approximate linear program (ALP) restricts the MDP linear program to V = F w. It minimises c^T F w subject to F w >= T(F w), so the answer is an upper bound on V*.

Write these points

Formulation

  • Variables: only the weights w, one per feature.
  • Objective: minimise sum over s of c(s) V_w(s). The weights c(s) are state relevance weights that say where accuracy matters.
  • Constraints: V_w(s) >= R(s,a) + g sum of P(s'|s,a) V_w(s') for every s and a. There are still many constraints, so they are sampled in practice.

Approximation and convergence guarantees

  • Every feasible V_w lies above V*, so the solution is a one sided approximation.
  • A known result bounds the error by a constant times the best possible fit of V* by the features, which gives a firm bound without iterating.
  • No iteration means no divergence. This is the main strength compared with AVI.
  • Weakness: the quality depends on the weights c and on which constraints are sampled.

Remember. The error guarantee is stated in words only. The exact weighted norm and constant are not confirmed here.

ALP with one feature on the two state MDP.

Use V(A) = V(B) = w, a single constant feature, with g = 0.9.

Constraints: w >= 1 + 0.9 w, w >= 0 + 0.9 w, w >= 3 + 0.9 w. The largest requirement gives w >= 30.

The solution is w = 30. This is an upper bound: it is exact for B and above the true 27 for A. The error is 3 in state A.

Real-life example

A power distribution company must plan voltages at thousands of nodes. It writes a smaller model with a handful of parameters and requires that the model never falls below the real cost in any tested situation. The result is cautious but safe. ALP gives the same kind of safe, upper side answer.

Diagram: Approximate linear program and guarantees

Same or opposite: exact LP and approximate LP

PointExact LPApproximate LPSame or opposite
VariablesOne per stateOne per featureOpposite
ResultV* exactlyUpper bound near V*Opposite
ConstraintsAll state-action pairsOften sampledOpposite
Linear programYesYesSame

Exam tip. Write the objective and the constraint with F w in place of V. Then state the upper bound property and the no divergence advantage. Use the one feature example for the marks on numbers.

Back to the topic list

Q10. Single and multi timescale stochastic approximation

From the syllabus · Unit 3

From the papers

  • “Unit 3: Single and multi-timescale stochastic approximation.” (Syllabus)

The short answer

Stochastic approximation (SA) finds the root of an equation from noisy samples: x_(n+1) = x_n + a_n ( h(x_n) + noise ). The step sizes must satisfy sum of a_n = infinity and sum of a_n^2 < infinity.

Write these points

Single timescale

  • This is the Robbins-Monro scheme. It is the base of TD learning and Q-learning.
  • The first condition lets the iterate travel far enough. The second makes the noise die out.
  • The step a_n = 1/n meets both. A constant step does not meet the second, so the iterate keeps a small random wobble.

Multi timescale

  • Two iterates run together with step sizes b_n and a_n where a_n / b_n goes to zero.
  • The fast one sees the slow one as nearly frozen. The slow one sees the fast one as already settled.
  • Actor critic uses this: the critic is fast and the actor is slow.

ODE method

The scheme tracks the differential equation dx/dt = h(x). If this ODE has a stable equilibrium x*, the iterates converge to it (details in the next answer).

Running average as stochastic approximation.

Samples y = 4, 6, 5, 7. Use x_(n+1) = x_n + (1 / (n + 1)) (y - x_n) with x_0 = 0.

After y = 4: x = 4. After y = 6: x = 4 + 0.5 x 2 = 5. After y = 5: x = 5 + (1/3) x 0 = 5. After y = 7: x = 5 + 0.25 x 2 = 5.5.

5.5 is the mean of the four samples. Steps 1/n give the exact mean. Over 100 terms the sum of 1/n is 5.19 and the sum of 1/n^2 is 1.63, which settles near pi^2 / 6.

Real-life example

A bus operator estimates the average delay on a route from daily reports. She does not store all reports. Each evening she moves her estimate a little toward the day's delay. At first the steps are large, but later each step is small. This is the one over n rule.

Diagram: Single and multi timescale stochastic approximation

Same or opposite: single and multi timescale SA

PointSingle timescaleMulti timescaleSame or opposite
Number of iteratesOneTwo or moreOpposite
Step sizesOne sequenceDifferent speedsOpposite
Step size conditionsSum infinite, squares finiteSame, plus a ratio going to zeroOpposite
Needs noise to die outYesYesSame

Exam tip. State the two step size conditions exactly and show that 1/n meets them. Then give the actor critic as the use of two timescales. The running average example is a quick source of numbers.

Back to the topic list

Start with the latest papers

Previous year papers will be added soon!

Reinforcement Learning (CD-802-A) FAQs

What are the most important topics in Reinforcement Learning?

No past paper of this subject is on this site yet, so the topics were chosen from the syllabus. The first five: Reinforcement learning, its applications and relation to other AI problems; Markov decision process; Value iteration; Policy iteration; Linear programming for MDPs.

How were these Reinforcement Learning important questions chosen?

Each topic was taken from the syllabus units. No past paper was available to count repeats, and the answers are not teacher-reviewed, so use them together with your syllabus.

Is there a PDF of Reinforcement Learning important questions with answers?

Yes. The Paperwala Imp Question & Answer PDF for Reinforcement Learning is free to download from this page.

The 10 topics of Reinforcement Learning (CD-802-A) for RGPV B.Tech CSE-DS semester 8, chosen from the syllabus. No past paper of this subject is on this site yet, so repeats could not be counted.