D ATA -D RIVEN E VALUATION OF T RAINING A CTION S PACE FOR R EINFORCEMENT L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
Training action space selection for reinforcement learning (RL) is conﬂict-prone due to complex state-action relationships.
To address this challenge, this paper proposes a Shapley-inspired methodology for training action space categorization and ranking.
To reduce exponential-time shapley computations, the methodology includes a Monte Carlo simulation to avoid unnecessary explorations.
The effectiveness of the methodology is illustrated using a cloud infrastructure resource tuning case study.
It reduces the search space by 80% and categorizes the training action sets into dispensable and indispensable groups.
Additionally, it ranks different training actions to facilitate superior RL model performance and lower cost.
The proposed data-driven methodology is extensible to different domains, use cases, and machine learning algorithms
I NTRODUCTION
A reinforcement learning (RL) agent learns how to map situations to actions in order to maximize a long-term cumulative award signal in a given environment.
Figure 1 shows the various artifacts of an RL algorithm.
An RL problem is deﬁned by a quartet of ( S, A, P a , R a ) , where S is a set of states or the state space; A is a set of actions or the action space available to inﬂuence S ;
P a ( s, s (cid:48) )
=
Pr ( s t +1 = s (cid:48) | s t = s, a t = a ) is the transition probability which is the probability that action a in state s at time t will lead to state s (cid:48) at time t
+ 1 ; and ﬁnally, R a ( s, s (cid:48) ) is the immediate reward signal received after transitioning from state s to state s (cid:48) , due to action a .
An RL agent training involves recognizing an optimal policy function from a corpus of { ( s i , a i ) } .
The reward function, R a , is deﬁned ab initio for an efﬁcient goal accomplishment.
The transition probability or state-action mapping is deﬁned by the environment dynamics.
In many real-life use cases, the agent cannot directly sense the effect of its actions on the environment.
This is particularly true when the state-action relationship cannot be modeled by either closed-form analytical expressions [25, 28, 56] or explicit rules as in the popular games such as Chess [27], Go [45, 44], and Atari [33].
This challenge is well documented in the literature [49, 55].
To address this challenge for RL model training [50, 32], simulation-based action models [48] play a pivotal role.
The optimal choice of simulation parameters such as the training action space is a non-trivial challenge because of the curse of dimensionality [17] and non-linearity [11].
Training data valuation [22, 10] and associated artisanal software engineering efforts constitute a large part of the machine learning (ML) life cycle (or MLOps).
Yet, most research and development efforts [35] focus on algorithms and infrastructure.
Production-grade MLOps needs to handle data lifecycle management (DLM) [39] challenges including: fairness and bias in labeled datasets [16], data quality [9], limitations of benchmarks [41], and reproducibility concerns [38].
For RL, the DLM challenges are further compounded due to complexities arising from non-linear state-action interactions, partiallyobservable processes, non-isometric action spaces [31], and strong domain speciﬁcity [21] of action models.
With the recent emphasis on ML explainability, traditional supervised learning and deep learning research communities are actively working on systematic data-driven frameworks [14, 51] for training data valuation.
We need equivalent frameworks for RL to streamline conﬂict-prone training action selection [8, 36, 18].
Depending on the agent-environment interactions, different training actions have different relative contributions to the RL agent performance.
Some training actions are indispensable because of their unique positions in the parametric space.
Other dispensable actions have different relative contributions to the reward function.
Remarkably, a high-cardinality training action space in many cases leads to lower cumulative reward than a well-designed training action space.
To the best of authors’ knowledge, there is hardly any data-driven tool for the evaluation of training action space for RL.
Such a tool leads to superior RL agent performance, lower model training and maintenance cost, and strong multi-disciplinary collaboration [34].
This paper proposes a shapley-inspired [52] algorithm to categorize and rank training action sets.
It also assists in recognizing cut-off cardinality for the training action space to reduce unnecessary exploration and ensure polynomial time complexity.
Additionally, a gradient-based action update rule is proposed for faster convergence for the RL loop.
While Section ?? describes the algorithms for RL training action space evaluation, Section 3 illustrates the effectiveness of the algorithms in a speciﬁc case study. Section 4 discusses the relevant literature.
Finally, Section 5 presents a succinct summary with possible future directions.
A LGORITHM
The proposed framework provides a shapley-inspired methodology [47] to efﬁciently ﬁlter out unnecessary training actions and discover a near-optimal action set. Figure 2 shows the framework consists of two algorithms and how these two algorithms interact with each other to design a nearoptimal RL model by training action space ﬁltering and evaluation.
The ﬁrst algorithm computes cut-off cardinality computation for the training action space.
The cut-off cardinality is deﬁned as the minimium number of action points needed in a training action set to enable high-ﬁdelity predictions within an acceptable computational complexity and an error bound. The second algorithm takes action points only above the cut-off cardinality and categorize action points into two classes: { dispensable, indispensable } and ranking dispensable training action points based on the corresponding cumulative award. Indispensable action points are absolute essential action points for the RL agent to achieve the desired goal.
On the other hand, dispensable action points are non-essential action points that can be discarded.
However, the RL agent might perform sub-optimally without a disposable action point. By ranking disposable training action points based on the corresponding cumulative reward, the relative contributions of different training action points are estimated. 2. C UT - OFF C ARDINALITY C OMPUTATION FOR T RAINING A CTION S PACE
RL deals with compilation of a quartet ( S, A, P a , R a ) and computation of an optimal policy, π ∗ which maximizes the long-term cumulative reward. The search space for a shapley-inspired technique needs to span across the power set for the training action space which has exponential complexity with training action points.
To circumvent this problem, the proposed algorithm, as discussed in Algorithm 1, uses Monte Carlo method to compute the cut-off cardinality.
The inputs to this algorithm include an RL algorithm, the power set for the training action space, the corresponding state space, the transition probability, an acceptable performance margin, and an acceptable number of iterations. The output is the cut-off cardinality. The algorithm uses an iterative procedure to train the RL agent with different numbers of training actions, starting from all available training actions to only one training action. If for a certain cardinality, all the cumulative rewards do not improve by (cid:15) within n iterations, then we set the status to failure, and assign the cut-off cardinality to that cardinality plus one.
The cut-off cardinality signiﬁes computational efﬁciency — a larger cut-off cadinality means lower computational overhead and vice versa. Algorithm 1 Monte Carlo method for cut-off cardinality computation for the training action space
Input: The RL algorithm, R , the power set for the training action space, P ( A ) , the corresponding state space, P ( S | A ) , transition probability P , an acceptable performance margin, (cid:15) , and an acceptable number of iterations, n . Output: Cut-off cardinality, | A | cutoff for k ← | A | to 1 do repeat π ∗ ← R ( S, A, P a , R a ) if the cumulative reward improves by (cid:15) with n iterations then status ← success else status ← failure end if until all necessary training action sets for a given cardinality is exhausted. if all statuses for a given cardinality, k , are failures then | A | cutoff ← k +end if end for 2. C ATEGORIZATION AND R ANKING OF T RAINING A CTIONS
Algorithm 2 offers a principled procedure for training action selection.
As for inputs, it takes the combinations of training state-action pairs above the cut-off cardinality, determined by Algorithm 1, the RL algorithm, the reward function, the threshold condition, and the acceptable number of iterations. As for outputs, it predicts a categorization vector which classiﬁes training action points into two classes: { dispensable , indispensable } and ranks dispensable training actions based on the corresponding cumulative reward. At its core, Algorithm 2 determines whether the policy determined from the given state-action pairs achieves the threshold condition within the acceptable number of iterations.
The algorithm uncovers the indispensability of some training action sets for a given RL task.
A training action set is deemed to be indispensable:
iff upon removal of that training action point, the RL agent fails to accomplish the goal within a ﬁnite number of iterations [24, 54, 23]. All other action points are dispensable. The dispensable action points are rank listed in L based on the corresponding cumulative reward.
Essentially, L informs the performance impact of different disposable action points on the RL agent.
Algorithm
Input: All combinations of training state-action pairs upto cut-off cardinality: { ( s i , a i ) } , the RL algorithm, R , the reward function, the threshold condition, and the acceptable number of iterations.
Output: Categorization vector, V , which classiﬁes training action points into two classes: { dispensable , indispensable }.
Rank order list of dispensable training actions based on the corresponding cumulative reward.
repeatfor <
s i , a i > do π ∗ ← R ( S, A, P a , R a ) if Threshold condition is never satisﬁed within the acceptable number of iterations then
V ( A − a i ) ← indispensable else
V ( A − a i ) ← dispensable end if end for until all necessary training action sets are evaluated.
Rank List, L ← dispensable actions sorted in order of the corresponding cumulative rewards
C ASE S TUDY
In this section, we design a resource tuning example (in the cloud) to illustrate the effectiveness of the proposed algorithm for the training action space evaluation.
We evaluate the performance of an
MDP [20]-based RL agent, as shown in Figure 1.
The state-action mapping and transition probability are modeled using time-series auto-regression [37] after a PCA-based dimensionality reduction [40] with time complexity O ( klogk ) , where k is the number of principal components.
The choice of the algorithms is purely driven by the nature of the training dataset.
A more complex non-linear dataset warrants more complex sequential models such as long short-term memory (LSTM) [43] or attention based models [29].
For action updates, WLOG, an RL-based PID controller [1, 13] is used.
Similar to time-series modeling, action update can be conducted by other policy learning algorithms such as
SARSA [19].
As shown in Table 1, the objective of the RL agent for this case study is to quickly reduce high CPU utilization below a pre-assigned threshold for a given workload.
In most infrastructure/cloud resource tuning technologies [53], CPU utilization represents a key metric.
Therefore, the state space for this
RL case study consists of virtual machine CPU utilization (%) metrics and the action space is deﬁned by the VM resource set points, i.e., (# of vCPUs, Memory Size (GB)).
The RL agent uses AWS boto
SDK [2] to manipulate actions and AWS CloudWatch [3] for state space monitoring.
The reward is deﬁned as the number of time steps required by the agent to accomplish the objective multiplied by − 1 .
The negative reward per time step was meant to push the agent to accomplish the task as fast as possible.
The training data for this case study was generated internally [4] with an open source library, stress (https://linux.die.net/man/1/stress).
It uses a rectangular workload.
The peak of the workload uses the stress command: sudo stress –io 4 –vm 2 –vm-bytes 1024M –timeout 500s .
Essentially, the peak is running 4 I/O stressors and 2 VM workers spinning on malloc with 1024 MB per worker fors.
The simulated rectangular workload has a time period of 600 s: a high-stress phase of 500 s is followed by an inactive phase of 100 s. The RL training action space is spanned by the power set drawn from the ﬁve pairs of EC2 conﬁguration set points as shown in Table 2.
Using Algorithm 1, we notice that the power set below the cut-off cardinality of 4 produces trivial and unstable results.
Therefore, WLOG, the analysis in this paper has been focused on six training action sets as shown in
Table 4.
That amounts to 81.25% reduction in the search space.
For each EC2 instance in the training action space, the corresponding state metrics, i.e., CPU utilization (%) are shown in Figure 3.
The training data was collected for a 24 hour period with 1 minute sampling interval.
Using Algorithm [Table] [Table] ?? , the optimal step-size for action update is identiﬁed to be 0 .
1 in both # of vCPUs and Memory Size (GB) dimensions
[Table] With this set up [Table] different RL models are developed with different training action sets and the corresponding rewards and ranks are noted in Table 4.
Remarkably
[Table] a high cardinality training action set does not guarantee the best reward: the agent with all training actions, <small t3a, medium t3a, large t3a, xlarge t3a, 2xlarge t3a> [Table] does not yield the highest reward.
In fact [Table] the action set with <medium t3a, large t3a, xlarge t3a, 2xlarge t3a> yields the highest reward.
This pattern could be attributed to the state-action interaction in this particular case study.
First, the parametric distances between different EC2 instance pairs are not uniform.
While the Euclidean distance between small t3a and medium t3a is equal to 2 , that between xlarge t3a and 2xlarge t3a is 16 .
The non-uniform spacing for training action space is a considerable deterrent [30] for RL adoption.
Second, in this case study, the transient CPU utilization (%) patterns have undergone a material change from xlarge t3a (max 100%) to 2xlarge t3a (max 73%) This indicates the strong
inﬂuence of 2xlarge t3a for the given RL task.
Indeed, we noticed 2xlarge t3a to be an indispensable training action.
As shown in Table 3, a categorization of training actions can be inferred based on the valuation vector, V , as described in Algorithm 2: two dispensable training actions are uncovered to be small t3a, medium t3a and three indispensable training actions to be large t3a, xlarge t3a, 2xlarge t3a .
Figure 4 shows the RL loop action with three training actions: <small t3a, medium t3a, large t3a, xlarge t3a, 2xlarge t3a> , <medium t3a, large t3a, xlarge t3a, 2xlarge t3a> , and <small t3a, large t3a, xlarge t3a, 2xlarge t3a> .
• For the ﬁrst training action set of <small t3a, medium t3a, large t3a, xlarge t3a, 2xlarge t3a> , the reward is − 21 .
The left subplot in Figure 4(a) shows how the recommended action is evolving with time from an arbitrary initial point of (6, 14).
The recommended points are superimposed on the training action parameter space to illustrate their relative position with respect to the parametric boundary which is deﬁned by the trapezium with vertices: {(2,2), (2,8), (8,32), (8,2)} in the (# of vCPUs, Memory Size (GB)) space.
The right subplot in Figure 4(a) shows how the median CPU utilization (%) comes below the 90% threshold in 21 steps leading to − 21 in reward.
The blue dots represent the median CPU utilizations for different training set points. [Table]
[Table] <small t3a, medium t3a, large t3a, xlarge [Table] • For the second training action set of <medium t3a, large t3a, xlarge t3a, 2xlarge t3a> , the reward is − 13 as shown in Figure 4(b).
• For the third training action set of <small t3a, large t3a, xlarge t3a, 2xlarge t3a> , the reward is − 16 as shown in Figure 4(c).
As shown in Table
[Table]
the reward scores can indeed be used for ranking different training action sets leading to a data-driven approach for training action selection.
As shown in Figure 5, large t3a is an indispensable element in the training action space for the given RL agent.
Without this training action, the RL agent fails to accomplish the goal of bringing the CPU utilization below the critical threshold.
Similar observations can be made about xlarge t3a and 2xlarge t3a .  R ELATED W ORK
Shapley value was postulated in a classic paper in game theory [15] and inﬂuences the ﬁeld of economics signiﬁcantly [42].
Various shapley-inspired techniques have been applied to model diverse problems including voting [12], resource allocation [46] and bargaining [26]. Recent years saw increased application of shapley-inspired methodologies in machine learning feature importance evaluation and training data valuation [14, 10]. To the best of our knowledge, Shapley value has not been used to quantify training action valuation in a reinforcement learning context. The application of shapley-inspired technique for reinforcement learning is a challenging problem.
First, the relationship between state-action pairs and transition probabilities are expensive to model.
Also, often the RL training action points are not uniformly positioned.
Finally, we have purposefully focused on a small sample cloud infrastructure use case instead of cliched RL use cases [5].
That is because the problem of optimal action selection has relatively more expensive in the cloud infrastructure space where the state-action relationship is only partially observable.
C ONCLUSION
This paper proposes a data-driven methodology for training action space evaluation for RL.
The methodology offers a principled framework for training action space categorization and ranking within a ﬁnite computational time.
It unleashes a strategy for superior model performance and lower modeling cost.
Additionally, the proposed methodology is completely agnostic of use cases and machine learning algorithms.
Therefore, it is a general-purpose methodology extensible to different domains including distributed computing, network trafﬁc control, healthcare, automatic locomotion, building management system, and industrial controls, and different machine learning algorithms such as PCA, Autoencoder, ARIMA, LSTM, Transformer, PID, SARSA, DQN, and many others. For the next phase of the development for this data-agnostic methodology, we are planning to contribute a general RL design library to relevant open source projects [6, 5, 7].  N OTATION S Space Space
A Action Space P a Transition Probability
R a
Reward Signal
P Power Set π Policy π ∗ Optimal Policy π ∗
Optimal Policy
Vector L Rank List of Dispensable Actions