Multi-Agent Reinforcement Learning for Efficient Content ...

13
1610 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019 Multi-Agent Reinforcement Learning for Efficient Content Caching in Mobile D2D Networks Wei Jiang , Gang Feng, Senior Member, IEEE, Shuang Qin, Member, IEEE, Tak Shing Peter Yum, Fellow, IEEE , and Guohong Cao, Fellow, IEEE Abstract— To address the increase of multimedia traffic dominated by streaming videos, user equipment (UE) can collab- oratively cache and share contents to alleviate the burden of base stations. Prior work on device-to-device (D2D) caching policies assumes perfect knowledge of the content popularity distribution. Since the content popularity distribution is usually unavailable in advance, a machine learning-based caching strategy that exploits the knowledge of content demand history would be highly promising. Thus, we design D2D caching strategies using multi-agent reinforcement learning in this paper. Specifically, we model the D2D caching problem as a multi-agent multi- armed bandit problem and use Q-learning to learn how to coordinate the caching decisions. The UEs can be independent learners (ILs) if they learn the Q-values of their own actions, and joint action learners (JALs) if they learn the Q-values of their own actions in conjunction with those of the other UEs. As the action space is very vast leading to high computational complexity, a modified combinatorial upper confidence bound algorithm is proposed to reduce the action space for both IL and JAL. The simulation results show that the proposed JAL-based caching scheme outperforms the IL-based caching scheme and other popular caching schemes in terms of average downloading latency and cache hit rate. Index Terms— D2D caching, multi-agent, reinforcement learning. I. I NTRODUCTION T HE explosive growth of mobile devices and mobile internet applications brings great convenience to society. It also creates tremendous traffic demand which challenges the design of next generation mobile communication systems. Cisco [1] predicted that mobile traffic will increase 7-folds from 2016 to 2021. Studies [2], [3] also revealed that a major portion of the increased traffic is the duplicated downloads of Manuscript received July 12, 2018; revised November 24, 2018; accepted January 15, 2019. Date of publication January 29, 2019; date of current version March 11, 2019. This work was supported in part by the National Natural Science Foundation of China under Grant 61631005 and Grant 61871099 and in part by the National Science Foundation under Grant CNS-1526425 and Grant CNS-1815465. The associate editor coordinating the review of this paper and approving it for publication was J. Tang. (Corresponding author: Gang Feng.) W. Jiang, G. Feng, and S. Qin are with the National Key Laboratory on Communications, University of Electronic Science and Technology of China, Chengdu 611731, China, and also with the Center for Intelligent Networking and Communications, University of Electronic Science and Technology of China, Chengdu 611731, China (e-mail: [email protected]). T. S. P. Yum is with Zhejiang Lab, Hangzhou 310000, China. G. Cao is with the Department of Computer Science and Engineering, The Pennsylvania State University, State College, PA 16801 USA. Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TWC.2019.2894403 popular video files from remote servers, and thus local content caching and sharing can alleviate the congestion in mobile networks. Content distribution networks (CDN) together with Peer-to- Peer (P2P) networks [4] have been widely used for streaming video traffic in the Internet. In CDN, popular video files are cached in proxies or intermediate servers so that they can be directly streamed to clients instead of from the home servers [5]. Similar ideas have been applied to wireless networks, where access nodes (such as access points, base stations) are used to cache popular video files to reduce net- work traffic and improve users’ Quality of Experience (QoE) [6]–[13]. Similar to P2P, Device-to-Device (D2D) commu- nication has been proposed in 3GPP 4G LTE-A [14] to enable multiple direct transmissions between pairs of near-by devices in cellular systems [15]. Meanwhile, state-of-the-art user equipment (UE) such as Apple X and Huawei Mate 10 have been equipped with AI chips capable of execut- ing AI algorithms in addition to larger storage, longer battery life and more accurate GPS location [16]. Such advanced features allow UEs to play an active role as caching servers in content distribution. Content distribution in wireless networks is quite differ- ent from that in the Internet. First, the service coverage of a UE is limited by its transmission power. Second, the cache hit rate of cached content items could be rather low in mobile D2D networks due to the limited number of UEs in a cell. Third, although the storage in UEs has greatly increased in recent years, it is still much smaller than that of CDN servers. Therefore, the design of efficient caching strategies is crucial to the successful content sharing in mobile D2D networks. Many recent studies on D2D caching assume the knowledge of content popularity distribution (the expected number of requests per content item) is available in advance [17]–[20]. A few machine learning methods have been proposed to estimate the content popularity distribution at the Base Stations (BSs) for D2D caching [21]. However, the estimated content popularity distribution is based on all UEs in the whole cell, which may not reflect the preference of individual UE (referred to as the user’s content access pattern), and hence may not perform well when being used for determining what content each UE should cache. Enabled by Artificial Intelligence (AI) technology, state-of- the-art UEs of D2D mobile networks can use learning methods to learn what to cache in a distributed way. They can also learn from each other in multi-agent settings where the behaviors 1536-1276 © 2019 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

Transcript of Multi-Agent Reinforcement Learning for Efficient Content ...

Page 1: Multi-Agent Reinforcement Learning for Efficient Content ...

1610 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

Multi-Agent Reinforcement Learning for EfficientContent Caching in Mobile D2D Networks

Wei Jiang , Gang Feng, Senior Member, IEEE, Shuang Qin, Member, IEEE,Tak Shing Peter Yum, Fellow, IEEE, and Guohong Cao, Fellow, IEEE

Abstract— To address the increase of multimedia trafficdominated by streaming videos, user equipment (UE) can collab-oratively cache and share contents to alleviate the burden of basestations. Prior work on device-to-device (D2D) caching policiesassumes perfect knowledge of the content popularity distribution.Since the content popularity distribution is usually unavailablein advance, a machine learning-based caching strategy thatexploits the knowledge of content demand history would behighly promising. Thus, we design D2D caching strategies usingmulti-agent reinforcement learning in this paper. Specifically,we model the D2D caching problem as a multi-agent multi-armed bandit problem and use Q-learning to learn how tocoordinate the caching decisions. The UEs can be independentlearners (ILs) if they learn the Q-values of their own actions,and joint action learners (JALs) if they learn the Q-values oftheir own actions in conjunction with those of the other UEs.As the action space is very vast leading to high computationalcomplexity, a modified combinatorial upper confidence boundalgorithm is proposed to reduce the action space for both IL andJAL. The simulation results show that the proposed JAL-basedcaching scheme outperforms the IL-based caching scheme andother popular caching schemes in terms of average downloadinglatency and cache hit rate.

Index Terms— D2D caching, multi-agent, reinforcementlearning.

I. INTRODUCTION

THE explosive growth of mobile devices and mobileinternet applications brings great convenience to society.

It also creates tremendous traffic demand which challengesthe design of next generation mobile communication systems.Cisco [1] predicted that mobile traffic will increase 7-foldsfrom 2016 to 2021. Studies [2], [3] also revealed that a majorportion of the increased traffic is the duplicated downloads of

Manuscript received July 12, 2018; revised November 24, 2018; acceptedJanuary 15, 2019. Date of publication January 29, 2019; date of current versionMarch 11, 2019. This work was supported in part by the National NaturalScience Foundation of China under Grant 61631005 and Grant 61871099 andin part by the National Science Foundation under Grant CNS-1526425 andGrant CNS-1815465. The associate editor coordinating the review of thispaper and approving it for publication was J. Tang. (Corresponding author:Gang Feng.)

W. Jiang, G. Feng, and S. Qin are with the National Key Laboratory onCommunications, University of Electronic Science and Technology of China,Chengdu 611731, China, and also with the Center for Intelligent Networkingand Communications, University of Electronic Science and Technology ofChina, Chengdu 611731, China (e-mail: [email protected]).

T. S. P. Yum is with Zhejiang Lab, Hangzhou 310000, China.G. Cao is with the Department of Computer Science and Engineering, The

Pennsylvania State University, State College, PA 16801 USA.Color versions of one or more of the figures in this paper are available

online at http://ieeexplore.ieee.org.Digital Object Identifier 10.1109/TWC.2019.2894403

popular video files from remote servers, and thus local contentcaching and sharing can alleviate the congestion in mobilenetworks.

Content distribution networks (CDN) together with Peer-to-Peer (P2P) networks [4] have been widely used for streamingvideo traffic in the Internet. In CDN, popular video files arecached in proxies or intermediate servers so that they canbe directly streamed to clients instead of from the homeservers [5]. Similar ideas have been applied to wirelessnetworks, where access nodes (such as access points, basestations) are used to cache popular video files to reduce net-work traffic and improve users’ Quality of Experience (QoE)[6]–[13]. Similar to P2P, Device-to-Device (D2D) commu-nication has been proposed in 3GPP 4G LTE-A [14] toenable multiple direct transmissions between pairs of near-bydevices in cellular systems [15]. Meanwhile, state-of-the-artuser equipment (UE) such as Apple X and HuaweiMate 10 have been equipped with AI chips capable of execut-ing AI algorithms in addition to larger storage, longer batterylife and more accurate GPS location [16]. Such advancedfeatures allow UEs to play an active role as caching serversin content distribution.

Content distribution in wireless networks is quite differ-ent from that in the Internet. First, the service coverage ofa UE is limited by its transmission power. Second, the cachehit rate of cached content items could be rather low in mobileD2D networks due to the limited number of UEs in a cell.Third, although the storage in UEs has greatly increased inrecent years, it is still much smaller than that of CDN servers.Therefore, the design of efficient caching strategies is crucialto the successful content sharing in mobile D2D networks.

Many recent studies on D2D caching assume the knowledgeof content popularity distribution (the expected number ofrequests per content item) is available in advance [17]–[20].A few machine learning methods have been proposed toestimate the content popularity distribution at the Base Stations(BSs) for D2D caching [21]. However, the estimated contentpopularity distribution is based on all UEs in the whole cell,which may not reflect the preference of individual UE (referredto as the user’s content access pattern), and hence may notperform well when being used for determining what contenteach UE should cache.

Enabled by Artificial Intelligence (AI) technology, state-of-the-art UEs of D2D mobile networks can use learning methodsto learn what to cache in a distributed way. They can also learnfrom each other in multi-agent settings where the behaviors

1536-1276 © 2019 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

Page 2: Multi-Agent Reinforcement Learning for Efficient Content ...

JIANG et al.: MULTI-AGENT REINFORCEMENT LEARNING FOR EFFICIENT CONTENT CACHING 1611

of other UEs are unknown in advance. Multi-agent learningis complicated by the fact that other UEs may be learningsimultaneously, creating a non-stationary environment for aspecific UE.

In this paper, we take a more realistic approach, anddesign content caching strategies in mobile D2D networksusing multi-agent reinforcement learning without assumingthe knowledge of content popularity distribution. Specifically,UEs are treated as agents, content items as arms, cachingdecisions as actions, the reduction of downloading latency ascaching reward. Then, we formulate the D2D caching problemas a multi-agent multi-armed bandit (MAB) learning prob-lem to maximize the expected total caching reward. We usethe well-understood reinforcement learning algorithm calledQ-learning to learn how to coordinate the caching deci-sions in multi-agent systems. UEs are independent learn-ers (ILs) if they apply Q-learning in the same way as inthe single agent system, ignoring the caching decisions ofother UEs. As the action space is very large leading tohigh computational complexity, a corresponding IL modifiedcombinatorial upper confidence bound (MCUCB) solution isproposed to reduce the action space. The IL-based solutioncan be justified when other UEs’ caching decisions do notchange, but may fail when other UEs adapt their cachingdecisions. To address this problem, UEs should be joint actionlearners (JALs); i.e., to learn the Q-values of their own actionsin conjunction with those of other UEs. Then, a correspondingJAL MCUCB algorithm is proposed to reduce the action space.Evaluation results show that the proposed JAL-based cachingscheme outperforms IL-based caching scheme and other pop-ular caching schemes in terms of average downloading latencyand cache hit rate.

In the following, we introduce related work and the systemmodel in Section II and Section III, respectively. In Section IV,we formulate the D2D content caching problem as a multi-agent MAB problem. In Section V, IL-based and JAL-basedmethods are presented. In Section VI, we evaluate the per-formance of these two algorithms by simulations. Finally,we conclude this paper in Section VII.

II. RELATED WORK

D2D caching strategies can be broadly classified as thosewith perfect knowledge of content popularity distrobution andthose without.

A. D2D Caching Strategies With Perfect Knowledge ofContent Popularity Distribution

Most relevant studies belong to this type. The fundamen-tal limits of caching in wireless D2D networks have beeninvestigated in [17]. In [18], an optimal dual-solution searchalgorithm was proposed for maximizing the average cache hitrate in D2D caching. In [19], a joint design of the transmissionand caching policies was presented by assuming that thecontent popularity distrobution is known in advance. Consid-ering heterogeneous environments where both BS caching andD2D caching are used, an optimal cooperative caching policywas proposed in [20].

B. D2D Caching Strategies Without Perfect Knowledge ofContent Popularity Distribution

There is very little related work in this area. In [22],the authors propose a transfer learning-based caching proce-dure to exploit the rich contextual information extracted fromsource domain. This prior information is incorporated in theso-called target domain where the goal is to optimally cachestrategic contents at a small cell. The authors of [23] modelthe caching problem in a small BS (SBS) as a combinatorialMAB problem, and propose several learning algorithms tooptimize the cache content. In [24], the authors use an upperconfidence bound (UCB)-type algorithm to learn the contentpopularity matrix. They then present a novel caching strategythat uses the learned content popularity matrix to optimizethe cache content placement by taking into account users’connectivity to the SBS. These approaches are designed forSBS caching and only consider the single agent cases, whichare inappropriate for D2D caching.

In [25], the authors propose a socially-aware D2D cachingpolicy which takes into account the social ties and interestsimilarities among users. They measure the interest simi-larities among users through learning users’ cached contentitems. Exploiting proactive caching, the authors of [21] pro-posed a novel caching paradigm which assumes non-perfectknowledge of the content popularity distribution. Supervisedmachine learning and collaborative filtering techniques areused to estimate the content popularity distribution. Sincecontent popularity distribution may not reflect the prefer-ence of individual UE (i.e., user’s content access pattern),the authors in [26] proposed to learn user’s content accesspattern. The caching policy was optimized with user’s contentaccess pattern to improve performance. These approaches arebased on supervised learning and require training sets. Sinceappropriate training sets are hard to get, an online learningmethod should be proposed to learn the user’s content accesspattern over time. In [27], we have proposed a reinforcementlearning based algorithm for D2D caching. Although it isshown that the proposed algorithm outperforms other popularcaching schemes, the computational and spatial complexityis high. Hence, a more efficient learning based D2D cachingpolicy is needed.

III. SYSTEM MODEL

The system model of D2D caching is illustrated in Fig. 1.A cell with U randomly distributed UEs, denoted as U ={1, 2, . . . , U}. UEs can request any content item from acontent item set F = {1, 2, . . . , F}. Each content item f isof size sf and each UE u has a local cache with a storagecapacity of Su. UEs share cached content via D2D links. TheBS is connected to the core network via backhaul. We assumethat the BS has a cache memory large enough to store theentire content directory [8]. The assumption is justified by thefact that the BS can easily retrieve any content item fromthe core networks if the content item is not cached.

Assume there is a resource scheduler that allocates fre-quency sub-channels to D2D users dynamically to avoidinterferences [15]. Let lu ∈ R

2 denote the location of UE u.We present a simple communication protocol to determine

Page 3: Multi-Agent Reinforcement Learning for Efficient Content ...

1612 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

Fig. 1. System model of the D2D caching system, where (a), (b)and (c) represents local cache hits, D2D cache hits and BS cache hits,respectively.

the set of neighboring UEs for each UE. Essentially, we letUE v at location lv communicate with UE u at loca-tion lu if ‖lu − lv‖ < RD2D, RD2D > 0. The setof potential neighbors of UE u is denoted as N (u) ={v |v ∈ U , ‖lu − lv‖ < RD2D }.

We use SNR to compute the transmission rate. The SNR ofD2D links and BS-UE communication links are SNRD2D =PD ·GD2D/σ2

N and SNRBS−UE = PBS ·GBS−UE/σ2N

respectively, where σ2N is the Gaussian white noise power.

PD and PBS denote the transmission power of UE and BSrespectively. Let GD2D and GBS−UE denote the channelgain of each communication link for the D2D pair and BSto UE respectively. The channel gain of D2D and BS-UElinks is given by GD2D=κ · dD2D

−ε and GBS−UE = κ ·dBS−UE

−ε respectively, where κ and ε denote the pathlossconstant and exponent respectively. Let d be the path dis-tance. Therefore, the downloading rate of a UE from D2Dand BS is wD2D = BD2D · log2(1 + SNRD2D) andwBS−UE = BBS−UE · log2(1 + SNRBS−UE) respectively,where BD2D and BBS−UE denote the allocated bandwidthto each link, given by total bandwidth×spatial reuse/numberof UEs. Hence, we can calculate the downloading rate of UE ufrom neighbor v and BS, denoted by wuv and wu0 respectively,and wuv = 0 when v /∈ N (u). With these assumptions,we can obtain the latency of UE u downloading content itemf from neighbor v ∈ N (u) and BS as τf

uv = sf/wuv andτfu0 = sf/wu0, respectively, and τf

uv = ∞ when v /∈ N (u).We define a set of neighbors of UE u with wuv > wu0, v ∈N (u) as N ′ (u).

Time is divided into periods. Within each time period, thereis a user request phase and a cache replacement phase. In theuser request phase, let dT

u,f denote the number of times UEu requests content item f within time period T , which is anindependent identically distributed (i.i.d) random variable withmean θu,f = E

(dT

u,f

). For simplicity, we assume that u’s

requests occur independently following Poisson processes withaverage rate Nu (arrival/time period). Furthermore, we assumeeach UE’s content access pattern follows Zipf distribution [26].Hence, the expected number of request for content item f inone time period is θu,f = Nu · |Δu,f |−γu/

∑i∈F i−γu , u ∈

U , f ∈ F , where γu is the shape factor of ZipF distribution

and Δu,f is the popularity rank of content item f in UE u,i.e., different UEs may have different preferences for contentitems. In this work, we take a more practical scenario that Nu,γu and Δu,f are unknown to UEs in advance.1

UE’s content request can be served by local cache, otherUEs or the cellular BS. When a content request occurs,the content retrieval protocol is as follows:

(a) Local cache hits: When UE u needs content item f ,it first checks its local cache and retrieves it immediately iffound. We call this “local cache hits”.

(b) D2D cache hits: If the exact content item has not beenstored in the local cache, and there is at least one neighborsin N ′ (u) has a copy, the required content item would betransmitted from a neighbor via a D2D communication link,termed as “D2D cache hits”. Note that the “D2D cache hits”only allows content request to be served by a UE in proximitywhich has already cached it. This is in contrast to delaytolerant network (DTN) that allows multi-hop content delivery.

Moreover, we assume that D2D networking participantsare willing to share content items based on some incentiveschemes [28]. For example, UEs can obtain some rewardswhen transmitting content items to others, and can usethose rewards for downloading required content item fromother UEs.2 The UEs can benefit from receiving rewardsby serving other UEs and enjoying lower delay with moreD2D services.

(c) BS cache hits: If the content request is not availablelocally or through neighbors, a request is sent to and fulfilledby the BS.

In the cache replacement phase, which is considered ofnegligible duration, UEs refresh content items in their localcache according to a caching strategy.

IV. PROBLEM FORMULATION

In this section, we model the D2D caching problem froma multi-agent reinforcement learning perspective. Specifically,we model the D2D caching problem which minimizes the totaldownloading latency of all UEs as a multi-agent MAB problemin which UEs learn from the historical downloading latencyto adjust their caching strategy.

A. Multi-Agent Multi-Armed Bandit Problem

MAB is a problem extensively studied in statistics andmachine learning. The classical version of the problem isformulated as a system of M arms each having an unknowndistribution of the reward with an unknown mean. The agentplays these arms repeatedly, based on its current knowledge,in order to maximize the accumulated reward overtime, whilesimultaneously acquiring new knowledge.

As it is well known in the MAB literature, there is a tradeoffbetween the exploration of new arms (i.e., learning their

1We assume each UE periodically broadcasts its currently cached contentitems. UEs send content requests to their neighbors depending on theavailability of the content item. Then, each UE can observe its serving UEs’requests of the content item in its storage, but it may not know other UE’sinstantaneous demand. Hence, the overall user’s content access pattern isunknown to these UEs.

2The rewards could be of any form, such as monetary value or virtual credits,and can be paid to the UEs under specific protocols.

Page 4: Multi-Agent Reinforcement Learning for Efficient Content ...

JIANG et al.: MULTI-AGENT REINFORCEMENT LEARNING FOR EFFICIENT CONTENT CACHING 1613

mean rewards) and the exploitation of known arms(i.e., achieving the highest empirical rewards). If the expectedrewards of arms were known, the optimal policy would alwayspull the arm that offers the highest expected reward. Theregret of a policy is the difference between its accumulatedreward and that of the optimal policy. Existing results showthat one can achieve a regret of O (log N) when playing armsin N rounds.

There are several variants of the classical MAB model,and one of them is the combinatorial MAB (CMAB) [29].In the CMAB model, we allow m < M active armsat each decision time. The objective of CMAB is iden-tical to that of the classical MAB model. Applied tomulti-agent system, the reward obtained by playing a setof arms is associated with other agents’ decision. Next,we formulate the D2D caching problem which minimizesthe total downloading latency of all UEs as a multi-agentCMAB problem.

B. Multi-Agent CMAB Problem for D2D Caching

Each UE u is treated as an agent and each content item fis treated as an arm. The decision of whether f should becached or not, is treated as action, denoted as au,f , i.e.,au,f = 1 if u caches f and au,f = 0 otherwise. Eachu can cache several content items at the same time. Notethat the total size of the cached content items cannot exceedits storage capacity, i.e.,

∑f∈F sf · au,f ≤ Su. We define

Au = {(au,1, au,2, . . . , au,F )|∑f∈F sf · au,f ≤ Su, au,f ∈{0, 1}, f ∈ F} as the set of super actions for UE u.In time period T , each u independently selects an super actionaT

u ∈ Au to play. The selected super actions of allUEs in time period T constitute a joint super actionaT

1 , . . . , aTU .

The downloading latency of UE u for content item f intime period T is

LTu,f = (1− aT

u,f ) ·[ZT

u,f + τfu,0 ·

∏i∈N ′(u)

(1− aTi,f )

],

where (i)u is the UE with the i-th lowest latency for UE u

and ZTu,f =

|N ′(u)|∑i=1

(τfu,(i)u

·i−1∏j=1

(1 − aT(j)u,f ) · aT

(i)u,f ) is the

lowest latency for UE u to fetch content item f from N ′ (u).∏i∈N ′(u)

(1− aTi,f ) is the indicator function for the condition

that content item is not found in N ′ (u).The reward of u for f is defined as the reduction in the

downloading latency.

Y Tu,f = τf

u,0 − LTu,f . (1)

UE u should pay a portion of reward Y Tu,f to UE vT

u,f ∈ Uwho fulfills the requests. Therefore, the reward of u fordownloading f is (1 − r) · Y T

u,f and the reward of UE vTu,f

for delivering f to u is r · Y Tu,f , where 0 ≤ r ≤ 1 is the

proportional factor.

Then, the reward u receives for f in time period T withjoint action aT

1,f , . . . , aTU,f is defined as,

RTu,f (aT

1,f , . . . , aTU,f ) = dT

u,f · (1 − r) · Y Tu,f

+∑i∈U

u=vTi,f

dTi,f · r · Y T

i,f . (2)

The total reward u receives in time period T with joint superaction aT

1 , . . . , aTU is defined as,

RTu (aT

1 , . . . , aTU ) =

∑f∈F

dTu,f · (1 − r) · Y T

u,f

+∑f∈F

∑i∈U

u=vTi,f

dTi,f · r · Y T

i,f . (3)

The expected total reward u receives in time period T withjoint super action aT

1 , . . . , aTU is given by,

ΥTu (aT

1 , . . . , aTU ) = E

(RT

u (aT1 , . . . , aT

U ))

=∑f∈F

[θu,f · (1 − r) · Y Tu,f +

∑i∈U

u=vTi,f

θi,f · r · Y Ti,f ]. (4)

Let aTu (πu) ∈ Au denote the super action selected by u

in time period T according to caching policy πu. A policyprofile is a collection Π = {π1, π2, . . . , πU} of policies foreach UE. The objective is to find the optimal policy Π∗,which maximizes the expected total reward over a long timehorizon N . The multi-agent CMAB problem for D2D cachingcan be expressed as follows:

Π∗ = arg maxΠ

N∑T=1

U∑u=1

ΥTu (aT

1 (π1), aT2 (π2), . . . , aT

U (πU )).

(5)

The multi-agent CMAB problem for D2D caching is aspecial case of the general-sum n-player game, as general-sum n-player games allow the agents’ rewards to be arbitrarilyrelated [30]. Based on results in [30] and [31], the general-sum n-player game has at least one Nash equilibrium. Thebaseline solution for general-sum n-player games is to find aNash equilibrium [31]. A Nash equilibrium is a joint strategywhere each agent’s strategy is the best response to the others’strategy. We denote by Π−u = {π1, . . . πu−1, πu+1, . . . , πU}a reduced strategy profile for UE u. Given a profile Π−u,strategy πu is the best response for u if the expected rewardof the strategy profile Π−u ∪ {πu} is maximal for u. In otherwords, u could not do better using any other strategy πu

′.Finally, we say that the strategy profile Π is Nash equilibriumif Π[u] (u-th component of Π) is a best response to Π−u,for every u ∈ U . Note that an equilibrium (or joint action) isoptimal if no other strategy can achieve greater value.

Proposition 1: The optimal strategy Π∗ for problem (5) isalso the optimal D2D caching strategy which maximizes theexpected total reduction in downloading latency.

Page 5: Multi-Agent Reinforcement Learning for Efficient Content ...

1614 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

Proof: According to Equations (1) and (4), we have

N∑T=1

U∑u=1

ΥTu (aT

1 (π1), aT2 (π2), . . . , aT

U (πU ))

=N∑

T=1

U∑u=1

∑f∈F

[θu,f · (1− r) · Y Tu,f +

∑i∈U

u=vTi,f

θi,f · r · Y Ti,f ]

=N∑

T=1

U∑u=1

∑f∈F

θu,f · Y Tu,f

=N∑

T=1

U∑u=1

∑f∈F

θu,f · (τfu,0 − LT

u,f).

Hence, the objective function of problem (5), i.e.,the expected total reward of all UEs is equivalent to theexpected total reduction in downloading latency.

For a more practically scenario where user’s content accesspattern is not known in advance, this problem cannot be solvedby using optimization or game theory. Action selection isdifficult if UEs are unaware of the expected reward associatedwith various super actions. In our multi-agent systems, actionselection is more difficult if UEs are unaware of the expectedreward associated with various joint super actions. In sucha case, multi-agent reinforcement learning can be used byUEs to estimate the expected reward associated with individ-ual or joint super actions based on past experience. In thenext section, we propose multi-agent reinforcement learningapproaches for solving this problem.

V. MULTI-AGENT REINFORCEMENT LEARNING-BASED

D2D CACHING POLICIES

Reinforcement learning can be used by agents to learnhow to coordinate their action choices in multi-agent systems.A simple, well-understood reinforcement learning algorithmis Q-learning. The usefulness of performing an action isrepresented by a numerical value known as the Q-value,i.e., an expected cumulative reward for taking a particularaction at a specific state. The job of a Q-learning algorithmis to estimate the Q-values for every action at every state.In some cases where an environment is not represented bystates. Instead, only the action space is considered, and thusthe standard Q-learning is typically simplified to its statelessversion [32]. This is also the case investigated in this paper.The formulation of Q-learning for general sequential decisionprocesses is more sophisticated than what we need here.Hence, in our stateless setting, the multi-agent reinforcementlearning model consists of three elements: agent, action andreward, where agents are defined as UEs, actions are definedas caching decisions, and rewards are defined as the reductionsof downloading latency. For each agent u, we assume the valueQu(a) can provide an estimate of the usefulness of performingaction a in the next time period and these values are updatedaccording to the reward received for the action. There aretwo ways Q-learning could be used in a multi-agent system.We say agents are independent learners (ILs) if they learn theQ-values of their own actions, and joint action learners (JALs)

if they learn the Q-values of their own actions in conjunctionwith those of other agents via integration of reinforcementlearning with equilibrium (or coordination) learning methods.In the following, we present IL-based algorithm and JAL-based algorithm for D2D caching.

A. IL-Based Algorithm for D2D Caching

If all UEs are ILs, for each UE u, it is possible totreat every super action as an action and simply applyQ-learning algorithm to solve problem (5). In our statelesssetting, Qu(au), au ∈ Au is denoted as the estimate rewardof performing super action au in the next time period.UE u updates Qu(au) after super action au is performed intime period T . The update equation for stateless Q-learning,as defined in [33], is given below:

Qu(au)← Qu(au) + λT · (RTu −Qu(au)),

where RTu is the reward associated with the joint super action

played in time period T and calculated by equation (3). λT isthe learning rate (0 ≤ λT ≤ 1), governing to what extent thenew sample replaces the current estimate.

However, such naive treatment has two problems. First,the number of super actions |Au| is roughly 2F for each UE u.It is exponential to the number of content items due tocombinatorial explosion, and thus the Q-learning algorithmmay need exponential number of steps to go through allthe super actions. Second, after super action au is played,in many cases, we can observe some information regardingthe outcomes of underlying actions au,f , f ∈ F , which maybe shared by other super actions. However, this information isdiscarded in the Q-learning algorithm, making it less effective.

In the CMAB framework, a super action (e.g., au) is avector, whose elements are underlying actions (e.g., au,f ).In each round one super action is selected and the rewards ofall underlying actions in the super action are revealed. Sincea CMAB algorithm needs only the expected rewards of theunderlying actions to compute the expected rewards of superactions, a combinatorial upper confidence bound (CUCB)algorithm [29] is proposed to use the expected rewards of theunderlying actions instead of the expected rewards of the superactions. Thus, we can reduce the action space from the numberof super actions to the number of underlying actions. However,this reduction is at the cost of computing the optimal or near-optimal super action; i.e., the algorithm has to resort to acomputation oracle that takes the expected rewards of theunderlying actions as input, together with the knowledge of theproblem instance, for computing the optimal or near-optimalsuper action.

The CUCB algorithm is detailed as follows. It maintains anempirical mean reward μf of playing each arm f . In moredetail, if arm f has been played Cf times by the end oftime T , the expected reward of playing arm f at the end oftime period T is (

∑Cf

i=1 Xf,i)/T , where Xf,i is the reward ofarm f in its i-th play. The actual expected reward μf givento the oracle contains an adjustment term for each μf , whichdepends on the time period number and the number of timesthat arm f has been played (i.e., μf = μf +

√3 lnT/2Cf ).

Page 6: Multi-Agent Reinforcement Learning for Efficient Content ...

JIANG et al.: MULTI-AGENT REINFORCEMENT LEARNING FOR EFFICIENT CONTENT CACHING 1615

Then it plays the super action returned by the oracle and updateCf and μf accordingly.

Hence, we propose an IL CUCB algorithm that intro-duces a CUCB-type algorithm to reduce the action space ofQ-learning. The IL CUCB algorithm for the D2D cachingproblem is detailed as follows. It employs Qu,f (au,f ), u ∈U , f ∈ F instead of Qu(au), u ∈ U , au ∈ Au to reduce theaction space from 2F to 2 · F for each UE. More precisely,the Q-value Qu,f (au,f ) is defined as the average reward ofaction au,f selected by UE u. Let Cu,f (au,f ) denote thenumber of times action au,f ∈ {0, 1} is selected by UE u inthe past. Specifically, Cu,f (1) is the number of times actionau,f = 1 selected by UE u, i.e., the number of times contentitem f cached in UE u. If action au,f is selected by UE u intime period T , the Q-value Qu,f(au,f ) is updated by,

Qu,f (au,f )← Qu,f (au,f )

+1

Cu,f (au,f ) + 1· (RT

u,f −Qu,f (au,f )),

where RTu,f is calculated by equation (2).

The CUCB algorithm adjusts Q-values only depending onthe time period number and the number of times actionau,f has been played. To promote the exploitation-exploration,we use a modified CUCB algorithm to adjust Q-values basedon the Zipf-like distribution of the content popularity andthe particular structure of the problem at hand. The adjustedQ-value is given by,

Qu,f = Qu,f + l · (|N′ (u)|+1) · sf

F γ·√

3 logT

2Cu,f (1),

where Qu,f = Qu,f (1) − Qu,f (0), l = maxi∈F

Qu,i/si and

parameter γ is the shape factor of Zipf distribution, whichcan be empirically approximated as in [34]. Note that thefactor 1/F γ promotes exploitation when γ is large and thereare few popular content items. Exploration is promoted when|N ′ (u)| is large, since the reward distribution is more com-plicated with a large number of neighbors.

We resort to a computation oracle that takes the adjustedQ-value Qu,f , u ∈ U , f ∈ F as input to find the optimalsuper action a∗

u. The problem for finding a∗u is a 0-1 Knapsack

problem with profits Qu,f , f ∈ F , and weights sf , f ∈ F ,and can be rewritten as follows:

max∑

f∈F Qu,f · au,f ,

s.t.∑

f∈F sf · au,f ≤ Su,

au,f ∈ {0, 1}. (6)

The 0-1 Knapsack problem is known as NP-hard [35]. Theexact computation of a∗

u is computationally hard and thealgorithm may be randomized with a small failure probability.Thus, we resort to an (α, β)-approximation oracle to solvethis problem. The (α, β)-approximation oracle is defined as:for some α, β ≤ 1, the oracle could output a super actionwhose expected reward is at least α fraction of the optimalexpected reward with probability β.

We use a greedy algorithm for the 0-1 Knapsackproblem as the (α, β)-approximation oracle, denoted as

aGu = Oracle(Qu,1, . . . , Qu,F ). We start with the feasible

solution aGu = (0, 0, . . . , 0) and replace 0 by 1 in an iter-

ative way, while maintaining the feasibility of the solution.The algorithm terminates when the last feasible solution isobtained. In other words, the greedy algorithm constructs asequence of feasible solutions with monotonically increasingvalues of the objective function. Formally, the solution aG

u isobtained in the following way. We number au,fi , fi ∈ F , i =1, 2, . . . , F in a non-increasing order of their specific valuesQu,fi/sfi : Qu,f1/sf1 ≥ Qu,f2/sf2 ≥ · · · ≥ Qu,fF /sfF .We assume that au,f1 = 1 and for k = 2, . . . , F ,

aGu,fk

=

⎧⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎩

1,

k−1∑j=1

sfj aGu,fj

+ sfk≤ Su

0,

k−1∑j=1

sfj aGu,fj

+ sfk> Su.

(7)

We denote by δ =∑

f∈F Qu,f · a∗u,f/

∑f∈F Qu,f · aG

u,f ,the ratio between the value of the optimal solution andthat of the greedy approximation and it can be estimatedthat δ ≤ 2 [35], and thus

∑f∈F Qu,f · aG

u,f ≥∑

f∈FQu,f · a∗

u,f/2, i.e., the expected reward of super action aGu

is at least 1/2 fraction of the optimal expected reward withprobability 1. Hence, the greedy algorithm is an (α, β)-approximation oracle with α = 0.5 and β = 1. If the cachesize is much larger than the maximum content item size, thenδ ≈ 1 [23], and, hence, α ≈ 1. For the special case of si = sj ,i, j ∈ F , i.e., when all the content items have the same size,the solution of the greedy approximation is optimal. TheIL-based algorithm for D2D caching is detailedin Algorithm 1.

Algorithm 1 The IL-Based Algorithm for D2D Caching1: Step 1. Initialize:2: Cu,f (au,f ) = 0, Qu,f (au,f ) = 0, u ∈ U , f ∈ F .3: For each UE u, cache all content items at least

once, observe the rewards RTu,f and update Cu,f (au,f ),

Qu,f(au,f ), f ∈ F .4: Set T ← F + 1.5: Step 2. Observe (user request phase in period T):6: for u ∈ U , f ∈ F do7: Observe RT

u,f .8: Update Qu,f (au,f )← Qu,f (au,f )+1/(Cu,f (au,f ) + 1) ·

(RTu,f −Qu,f(au,f )) and Cu,f (au,f )← Cu,f (au,f ) + 1,

∀au,f selected in period T .9: end for

10: Step 3. Optimize (cache replacement phase in periodT):

11: for u ∈ U do12: Compute Qu,f = Qu,f(1)−Qu,f (0) and Qu,f = Qu,f +

l · (|N′(u)|+1)·sf

F γ ·√

3 log T2Cu,f (1) , f ∈ F .

13: aTu (πu) = Oracle(Qu,1, . . . , Qu,F ).

14: end for15: Set T ← T + 1.16: Go to Step 2.

Page 7: Multi-Agent Reinforcement Learning for Efficient Content ...

1616 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

In IL-based algorithm, for each UE, the computational com-plexity is the sum of the complexity for computing Q-valuesand finding the optimal super action by (α, β)-approximationoracle. Both the complexity of computing Q-values and find-ing the optimal super action by (α, β)-approximation oracleare O(F ). Hence, the computational complexity of IL-basedalgorithm for D2D caching problem is O(F ).

However, this approach ignores the multi-agent nature ofthe setting. The Q-values are updated without regard for theactions selected by the other UEs. The IL-based solution canbe justified when other UEs’ caching decisions do not change,but may fail when other UEs adapt their caching decisions.

B. JAL-Based Algorithm for D2D Caching

JALs apply the multi-agent Q-learning algorithm with learn-ing the Q-values of their own actions in conjunction withthose of other UEs. This implies that each UE can observethe actions of other UEs. The Q-value for any individual UEu is Qu(a1, . . . , aU ) in multi-agent Q-learning algorithm. Thejoint action space for any individual UE is

∏u∈U |Au|. It is

exponential to the number of UEs and the number of contentitems. Thus, the multi-agent Q-learning algorithm may needexponential number of steps to go through all the joint superactions.

Since the expected reward of each UE is only influ-enced by the joint super actions performed by itself andits neighbors, we use a JAL CUCB algorithm that employsQu,f (au,f , av1,f , . . . , av|N′(u)|,f ), u ∈ U , f ∈ F instead of

Qu(a1, . . . , aU ) to reduce the action space to F · 2|N ′(u)|+1

for each UE u, where vj ∈ N ′ (u) , j = 1, 2, . . . , |N ′ (u)|.On the other hand, action selection polices require more

care for JALs. For example, if UE u currently has Q-valuesfor all joint actions, the expected reward of performing whichsuper action depends crucially on the strategy adopted by itsneighbors. To determine the relative values of their individualactions, each UE maintains beliefs about the strategies of otherUEs. UE u, for instance, assumes that each other UE v willchoose actions in accordance with u’s current beliefs about v(i.e., u’s empirical distribution over v’s action choices).

The definitions used in JAL-based algorithm for D2Dcaching are given as follows:

1) Joint actions: for UE u, we define Bu,f = {(au,f ,av1,f , . . . , av|N′(u)|,f )|au,f , avj ,f ∈ {0, 1}, vj ∈ N ′ (u) , j =1, 2, . . . , |N ′ (u)|} as the set of joint actions for content item f .We define B−u

u,f = {(av1,f , . . . , av|N′(u)|,f )|avj ,f ∈ {0, 1},vj ∈ N ′ (u) , j = 1, 2, . . . , |N ′ (u)|} as the set of reducedjoint actions for content item f .

2) Counts: each UE u keeps counts Cu,f (au,f ), f ∈ F ,of the number of times action au,f selected by u andCu,v,f (av,f ), f ∈ F for each v ∈ N ′ (u), of the number oftimes action av,f selected by UE v observed by u. Each u alsokeeps counts Cu,f (bu,f ), f ∈ F , bu,f ∈ Bu,f , of the numberof times joint action bu,f selected by u and its neighbors.

3) Q-values: the Q-value Qu,f (bu,f ), u ∈ U , f ∈ F , bu,f ∈Bu,f is defined as the average reward observed by UE u,of joint action bu,f selected by u and its neighbors.

4) Updating Q-values: if joint action bu,f is selectedby UE u and its neighbors in time period T , the Q-valueQu,f(bu,f ) is updated by Qu,f(bu,f ) ← Qu,f (bu,f ) +1/(Cu,f(bu,f ) + 1) · (RT

u,f − Qu,f (bu,f )), where RTu,f is

calculated by equation (2).UE u treats the relative frequencies of UE v’s selections as

indicator of v’s current strategy. In other words, for each UEv ∈ N ′ (u), u assumes v selects action av,f with probabilityPru,v,f (av,f ) = Cu,v,f (av,f )/T . Hence, UE u assesses theprobability of reduced joint action b−u

u,f ∈ B−uu,f selected by its

neighbors to be Pru,f (b−uu,f ) =

∏v∈N (u) Pru,v,f (av,f ) and the

expected reward of selecting action au,f to be Qu,f (au,f ) =∑b−u

u,f∈B−uu,f

Qu,f (au,f , b−uu,f ) · Pru,f (b−u

u,f ).Then, each UE uses the modified CUCB algorithm to

adjust Q-values and input the adjusted Q-values into the(α, β)-approximation oracle to obtain the super action forcaching decision. The JAL-based algorithm for D2D cachingis summarized in Algorithm 2.

Algorithm 2 The JAL-Based Algorithm for D2D Caching1: Step 1. Initialize:2: Cu,f (au,f ) = 0, Cu,v,f (av,f ) = 0, Cu,f (bu,f ) = 0,

Qu,f(bu,f ) = 0, u ∈ U , f ∈ F , v ∈ N ′ (u), bu,f ∈ Bu,f .3: For each UE u, cache all content items at least once,

observe the rewards RTu,f , f ∈ F and update Cu,f (au,f ),

Cu,v,f (av,f ), Cu,f (bu,f ), Qu,f (bu,f ), f ∈ F , v ∈ N ′ (u),bu,f ∈ Bu,f .

4: Set T ← F + 1.5: Step 2. Observe (user request phase in period T):6: for u ∈ U , f ∈ F do7: Observe RT

u,f .8: Update Qu,f (bu,f )← Qu,f(bu,f )+1/(Cu,f (bu,f ) + 1)·

(RTu,f −Qu,f (bu,f )) and Cu,f (bu,f )← Cu,f (bu,f ) + 1,

∀bu,f selected in period T .9: Update Cu,f (au,f ) ← Cu,f (au,f ) + 1, ∀au,f selected

in period T and Cu,v,f (av,f ) ← Cu,v,f (av,f ) + 1, v ∈N ′ (u), ∀av,f selected in period T .

10: end for11: Step 3. Optimize (cache replacement phase in period

T):12: for u ∈ U do13: Compute Pru,v,f (av,f ) = Cu,v,f (av,f )/T , v ∈ N ′ (u),

f ∈ F and Pru,f (b−uu,f ) =

∏v∈N ′(u) Pru,v,f (av,f ), f ∈

F , b−uu,f ∈ B−u

u,f .14: Compute Qu,f(au,f ) =

∑b−u

u,f∈B−uu,f

Qu,f (au,f , b−uu,f ) · Pru,f (b−u

u,f ), f ∈ F .15: Compute Qu,f = Qu,f(1)−Qu,f (0) and Qu,f = Qu,f +

l · (|N (u)|+1)·sf

F γ ·√

3 log T2Cu,f (1) , f ∈ F .

16: aTu (πu) = Oracle(Qu,1, . . . , Qu,F ).

17: end for18: Set T ← T + 1.19: Go to Step 2.

In JAL-based algorithm, the complexity for computingQ-values is O(2|N ′(u)|+1 · F ) and the complexity for findingthe optimal super action by the (α, β)-approximation oracle

Page 8: Multi-Agent Reinforcement Learning for Efficient Content ...

JIANG et al.: MULTI-AGENT REINFORCEMENT LEARNING FOR EFFICIENT CONTENT CACHING 1617

is O(F ). Therefore, the computational complexity ofJAL-based algorithm for D2D caching problem isO(2|N ′(u)|+1 · F ).

C. Properties of Algorithm 1 and Algorithm 2

Next we theoretically investigate the convergence and regretbound of Algorithm 1 and Algorithm 2. We first provideFact 1 and Corollary 1.

Fact 1: Let ET be a random variable denoting the prob-ability of an equilibrium strategy profile being played attime period T . Then for multi-agent reinforcement learningalgorithms with required conditions, for any σ, ω > 0, thereis an T (σ, ω) such that Pr(|ET − 1| < ω) > 1 − σ for allT > T (σ, ω). The required conditions are as follows:

1) The learning rate λT decreases over time such that∑∞T=0 λT =∞ and

∑∞T=0 λT

2 <∞.2) Each agent plays each of its actions infinitely often.3) The probability Pu

T (au) of agent u choosing action au

is nonzero.4) Each agent’s exploration strategy is exploitive. That

is, limT→∞PuT (XT ) = 0, where XT is a random variable

denoting the event that some non-optimal action was takenbased on u’s estimated values at time period T .

Proof: cf. [33] for proofs.Corollary 1: Let ET be a random variable denoting the

probability of an equilibrium strategy profile being played attime period T . Then for both Algorithm 1 and Algorithm 2,for any σ, ω > 0, there is an T (σ, ω) such that Pr(|ET − 1| <ω) > 1− σ for all T > T (σ, ω).

Proof: The learning rate of Algorithm 1 is

1/(Cu,f (au,f ) + 1), and∞∑

T=0

1Cu,f (au,f )+1 = ∞,

∞∑T=0

( 1Cu,f (au,f )+1 )2 < ∞. The learning rate of Algorithm 2

is 1Cu,f (bu,f )+1 , and

∞∑T=0

1Cu,f (bu,f )+1 = ∞,

∞∑T=0

( 1Cu,f (bu,f )+1 )2 < ∞. Hence, both Algorithm 1 and

Algorithm 2 satisfy the first condition in Fact 1. Since theUCB-type algorithm is used in Algorithm 1 and Algorithm 2to bias Q-values, conditions 2) and 3) are apparently satisfied.The expected number of times a non-optimal super actionselected within T is E(m(T )) =

∑au∈Au

au �=a∗u

E(nau(T )),

where a∗u is the optimal super action and E(nau

(T ))is the expected number of times au selected within T .The probability of a non-optimal action was taken attime period T is E(m(T ))/T . According to the lowerbound of UCB-type algorithm, the expected number oftimes an agent selects a non-optimal action is O(log T ), i.e.,E(nau

(T )) = O(log T ), au ∈ Au, au �= a∗u [36]. We can get

E(m(T )) ≤ 2F · O(log(T )) and limT→∞E(m(T ))/T = 0.Therefore, for both Algorithm 1 and Algorithm 2,condition 4) is satisfied. According to Fact 1, for bothAlgorithm 1 and Algorithm 2, there is an T (σ, ω) such thatPr(|ET − 1| < ω) > 1− σ for all T > T (σ, ω).

Next we prove the regret bound of Algorithm 1 andAlgorithm 2.

Fact 2: The (α, β)-approximation regret of the CUCB algo-rithm using an (α, β)-approximation oracle with a boundedsmoothness function can achieve logarithmic bound.

Proof: cf. [29] for proofs.Corollary 2: The (α, β)-approximation regret of

Algorithm 1 and Algorithm 2 can achieve logarithmicbound.

Proof: Note that, for each UE u, the reward of a superaction au is linear to the reward of action au,f , f ∈ F , andthe reward of a joint super action au, av1 , . . . , av|N′(u)| also islinear to the reward of joint action au,f , av1,f , . . . , av|N′(u)|,f ,f ∈ F . The monotonicity property is straightforward. Thebounded smoothness function can be defined as f(x) = Su ·x,i.e., increasing the expected reward of all (joint) actions byx can increase the expected reward of a (joint) super actionat most Su ·x. According to Fact 2, the (α, β)-approximationregret of Algorithm 1 and Algorithm 2 can achieve logarithmicbound.

VI. PERFORMANCE EVALUATIONS

In this section, we evaluate the performance of the pro-posed IL-based and JAL-based algorithm for D2D caching.The performance metrics include the average downloadinglatency, the percentage of traffic offloading and the D2Dcache hit rate. The average downloading latency is the aver-age delay for all content requests. D2D cache hit rate isthe content items (in terms of byte) served by D2D cachedivided by the content items (in terms of byte) requested.The percentage of traffic offloading is the content items(in terms of byte) served by local cache or D2D cache dividedby content items (in terms of bytes) requested. In other words,the percentage of traffic offloading is the D2D cache hit rateplus the local cache hit rate.

We use simulations to compare the performance of ourIL-based algorithm and JAL-based algorithm for D2D cachingwith the following well-known caching schemes: 1) InformedUpper Bound (IUB) [23] algorithm which assumes that thecontent popularity is perfectly known in advance. The IUBalgorithm provides an upper bound on the performance ofother learning algorithms. Note that since the content popular-ity is usually unknown in practice, it is impossible to achievesuch performance upper bound. 2) Least Recently Used (LRU)[37] caching algorithm that always keeps the most recentlyrequested content items in the cache. 3) Least Frequently Used(LFU) [38] caching algorithm that always keeps the mostfrequently requested content items in the cache.

We consider a single macro cell with radius 350m and800 UEs are randomly distributed in the cell. The maximumdistance of D2D communication is chosen to be 30m [15]. Thetransmit power of the BS and UEs is set to 40W and 0.25Wrespectively. Bandwidth set aside for BS transmission and forD2D transmission is 10MHz each [20]. There are 200 contentitems which are randomly chosen to have sizes distributedfrom 1 to 10 units [23]. The cache size of each UE is 30 units.Each UE generates content requests according to a Poissonprocess with rate 100 (arrivals/time period) [7]. We run thesimulations for 500 time periods. The content popularity

Page 9: Multi-Agent Reinforcement Learning for Efficient Content ...

1618 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

Fig. 2. The average downloading latency, the percentage of traffic offloading and the D2D cache hit rate of IL-based, JAL-based, IUB, LRU, LFU cachingschemes for different cache sizes.

TABLE I

SYSTEM PARAMETERS

distribution is generally modeled as a ZipF distribution [8],i.e., the probability that a request is for the j-th most popularcontent item is j−γ/

∑Fi=1 i−γ and the shape factor γ of the

ZipF distribution is 0.56 [8]. The default system parametersused in the performance evaluation are listed in Table I.We implement our proposed algorithms for D2D cachingby using Matlab R2015a, running in Intel(R) Core(TM)i5-4590 CPU @ 3.30GHz with RAM of 8GB. The averagerunning time of IL-based and JAL-based algorithms for a UEin a time period are 0.688 and 2.287 milliseconds respectively.

As shown in Fig. 2, we first compare the average down-loading latency, the percentage of traffic offloading and theD2D cache hit rate when the cache size varies from 10 to50 units. In Fig. 2 (a), we can see that the average downloadinglatency decreases with the cache size for all caching schemes.In Fig. 2 (b) and Fig. 2 (c), we observe that the percentageof traffic offloading and the D2D cache hit rate increase withthe cache size for all caching schemes, since more contentitems can be cached in UEs. As expected, the IUB gives anupper bound to the other caching algorithms. Note that sincethe content popularity is unknown in practice, it is impossible

to achieve such performance upper bound. Among the othercaching algorithms, IL-based and JAL-based caching schemesoutperform LRU and LFU. This is due to that IL-based andJAL-based caching schemes learn from the history of observedcontent demands, while LRU and LFU caching schemes learnonly from one-step past. Note that the JAL-based cachingscheme outperforms the IL-based caching scheme since theUEs in JAL-based caching learn the Q-values of their ownactions in conjunction with those of other UEs while UEsin IL-based caching only learn the Q-values of their ownactions. In Fig. 2 (c), there is an intersection of the D2Dcache hit rate curves of IL-based and LRU caching schemes,since the D2D cache hit rate of LRU increases faster thanthat of IL-based caching with the cache size of UEs. Thereasons are as follows. With the increase of cache size ofUEs, more content requests can be satisfied by local cachein IL-based caching than LRU, and thus the D2D cache hitrate of IL-based caching increases slower than that of LRU.In Fig. 2 (a), the average downloading latency of JAL-basedcaching is significantly lower than that of the other threecaching schemes. In particular, compared with the IL-based,LRU and LFU caching schemes, the gain of the JAL-basedcaching scheme in terms of the average downloading latencyis approximately 8%, 11% and 19%, respectively when cachesize is up to 50 units.

Fig.3 shows the average downloading latency, the percent-age of traffic offloading and the D2D cache hit rate as afunction of the total number of content items. We can see thatthe average downloading latency increases with the numberof content items for all caching schemes in Fig. 3 (a), whilethe percentage of traffic offloading and the D2D cache hit ratedecrease with the number of content items for all cachingschemes in Fig. 3 (b) and Fig. 3 (c) respectively, due tothe limited cache size of UEs. In Fig. 3 (b), it is shownthat the JAL-based caching scheme outperforms the IL-based,LRU and LFU caching schemes with the improvement on thepercentage of traffic offloading approximately 18%, 55% and120%, respectively when the number of content items is 300.

In the following we compare the average download-ing latency, the percentage of traffic offloading and the

Page 10: Multi-Agent Reinforcement Learning for Efficient Content ...

JIANG et al.: MULTI-AGENT REINFORCEMENT LEARNING FOR EFFICIENT CONTENT CACHING 1619

Fig. 3. The average downloading latency, the percentage of traffic offloading and the D2D cache hit rate of IL-based, JAL-based, IUB, LRU, LFU cachingschemes for different numbers of content items.

Fig. 4. The average downloading latency, the percentage of traffic offloading and the D2D cache hit rate of IL-based, JAL-based, IUB, LRU, LFU cachingschemes for different numbers of UEs.

D2D cache hit rate for different numbers of UEs. In Fig. 4 (a),we observe that the average downloading latency increaseswith the number of UEs in all caching schemes, since theresources in the cell are constrained and the link bandwidthcapacity shared by UEs decreases with more UEs. FromFig. 4 (b) and (c), we can see that the percentage of trafficoffloading and the D2D cache hit rate increase with the numberof UEs for all caching schemes. This is because that with theincrease of the number of UEs, each UE has more neighborUEs to connect and more content requests can be satisfied byD2D transmissions. The D2D cache hit rate of the JAL-basedcaching scheme is significantly higher than that of the IL-based, LRU and LFU caching schemes. Compared with theIL-based and LRU caching schemes, the gain of the JAL-based caching scheme in terms of D2D cache hit rate isapproximately 40% and 25% respectively when the numberof UEs is 1000.

Finally, we examine the impact of the shape factor ofthe content popularity distribution (ZipF) γ on the averagedownloading latency, the percentage of traffic offloading andthe D2D cache hit rate in Fig. 5. In Fig. 5 (a) and (b),we can see that when γ ranges from 0.2 to 1, the

average downloading latency decreases and the percentageof traffic offloading increases for all schemes. The rea-sons are as follows. When γ is large, the vast major-ity of user requests is concentrated on a small numberof content items. Clearly, caching the most popular con-tent items provides more significant benefits. In Fig. 5 (c),we can see that when γ is large, the D2D cache hit rate ofIL-based caching, JAL-based caching, IUB, LFU becomessmaller with the increase of γ. This is because that whenγ increases, the content popularity becomes more con-centrated, and thus local caching becomes more effective.In Fig. 5 (c), when γ is large, the D2D cache hitrate of IL-based caching decreases and the D2D cachehit rate of LRU increases with γ. It leads to an inter-section of the D2D cache hit rate curves of IL-basedand LRU caching schemes when γ is around 0.5. This isbecause that more content requests can be satisfied by localcache with the increase of γ in the IL-based caching scheme,while LRU ignores the local cache efficiency. Note that asshown in Fig. 5 (b), the percentage of traffic offloading ofIL-based caching is higher than that of LRU when IL-basedcaching and LRU have the same D2D cache hit rate, since the

Page 11: Multi-Agent Reinforcement Learning for Efficient Content ...

1620 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

Fig. 5. The average downloading latency, the percentage of traffic offloading and the D2D cache hit rate of IL-based, JAL-based, IUB, LRU, LFU cachingschemes for different shape factors of ZipF distribution.

local cache hit rate of IL-based caching can be significantlyimproved by learning from the history of observed contentdemands.

VII. CONCLUSIONS AND FUTURE WORK

In this paper, we proposed content caching strategies formobile D2D networks based on multi-agent reinforcementlearning. Specifically, UEs are treated as agents, content itemsas arms, caching decisions as actions, the reduction of down-loading latency as caching reward. We then formulate theD2D caching problem as a multi-agent multi-armed bandit(MAB) learning problem to maximize the expected totalcaching reward. UEs can be independent learners (ILs) ifthey learn the Q-values of their own actions and can be jointaction learners (JALs) if they learn the Q-values of their ownactions in conjunction with those of other UEs. As the actionspace is very large leading to high computational complexity,a modified combinatorial upper confidence bound algorithmwas proposed to reduce the action space for both IL and JAL.Simulation results show that the proposed JAL-based cachingscheme outperforms IL-based caching scheme and other pop-ular caching schemes in terms of average downloading latencyand cache hit rate.

The successful deployment of video streaming in a mobileD2D network faces many challenges and will be addressed asfuture work. First, there are four parties involved, namely thecontent owner, the content provider, the cellular carrier andthe users. They need to have their interests aligned. Second,although there are many user-generated-content free for dis-tribution like what we find in Youtube, there are also manycopyrighted contents that cannot be redistributed without con-sent. Ways to track the scope of distribution in D2D networksand ways to collect royalties need to be worked out. Third,the content provider needs to pay for the distribution cost.Like CDN and P2P streaming, D2D network can significantlyreduce traffic through intelligent caching as demonstratedin this paper. Fine-tuning the algorithm for specific trafficparameters and network settings would be of interest. Fourth,direct communication between nearby mobile devices needs

a protocol. The participating devices also need mutual consentto the joint effort of sharing videos. Trust between devicesis hard to establish except through a common trusted agent.Who should play the role of this agent? Fifth, could WiFiad hoc mode be a substitute or a backup? Sixth, the numberof neighbors a device has depends on its transmission range.What determines the optimal range?

REFERENCES

[1] Cisco. (2017). Cisco Visual Networking Index: Forecast andMethodology, 2016–2021. [Online]. Available: http://www.cisco.com/c/en/us/solutions/collateral/service-provider/visual-networking-index-vni/complete-white-paper-c11-481360.html

[2] J. Erman, A. Gerber, M. Hajiaghayi, D. Pei, S. Sen, and O. Spatscheck,“To cache or not to cache: The 3G case,” IEEE Internet Comput., vol. 15,no. 2, pp. 27–34, Mar./Apr. 2011.

[3] L. Qiu and G. Cao, “Popularity-aware caching increases the capacityof wireless networks,” in Proc. IEEE Int. Conf. Comput. Commun.(INFOCOM), May 2017, pp. 1–9.

[4] A. Passarella, “A survey on content-centric technologies for the currentInternet: CDN and P2P solutions,” Comput. Commun., vol. 35, no. 1,pp. 1–32, 2012.

[5] X. Wang, M. Chen, T. Taleb, A. Ksentini, and V. C. M. Leung, “Cachein the air: Exploiting content caching and delivery techniques for 5Gsystems,” IEEE Commun. Mag., vol. 52, no. 2, pp. 131–139, Feb. 2014.

[6] S. Müller, O. Atan, M. van der Schaar, and A. Klein, “Context-aware proactive content caching with service differentiation in wire-less networks,” IEEE Trans. Wireless Commun., vol. 16, no. 2,pp. 1024–1036, Feb. 2017.

[7] B. N. Bharath, K. G. Nagananda, and H. V. Poor, “A learning-basedapproach to caching in heterogenous small cell networks,” IEEE Trans.Commun., vol. 64, no. 4, pp. 1674–1686, Apr. 2016.

[8] K. Shanmugam, N. Golrezaei, A. G. Dimakis, A. F. Molisch, andG. Caire, “FemtoCaching: Wireless content delivery through distrib-uted caching helpers,” IEEE Trans. Inf. Theory, vol. 59, no. 12,pp. 8402–8413, Dec. 2013.

[9] K. Poularakis, G. Iosifidis, V. Sourlas, and L. Tassiulas, “Exploitingcaching and multicast for 5G wireless networks,” IEEE Trans. WirelessCommun., vol. 15, no. 4, pp. 2995–3007, Apr. 2016.

[10] J. Wen, K. Huang, S. Yang, and V. O. K. Li, “Cache-enabled hetero-geneous cellular networks: Optimal tier-level content placement,” IEEETrans. Wireless Commun., vol. 16, no. 9, pp. 5939–5952, Sep. 2017.

[11] Y. Cui, D. Jiang, and Y. Wu, “Analysis and optimization of cachingand multicasting in large-scale cache-enabled wireless networks,” IEEETrans. Wireless Commun., vol. 15, no. 7, pp. 5101–5112, Jul. 2016.

[12] Z. Chen, J. Lee, T. Q. S. Quek, and M. Kountouris, “Cooperative cachingand transmission design in cluster-centric small cell networks,” IEEETrans. Wireless Commun., vol. 16, no. 5, pp. 3401–3415, May 2017.

Page 12: Multi-Agent Reinforcement Learning for Efficient Content ...

JIANG et al.: MULTI-AGENT REINFORCEMENT LEARNING FOR EFFICIENT CONTENT CACHING 1621

[13] C. Yang, Y. Yao, Z. Chen, and B. Xia, “Analysis on cache-enabledwireless heterogeneous networks,” IEEE Trans. Wireless Commun.,vol. 15, no. 1, pp. 131–145, Jan. 2016.

[14] K. Doppler, M. Rinne, C. Wijting, C. B. Ribeiro, and K. Hugl, “Device-to-device communication as an underlay to LTE-advanced networks,”IEEE Commun. Mag., vol. 47, no. 12, pp. 42–49, Dec. 2009.

[15] D. Feng, L. Lu, Y. Yuan-Wu, G. Li, S. Li, and G. Feng, “Device-to-device communications in cellular networks,” IEEE Commun. Mag.,vol. 52, no. 4, pp. 49–55, Apr. 2014.

[16] L. Dignan. (2017). 300 Million Smartphones Will Have MachineLearning Ability, Says Deloitte. [Online]. Available: http://www.zdnet.com/article/300-million-smartphones-will-have-machine-learning-ability-says-deloitte/

[17] M. Ji, G. Caire, and A. F. Molisch, “Fundamental limits of cachingin wireless D2D networks,” IEEE Trans. Inf. Theory, vol. 62, no. 2,pp. 849–869, Feb. 2016.

[18] H. J. Kang and C. G. Kang, “Mobile device-to-device (D2D) contentdelivery networking: A design and optimization framework,” J. Com-mun. Netw., vol. 16, no. 5, pp. 568–577, Oct. 2014.

[19] M. Gregori, J. Gómez-Vilardebó, J. Matamoros, and D. Gündüz,“Wireless content caching for small cell and D2D networks,”IEEE J. Sel. Areas Commun., vol. 34, no. 5, pp. 1222–1234,May 2016.

[20] W. Jiang, G. Feng, and S. Qin, “Optimal cooperative contentcaching and delivery policy for heterogeneous cellular networks,”IEEE Trans. Mobile Comput., vol. 16, no. 5, pp. 1382–1393,May 2017.

[21] E. Bastug, M. Bennis, and M. Debbah, “Living on the edge: The roleof proactive caching in 5G wireless networks,” IEEE Commun. Mag.,vol. 52, no. 8, pp. 82–89, Aug. 2014.

[22] E. Bastug, M. Bennis, and M. Debbah, “A transfer learning approachfor cache-enabled wireless networks,” in Proc. IEEE 13th Int. Symp.Modeling Optim. Mobile, Ad Hoc, Wireless Netw. (WiOpt), May 2015,pp. 161–166.

[23] P. Blasco and D. Gündüz, “Learning-based optimization of cache contentin a small cell base station,” in Proc. IEEE Int. Conf. Commun. (ICC),Jun. 2014, pp. 1897–1903.

[24] A. Sengupta, S. Amuru, R. Tandon, R. M. Buehrer, and T. C. Clancy,“Learning distributed caching strategies in small cell networks,” in Proc.IEEE 11th Int. Symp. Wireless Commun. Syst. (ISWCS), Aug. 2014,pp. 917–921.

[25] B. Bai, L. Wang, Z. Han, W. Chen, and T. Svensson, “Cachingbased socially-aware D2D communications in wireless content deliverynetworks: A hypergraph framework,” IEEE Wireless Commun., vol. 23,no. 4, pp. 74–81, Aug. 2016.

[26] B. Chen and C. Yang, “Caching policy optimization for D2D communi-cations by learning user preference,” in Proc. IEEE 85th Veh. Technol.Conf. (VTC Spring), Jun. 2017, pp. 1–6.

[27] W. Jiang, G. Feng, S. Qin, and T. S. P. Yum, “Efficient D2D con-tent caching using multi-agent reinforcement learning,” in Proc. IEEEINFOCOM WKSHPS, Apr. 2018, pp. 511–516.

[28] X. Zhuo, W. Gao, G. Cao, and S. Hua, “An incentive framework forcellular traffic offloading,” IEEE Trans. Mobile Comput., vol. 13, no. 3,pp. 541–555, Mar. 2014.

[29] W. Chen, Y. Wang, and Y. Yuan, “Combinatorial multi-armed bandit:General framework and applications,” in Proc. Int. Conf. Mach. Learn.,2013, pp. 151–159.

[30] J. Hu and M. P. Wellman, “Nash Q-learning for general-sum stochasticgames,” J. Mach. Learn. Res., vol. 4, pp. 1039–1069, Nov. 2003.

[31] J. Nash, “Non-cooperative games,” Ann. Math., vol. 54, no. 2,pp. 286–295, 1951.

[32] S. Kapetanakis, D. Kudenko, and M. J. A. Strens, “Reinforcementlearning approaches to coordination in cooperative multi-agent systems,”in Adaptive Agents and Multi-Agent Systems. Berlin, Germany: Springer,2003, pp. 18–32.

[33] C. Claus and C. Boutilier, “The dynamics of reinforcement learn-ing in cooperative multiagent systems,” in Proc. AAAI/IAAI, 1998,pp. 746–752.

[34] L. Breslau, P. Cao, L. Fan, G. Phillips, and S. Shenker, “Web cachingand Zipf-like distributions: Evidence and implications,” in Proc. IEEEINFOCOM, Mar. 1999, pp. 126–134.

[35] A. A. Korbut and I. K. Sigal, “Exact and greedy solutions of the knap-sack problem: The ratio of values of objective functions,” J. Comput.Syst. Sci. Int., vol. 49, no. 5, pp. 757–764, 2010.

[36] D. Kalathil, N. Nayyar, and R. Jain, “Decentralized learning for mul-tiplayer multiarmed bandits,” IEEE Trans. Inf. Theory, vol. 60, no. 4,pp. 2331–2345, Apr. 2014.

[37] M. Abrams, C. R. Standridge, G. Abdulla, E. A. Fox, and S. Williams,“Removal policies in network caches for world-wide web documents,”ACM SIGCOMM Comput. Commun. Rev., vol. 26, no. 4, pp. 293–305,1996.

[38] M. Arlitt, L. Cherkasova, J. Dilley, R. Friedrich, and T. Jin, “Evaluatingcontent management techniques for web proxy caches,” ACM SIGMET-RICS Perform. Eval. Rev., vol. 27, no. 4, pp. 3–11, 2000.

Wei Jiang received the B.S. degree from the Schoolof Communication and Information Engineering,Chongqing University of Posts and Telecommu-nications, in 2013. She is currently pursuing thePh.D. degree with the School of Communicationand Information Engineering, University of Elec-tronic Science and Technology of China. She was aVisiting Ph.D. Student with The Pennsylvania StateUniversity, State College, PA, USA, from 2017 to2018. Her current research interests include next-generation cellular networks, machine learning and

content caching, and distribution techniques in heterogeneous networks.

Gang Feng (M’01–SM’06) received the B.Eng. andM.Eng. degrees in electronic engineering from theUniversity of Electronic Science and Technology ofChina in 1986 and 1989, respectively, and the Ph.D.degree in information engineering from The ChineseUniversity of Hong Kong in 1998. In 2000, he joinedthe School of Electric and Electronic Engineering,Nanyang Technological University, as an AssistantProfessor, and was promoted to an Associate Pro-fessor in 2005. He is currently a Professor with theNational Laboratory of Communications, University

of Electronic Science and Technology of China.He has extensive research experience and has published widely in computer

networking and wireless networking research. His research interests includeartificial intelligence enabled wireless access and content distribution, andnext-generation cellular networks. He is a Senior Member of the IEEE.

Shuang Qin received the B.S. degree in electronicinformation science and technology and the Ph.D.degree in communication and information systemfrom the University of Electronic Science and Tech-nology of China (UESTC) in 2006 and 2012, respec-tively. He is currently an Associate Professor withthe National Key Laboratory of Science and Tech-nology on Communications, UESTC. His researchinterests include cooperative communication in wire-less networks and data transmission in opportunisticnetworks.

Page 13: Multi-Agent Reinforcement Learning for Efficient Content ...

1622 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS, VOL. 18, NO. 3, MARCH 2019

Tak Shing Peter Yum (F’13) was born in Shanghai,China. He received the B.S., M.S., M.P.H., and Ph.D.degrees from Columbia University, New York, NY,USA, in 1974, 1975, 1977, and 1978, respectively.He received primary and secondary school educa-tion in Hong Kong. In 1978, he joined the BellTelephone Laboratories, focusing on switching andsignaling systems for 2.5 years. Then, he taughtat National Chiao Tung University, Taiwan, fortwo years. He joined The Chinese University ofHong Kong in 1982. He is currently with Zhejiang

Lab, Hangzhou, China. He was the appointed Chairman of the IE Departmenttwice and was an Elected Dean of Engineering for two terms, from 2004 to2010. Since 2010, he took a no-pay leave from CUHK to serve as a CTOfor Hong Kong Applied Science and Technology Research Institute CompanyLimited. He is a fellow of the IEEE.

Guohong Cao is currently a Distinguished Professorwith the Department of Computer Science and Engi-neering, The Pennsylvania State University, StateCollege, PA, USA. He has published more than200 papers which have been cited over 20 000 times,with an h-index of 74. His research interests includewireless networks, mobile systems, wireless securityand privacy, and the Internet of Things. He is afellow of the IEEE. He was a recipient of severalbest paper awards, including the IEEE INFOCOMTest of Time Award, and the NSF CAREER Award.

He has served on the Editorial Boards of the IEEE TRANSACTIONS ON

MOBILE COMPUTING, the IEEE TRANSACTIONS ON WIRELESS COMMU-NICATIONS, and the IEEE TRANSACTIONS ON VEHICULAR TECHNOLOGY.He has served on the organizing and technical program committees ofmany conferences, such as the TPC Chair/Co-Chair of IEEE SRDS, MASS,and INFOCOM.