=== Original PDF page 2 ===
                                              Policy Gradient with Tree Expansion

rate of |λ2 |d , where d is the depth of the tree and λ2 is the       state distribution. We denote the transition matrix starting
second eigenvalue of the transition matrix induced by the             from state s by Ps ∈ [0, 1]A×S , i.e., [Ps ]a,s′ = P (s′ |a, s).
tree expansion policy. This work is the first to prove such a         Similarly, let Rs = r(s, ·) ∈ RA denote the correspond-
relation between PG variance and tree expansion policy. In            ing reward vector. Separately, let π : S → ∆A be a sta-
addition, we prove that with an approximate forward model,            tionary policy. Let P π and Rπ be the induced transition
                                                                                                                          π ′
the bias of the gradient is bounded proportionally to the                                                    P i.e., P (s |s) =
                                                                      matrix and reward function, respectively,
                                                                      P                 ′
approximation error of the model.                                        a π(a|s) Pr(s |s, a) and Rπ (s) =      a π(a|s)r(s, a). De-
                                                                      note the stationary distribution of P π by µπ ∈ RS s.t.
To verify our results, we implemented a practical version of
                                                                      µ⊤πP
                                                                            π
                                                                                = P π , and the discounted state P∞visitation     fre-
SoftTreeMax that exhaustively searches the entire tree and
                                                                      quency by dπ so that d⊤    π = (1 − γ)
                                                                                                                         t ⊤     π t
                                                                                                                    t=0 γ ν (P ) .
applies a neural network on its leaves. We test our algorithm
                                                                      Also, let V π ∈ RP     S
                                                                                               be the value function of π defined
on a parallelized Atari GPU simulator (Dalton et al., 2020).                                   ∞
                                                                             π           π
                                                                      by V (s) = E [ t=0 γ t r (st , π(st )) | s0 = s], and let
To enable a tractable deep search, up to depth eight, we
                                                                      Qπ ∈ RS×A be the Q-function such that Qπ (s, a) =
also introduce a pruning technique that limits the width of
                                                                      Eπ [r(s, a) + γV π (s′ )]. Our goal is to find an optimal pol-
the tree. We do so by sampling only the most promising                                               ⋆
                                                                      icy π ⋆ such that V ⋆ (s) ≡ V π (s) = maxπ V π (s), ∀s ∈ S.
nodes at each level. We integrate our SoftTreeMax GPU im-
plementation into the popular PPO (Schulman et al., 2017)             For the analysis in Section 4, we introduce the following
and compare it to the flat distributed variant of PPO. This           notation. Denote by Θ ∈ RS the vector representation
allows us to demonstrate the potential benefit of utilizing           of θ(s) ∀s ∈ S. For a vector u, denote by exp(u) the
learned models while isolating the fundamental properties             coordinate-wise exponent of u and by D(u) the diagonal
of TS without added noise. In all tested Atari games, our             square matrix with u in its diagonal. For a matrix A, denote
results outperform the baseline and obtain up to 5x more              its i-th eigenvalue by λi (A). Denote the k-dimensional iden-
reward. We further show in Section 6 that the associated              tity matrix and all-ones vector by Ik and 1k , respectively.
gradient variance is smaller by three orders of magnitude in          Also, denote the trace operator by Tr . Finally, we treat all
all games, demonstrating the relation between low gradient            vectors as column vectors.
variance and high reward.
We summarize our key contributions. (i) We show how to                2.1. Policy Gradient
combine two families of SoTA approaches: PG and TS by                 PG schemes seek to maximize the cumulative reward as a
introducing SoftTreeMax: a novel parametric policy that               function of the policy πθ (a|s) by performing gradient steps
generalizes softmax to planning. Specifically, we propose             on θ. The celebrated Policy Gradient Theorem (Sutton et al.,
two variants based on cumulative and exponentiated rewards.           1999) states that
(ii) We prove that the gradient variance of SoftTreeMax
                                                                      ∂ ⊤ πθ
in its two variants decays with its tree depth. Our analysis             ν V = Es∼dπθ ,a∼πθ (·|s) [∇θ log πθ (a|s)Qπθ (s, a)] ,
sheds new light on the choice of tree expansion policy. It            ∂θ
raises the question of optimality in terms of variance versus         where ν and d⊤ πθ are as defined above. The variance of the
the traditional regret; e.g., in UCT (Kocsis & Szepesvári,           gradient is thus
2006). (iii) We prove that with an approximate forward
model, the gradient bias is proportional to the approx-                     Vars∼dπθ ,a∼πθ (·|s) (∇θ log πθ (a|s)Qπθ (s, a)) .    (1)
imation error, while retaining the variance decay. This
quantifies the accuracy required from a learned forward               In the notation above, we denote the variance of a vector
model. (iv) We implement a differentiable deep version of             random variable X by
SoftTreeMax that employs a parallelized GPU tree expan-                                  h h
                                                                                                          ⊤
                                                                                                                        ii
                                                                         Varx (X) = Tr Ex (X − Ex X) (X − Ex X) ,
sion. We demonstrate how its gradient variance is reduced
by three orders of magnitude over PPO while obtaining up              similarly as in (Greensmith et al., 2004). From now on, we
to 5x reward.                                                         drop the subscript from Var in (1) for brevity. When the
                                                                      action space is discrete, a commonly used parameterized
2. Preliminaries                                                      policy is softmax: πθ (a|s) ∝ exp (θ(s, a)) , where θ : S ×
                                                                      A → R is a state-action parameterization.
Let ∆U denote simplex over the set U. Throughout, we con-
sider a discounted Markov Decision Process (MDP) M =
(S, A, P, r, γ, ν), where S is a finite state space of size S,        3. SoftTreeMax: Exponent of trajectories
A is a finite action space of size A, r : S × A → [0, 1] is the       We introduce a new family of policies called SoftTreeMax,
reward function, P : S ×A → ∆S is the transition function,            which are a model-based generalization of the popu-
γ ∈ (0, 1) is the discount factor, and ν ∈ RS is the initial          lar softmax. We propose two variants: Cumulative

                                                                  2


=== Original PDF page 3 ===
                                             Policy Gradient with Tree Expansion

(C-SoftTreeMax) and Exponentiated (E-SoftTreeMax). In                the best trajectory is defined in expectation, while for
both variants, we replace the generic softmax logits θ(s, a)         E-SoftTreeMax it is defined in terms of the best sample
with the score of a trajectory of horizon d starting from            path.
(s, a), generated by applying a behavior policy πb . In
                                                                     SoftTreeMax behavior policy selection. The choice of
C-SoftTreeMax, we exponentiate the expectation of the log-
                                                                     behavior policy πb plays a crucial role in the performance
its. In E-SoftTreeMax, we first exponentiate the logits and
                                                                     of SoftTreeMax. As we show in Section 4, the gradient vari-
then only compute their expectation.
                                                                     ance is minimized when the transitions induced by πb result
Logits. We define the SoftTreeMax logit ℓs,a (d; θ) to be            in similar distributions across states, which is achieved when
the random variable depicting the score of a trajectory of           the second eigenvalue of P πb is small. Without specific as-
horizon d starting from (s, a) and following the policy πb :         sumptions on the MDP, a uniform policy that smoothens
                            "d−1                #                    transition probabilities across all actions serves as a reason-
                         −d
                             X
                                  t      d                           able approximation to this goal. In practice, this leads to
         ℓs,a (d; θ) = γ         γ rt + γ θ(sd ) .       (2)         better mixing properties in the associated Markov chain.
                             t=0
                                                                     SoftTreeMax convergence. Under regularity conditions,
In the above expression, note that s0 = s, a0 = a, at ∼              for any parametric policy, PG converges to local optima
πb (·|st ) ∀t ≥ 1, and rt ≡ r (st , at ) . For brevity of the        (Bhatnagar et al., 2009), and thus also SoftTreeMax. For
analysis, we let the parametric score θ in (2) be state-based,       softmax PG, asymptotic (Agarwal et al., 2021) and rate re-
similarly to a value function. Instead, one could use a state-       sults (Mei et al., 2020b) were recently obtained, by showing
action input analogous to a Q-function. Thus, SoftTreeMax            that the gradient is strictly positive everywhere (Mei et al.,
can be integrated into the two types of implementation of RL         2020b, Lemmas 8-9). We conjecture that SoftTreeMax sat-
algorithms in standard packages. Lastly, the preceding γ −d          isfies the same property, being a generalization of softmax,
scales the θ parametrization to correspond to its softmax            but formally proving it is subject to future work.
counerpart.
                                                                     SoftTreeMax gradient. The two variants of SoftTreeMax
C-SoftTreeMax. Given an inverse temperature parameter                involve an expectation taken over S d many trajectories from
β, we let C-SoftTreeMax be                                           the root state s and weighted according to their probability.
                                                                     Thus, during the PG training process, the gradient ∇θ log πθ
             C
            πd,θ (a|s) ∝ exp [βEπb ℓs,a (d; θ)] .         (3)
                                                                     is calculated using a weighted sum of gradients over all
C-SoftTreeMax gives higher weight to actions that result             reachable states starting from s. Our method exploits the
in higher expected returns. While standard softmax relies            exponential number of trajectories to reduce the variance
entirely on parametrization θ, C-SoftTreeMax also interpo-           while improving performance. Indeed, in the next section
lates a Monte-Carlo portion of the reward.                           we prove that the gradient variance of SoftTreeMax decays
                                                                     exponentially fast as a function of the behavior policy πb and
E-SoftTreeMax.      The second operator we propose is                trajectory length d. In the experiments in Section 6, we also
E-SoftTreeMax:                                                       show how the practical version of SoftTreeMax achieves
                                                                     a significant reduction in the noise of the PG process and
            E
           πd,θ (a|s) ∝ Eπb exp [(βℓs,a (d; θ))] ;        (4)
                                                                     leads to faster convergence and higher reward.
here, the expectation is taken outside the exponent. This
objective corresponds to the exponentiated reward objec-             4. Theoretical Analysis
tive which is often used for risk-sensitive RL (Howard
& Matheson, 1972; Fei et al., 2021; Noorani & Baras,                 In this section, we first bound the variance of PG when
2021). The common risk-sensitive objective is of the form            using the SoftTreeMax policy. Later, we discuss how the
log E[exp(δR)], where δ is the risk parameter and R is the           gradient bias resulting due to approximate forward models
cumulative reward. Similarly to that literature, the exponent        diminishes as a function of the approximation error, while
in (4) emphasizes the most promising trajectories.                   retaining the same variance decay.

SoftTreeMax properties. SoftTreeMax is a natural model-              We show that the variance decreases with the tree depth,
based generalization of softmax. For d = 0, both variants            and the rate is determined by the second eigenvalue of the
above coincide since (2) becomes deterministic. In that case,        transition kernel induced by πb . Specifically, we bound the
for a state-action parametrization, they reduce to standard          same expression for variance as appears in (Greensmith
softmax. When β → 0, both variants again coincide and                et al., 2004, Sec. 3.5) and (Wu et al., 2018, Sec. A, Eq. (21)).
sample actions uniformly (exploration). When β → ∞,                  Other types of analysis could instead have focused on the
the policies become deterministic and greedily optimize              estimation aspect in the context of sampling (Zhang et al.,
for the best trajectory (exploitation). For C-SoftTreeMax,           2021; Shen et al., 2019; Pham et al., 2020). Indeed, in

                                                                 3


=== Original PDF page 14 ===
                                                 Policy Gradient with Tree Expansion

A.3. Proof of Lemma 4.3 – Gradient of C-SoftTreeMax
The C-SoftTreeMax gradient of dimension A × S is given by
                                                           C ⊤             d−1
                                         C
                                                               ) Ps (P πb )
                                                                
                                 ∇θ log πd,θ = β IA − 1A (πd,θ                 ,
                                                                   C      C
where for brevity, we drop the s index in the policy above, i.e., πd,θ ≡ πd,θ (·|s).

                                      C
Proof. The (j, k)-th entry of ∇θ log πd,θ satisifes

                   C
                                       C
                                ∂ log(πd,θ (aj |s))
          [∇θ log πd,θ ]j,k =
                                      ∂θ(sk )
                                                        P h h 
                                                                                πb d−1
                                                                                            ii                  
                                                      a exp   β  C s,d + P s (P     )     Θ        β Ps (P πb )d−1 a,k
                           = β[Ps (P πb )d−1 ]j,k −                    h                        a     i
                                                               1⊤ exp   β   C     +   P   (P πb )d−1 Θ
                                                                A             s,d       s
                                                      X
                           = β[Ps (P πb )d−1 ]j,k − β    C
                                                             (a|s) Ps (P πb )d−1 a,k
                                                                                 
                                                        πd,θ
                                                           a
                                        πb d−1
                                                      C ⊤
                                                           ) Ps (P πb )d−1 k
                                                                            
                           = β[Ps (P ) ]j,k − β (πd,θ
                                                           C ⊤
                           = β[Ps (P πb )d−1 ]j,k − β 1A (πd,θ ) Ps (P πb )d−1 j,k .
                                                                             


Moving back to matrix form, we obtain the stated result.

A.4. Proof of Theorem 4.4 – Exponential variance decay of C-SoftTreeMax
The C-SoftTreeMax policy gradient is bounded by

                                                                   A2 S 2 β 2
                                              C
                                                                              |λ2 (P πb )|2(d−1) .
                                                              
                                  Var ∇θ log πd,θ (a|s)Q(s, a) ≤ 2
                                                                   (1 − γ)2

Proof. We use Lemma 4.1 directly. First of all, it is know that when the reward is bounded in [0, 1], the maximal value of
                   1
the Q-function is 1−γ as the sum as infinite discounted rewards. Next, we bound the Frobenius norm of the term achieved in
Lemma 4.3, by applying the eigen-decomposition on P πb :
                                                                          S
                                                                          X
                                                      P πb = 1S µ⊤ +            λi ui vi⊤ ,                                                (10)
                                                                          i=2

where µ is the stationary distribution of P πb , and ui and vi are left and right eigenvectors correspondingly.
                                                                                              S
                                                                                                           !
                                                                                             X
                                 ⊤         πb d−1                          ⊤            ⊤          d−1   ⊤
                                                                            
                ∥β IA,A − 1A π Ps (P ) ∥F = β∥ IA,A − 1A π Ps 1S µ +                             λi ui vi ∥F
                                                                                                             i=2
                                                                                                         S
                                                                                                                                  !
                                                                                                         X
                                                                                    ⊤
                                                                                              1A µ⊤ +           λid−1 Ps ui vi⊤
                                                                                      
                                   (Ps is stochastic)     = β∥ IA,A − 1A π                                                            ∥F
                                                                                                          i=2
                                                                                          S
                                                                                                                      !
                                                   ⊤                                ⊤
                                                                                         X
                      (projection nullifies 1A µ )        = β∥ IA,A − 1A π                          λid−1 Ps ui vi⊤       ∥F
                                                                                              i=2
                                                               S
                                                               X
                                                                     ∥ IA,A − 1A π ⊤                λid−1 Ps ui vi⊤ ∥F
                                                                                                                  
                                (triangle inequality)     ≤β
                                                               i=2
                                                                          S
                                                                          X
              (matrix norm sub-multiplicativity)          ≤ β|λd−1
                                                               2   |            ∥IA,A − 1A π ⊤ ∥F ∥Ps ∥F ∥ui vi⊤ ∥F
                                                                          i=2

                                                          = β|λd−1
                                                               2   |(S − 1)∥IA,A − 1A π ⊤ ∥F ∥Ps ∥F .

                                                                     14


=== Original PDF page 15 ===
                                             Policy Gradient with Tree Expansion

Now, we can bound the norm ∥IA,A − 1A π ⊤ ∥F by direct calculation:
                                                   h                           ⊤ i
                           ∥IA,A − 1A π ⊤ ∥2F = Tr IA,A − 1A π ⊤ IA,A − 1A π ⊤
                                                                    
                                                                                                               (11)
                                                   h                               i
                                              = Tr IA,A − 1A π ⊤ − π1⊤     ⊤     ⊤
                                                                      A + π π1A 1A                             (12)
                                                   = A − 1 − 1 + Aπ ⊤ π                                        (13)
                                                   ≤ 2A.                                                       (14)

From the Cauchy-Schwartz inequality,
                            XX                  2
                                                   X                 X
                  ∥Ps ∥2F =          [[Ps ]a,s ] =   ∥[Ps ]a,· ∥22 ≤   ∥[Ps ]a,· ∥1 ∥[Ps ]a,· ∥∞ ≤ A.
                                a    s                  a                 a

So,
                                                                 2
                                 C                                             C
                                                                                   (·|s)∥2F
                                                 
                     Var ∇θ log πd,θ (a|s)Q(s, a) ≤ max [Q(s, a)] max ∥∇θ log πd,θ
                                                             s,a              s
                                                              1
                                                                   ∥β IA,A − 1A π ⊤ Ps (P πb )d−1 ∥2F
                                                                                        
                                                        ≤
                                                          (1 − γ)2
                                                              1
                                                        ≤          β 2 |λ2 (P πb )|2(d−1) S 2 (2A2 ),
                                                          (1 − γ)2

which obtains the desired bound.

A.5. A lower bound on C-SoftTreeMax gradient (result not in the paper)
For completeness we also supply a lower bound on the Frobenius norm of the gradient. Note that this result does not
translate to the a lower bound on the variance since we have no lower bound equivalence of Lemma 4.1.
Lemma A.1. The Frobenius norm on the gradient of the policy is lower-bounded by:
                                                  C
                                         ∥∇θ log πd,θ (·|s)∥F ≥ C · β|λ2 (P πb )|(d−1) .                       (15)

Proof. We begin by moving to the induced l2 norm by norm-equivalence:

                     ∥β IA,A − 1A π ⊤ Ps (P πb )d−1 ∥F ≥ ∥β IA,A − 1A π ⊤ Ps (P πb )d−1 ∥2 .
                                                                        

Now, taking the vector u to be the eigenvector of the second eigenvalue of P πb :

                    ∥β IA,A − 1A π ⊤ Ps (P πb )d−1 ∥2 ≥ ∥β IA,A − 1A π ⊤ Ps (P πb )d−1 u∥2
                                                                              

                                                         = β∥ IA,A − 1A π ⊤ Ps u∥2
                                                                               

                                                         = β|λ2 (P πb )|(d−1) ∥ IA,A − 1A π ⊤ Ps u∥2 .
                                                                                             

Note that even though Ps u can be 0, that is not the common case since we can freely change πb (and therefore the
eigenvectors of P πb ).

A.6. Proof of Lemma 4.5 – Vector form of E-SoftTreeMax
For d ≥ 1, (4) is given by
                                                 E              Es,d exp(βΘ)
                                                πd,θ (·|s) =                   ,                               (16)
                                                               1⊤
                                                                A Es,d exp(βΘ)
where
                                                       d−1
                                                       Y
                                                             D exp[βγ h−d R] P πb
                                                                                 
                                           Es,d = Ps                                                           (17)
                                                       h=1

with R being the |S|-dimensional vector whose s-th coordinate is r(s).

                                                                   15
