Provable General Function Class Representation Learning in Multitask Bandits and MDPs
Abstract
While multitask representation learning has become a popular approach in reinforcement learning (RL) to boost the sample efficiency, the theoretical understanding of why and how it works is still limited.
Most previous analytical works could only assume that the representation function is already known to the agent or from linear function class, since analyzing general function class representation encounters non-trivial technical obstacles such as generalization guarantee, formulation of confidence bound in abstract function space, etc.
However, linear-case analysis heavily relies on the particularity of linear function class, while real-world practice usually adopts general non-linear representation functions like neural networks.
This significantly reduces its applicability.
In this work, we extend the analysis to general function class representations.
Specifically, we consider an agent playing
M contextual bandits (or MDPs) concurrently and extracting a shared representation function ϕ from a specific function class Φ using our proposed Generalized
Functional Upper Confidence Bound algorithm (GFUCB).
We theoretically validate the benefit of multitask representation learning within general function class for bandits and linear MDP for the first time.
Lastly, we conduct experiments to demonstrate the effectiveness of our algorithm with neural net representation.
Introduction
Recently, reinforcement learning (RL) has achieved many successful applications in games [6, 34], robotics [23] and many other fields.
However, due to the large cardinality of state space or action space in real-world problems, the large sample complexity has been a major problem for employing these RL algorithms in reality.
A popular method called multitask representation learning tries to tackle this problem by extracting a shared low-dimensional representation function among multiple related tasks, then using a simple function (e.g., linear) on top of this common representation to solve each task[4, 7, 24].
Despite the empirical success for multitask representation learning, particularly in reinforcement learning because of its effectiveness in reducing sample complexity, the theoretical understanding about it is still limited.
A march of works[37, 36, 22, 33, 25, 31, 16, 3, 11, 9, 41, 30] give results on function approximation in bandits and RL, which permits a representation.
In these frameworks, an agent is considered playing M related tasks concurrently.
Each task is a distinct contextual bandit or linear MDP problem 1 , and all these M tasks share a common representation ϕ ∈ Φ where Φ = { ϕ : S × A (cid:55)→ R k } is representation function class extracting a k -dimensional representation vector from state-action pair.
Such representation function can reduce the complexity of problem from a huge space S
× A to a simple regression problem in k -dimensional space.
The value approximation function class is defined by F = L ◦ Φ , here ◦ means composition and L means linear function, which means the value of any state-action pair ( s, a ) is linear in its representation ϕ ( s, a ) .
However, previous analyses either assume Φ is linear [40], or assume that the agent already knows the concrete function ϕ [17, 21], which equivalently reduces to learning linear weight parameters.
This limits their applicability, since general non-linear value estimation is ubiquitous and is the essence for the success of multitask representation learning.
For instance, DQN[29] achieves great success by employing a deep network to approximate Q-value function.
Also, assuming the agent already knows a good representation function is unrealistic in practice.
Therefore, we aim to extend the analysis to unknown general non-linear representation functions.
This would not only reveal the more essential benefit of multitask representation learning, but also inspire and facilitate future practice.
1.1 Our Contribution
The focus of previous works on linear analyses has its own reasons.
The particularity of linear function could circumvent many non-trivial obstacles in analysis, which hinders previous work from from being applicable to real world scenarios.
For instance, the formulation of confidence set in linear parameter space is simply an ellipsoid, and its update is straightforward via covariance matrix.
More importantly, linear function class generically ensures generalization.
The analysis [18, 43, 26, 21] only requires the samples to span the whole input space to let the covariance matrix converge, then is able to derive uniform prediction error guarantee for the whole input space.
However, generalization issue is much more complicated for general non-linear scenarios.
In summary, our work embraces following contributions, which solves the challenges for previous works and extends the analysis for the role of representation function in more general setting.
Eliminate the Dependency on Linearity.
Towards general function class analysis, we adopt the idea of confidence set [32, 17].
The algorithm extends the idea of upper confidence bound and maintains a confidence set for all the possible value estimation functions.
The confidence set contains all the functions whose total empirical error at step t is less than a predetermined bound β t .
As more seen data reveals more information about the environment, the confidence set will gradually shrink until converge.
Therefore, our algorithm and analysis framework is applicable to general function class.
Note that designing β t to achieve low regret for general function class Φ is non-trivial.
We firstly determine the concrete UCB form for general function class β t (Φ) and propose a straightforward algorithm called Generalized Functional Upper Confidence Bound (or GFUCB in abbreviation) for general non-linear function class approximation.
We use Eluder dimension[32] to measure the complexity of the function class Φ to give an efficient sample complexity that ensures generalization.
Multihead Function Class.
To derive sharp regret bound for our algorithm and theoretically demonstrate the benefit of multitask representation learning, we firstly introduce multihead function class
F ⊗ M , which is the key technical contribution of our work.
The efficacy of multitask representation learning essentially originates from the shared knowledge and structure among tasks.
Hence it is vital and necessary to characterize such relation between multiples tasks that the agent simultaneously learns.
However, such structure is absent in previous single task work [39, 32], and it calls for special techniques to analyze the efficiency for learning these correlated functions.
To this end, we introduce multihead function class, namely F ⊗ M in section 4.
This abstract function space captures the relation between different task functions, which concatenate the values of ( s, a ) for all M tasks together as the output.
Being more compact by sharing a common backbone ϕ , function in F ⊗ M requires much fewer samples to learn compared to M independent tasks space F M .
All the tasks contribute to shape a good representation, then feedback to each task for faster convergence.
We formally prove that our algorithm enjoys regret bound as ˜ O
(cid:16)(cid:112) MT dim E ( F )( Mk + log N (Φ)) (cid:17) , where T is the number of steps, M is the number of tasks and N (Φ) means the covering number of function space Φ .
We also extend the algorithm and analysis to multitask episodic RL with general value approximation under low inherent Bellman error.
By simultaneously solving M different but correlated MDP tasks, our method is sample-efficient with regret ˜ O
(cid:16)(cid:112) MTH dim E ( F )( Mk + log N (Φ) + MTH I 2 ) (cid:17) where T is the number of episodes,
H is planning horizon and I denotes the inherent Bellman error.
To the best of our knowledge, this is the first provably sample efficient algorithm for general representation function bandits and linear MDP.
It is comparable to the most optimal regret bound when Φ is specialized to linear representation, and is better than the bounds which solve each task independently.
This also theoretically explains how multitask representation learning reduces sample complexity.
Essentially, the joint training for the shared representation function helps accelerate the convergence of the common backbone by having more samples from all the tasks.
Empirical Value.
Finally, we conduct experiments to verify our theoretical result.
We design a neural network based bandit environment and implement the GFUCB algorithm.
Experimental results corroborate the effect of multitask representation learning in boosting sample efficiency in non-linear bandits.
For the first time, the efficacy of the general representation algorithm proposed in theoretical analysis is validated in a proof-of-concept experiment.
Related Work
In the supervised learning setting, a line of works have been done on multitask learning and representation learning with various assumptions [4, 15, 2, 5, 27, 8, 28, 14, 38].
These results assumed that all tasks share a joint representation function.
It is also worth mentioning that [38] gave the method-of-moments estimator and built the confidence ball for the feature extractor, which inspired our algorithm for the infinite-action setting.
The benefit of representation learning has been studied in sequential decision-making problems, especially in RL domains.
Arora et al.
[3] proved that representation learning could reduce the sample complexity of imitation learning.
D’eramo et al.
[11] showed that representation learning could improve the convergence rate of the value iteration algorithm.
Both require a probabilistic assumption similar to that in [28], and the statistical rates are of similar forms as those in [28].
Following these works, we study a special class of MDP called Linear MDP.
Linear MDP [42, 21] is a popular model in RL, which uses linear function approximation to generalize large state-action space.
[44] extends the definition to low inherent Bellman error (or IBE in short) MDPs.
This model assumes that both the transition and the reward are near-linear in given features.
Recently, Yang et al.
[40] showed multitask representation learning reduces the regret in linear bandits, using the framework developed by Du et al.
Moreover, some works [17, 26, 21] proved results on the benefit of multitask representation learning RL with generative model or linear representation function.
However, these works either restrict the representation function class to be linear, or the representation function is known to agent.
This is unrealistic in real world practice, which limits these works’ meaning.
The most relevant works that need to be mentioned is general function class value approximation for bandits and MDPs.
Russo et al.
[32] first proposed the concept of eluder dimension to measure the complexity of a function class and gave a regret bound for general function bandits using this dimension.
Wang et al.
[39] further proved that it can also be adopted in MDP problems.
Dong et al.
[12] extended the analysis with sequential Rademacher complexity.
Inspired by these works, we adopt eluder dimension and develop our own analysis.
But it should be pointed out that all those works focus on single task setting, which give a provable bound for just one single MDP or bandit problem.
They lack the insight for why simultaneously dealing with multiple distinct but correlated tasks is more sample efficient.
Our work aim to establish a framework to explain this.
By considering locating the ground truth value function in multihead function space F ⊗ M (see detailed definition in section 4), we are able to theoretically explain the main reason for the boost of sample efficiency.
Informally speaking, the shared feature extraction backbone ϕ receives samples from all the tasks, therefore accelerating the convergence for every single task compare with solving them separately.
Preliminaries 3.1 Notations
We use [ n ] to denote the set { 1 , 2 , . . . , n } and ⟨· , ·⟩ to denote the inner product between two vectors.
We use f ( x ) =
O ( g ( x )) to represent f ( x ) ≤ C · g ( x ) holds for any x > x 0 with some C > 0 and x 0 > 0 .
Ignoring the logarithm term, we use f ( x ) =
˜ O ( g ( x )) .
3.2 Multitask Contextual Bandits
We first study multitask representation learning in contextual bandits.
Each task i ∈
[ M ] is associated with an unknown function f ( i ) ∈ F from certain function class F .
At each step t ∈ [ T ] , the agent is given a context vector C t,i from certain context space C and a set of actions
A t,i selected from certain action space A for each task i .
The agent needs to choose one action A t,i ∈
A t,i , and then receives a reward as R t,i =
f ( i ) ( C t,i , A t,i ) + η t,i , where η t,i is the random noise sampled from some i.i.d.
distribution.
The agent’s goal is to understand function f
( i ) and maximize the cumulative reward, or equivalently, minimize the total regret from all M tasks in T steps defined as below.
[Equation]
where A ⋆t,i = arg max A ∈A t,i f
( i ) ( C t,i , A ) is the optimal action with respect to context C t,i in task i .
3.3 Multitask MDP
Going beyond contextual bandits, we also study how this shared low-dimensional representation could benefit the sequential decision making problem like Markov Decision Process (MDP).
In this work, we study undiscounted episodic finite horizon MDP problem.
Consider an MDP M =
( S , A , P , r, H ) , where S is the state space,
A is the action space, P is the transition dynamics, r ( · , · ) is the reward function and H is the planning horizon.
The agent starts from an initial state s 1 which can be either fixed or sampled from a certain distribution, then interacts with environment for H rounds.
In the single task framework, at each round (also called level) h , the agent needs to perform an action a h according to a policy function a h
= π h
( s h ) .
Then the agent will receive a reward
R h ( s h , a h ) =
r ( s h , a h ) + η h where η h again is the noise term.
The environment then transits the state from s h to s h +1 according to distribution P ( ·| s h , a h ) .
The estimation for action value function given following action policy π is defined as Q πh ( s h , a h ) =
r ( s h , a h ) + E (cid:104)(cid:80)
Ht = h +1 R t ( s t , π t ( s t ))
(cid:105) , and state value function is defined as V πh ( s h ) =
Q πh ( s h , π h ( s h )) .
Note that there always exists a deterministic optimal policy π ⋆ for which V π ⋆ h ( s ) =
max π V πh ( s ) and Q π ⋆ h ( s, a ) =
max π Q πh ( s, a ) , we will denote them as V ⋆h ( s ) and Q ⋆h ( s, a ) for simplicity.
In the multitask setting, the agent gets a batch of states { s ( i ) h,t } Mi =1 simultaneously from M different
MDP tasks {M ( i ) } Mi =1 at each round h in episode t , then performs a batch of actions
{ π it ( s ( i ) h,t ) } Mi = for each task
i ∈
[ M ] .
Every H rounds form an episode, and the agent will interact with the environment for totally T episodes.
The goal for the agent is minimizing the regret defined as
[Equation]
where V ( i ) ⋆is the optimal value of task i and s ( i ) 1 ,t is the initial state for task i at episode t .
To let representation function play a role, it is assumed that all tasks share the same state space S and action space A .
Moreover, there exists a representation function ϕ : S × A (cid:55)→ R k such that action and state value function of all tasks M ( i ) is always (approximately) linear in this representation.
For example, given a representation function ϕ , the action value approximation function at level h is parametrized by a vector θ h ∈ R k as Q h
[ ϕ, θ h ] def = ⟨ ϕ ( s, a ) , θ h ⟩ , similar for V h
[ ϕ, θ h ]( s ) def = max a ⟨ ϕ ( s, a ) , θ h ⟩ .
We denote all such action value functions as Q h
= { Q h
[ ϕ, θ h ] : ϕ ∈ Φ , θ h ∈ R k } , also value function approximation space as V h
= { V h
[ ϕ, θ h ] : ϕ ∈ Φ , θ h ∈ R k } .
Each task
M ( i ) is a linear MDP, which means Q h is always approximately close under Bellman operator
T h ( Q h +1 )
( s, a ) def = r h
( s, a ) + E s ′ ∼P
h ( ·| s,a ) max a ′ Q h
+1 ( s ′ , a ′ ) .
Linear MDP Definition.
A finite horizon MDP M
=
( S , A , P , r, H ) is a linear MDP, if there exists a representation function ϕ :
S × A (cid:55)→ R k and its induced value approximation function class
Q h , h ∈ [ H ] , such that the inherent Bellman error [44]
[Equation]
is always smaller than some small constant I .
The definition essentially assumes that for any Q-value approximation function Q h +1 ∈ Q
h +1 at level h + 1 , the Q-value function Q h at level h induced by it can always be closely approximated in class Q h , which assures the accuracy through sequential levels.
3.4 Eluder Dimension
To measure the complexity of a general function class f , we adopt the concept of eluder dimension [32].
First, define ϵ -dependence and independence.
Definition 1 ( ϵ -dependent).
An input x is ϵ -dependent on set X = { x 1 , x 2 , . . .
, x n } with respect to function class F , if any pair of functions f, ˜ f ∈ F satisfying (cid:113)(cid:80) ni
=
( f ( x i ) − ˜ f
( x i )) 2 ≤ ϵ also satisfies | f ( x ) − ˜ f
( x ) | ≤ ϵ .
Otherwise, we call action x to be ϵ -independent of data set X .
Intuitively, ϵ -dependence captures the exhaustion of interpolation flexibility for function class F .
Given an unknown function f ’s value on set X = { x 1 , x 2 , . . .
, x n } , we are able to pin down its value on some particular input x with only ϵ -scale prediction error.
Definition 2 ( ϵ -eluder dimension).
The ϵ -eluder dimension dim E ( F , ϵ ) is the maximum length for a sequence of inputs x 1 , x 2 , . . .
x d ∈ X , such that for some ϵ ′ ≥ ϵ , every element is ϵ ′ -independent of its predecessors.
This definition is similar to the definition of the dimensionality of a linear space, which is the maximum length of a sequence of vectors such that each one is linear independent to its predecessors.
For instance, if F = { f ( x ) : R d (cid:55)→ R , f ( x ) =
θ
⊤ x } , we have dim E ( F , ϵ )
=
O ( d log 1 /ϵ ) since any d linear independent input’s estimated value can fully describe a linear mapping function.
We also omit the ϵ and use dim E ( F ) when it only has a logarithm dependent term on ϵ .
Main Results for Contextual Bandits
In this section, we will present our theoretical analysis on the proposed GFUCB algorithm for contextual bandits.
4.1 Assumptions
This section will list the assumptions that we make for our analysis.
The main assumption is the existence of a shared feature extraction function from class Φ =
{ ϕ : C × A (cid:55)→ R k } that any task’s value function is linear in this ϕ .
Assumption 1.1 (Shared Space and Representation)
All the tasks share the same context space
C and action space A .
Also, there exists a shared representation function ϕ ∈ Φ and a set of k -dimensional parameters { θ i } M i =1 such that each f ( i ) has the form f
( i ) ( · , · ) =
⟨ ϕ ( · , · ) , θ i ⟩ .
Following standard regularization assumptions for bandits [17, 40], we make assumptions on noise distribution and function parameters.
Assumption 1.2 (Conditional Sub-Gaussian Noise)
Denote H t,i =
σ ( C 1 ,i , A 1 ,i , . . .
, C t,i , A t,i ) to be the σ -field summarizing the history information available before reward R t,i is observed for every task i ∈ [ M ] .
We have η t,i is sampled from a 1-Sub-Gaussian distribution, namely
[Equation]
Assumption 1.3 (Bounded-Norm Feature and Parameter)
We assume that the parameter θ i and the feature vector for any context-action pair ( C, A ) ∈
C
× A is constant bounded for each task i ∈
[ M ] , namely ∥ θ i ∥ 2 ≤ √ k for ∀ i ∈
[ M ] and ∥ ϕ ( C, A ) ∥ 2 ≤ 1 for ∀ C ∈ C , A ∈ A .
Apart from these assumptions, we add assumption to measure and constrain the complexity of value approximation function class F = L ◦ Φ .
Assumption 1.4 (Bounded Eluder Dimension).
We assume that function class F has bounded
Eluder dimension d , which means for any ϵ , dim E ( F , ϵ ) =
˜ O
( d ) .
Algorithm
1: for step t : 1 → T do 2:
Compute F t according to ( ∗ ) 3:
Receive contexts C t,i and action sets A t,i , i ∈
[ M ] 4: f t , A t,i = argmax f
∈F t , A i ∈A t,i (cid:80) Mi
=1 f ( i ) ( C t,i , A i ) 5:
Play A t,i for task i, and get reward R t,i for i ∈
[ M ] .
6: end for
The details of the algorithm is in Algorithm 1.
At each step t , the algorithm first solves the optimization problem below to get the empirically optimal solution ˆ f t that best predicts the rewards for contextinput pairs seen so far.
[Equation]
Here we abuse the notation of F ⊗ M as F ⊗ M = (cid:8) f
= (cid:0) f
[Equation]
f
[Equation]
M
[Equation]
f
[Equation]
( · ) = ϕ
[Equation]
· ) ⊤ w i ∈ F
[Equation]
to denote the M-head prediction version of F , parametrized by a shared representation function ϕ ( · ) and a weight matrix W =
[ w 1 , . .
. , w M ] ∈ R k × M .
We use f ( i ) to denote the i th head of function f which specially serves for task i .
After obtaining ˆ f t , we maintain a functional confidence set F t ⊆
F ⊗ M for possible value approximation functions
[Equation]
∈ [ M ] (cid:41) ( ∗ )
Here, for the sake of simplicity, we use (cid:13)(cid:13)(cid:13)
[Equation]
to denote the empirical 2-norm of function ˆ f t − f = (cid:16) ˆ f (1) t − f (1) , . . .
, ˆ f ( M ) t − f ( M ) (cid:17) .
Basically, ( ∗ ) contains all the functions in F ⊗ M whose value estimation difference on all collected contextaction pairs x k,i =
( C k,i , A k,i ) compared with empirical loss minimizer ˆ f t does not exceed a preset parameter β t .
We show that with high probability, the real value function f θ is always contained in F t when β t is carefully chosen as ˜ O ( Mk + log ( N (Φ , α, ∥ · ∥ ∞ )) , where N ( F , α, ∥ · ∥ ∞ ) is the α -covering number of function class Φ in the sup-norm ∥ ϕ ∥ ∞ =
max x ∈S×A ∥ ϕ ( x ) ∥ 2 and α is set to be a small number as 1 kMT (see detailed definition and proof in Lemma 1).
For the action choice, our algorithm follows OFUL , which estimates each action value with the most optimistic function value in our confidence set F t , and chooses the action whose optimistic value estimation is the highest.
In the multitask setting, we choose one action from each task to form an action tuple ( A 1 , A 2 , . . .
, A M ) such that the summation of the optimistic value estimation (cid:80)
Mi =1 f ( i ) ( C t,i , A i ) is maximized by some function f ∈ F t .
Intractability.
Some may have concerns on the intractability of building the confidence set ( ∗ ) and solving the optimization problem to get ˆ f t , f t , A t,i .
The solution comes as two folds.
From the theoretical perspective, since the focus of problem is sample complexity rather than computational complexity, a computational oracle can simply be assumed to give the solution of the optimization.
This is the common practice for theoretical works [20, 35, 1, 19] in order to focus on the sample complexity analysis.
From empirical perspective, there are great chances to optimize it with gradient methods.
For example, solving ˆ f t is a standard empirical risk minimization problem, and can be effectively solved with gradient methods [13].
As for f t and A t,i , note that it is not necessary to explicitly build the confidence set F t by listing all the candidates.
The approximation algorithm just need to search within the confidence set via gradient method to optimize objective (cid:80) Mi
=1 f ( i ) ( C t,i , A i ) .
The start point is ˆ f t , and the algorithm knows that it approaches the border of F t when ∥ ˆ f t − f ∥ 22 ,E t approaches β t .
The details of implementation are in section 6.
Mechanism.
GFUCB algorithm solves the exploration problem in an implicit way.
For a contextaction pair x = ( C, A ) in task i which has not been fully understood and explored yet, the possible value estimation f
( i ) ( x ) will vary in large range with regard to constraint ∥ f − ˆ f t ∥ 22 ,E t ≤ β t .
This is because within F t there are many possible function value on this x while agreeing on all past context-action pairs’ value.
Therefore, the optimistic value f ( i ) ( x ) will become high by getting a significant implicit bonus, encouraging the agent to try such action A under context C , which achieves natural exploration.
The reduction of sample complexity is achieved through joint training for function ϕ .
If we solve these tasks independently, the confidence set width β t is at scale M log ( N (Φ , α, ∥ · ∥ ∞ )) because it needs to cover M representation function space respectively.
By involving ϕ in the prediction for all tasks, our algorithm reduces the size of confidence set by M times, since now the samples from all the tasks can contribute to learn the representation ϕ .
Usually log ( N (Φ , α, ∥ · ∥ ∞ )) is much greater than k and M , hence our confidence set shrinks at a much faster speed.
This explains how GFUCB achieves lower regret, since the sub-optimality at each step t is proportional to the confidence set width β t when real value function f θ ∈ F t .
4.3 Regret Bound
Based on the assumptions above, we have the regret guarantee as below.
Theorem 1.
Based on assumption 1.1 to 1.4, denote the cumulative regret in T steps as Reg( T ) , with probability at least 1 − δ
we have Reg( T ) =
˜ O (cid:16)(cid:112) MdT ( Mk + log N (Φ , α T , ∥ · ∥ ∞ ))
(cid:17) .
Here, d := dim E ( F , α T ) is the Eluder dimension for value approximation function class F = L ◦ Φ , and α T is discretization scale which only appears in logarithm term thus omitted.
The detailed proof is left in appendix.
To the best of knowledge, this is the first regret bound for general function class representation learning in contextual bandits.
To get a sense of its sharpness, note that when Φ is specialized as linear function class as Φ = { ϕ ( x ) =
Bx , B ∈ R k × d } , we have N (Φ , α T , ∥ · ∥ ∞ ) =
˜ O ( dk ) and dim E ( F ) =
d , then our bound is reduced to ˜ O
( M √ dTk + d √ MTk ) , which is the same optimal as the current best provable regret bound for linear representation class bandits in [17].
Main Results for MDP 5.1 Assumptions
For multitask Linear MDP setting, we adopt Assumption 3 from [17] which generalizes the inherent
Bellman error [44] to multitask setting.
Assumption 2.1 (Low IBE for multitask)
Define multi-task IBE is defined as
[Equation]
We have I def = sup h
I mul h is small for all Q h ,
h ∈
[ H ] .
Assumption 2.1 generalize low IBE to multitask setting.
It assumes that for every task i ∈
[ M ] , its
Q-value function space is always close under Bellman operator.
Assumption 2.2 (Parameter Regularization)
We assume that
• ∥ ϕ
( s, a ) ∥ ≤ 1 , 0 ≤ Q πh ( s, a ) ≤ 1 for ∀ ( s, a
) ∈ S × A , h ∈
[ H ] , ∀ π .
• There exists a constant D such that for any h ∈
[ H ] and θ ( i ) h , it holds that ∥ θ ( i ) h ∥ 2 ≤ D .
• For any fixed (cid:110) Q ( i ) h +1 (cid:111)
M i
= ∈
Q h +1 , the random noise z ( i ) h def =
R ( i ) h
( s, a )
+ max a Q ( i ) h +1 ( s ′ , a ) − T ( i ) h (cid:16) Q ( i ) h +1 (cid:17) ( s, a ) is bounded in [ − 1 , 1] and is always independent to all other random variables for ∀ ( s, a ) ∈ S × A ,
h ∈
[ H ] , i ∈
[ M ] .
These assumptions are widely adopted in linear MDP analytical works [44, 17, 26], which regularizes the parameter, feature, and noise scale.
Again we add bounded Eluder dimension constraint for the
Q-value estimation class.
Assumption 2.3 (Bounded Eluder Dimension).
We assume that function class Q h has bounded
Eluder dimension d for any h ∈
[ H ] .
5.2 Algorithm Details
1: for episode t : 1 → T do 2:
Q ( i ) H +1 = 0 , i ∈
[ M ] 3: for h : H → 1 do 4: ˆ ϕ h,t , ˆ θ ( i ) h,t ← solving (1) 5:
Q ( i ) h ( · , · )
=
ˆ ϕ h,t ( · , · ) ⊤ ˆ θ ( i ) h,t , V ( i ) h ( · )
= max a Q ( i ) h ( · , a ) 6: end for 7: for h : 1 → H do 8:
Compute F h,t according to Lemma9:
Receive states (cid:110) s
( i ) h,t (cid:111)
M i =1 , ˜ f h,t , a ( i ) h,t = argmax f
∈F h,t ,a ( i ) ∈A (cid:80) Mi
=1 f ( i ) (cid:16) s ( i ) h,t , a ( i ) (cid:17) 10:
Play a ( i ) h,t and get reward R ( i ) h,t for task i ∈
[ M ] .
11: end for 12: end for
The algorithm for multitask linear MDP is similar to contextual bandits as above.
The optimization problem in line 4 of Algorithm 2 is finding the empirically best solution for Q-value estimation at level h in episode t as below
[Equation]
[ M ]
[Equation]
where L ( ϕ, Θ ) is the empirical loss function defined as
[Equation]
The framework of our work resembles LSVI [21] and [26] which learns the Q-value estimation in a reverse order, at each level h , the algorithm uses just-learned value estimation function V h +1 to build the regression target value as R ( i ) h,j + V ( i ) h +1 (cid:16) s ( i )
h +1 ,j (cid:17) and find empirically best estimation
ˆ f
( i ) h,t
= ˆ ϕ ⊤ h,t
ˆ θ ( i ) h,t for each task i ∈
[ M ] .
The optimistic value estimation of each action is again searched within confidence set F h,t which centered at ˆ f h,t and shrinks as the constraint ∥ f − ˆ f h,t ∥ 22 ,E t ≤ β t becomes increasingly tighter.
Note that the contextual bandit problem can be regarded as a 1-horizon
MDP problem without transition dynamics, and our framework at each level h is indeed a copy of procedures in Algorithm 1.
5.3 Regret Bound
Based on assumptions 2.1 to 2.3, we prove that our algorithm enjoys a regret bound guaranteed by the following theorem.
Detailed proof is left in appendix.
Theorem 2.
Based on assumption 2.1 to 2.3, denote the cumulative regret in T episodes as Reg( T ) , we have the following regret bound for Reg( T ) holds with probability at least 1 − δ for Algorithm
[Equation]
where α is discretization scale smaller than 1 kMT .
Remark.
Compared with naively executing single task general value function approximation algorithm [39] for M tasks, whose regret bound is ˜ O ( MHd (cid:112) T N (Φ)) , to achieve same average regret, our algorithm outperforms this naive algorithm with a boost of sample efficiency by ˜ O
( Md ) .
This benefit mainly attributes to learning in function space F ⊗ M =
L M ◦ Φ instead of F M
=
( L ◦ Φ) M , the former is more compact and requires much less samples to learn.
Experiments
To validate our theoretical findings, we conduct experiments on a non-linear neural network bandits.
Note that it is a proof-of-concept experiment.
Our main purpose is to realize the GFUCB algorithm and check its efficacy but not to beat sophisticated real-world algorithms.
The point to demonstrate is that sample efficiency of GFUCB is scalable to the number of tasks and better than naive exploration.
6.1 Task Design
To test the efficacy of our algorithm, we use the MNIST dataset [10] to build a bandit problem that involves non-linear value approximation.
The reward function of the bandit environment maps the same digit into the same base reward r b , which ranges from 0 to 1, plus a noise η h sampled from a zero-mean Gaussian with a standard deviation of 0.01.
At every round, each task will present the agent a context C consists of K different digit images and ask the agent to take action as an integer j ∈ [ K ] meaning which image to choose, then return the reward according to the agent’s choice.
For the multitask setting, we construct M different tasks using different digit-to-reward mappings σ i : { 0 , . . .
, 9 } (cid:55)→ [0 , 1] , i ∈
[ M ] , where σ i ( k ) will give a unique reward for all images of digit k in task i .
Different tasks have different reward mapping function σ i ( · ) .
By designing the environment this way, it requires to learn a common representation ϕ to recognize digits for different tasks.
6.2 Implementation Details
We use a simple CNN as our feature extraction function ϕ , which takes a digit image as input and outputs a 10-dimensional normalized vector as representation.
It consists of two 3x3 convolution layers and two fully-connected layers, followed by ReLU activation and a normalization procedure.
The biggest challenge for implementation is how to solve a complex optimization problem in general functional space.
In principle, finding parameters for a neural network to achieve the (near) minimal empirical error is an NP-Hard problem.
To solve this issue, we use a gradient-based method to approximately find a local-optimal solution.
For finding the empirically best ˆ f t , we use Adam with lr = 1 e − 3 to train for sufficiently long steps; in our setting, it is set to be 200 epochs at every step t , to ensure that the training loss is sufficiently low.
The next major challenge is estimating the optimistic value for each action within the abstract function set F t .
To tackle this problem, we enumerate all possible action tuples { A i } Mi =
and then solve the equivalent optimization below to compute its optimistic estimated value
[Equation]
Still, this is a complicated optimization problem within an abstract function set.
Inspired by the
Lagrangian operator, we transform it into an unconstrained optimization problem minimizing loss function ℓ ( f ) =
− (cid:80) Mi
=1 f ( i ) (
A i ) + λ · max(0 , ∥
ˆ f t − f ∥ 22 ,E t − B t ) , where λ is a hyperparameter to be determined, in our algorithm we set it to be λ = 30 by empirical search.
Also B t = a log( b · t + c ) is an approximation for β t since β t includes N (Φ , α ) which is intractable to be exactly computed, we found ( a, b, c ) =
(0 . 4 , 0 . 5 , 2) to be a good parameter of UCB in single task.
We use SGD with a small learning rate ( 5 e − 4 ) to finetune the model ˆ f t for 200 iterations to optimize ℓ ( f ) .
The basic intuition is that, through optimizing ℓ ( f ) , the algorithm will try to maximize function value (cid:80)
Mi
=1 f ( i ) ( A i ) .
And as long as f satisfies ∥ ˆ f t − f ∥ 22 ,E t ≤ B t , such constraint will not appear in the loss term, thus has no effect on optimization.
When f comes to the border of F t , where
∥
ˆ f t − f ∥ 22 ,E t approaches B t
, the second term adds regularization term to the loss as punishment, preserving ∥ ˆ f t − f ∥ 22 ,E t at a near-constant level around B t .
So we can approximately simulate the optimistic value estimating procedure via searching in the neighborhood of ˆ f t .
6.3 Connection to Algorithm
The main difference between our practical version algorithm and the theoretical one is that we did not list out all the functions in the whole confidence set F t explicitly, but just use gradient-based method to implicitly search within a very small fraction of F t with heuristics.
Getting a candidate within the confidence set is much easier and tractable than rigorously exhausting all functions in F t to optimize.
We can start from the parameter of ˆ f t and use gradient method to approximately find f t and A t,i .
Another difference is we do not rigorous compute β t which involves N (Φ) , but directly determine a parametrized function form.
Rigorously speaking, our tuned value of β t is much smaller than the theoretical guaranteed ones, so all the candidate functions that we search along the trajectory of gradient method still satisfy the theoretical requirement (but it may omit many other potential candidates).
Therefore, our practical version algorithm should be regarded as an inaccurate approximation to the theoretical algorithm.
Moreover, it also plays a role as regularization to enable the convergence of F t since we only consider regular ones in the neighborhood of ˆ f t .
6.4 Results
We test the performance of our algorithm against a naive eps-greedy baseline that solves each task independently by training the same CNN value prediction module.
We show our results with number of tasks M = 1 , 5 , 10 in Figure 1.
Firstly, we randomly generate 10 different digit-value mapping functions σ i ( · ) , i = 1 , . . .
The total 10 tasks are divided into 10 /M groups; each group forms a M -task problem and is solved by an individual copy of some algorithm.
At each step t , the cumulative regret from alltasks is averaged to estimate the method’s performance.
Our result in Figure 1 verified that the multitask training does accelerate learning, which empirically validates our theoretical analysis.
The multitask training utilizes the samples from all M tasks to jointly learn a good representation ϕ , which significantly accelerates the learning procedure of the CNN backbone.
Also, the improvement in GFUCB algorithm’s performance with M = 1 validates the effect of our finetune procedure for getting a bonus.
Detailed dissection and discussion are left in appendix.
Conclusion
In this work, we extend the analysis of the benefit of multitask representation learning from linear representation class to general function class.
We propose a straightforward algorithm that can utilize samples from all the tasks to jointly train a representation function, which is demonstrated theoretically and empirically to accelerate the sample efficiency and outperform naively single-task learning.
Also, we extend the analysis to the MDP setting and show that the benefit of multitask representation learning is similar.
Furthermore, our experimental result reveals that our proposed algorithm is also effective in practice even for highly non-linear neural network representations.
Acknowledgments and Disclosure of Funding
This work is supported in part by the National Science and Technology Major Project of the Ministry of Science and Technology of China under Grants 2018AAA0101604, the National Natural Science
Foundation of China under Grants 62022048 and the State Key Lab of Autonomous Intelligent
Unmanned Systems.
A Bandit Regret Bound Analysis A.1 Algorithm Procedure
At each round s ∈ [ t ] , after performing a list of actions { A s,i } Mi =1 with respect to corresponding context vectors { C s,i } Mi =1 , the agent receives a list of rewards y s,i associated with input x s,i =
( C s,i , A s,i ) for i ∈
[ M ] .
Note that we will use f ( C t , A t ) or f ( x t ) where x t =
( C t , A t ) in different contexts.
The algorithm first solves the following regression problem to obtain the empirical minimizer function ˆ f t ( · ) =
ˆ ϕ t ( · ) ⊤ (cid:99) W t based on samples collected.
[Equation]
Here, X t − 1 ,i =
[ x 1 ,i , x 2 ,i , . . .
, x t − 1 ,i ] is the selected context-action pair for task i in the first t −rounds, and y t − 1 ,i =
[ R 1 ,i , R 2 ,i , . . .
, R t − 1 ,i ] ⊤ ∈ R t − 1 stacks all the received reward into a vector accordingly.
We use ϕ ( X ) to compactly represent feeding each column x i of X into ϕ ( · ) and get concatenated output as [ ϕ ( x 1 ) , ϕ ( x 2 ) , . . .
, ϕ ( x t − 1 )] .
After obtaining the best empirical estimator function ˆ f ( i ) t ( · ) =
ˆ ϕ t ( · ) ⊤ ˆ w t,i at round t ∈
[ T ] for each i ∈ [ M ] , we maintain a function confidence set F t ⊆
F ⊗ M for representation function and parameters.
[Equation]
Here we abuse the notation of F ⊗ M as F ⊗ M = (cid:8) f
= (cid:0) f (1) , . . .
f ( M ) (cid:1) : f i ( · ) = ϕ ( · ) ⊤ w i ∈ F (cid:9) to denote the M-head prediction version of F , parametrized by a shared representation function ϕ ( · ) and a weight matrix W =
[ w 1 , . .
. , w M ] ∈ R k × M .
We use f ( i ) to denote the i th head of function f .
For the sake of simplicity, we use
[Equation]
to denote the empirical 2-norm of function ˆ f t − f = (cid:16) ˆ f (1) t − f (1) , . . .
, ˆ f ( M ) t − f ( M ) (cid:17) .
Another important hyperparameter for our algorithm is the confidence set width term β t , which is a function of representation function class Φ , probability δ and discretization scale parameter α .
[Equation]
here N ( F , α, ∥ · ∥ ∞ ) is the α -covering number of function class Φ in the sup-norm ∥ ϕ ∥ ∞ =
max x ∈S×A ∥ ϕ ( x ) ∥ 2 (see detailed definition in Lemma 1) and α can be set to be some small scale number, like
[Equation]
A.2 Main Proof sketch
In this section we will give a theoretical guarantee for the performance of our algorithm.
Before diving into details, we first explain the overall idea and structure of our proof.
First, we decompose the regret into the summation of confidence set width at different rounds plus a small term which accounts for the possibility that confidence function set F t fails to contain ground truth function f θ .
Lemma 0.
Fix any sequence of confidence set {F t , t ∈ N } which is measurable with respect to history
H t , denote the induced policy by Algorithm 1 as π = {
π i } M i =1 where each π i : C
(cid:55)→ A , i ∈
[ M ] is for task
i , then for any T ∈ N we have
[Equation]
where x t,i =
( C t,i , π i ( C t,i )) is the context-action pair that actually happened.
A ⋆t,i = arg max A f ( i ) θ ( C t,i , A ) is the optimal action for each task i ∈
[ M ] at round t ∈ [ T ] , and x ⋆t,i =
( C t,i , A ⋆t,i ) is the corresponding optimal context-action pair, C is a universal large enough constant.
We use X t =
[ x t, 1 , . . .
, x t,M ] to stack x t,i into a matrix, similar for X ⋆t =
[ x ⋆t, 1 , . . .
, x ⋆t,M ] .
The confidence set width w F t ( X t ) is defined by
[Equation]
Essentially, it measures the largest total difference of value estimation among all the functions in f ∈ F t for the fixed inputs x t,i where i ∈ [ M ] .
Apart from the constant term accounting for the case that F t fails to contain f θ , which we will prove happen with small probability, this regret is then bounded by the sum of width over time step t .
Next, we will show that our construction of confidence set F t makes all of them contain real value function with high probability.
Lemma 1.
For all δ ∈ (0 , 1) and α > 0 , if F t is defined by F t = { f ∈ F ⊗ M : ∥ f − ˆ f ∥ 2 ,E t ≤ (cid:112) β t (Φ , δ, α ) } for all t ∈ N , where ˆ f is the solution to the empirical error minimization.
Denote the ground truth value function as f θ ( · ) , then we have
[Equation]
After that, we prove that
Lemma 2.
[Equation]
Then plug it into lemma 0, we get our main result for the regret bound as
[Equation]
Usually α T is set to be a small number like 1 kMT , or the minimizer for β T (Φ , α, δ ) .
We know that dim E ( F , α T ) is a poly-logarithmic function of T , which means the final regret bound is dominant by term (cid:112) M dim E ( F , α T ) β T T when T → ∞ .
This further becomes
[Equation]
For example, if Φ is specialized as linear function class parametrized by matrix Θ ∈ R
d × k , then log (cid:0) N (Φ , ( kMT ) − 1 , ∥ · ∥ ∞ ) (cid:1)
=
O ( kd log( kMT )) and dim E ( F , ( kMT ) − 1 ) =
O ( d log( kMT )) , hence the regret bound becomes
[Equation]
which reduces to result in [17] by a poly-logarithm factor.
A.3 Detailed Proof
Proof of Lemma 0.
Define the upper and lower bounds U t ( X t )
= sup (cid:110)(cid:80)
Mi
=1 f ( i ) ( x t,i ) : f ∈ F t (cid:111) and L t ( X t ) =
inf (cid:110)(cid:80) Mi
=1 f ( i ) ( x t,i ) : f ∈ F t (cid:111) .
If f θ ̸∈ F t , then the error will be bounded by a large constant C since all f ( x ) is constant bounded.
Otherwise f θ ∈ F t , we have
[Equation]
[Equation]
where X t and X ⋆t is defined in lemma 0.
Also, by the optimality of X t with respect to F t , we know
U t ( X ⋆t ) ≤ U t ( X t ) , therefore
M
[Equation]
Take summation over t ∈ [ T ] and complete the proof.
Lemma 1.
For all δ ∈ (0 , 1) and α > 0 , if F t is defined by F t =
[Equation]
β
[Equation]
Φ
[Equation]
α )
[Equation]
for all t ∈ N , where ˆ f is the solution to the empirical error minimization.
Denote the ground truth value function as f θ , then we have
[Equation]
Proof of Lemma 1.
Denote L 2 ,t ( f ) = (cid:80) Mi
=1 (cid:80) ts =1 | f ( i ) ( x s,i ) − y s,i
| 2 and ˜ f t
=
ˆ f t − f θ , we have
L 2 ,t ( ˆ f ) − L 2 ,t (
[Equation]
By the optimality of ˆ f , we know (5) ≤ 0 , hence
[Equation]
(6) here ˜ f
( i ) t ( X t,i ) =
[ ˜ f
( i ) t ( x 1 ,i ) , ˜ f
( i ) t ( x 2 ,i ) , . . . ,
˜ f
( i ) t ( x t,i )]
⊤ and η t,i =
[ η 1 ,i , η 2 ,i , . . .
, η t,i ] ⊤ are both in R t .
We can represent each function ˜
f ( i ) t ( · ) in form ˜ f
( i ) t ( · ) = (cid:104) ϕ
⋆ ( · ) ⊤ , ˆ ϕ t ( · ) ⊤ (cid:105) (cid:20) w ⋆t,i − ˆ w t,i (cid:21) =
ϕ
⋆ ( · ) ⊤ w ⋆t,i − ˆ ϕ t ( · ) ⊤ ˆ w t,i , which is exactly f θ − ˆ f t .
Denote ˜ ϕ t ( · ) =
(cid:20) ϕ
⋆ ( · ) ˆ ϕ t ( · ) (cid:21) ∈
Φ 2 and ˜ w t,i = (cid:20) w ⋆ t,i − ˆ w t,i (cid:21)
∈ R 2 k , then ˜ f
( i ) t ( · ) =
˜ ϕ t ( · ) ⊤ ˜ w t,i .
Since the output of ˜ ϕ t ( x s,i ) ∈ R 2 k , we can take following decomposition for each i ∈ [ M ]
[Equation]
For regret bound, we only need to care about t ≥ 2 k by a constant regret difference, hence this decomposition is possible.
Plug it into (6) and we get
[Equation]
Notice that, however, U t is obtained from optimization problem, which further depends on concrete sampled noise η t,i , hence the concentration bound based on i.i.d.
assumption cannot be applied directly.
If we fix function ˜ f t = ¯ f t , which induces corresponding ¯ ϕ t ( · ) and ¯ ϕ t ( X t,i ) =
¯ U i (¯ ϕ )
¯ Q i , ¯
U i (¯ ϕ ) means ¯
U i is a function determined by ¯ ϕ .
According to standard sub-exponential random variable concentration bound, each ¯ U i (¯ ϕ ) has 2 k independent degrees of freedom, hence we know that with probability at least 1 − δ
[Equation]
Denote Φ 2 = { g ( x ) =
[ ϕ 1 ( x ) ⊤ , ϕ 2 ( x ) ⊤ ]
⊤ : ϕ 1 , ϕ 2 ∈ Φ } , Φ 2 α is an α -cover of Φ 2 such that for any ϕ ∈ Φ 2 , there is a ϕ α ∈ Φ 2 α such that
[Equation]
For ˜ ϕ , find a closest ¯ ϕ ∈
Φ 2 α from α -cover net to satisfy the requirement above, then denote ¯ f ( i ) t ( · ) =
¯ ϕ ( · ) ⊤ ˜ w t,i .
By union bound, we know that with probability at least 1 − | Φ 2 α | δ 1 , for any ¯ ϕ ∈
Φ 2 α , the induced ¯ U i (¯ ϕ )
satisfy inequality (10), therefore
[Equation]
The first term of (18) comes from (10), and the second term is from Cauchy inequality.
We assign δ t = δ 2 T failure probability for event
[Equation]
By union bound, we have
[Equation]
Next we will give a bound for ∥ ˜
f t − ¯ f t ∥ 2 ,E t .
[Equation]
According to our assumption, we know ∥ ˜ w s,i ∥ 2 ≤ 2 ∥ w s,i ∥ 2 + 2 ∥ ˆ w s,i ∥ 2 ≤ 4 k , from (11) we know (cid:13) (cid:13) (cid:13) ˜
ϕ t ( x s,i ) − ¯ ϕ t ( x s,i ) (cid:13) (cid:13) (cid:13) 2 ≤ α , hence
[Equation]
Plug (19) and (23) back into (18), we know with probability at least 1 − δ 2 − | Φ 2 α | δ 1 , for any t ∈ N
[Equation]
Some simple algebraic transform gives
[Equation] [Equation]
Let δ 1 = δ/ | Φ 2 α | , δ 2 = δ , and notice log | Φ 2 α | ≤ 2 log ( N (Φ , α, ∥ · ∥ ∞ )) , we conclude that with probability at least 1 − 2 δ , for every t ∈ N
[Equation]
where the right handside is exactly our defined β t (Φ , α, δ ) , hence our conclusion holds.
Lemma 2.
If ( β t ≥ | t ∈
N ) is a nondecreasing sequence and F t :=
[Equation]
f ∈ F ⊗ M : ∥ f − ˆ f LSt ∥ 2 ,E t ≤ √ β t (cid:111) .
Also, denote F = L ◦ Φ : C × A (cid:55)→ [0 , 1] , we have
T (cid:88)
[Equation]
=
[Equation]
Proof.
The main structure of this proof is similar to proposition 3, section C in Eluder dimension’s paper, and we will only point out the subtle details that makes the difference.
We will show that if w F t ( X t ) > ϵ , then X t is ϵ -dependent on fewer than 4 Mβ T /ϵ 2 disjoint subsequences of ( X 1 , . . .
, X t − 1 ) .
Note that if w F t ( X t ) >
ϵ , there are f, f ∈ F t such that (cid:80) Mi
=
f
( i ) ( x t,i ) − f
( i ) ( x t,i ) >
ϵ .
By definition, if X t is ϵ -dependent on a subsequence ( X t 1 , X t 2 , . . .
, X t k ) of ( X 1 , . . .
, X t − 1 ) , then we know
[Equation]
It follows that, if X t is ϵ -dependent on K disjoint subsequences of ( X 1 , . . .
, X t − 1 ) , then
[Equation]
By triangle inequality we have
[Equation]
and it follows that K < 4 Mβ T /ϵ 2 .
Notice that essentially we are analyzing scalar output function g ( X t )
=
(cid:80) M i =
1 f ( i ) ( x t,i ) where f ∈ F ⊗ M .
Hence if we denote any f ∈ F ⊗ M as f ( · ) = ϕ ( · ) ⊤ Θ , then g ( · ) = ϕ ( · ) ⊤ w ∈ F , w = Θ · 1 .
Hence from original eluder dimension paper we know in any action sequence ( X 1 , . . .
, X τ ) , there must exist some element X j that is ϵ -dependent on at least τ/d − 1 disjoint subsequences of ( X 1 , . . .
, X τ ) , where d := dim E ( F , ϵ ) .
Finally we select X 1 , . . .
, X τ as those actions that w F t > ϵ , combine these two facts above and get τ/d − 1 ≤ 4 Mβ T /ϵ 2 .
Hence τ ≤ (4 Mβ T /ϵ 2 +1) d , which is our desired conclusion.
B Linear MDP Regret Analysis
Apart from the notations section 3, we add more symbols for the regret analysis.
We use Q [ f ] or
Q [ ϕ ◦ θ ] to denote the Q-value function parametrized by function f as Q [ f ]( s, a ) =
f ( s, a ) or
Q [ ϕ ◦ θ ]( s, a ) =
ϕ ( s, a ) ⊤ θ (similar for V [ f ] as state’s value estimation function).
Also, based on assumption 2.1, for any (cid:110) Q ( i ) h +1 (cid:111)
M i =1 , there always exists ˙
f h [ Q h +1 ] ∈ F ⊗ M such that
[Equation]
where the approximation error (cid:13)(cid:13)(cid:13) ∆ ( i ) h (cid:16) Q ( i ) h +1 (cid:17)(cid:13)(cid:13)(cid:13) ≤
I for ∀ i ∈
[ M ] .
Here ˙
f h [ Q h +1 ] indicates that function ˙
f h has dependence on Q-value function Q h +1 on next level h + 1 .
In following analysis, we will use different annotations for different function approximation as below
• f ( i ) ∗ h ( · , · ) =
ϕ ∗ ( · , · ) ⊤ θ
( i ) ∗ h is the “best” Q-value function approximation in Q h for task i at level h .
ˆ f
( i ) h ( · , · ) =
ˆ ϕ ( · , · ) ⊤ ˆ
θ
i is the empirical least-square minimizer solution for task
i at level h .
• ˙ f
( i ) h ( · , · ) = ˙ ϕ ( · , · ) ⊤ ˙
θ i is the value approximation function T ( i ) h Q ( i )
h +1 induced by Q ( i )
h +1 for task i at level h .
• ˜ f
( i ) h ( · , · ) =
˜ ϕ
( · , · ) ⊤ ˜ θ
i is the optimism Q-value approximation function for task i at level h .
• ¯ f ( i ) h
( · , · ) =
¯ ϕ ( · , · )
⊤ ¯ θ i is the nearest neighbor in covering set for task i at level h .
B.1 Main Proof sketch
The overall structure is similar to bandits, the main difference here is that we need to take care of the transition dynamics.
Firstly
[Equation]
we decompose the total regret into following terms
[Equation]
The inequality is because according to lemma 3, we have at each episode t ∈ [ T ]
[Equation]
MHT I .
Denote a ( i )
[Equation] [Equation]
=
[Equation]
it (cid:16) s ( i ) ht
(cid:17) , Q ( i ) h
[ ˜ f
( i ) h,t ] =
˜ Q ( i ) h,t and V ( i ) h
[ ˜ f
( i ) h,t ] =
˜ V ( i ) h,t for short.
We have for any t ∈
[ T ] , h ∈
[ H ]
[Equation]
Since the failure event (cid:83) Tt =1 (cid:83) Hh =1 E ht only happens with probability δ
according to lemma 6, and the addition of regret when it happens is constant bounded, we will simply assume that it does not happen.
Then applying lemma 5, we have
[Equation] [Equation]
where x h,t = (cid:104) ( s (1) h,t , a (1) h,t ) , . . .
, ( s ( M ) h,t , a ( M ) h,t ) (cid:105) denotes the stacked input for all state-action pair at level h , episode t .
Next
[Equation]
we expand the second summation in (35) and have
M
[Equation]
where ζ ( i ) h
[Equation]
t is a martingale difference with respect to history H h,t defined by
[Equation]
According to assumption 2.2 we know that | ζ ( i ) h,t | ≤ 4 , hence by Azuma-Hoeffding’s inequality, we know that with probability at least 1 − δ/ 2 , for any t ∈ [ T ] and i ∈
[ M ]
[Equation]
We can then apply (38) recursively from h = 1 to H , which gives
Reg
[Equation]
T
[Equation]
≤
[Equation] [Equation]
According to lemma 2 we know that
[Equation] [Equation]
where β h,t = ˜ O ( Mk + N (Φ , α, ∥ · ∥ ∞ )
+ MT
I 2 ) .
Summarizing all inequality above and we have the final regret bound as
[Equation] [Equation]
Set α = 1 kMT , we have the regret bound as
[Equation]
B.2 Detailed Lemma Proof
Lemma 3.
Let V i⋆ 1 be the value of optimal policy and V i 1 (cid:104)
˜
f
( i ) 1 ,t (cid:105) be the optimistic value estimation defined in main proof.
We have the accuracy guarantee as
[Equation]
Proof.
Recursively define the closest value approximator function f ∗ h
=
( ϕ ∗ h )
⊤ Θ ∗ h at level h within function class F ⊗ M as
[Equation]
with θ ( i ) H +
=
for any i ∈
[ M ] and Θ ∗ h
= (cid:104) θ (1) ∗ h , . .
, θ ( M ) ∗ h (cid:105) .
By lemma 6 in [44] we have
[Equation]
i
[Equation] [Equation]
[Equation]
where Q ( i ) ⋆ h is the optimal value function for task i .
Next, we will show that f ∗ h is a feasible solution for the optimization of F t .
This is achieved via inductive construction.
For h = H +
we know it holds trivially because ˜ f
( i ) H +
= f
( i ) ∗ H +
= 0 .
Now we suppose that β h,t for k = h + 1 , . . .
, H satisfies that we can always find ˜ f
( i ) k
= f ( i ) ∗ k .
Then from the definition of f ( i ) ∗ h we can always properly set F h,t (to be specified later) to let it contain
[Equation]
By lemma 4, we have
[Equation]
Therefore
[Equation]
set β h,t as the function we set does let f ( i ) ∗ h ∈ F h,t .
Finally
[Equation]
we can finish the proof from showing that
[Equation]
Lemma 4.
For any episode t ∈ [ T ] , level h ∈ [ H ] and any Q-value function at next level { Q ( i ) h
+
Mi =1 ∈ Q
h +1 , denote ˙ f h,t as the best fit Q-value estimation induced by Q ( i ) h +
minimizing
Bellman error, we have
[Equation]
The B h, 1 and B h, 2 are from Lemma 6.
Equivalently saying, this means that ˙ f h,t is contained in set
F h,t defined as
[Equation]
Proof.
By the empirical optimality of ˆ f h,t , we know
[Equation] [Equation]
Here we abuse the notation and use ˆ f ( i ) h,t
( X h,t ) to denote function
ˆ f ( i ) h,t ’s output on all the state-action pair X h,t in the first t − 1 episodes at level h for task i , also y ( i ) h,t is the corresponding target value label.
This inequality implies that
[Equation] [Equation]
where
[Equation]
is the Bellman error for Q-value approximation, each ∆ ( i ) h,j ( Q ( i ) h +1 )
( s ( i ) h,j , a ( i ) h,j ) is defined in (30)
[Equation]
And
[Equation]
where
[Equation] [Equation]
is the finite sampling noise.
Next, we are going to bound the two terms in (58).
For the first term, we have
[Equation]
By lemma 6, when the failure case does not happen, we have
[Equation]
where
[Equation]
Adding the bound for two terms and we get
[Equation]
which completes the proof
[Equation]
Lemma 5.
If the failure event in lemma 6 does not happen, for any feasible solution Q ( i ) h (cid:104)
˜
f
( i ) h (cid:105) in the definition of F h,t , and any h ∈ [ H ] , t ∈
[ T ] , we have
[Equation]
68) where x h,t = (cid:104) ( s (1) h,t , a (1) h,t ) , . . .
, ( s ( M ) h,t , a ( M ) h,t ) (cid:105) denotes the stacked input for all state-action pair at level h , episode t .
Proof.
M
[Equation]
69) =
[Equation]
i =
[Equation]
(70) ≤ M I +
M (cid:88) i =
[Equation]
− ˙
[Equation] [Equation]
≤ M I +
[Equation] [Equation]
According to our construction, we know that both ˜ f
[Equation]
i
[Equation]
,t and ˙ f
( i ) h are contained in
F h,t , therefore we have
[Equation]
and
[Equation]
≤
[Equation]
h
[Equation]
t
[Equation]
x
[Equation]
where x h
[Equation]
=
[Equation]
denotes the stacked input for all state-action pair at level h , episode t .
Summarizing all the inequalities and we know the whole lemma holds.
Lemma 6.
(Probability bound for failure event)
In this lemma we denote ˆ f ( i ) h (cid:104) Q
( i )
h +1 (cid:105) as ˆ f ( i ) h for the sake of simplicity (similar for ˙
f
( i ) h ).
Define event E h,t as
E h,t def = I (cid:34) ∃{ Q ( i ) h +1 } Mi =
M (cid:88) i =
(cid:68)
z
[Equation]
where B h, 1 and B h, 2 will be specified later.
We have
[Equation]
Proof.
Similar to lemma 1, we can find a α -cover Φ α for Φ such that for any Q-value function (cid:16)
Q (1) h +1 [ ϕ ◦ θ 1 ] , Q (2)
h +
[ ϕ ◦ θ 2 ] , . . .
, Q ( M ) h +
[ ϕ ◦ θ M ] (cid:17) , we can find ¯ ϕ ∈
Φ α
and ¯ θ i for i ∈
[ M ] such that for any ( s, a ) ∈ S × A and any i ∈ [ M ]
[Equation]
Define ¯ Q ( i )
h
+1 =
Q ( i ) h +1 (cid:2) ¯ ϕ ◦ θ i (cid:3) and further let ¯
[Equation] [Equation]
then we have
[Equation]
Notice that for fixed ¯ f ( i ) h ( · , · ) =
ϕ ( · , · ) ⊤ ¯ θ ( i )
h
+1 , each z ( i ) h, 1 (cid:16) ¯ Q ( i ) h +1 (cid:17) (cid:16) s ( i ) h, 1 , a ( i ) h, 2 (cid:17) is a zero-mean 1-subGaussian random variable conditioned on past history.
Therefore we can treat it as η t,i =
z ( i ) h,t in
Lemma 1 and get
[Equation] [Equation]
[Equation]
Setting δ 1 =
[Equation]
and get
[Equation]
By union bound, we know it holds for any ¯ f h with probability at least 1 − | Φ α | δ 1 = 1 − δ .
Also, from (cid:12)(cid:12)(cid:12) Q ( i ) h +
( s, a )
− ¯ ϕ
( s, a )
⊤ ¯ θ i (cid:12)(cid:12)(cid:12) ≤ √ kα ′
we know that
[Equation]
=
[Equation] [Equation]
[Table]
[Equation]
[Table]
[Equation]
87) hence we have
[Equation]
holds for arbitrary { Q ( i ) h +1 } at any level
h ∈
[ H ] , t ∈ [ T ] .
Adding (83) and (90), we finally finish the proof by setting α = α ′
[Equation]
C Experiment Dissection and Discussion
In this section, we will take a closer view of the learning procedure and analyze the functionality of the UCB term in our algorithm.
Usually, a reasonable UCB term should embrace several properties.
(i) It should let confidence set F t contain the real parameter with high probability.
(ii) It should shrink at a reasonable speed to achieve low regret.
To check (i), we choose the model ˆ f t at step t = 200 which is trained on insufficient data with only 2000 samples.
We then sample 100 images from test set as unknown inputs D = { ( x i , y i ) } 100 i =1 , where x i is the digit image and y
i is the corresponding target value.
We inspect the relationship between the original prediction error | ˆ f t ( x i ) − y i | and the added bonus b i = ¯ f t ( x i ) − ˆ f t ( x i ) via finetuning on each input x i ∈ D .
The result is presented as scatter dots in Figure 2(a).
We can clearly see that almost all the points lie above the line y
= x , meaning that b i = ¯ f t ( x i ) − ˆ f t ( x i ) ≥ | ˆ f t ( x i ) −
y i | ≥ y
i − ˆ f t ( x i ) for any i ∈ [100] , which further indicates that ¯ f t ( x i ) ≥ y i .
This validates that we can always find some ¯ f ∈ F t to give an optimistic estimation of the value for almost every x .
Moreover, we can observe an apparent correlated pattern between the test error and bonus, which implies that our
[Figure]
algorithm will give larger bonus for the data point whose prediction is not reliable, and only give relatively small bonus for the data that it is confident with.
We also check (ii) by plotting the average bonus level (closely related to the width of confidence set) against the number of samples the algorithm has been trained on.
We gradually increase the number of samples from 10 to 20000 and fix a set of test images D as before to see how the average bonus level changes when the training set size increases.
The result is shown in Figure 2(b).
Previous work [12] proves that the eluder dimension of neural networks can be exponentially large in the worst case, which means that it can give almost arbitrary output value even when it is constrained to give a precisely accurate prediction for a large number of samples in the training set.
In that case, the average bonus level should have remained constant regardless of the size of the training set.
However, our experiment shows that the average bonus drops when the number of training samples increases.
We conjecture that it is because in reality, when the input data are restricted to regular images with clear semantics, and the optimization procedure of the model is conducted via gradient-based methods in a very close neighborhood, the arbitrariness of the neural network’s output is substantially reduced.
Restricting the model’s training loss in the training set effectively limits the bonus obtained from the finetune procedure, which realizes the desired fast-shrinking property from our functional confidence set.
Such a phenomenon sheds light on the unknown property of neural network’s generalization capability and interpolation plasticity.
We leave explaining the underlying mechanism as future work.
C.1 Visualize the Learned Representation
A natural and interesting question is what representation does our CNN backbone actually learn.
To investigate this problem and visualize the learned representation, we measure the information of different digits within the learned representation.
Interestingly, we find that our model indeed learns an indicative representation for classification problem via multitask value regression training.
The basic measurement for the quality of representation is evaluated with the kernel function κ ( x i , x j ) =
⟨ ϕ ( x i ) , ϕ ( x j ) ⟩ and see whether it has a strong diagonal.
We take the checkpoint of neural network model at final step (around 600 with more than 6000 samples), and treat the module before the final linear layer as ϕ ( · ) .
Denote the MNIST test set as D =
{D i } 9 i =0 where D i is the images of digit i .
Define the correlation between digit i and j under representation ϕ as
[Equation]
To accelerate the evaluation, notice that we can preprocess an “template vector” T i for each digit i as
[Equation]
so that the correlation can be computed through
[Equation]
We plot this 10x10 correlation map for single task training and multitask training with M = 10 .
Notice that the single task reward mapping function is σ ( i ) =
i/ 10 , and to assure the different tasks in multitask training are heterogeneous, we manually set that the best digit for each task are distinct.
The result is in figure 3.
We can see that since single task only needs to recognize the large value digit, namely 9, 8 or 7, its representation function is not informative for distinguishing digits.
And interestingly, the multitask trained network’s representation demonstrates a very strong diagonal, indicating that the representation vector is very specific to the digit’s image, although the training process has no explicit definition for the classification task but a regression problem instead.
Actually, we found a simple linear layer append to this representation can achieve over 95 % accuracy on
MNIST test set.
(a) Single task
[Figure]