  Network slicing is a key enabler for 5G to support various applications.
Slices requested by service providers (SPs) have heterogeneous quality of
service (QoS) requirements, such as latency, throughput, and jitter. It is
imperative that the 5G infrastructure provider (InP) allocates the right amount
of resources depending on the slice's traffic, such that the specified QoS
levels are maintained during the slice's lifetime while maximizing resource
efficiency. However, there is a non-trivial relationship between the QoS and
resource allocation. In this paper, this relationship is learned using a
regression-based model. We also leverage a risk-constrained reinforcement
learning agent that is trained offline using this model and domain
randomization for dynamically scaling slice resources while maintaining the
desired QoS level. Our novel approach reduces the effects of network modeling
errors since it is model-free and does not require QoS metrics to be
mathematically formulated in terms of traffic. In addition, it provides
robustness against uncertain network conditions, generalizes to different
real-world traffic patterns, and caters to various QoS metrics. The results
show that the state-of-the-art approaches can lead to QoS degradation as high
as 44.5% when tested on previously unseen traffic. On the other hand, our
approach maintains the QoS degradation below a preset 10% threshold on such
traffic, while minimizing the allocated resources. Additionally, we demonstrate
that the proposed approach is robust against varying network conditions and
inaccurate traffic predictions.
