{'fraction_non_alphanumeric': 0.03970065956367326, 'fraction_numerical': 0.008667343142228986, 'mean_word_length': 4.166666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the Network-Wide Gain of Memory-Assisted Source Coding

Several studies have identified a significant amount of redundancy in the network traffic. For example, it is demonstrated that there is a great amount of redundancy within the content of a server over time. This redundancy can be leveraged to reduce the network flow by the deployment of memory units in the network. The question that arises is whether or not the deployment of memory can result in a fundamental improvement in the performance of the network. In this paper, we answer this question affirmatively by first establishing the fundamental gains of memory-assisted source compression and then applying the technique to a network. Specifically, we investigate the gain of memory-assisted compression in random network graphs consisted of a single source and several randomly selected memory units. We find a threshold value for the number of memories deployed in a random graph and show that if the number of memories exceeds the threshold we observe network-wide reduction in the traffic.


I. INTRODUCTION
Several studies have demonstrated the existence of considerable amount of redundancy in the Internet data traffic, where a few major dimensions have been identified as the main sources of redundancy in the network traffic. For example, the contents of a web server contains more than 60% redundant data on the average within a ten-day period [1]. Further, there are some popular files in each server that may be requested by several clients in the network. This redundancy in the data may be leveraged to reduce the communication within the network. The existing redundancy elimination techniques are mostly based on end-to-end caching mechanisms, where the redundant content is only cached in the server and the client for future reference [2]. However, these end-to-end approaches do not efficiently leverage the redundancy in the network because there is no memorization in today's Internet except end-to-end caching mechanisms [1].
Recently, a few studies considered the deployment of redundancy elimination techniques within the network [3], [4], where the intermediate nodes in the network have been assumed to be capable of caching of the previous communication and processing of the data. These works studied the network flow reduction via ad-hoc solutions such as deduplication of the repeated segments of the traffic without any connection to the information theory. The objective of this paper is to study this problem from an information theoretic point of view. We assume that some intermediate nodes (referred to as memory nodes) are capable of the memorization (to be defined later) of the previous communications which have passed through them. We further assume that the memorized content will be used in a memory-assisted source coding in the network, which we refer to as network flow compression with memory. However, several questions remain open regarding memory-assisted compression of the network flow. Does the deployment of memory in the network provide any fundamental benefit over end-to-end solutions? How much saving could be achieved using network compression? How can the savings be achieved?
This paper attempts to answer the above fundamental questions. To the best of our knowledge, this is the first work which addresses the memory-assisted redundancy elimination of the flow from the information theoretic point of view. The data that is transmitted inside the network have different spatial and temporal probability distributions. Thus, prior knowledge of the probability distributions underlying the contents may not be assumed. Hence, one important characteristic of any compression solution is that it must be universal in the sense that it must be able to remove redundancy without knowing the statistics and nature of the data [5], [6].
In this paper, we focus our study on the fairly broad class of parametric information sources, which include the class of Markov sources of any finite order [7]. We formulate the problem as memory-assisted compression of the network flow, where the redundancy in the traffic data is to be removed. In this context, the redundancy elimination could be viewed as universal source coding, where the goal is to represent the data with a minimum length codeword [7]. However, as we will discuss in Sec. II, this problem is different from the distributed source coding problem because of memory units. We investigate the fundamental gain of the memoryassisted network flow compression over end-to-end universal compression techniques, where the content is compressed at the server and routed via routers without any memorization inside the network. Throughout this paper, we focus on the problem involving a single source (content server) that is fixed in the network and extensions to multiple sources is left as future work.
In what follows, we first describe the memory-assisted source coding in Sec. II. The memory deployment problem and the gain of memorization in networks is discussed in Sec. III. In Sec. IV we study memory-assisted network flow compression on Erdős-Rényi (ER) random graphs and find a threshold value for the number of memory units. Finally, simulation results are provided in Sec. V.

II. MEMORY-ASSISTED SOURCE CODING
In what follows, we introduce the memory-assisted source coding via the sample network depicted in Fig 1, which is consisted of a server S, a memory unit µ (which also acts as a router), and the clients C 1 and C 2 . We assume that the communication is as follows. First, client C 1 , who has not previously communicated with the server, acquires the sequence f 1 from the server through the intermediate node µ. Next, client C 2 , who also has not previously communicated with S, acquires the sequence f 2 from S through µ. In order to show the benefits of the deployment of memory in the router, we compare three schemes: • NcompNmem (No compression with no memory), which does not apply any compression and does not utilize the memory unit. • UcompNmem (Universal compression with no memory), which only applies end-to-end universal source coding at the source without using the memory unit. • UcompWmem (Universal compression with memory), which assumes that the router has memory and utilizes the memory unit when compressing the data at the source. In all of the above scenarios, we assume that the client has no previous communication with the server since it is usually the case in networks. On the other hand, the memory/router is capable of memorizing the communication of f 1 between S and C 1 in order to better compress f 2 (on the link from S to µ) that is then being delivered to C 2 . We will later demonstrate that even if sequences f 1 and f 2 are independent given that the source model is known, the memorization of f 1 in µ can result in the reduction of the communication for the transfer of f 2 from S to C 2 . This seemingly counter intuitive phenomenon is due to the fact that the source model is not known a priori (at µ). The underlying source coding must be universal, which imposes a compression overhead when the length of the sequence is finite (small) [7]. On the other hand, sequence f 1 does indeed contain some information about the unknown source parameters to the extent that an infinite length sequence f 1 can be used to identify all of the unknown parameters of the source. This side information can be memorized at the memory unit µ and the source S for the compression of f 2 . Then the memory unit can decode f 2 using the side information and send f 2 to C 2 . It is important to note that the saving of memory-assisted compression in terms of flow reduction is observed in the S −µ link. For example, if f 1 and f 2 are unit size and the memorization helps to compress f 2 by a factor of 2, the total flow is reduced from 1 + 1, to 0.5 + 1 bit×hop, where there is a gain 2 in the link between S and µ.
While relevant, the memory-assisted source coding problem is different from those addressed by distributed source compression techniques (i.e., the Slepian Wolf problem) that target multiple correlated sources sending information to the same destination [8], [9]. As described in the above example, the memory-assisted source coding gain is due to the fact that the source parameter is unknown. Therefore, when the length of the sequence f 2 increases, the memory-assisted source coding gain, with respect to UcomNmem, vanishes since the source parameter can be well estimated using the sequence, and hence, f 2 can be compressed to fundamental limit (i.e., entropy rate). On the other hand, in the Slepian-Wolf, the gains are achievable in the asymptotic regime. Further, the memorization of a sequence f 1 that is independent of the sequence f 2 can result in a gain in memory-assisted compression of f 2 whereas, in the Slepian-Wolf problem, the gain is due to the bit by bit correlation between the two sequences. The memory-assisted compression problem is also distinct from the lossless source coding techniques such as LZ and CTW that simply remove redundancy in a single piece of content without regard to any memorization at the intermediate node µ [5], [6]. Next, we characterize the benefits of network memory in the context of a universal source coding problem for the class of smooth parametric sources [7], [10]. Let l(C n , x n ) = l n (x n ) denote the length function that describes the codeword associated with the sequence x n . The expected codeword length El n (X n ) quantifies the compression performance of UcompNmem, where E[·] denotes the expectation operator. For an asymptotically optimal code in the sense that it achieves the entropy rate, we have 1 n (El n (X n ) − H n (X n )) → 0 as n → ∞, where H n (X n ) denotes the entropy of a sequence of length n. In the case that the router is capable of memorization (UcompWmem), assume that y m is another sequence of length m from the same source that generates x n . By context memorization, we mean that both the source S and the memory unit µ have already visited the sequence y m . Let l n|m be a regular length function where S and µ have access to a context memory of length m from the previous communications. Then, the expected codeword length with memory El n|m (X n ) characterizes the compression performance of UcompWmem for x n in the link from S to µ, in Fig 1. Let Q(l n , l n|m ) be defined as the ratio of the expected codeword length of UcompNmem to that of UcompWmem as Further, let ǫ be a real number such that 0 < ǫ < 1. We denote g(n, m, ǫ) as the fundamental gain of the context memorization on the family of parametric sources on a sequence of length n using a context sequence of length m for a fraction 1 − ǫ of the sources, which is defined as follows: In other words, the fundamental gain of memorization is at least g(n, m, ǫ) for a fraction 1−ǫ of the sources in the family. In [10], Beirami and Fekri studied the fundamental limits of compression without memory. In [7], they extended their study to the behavior of the memorization gain g(n, m, ǫ) with respect to the sequence length and the memory size for different source models. In the rest of this paper, we investigate the effect of the context memorization gain on a network given that the memory-assisted compression gain g(n, m, ǫ) (hereafter, referred as g) is known.

III. MEMORY DEPLOYMENT PROBLEM IN NETWORKS
In this section, we will investigate the memorization gain on a network. A network is represented by an undirected graph G(V, E) where V is the set of N nodes (vertices) and E = {uv : u, v ∈ V } is the set of edges connecting nodes u and v. We consider a single source S which is the content server, and a set of memories µ = {µ i } M i=1 chosen out of N nodes. The content server is assumed to be a parametric information source [7]. We assume that each client requests a small to moderate length size sequence from the content server. As discussed in Sec. II, there is a fundamental limit beyond the entropy on the universal compression of a small to moderate length sequence. Therefore, UcompNmem will only be able to compress the content to a value which may be significantly larger than the entropy of the sequence. On the other hand, a memory nodes µ i is capable of memorizing the communication between the server and some client node C i .
To investigate the gain of memorization in the compression of the network flow, we must consider two phases. The first is the memorization phase in which we may assume all memory units have visited some sufficiently long sequence (or equivalently, a sufficient collection of small to moderate length sequences) from the source. This phase is realized in actual communication networks by observing the fact that a sufficient number of clients may have previously retrieved small to moderate length sequences from the server such that, via their routing, each of the memory units has been able to memorize the source. In the second phase, which is the subject of this section, we assume each node in the entire network may request (a small to moderate length) content from the server, uniformly. Our goal is to characterize the memorization gain in the compression of the sequences that are retrieved in the second phase. The above view simplifies our study as we are not concerned with the transition phase during which the memorization is taking place in the memory units. Hence, we can assume each memory unit will provide the same memory-assisted compression gain of g of the link from source to itself that depends on the length of the sequence that is being transmitted as well as the length of the sequence that is memorized in the memory unit, as described in Sec. II.
The goal of the memory deployment is to minimize the total cost of communication between the source and destinations in the network, measured by bit×hop, by deploying a set of memories µ. We wish to study the behavior of the total savings in terms of bit×hop, as a function of the number of The shortest walk between the source and destination is not necessarily a path when we have memory in network. the memories, place of memories, size of memories, length of the sequences, and the information source model.
In a network with source S and a set of destinations , let f D be the flow destined to D ∈ D. The distance between any two nodes u and v is shown by  d(u, v). The distance is measured as the number of hops in the shortest path between two nodes. As we will see later, introducing memories to the network will change the lowest cost paths from the source to destinations, as there is a gain associated with the S − µ portion of the path. Therefore, we have to modify paths accounting for the gain of memories. Accordingly, for each destination D, we define effective walk, denoted by W D = {S, u 1 , . . . , D}, which is the ordered set of nodes in the modified (lowest cost) walk between the source and D. Then, we partition the set of destinations as (3) Using (3), we defined D , called the effective distance from source to D, aŝ In short, the effective distance is the distance when memoryassisted source compression is performed and hence the gain g applies. By definition,d D ≤ d(S, D) ∀D. For simplicity, we assume f D = 1 for all destinations. Hence, F = D∈Dd D .
In a general network where every node can be a client, we define a generalized network-level gain of memory deployment as a function of memorization gain g, as follows: where F 0 is the total flow in the network under UcompNmem, i.e., F 0 = D∈D d(S, D).
In order to show the challenges of the memory deployment problem, we show as to how a single memory changes the effective paths in a network with a single source. Consider the network with the source node S placed as shown in Fig. 2.
The destinations are nodes C 1 , . . . , C 4 , and g = 4. The effective walks from the source to destinations are obviously the shortest paths when there is no memorization (UcompNmem). As shown in the figure, the placement of memory changes the effective path to C 2 while the shortest paths from the source to C 1 , C 3 , and C 4 are the same as the effective paths. Without memory, the shortest path to C 2 is two hops long (S → C 1 → C 2 ), while the memory totally changes the effective walk distance to C 2 tod C2 = 3 4 + 1 as depicted in the figure.
In order to extend our study to analyze the achievable gains in general networks and study the behavior of G(g), in the next section, we consider the memory deployment gain in the network graphs that resemble the ER random graph [11]. The ER random graph is the building block of the recent models for complex graphs and hence the results would be useful in much broader contexts. We specifically direct our attention to connected random graphs since they better describe real networks.

IV. GAIN OF MEMORY DEPLOYMENT ON THE NETWORK FLOW COMPRESSION
Definition 1: An ER random graph G(N, p) is an undirected, unweighted graph on N vertices where every two vertices are connected with probability p.
Definition 2: Let u, v ∈ G be any two vertices. The diameter of a connected graph is defined as max u,v d(u, v). Similarly, the average distance of a connected graph is defined The following properties hold for ER random graphs: 1) If p < (1−ǫ) G (N, p) is a.s. connected and every vertex asymptotically has degree c log N [12].
3) The diameter of G(N, p) is almost surely log N log N p . 4) The average distance in G(N, p), denoted byd, is provided that log N log N p goes to infinity as N → ∞ (this condition is satisfied in the connected regime) [13]. Again, the main question is how G(g) scales with M . In order to characterize the gain of memory placement, we consider connected G (N, p), p = c log N N , with a single source node S and all other nodes as destinations. Since the expected degree of all nodes in ER graph is the same and every vertex is a destination with equal probability, we select memories {µ i } M i=1 uniformly and random. Theorem 1, below, provides the scaling of G(g) with respect to M : Theorem 1: Suppose M is the number of deployed memories in an ER random graph. Let ǫ be a positive real number.
(a) If M = O N 1 g −ǫ , then G(g) ∼ 1. 1 1 In this paper, we have used the following asymptotic notation: f (x) ∼ g(x) iff f (x)/g(x) → 1. For the second part, we find a lower bound on the number of benefiting destinations.
To characterize G(g), we first need to find F 0 . The average distance from the source to a node isd. Thus, F 0 = Nd. For large N , (6) results in F 0 ∼ N log N log log N . Next, we need to find F . For every memory µ we consider a neighbourhood N r (µ) as shown in Fig. 3. This neighborhood consist of all vertices v within distance r from µ. We choose r such that, almost surely, all nodes in N r (µ) would benefit from the memory µ. Clearly, if d(S,µ) g + r = d(S, v), the benefit of the memory for node v vanishes and only nodes at distances less than r benefit from the memory µ. Given g, we denote this set of nodes benefiting from µ by N r (µ, g).
Since memories are uniformly placed, the average value of d(S, µ) ind v is equal tod. Similarly, the average of d(S, v) is alsod. Hence, solving for r in (7) and then using the result on the average distance in (6), we conclude r a.s.
Using Lemma 2 and (8), we deduce that Therefore, the total number of nodes gaining from the memories is upper-bounded by M i=1 |N r (µ i , g)| ≤ M (1 + 2ǫ)N 1−1/g . As we will see, from (9) Fig. 3. Memory Neighborhood where inequality in (10) follows from the double counting of the destination nodes that may reside in more than one neighborhood. Also, (11) follows from replacing (9) in (10).
Since we need more than n 1 g memory units to have a network-wide gain, the next question is as to how G(g) scales when the number of memory units exceeds n 1 g . To answer this question, we need to establish a lower-bound on the neighborhood size and the number of nodes benefiting from memory. Further, we have to account for the possible double counting of the intersection between the memory neighborhoods. We use the following concentration inequality from [13] to establish the desired bound.
This inequality will be helpful to show that the quantities of interest concentrate around their expected values.
The following lemma provides a lower-bound on the neighborhood size |N r (µ, g)| and the lower-bound on G(g), as we show, is immediate.
Lemma 4: Consider a set of vertices V of G(N, p) such that |V | N = o(1). For 0 < ǫ < 1, with probability at least 1 − e −N p|V |ǫ 2 /2 , we have Proof: The vertex boundary of V , denoted by Γ(V ), consists of all vertices in G adjacent to some vertex in V .
Let X u be the indicator random variable that a vertex u is in Γ(V ), i.e., P[X u = 1] = P[u ∈ Γ(V )]. Then, where the inequality in (13) follows from and the second part holds because |V | N = o(1). Since, X u 's are non-negative independent random variables, by applying Proposition 3 with λ = αE[|Γ(V )|], with probability at least 1 − e −α/2 we have By picking a single vertex and applying (14) inductively r times, and then adding up the number of adjacent nodes, we obtain (12). Now that we have a lower-bound on the number of nodes benefiting from each memory, we show that by increasing the number of memories beyond M = N 1 g , memories cover all the nodes in the graph effectively and hence all the nodes would gain from the memory placement.
In order to limit the intersection between the neighborhoods, we reduce r to r δ as below: With this choice of r δ , by lemmas 2 and 4, we deduce that the probability that a random node u ∈ G belongs to the neighborhood N r δ (µ i , g) of the memory µ i is N −1/g−δ .
Hence, the expected number of the covered nodes is where (16) holds by choosing M = N 1/g+δ . To show that the number of covered nodes is concentrated around its mean, we use Prop. 3 again with λ = αE [|∪N r δ (µ i , g)|]. Then, with probability at least 1−e −α/2 we have Hence, the memories cover, almost surely, all of the nodes.
Since all nodes are covered with high probability, we can associate each node with a neighborhood |N r δ (µ i , g)|, for which nodes' distances in the neighborhood from memory are (1 − o(1))r δ .
Proof of Theorem 1(b): By (16), we can bound the network-wide gain of the memory from below. We have G(g) a.s.

=
Nd (d/g + r δ )N (17) where (17) holds because the distance of the nodes from memory is r δ , asymptotically almost surely.
As the number of memories becomes close to N , i.e., δ → (1 − 1 g ), the gain G → g, as expected. In the next section, we verify our result in memory-assisted source coding and the network-wide gain of memory via numerical simulations.

V. SIMULATION RESULTS
In this section, we first demonstrate our theoretical results through an example. We consider the source to be a first-order Markov source with alphabet size equal to 256. In [7], Beirami and Fekri derived a lower bound on the memorization gain as a function of the sequence length and the memory size. For example, they showed that g(512kB, 8MB, 0.05) is about 1.25, i.e., with a memory of 8MB, a gain of 1.25 is obtained on the memory-assisted compression of 512kB long sequences [7]. Fig. 4 presents the simulation results for network-wide gain for different network sizes versus log N (M ) when g = 1.25. The rightmost solid curve is our theoretical result in (17). For small values of M , the network-wide gain would be 1 for N → ∞, while for large M , G tends to g. Also, as N increases, simulation results approach the theoretical limit for both small and large values of M .