# Winning the lottery with neural connectivity constraints: faster learning
across cognitive tasks with spatially constrained sparse RNNs

Mikail Khona∗
Physics
MIT
<EMAIL_ADDRESS>
Sarthak Chandra∗
Brain and Cognitive Sciences
MIT
<EMAIL_ADDRESS>
Joy J. Ma
Physics
MIT
<EMAIL_ADDRESS>
Ila Rani Fiete
Brain and Cognitive Sciences
MIT
<EMAIL_ADDRESS>

###### Abstract

Recurrent neural networks (RNNs) are often used to model circuits in the
brain, and can solve a variety of difficult computational problems requiring
memory, error-correction, or selection (Hopfield, 1982; Maass et al., 2002;
Maass, 2011). However, fully-connected RNNs contrast structurally with their
biological counterparts, which are extremely sparse ($\sim 0.1$%). Motivated
by the neocortex, where neural connectivity is constrained by physical
distance along cortical sheets and other synaptic wiring costs, we introduce
locality masked RNNs (LM-RNNs) that utilize task-agnostic predetermined graphs
with sparsity as low as 4%. We study LM-RNNs in a multitask learning setting
relevant to cognitive systems neuroscience with a commonly used set of tasks,
20-Cog-tasks (Yang et al., 2019). We show through reductio ad absurdum that
20-Cog-tasks can be solved by a small pool of separated autapses that we can
mechanistically analyze and understand. Thus, these tasks fall short of the
goal of inducing complex recurrent dynamics and modular structure in RNNs. We
next contribute a new cognitive multi-task battery, Mod-Cog, consisting of
upto 132 tasks that expands by $\sim 7$-fold the number of tasks and task-
complexity of 20-Cog-tasks. Importantly, while autapses can solve the simple
20-Cog-tasks, the expanded task-set requires richer neural architectures and
continuous attractor dynamics. On these tasks, we show that LM-RNNs with an
optimal sparsity result in faster training and better data-efficiency than
fully connected networks.

##  1 Introduction

Connectivity in biological neural networks are constrained by wiring-length
costs, with a preference towards shorter synapses. The neocortex is
effectively a two dimensional sheet which geometrically restricts physical
distances between neurons — correspondingly, the spatial extent of
connectivity in cortical circuits has been found to be significantly skewed
towards shorter connections(Ercsey-Ravasz et al., 2013; Markov et al., 2013;
Theodoni et al., 2022) (in particular connectivity extent appears to follow an
exponential distribution).

Inspired by such biological constraints, we modify the architecture of a
vanilla fully-connected RNN in one particular fashion — we construct a fixed
sparse graph chosen by allowing local connections among neurons laid on a two-
dimensional sheet. We then use this sparse graph for the RNN, by only training
weights between nodes that correspond to edges on the graph, and setting all
other weights to zero. We refer to an RNN in this set up as a ‘Locality Masked
RNN’ (LM-RNN). Another motivation for our work comes from continuous attractor
network models of grid cells (Khona et al., 2022), where it was shown
analytically that fixed and local topographic connectivity encouraged the
formation of discrete modules.

Exploiting such simple locality constraints in LM-RNNs, when applied to
multitask regimes relevant to cognitive systems neuroscience, results in
distinct advantages: these networks require far fewer parameters to train,
there is no cost to performance relative to an unconstained network, and in
fact learning is more rapid, sample-efficient and can acheive higher
asymptotic performance. In contrast to other machine-learning approaches to
network sparsification (see related work), we do not need any sophisticated
pruning methods, any algorithms to construct and modify sparse skeletons nor
any training data.

We focus our results on multitasking regimes for RNNs, by training them to
simultaneously learn many cognitive tasks. We expect our results on the
improvements conferred by LM-RNNs to primarily apply in this multitask
learning setting, where the recognition of modular structure across tasks is
important for generalization and effective learning.

Our main contributions are summarized by:

  * •

We show that LM-RNNs can perform as well or better than dense networks, when
accounting for the total number of nodes or the total number of synapses.
Locality masking is thus an efficient prescription for choosing sparse
subnetworks in a task agnostic and data independent fashion while still
achieving high performance.

  * •

We show that LM-RNNs reach this high performance faster and with lesser
training than dense networks, indicating that sparse networks may be
preferable to dense networks in memory and data-limited regimes for learning
multiple tasks.

  * •

We show that the tasks defined in (Yang et al., 2019) (an increasingly
commonly used set of 20 tasks (Driscoll et al., 2022; Hummos, 2022; Flesch et
al., 2022; Marton et al., 2021; Riveland and Pouget, 2022; da Costa et al.,
2019; Duncker et al., 2020; Masse et al., 2022; Kao et al., 2021) to study
representations in networks performing many cognitive tasks) can be solved by
a small pool of unconnected autapses, which is essentially a feedforward
structure.

  * •

Despite not have any lateral recurrent connections, the pool of autapses shows
the existence of cell clusters according to the nodal task variance metric
used in (Yang et al., 2019). Thus, our work reveals the limitations of using
correlations or covariances between neurons to study recurrent mechanisms of
computation. The shared inputs and input weights are a fundamental confound
when using metrics such as nodal task variance used in (Yang et al., 2019). We
thus highlight the need for creation of better metrics.

  * •

We mechanistically study how this pool of unconnected autapses solves 20-Cog-
tasks.

  * •

We then introduce Mod-Cog, a large battery consisting of upto 132 tasks
inspired by cognitive science problems such as interval estimation, mental
navigation and sequence generation which provides a useful setting to examine
multitask learning and representation across tasks relevant to cognitive
systems neuroscience.

###  1.1 Related work

Recent work has shown that effective pruning in recurrent networks can be done
by biologically pruning plausible algorithms based on noise correlations
between the presynaptic and postsynaptic neurons (Moore and Chaudhuri, 2020)
that preserve the spectrum. In vision neuroscience, recent works have studied
cortical topography by using a pretrained vision frontend with a readout layer
with an additional spatial loss to encourage spatially nearby cells to have
correlated receptive fields (Finzi et al., 2022; Lee et al., 2020a; Obeid and
Konkle, 2021). Other work has studied representations in RNNs trained to do
simple tasks that have been embedded in 3-dimensional space .

Several works in the realm of machine learning have tried to operationalize
the idea of sparsity. These methods can be roughly categorized into 2 main
classes:

Dense-to-sparse Ref. (Han et al., 2015) experimentally showed that training
followed by pruning and retraining can give sparse networks with no loss of
accuracy and ignited an interest in pruning methods. Following this work, the
lottery ticket hypothesis states that dense, randomly-initialized, feed-
forward networks contain subnetworks (“winning tickets”) that — when trained
in isolation — reach test accuracy comparable to the original network in a
similar number of iterations (Frankle and Carbin, 2018). The best method to
identify such winning tickets is Iterative Magnitude-based Pruning (IMP)
(Frankle and Carbin, 2018; Frankle et al., 2019), which is computationally
expensive and has to be run thoroughly for every different network. It has
also been shown that parameters of the sparse initialization distribution and
sign of weights at initialization are important factors (Zhou et al., 2019)
which determine winning tickets. Overall, iterative pruning and retraining
methods involve 3 steps: (1) pre-training a dense all-to-all model, (2)
pruning synapses based on some criteria, and (3) re-training the pruned model
to improve performance. This cycle needs to be done atleast once and in many
cases, multiple times, to get good performance. So this procedure requires at
least the same training cost as training a dense model and often even more
than that. In contrast, our proposed method for RNNs does not require seeing
any data before pruning and trains over only the sparse remaining synapses;
thus we do not require multiple cycles of pruning and training.

Other methods involving ways to encourage sparsity during the training process
include $L_{1}$(Lasso) regularization (Wen et al., 2018), $L_{0}$
regularization (Louizos et al., 2017; Savarese et al., 2020) and pruning using
dynamically varying thresholds (Narang et al., 2017; Kusupati et al., 2020).
Unfortunately, all of the aforementioned methods require training the original
dense network, in varying amounts, thus precluding the benefits that can be
obtained by having a predetermined exact sparsity on the computation during
training.

A class of methods which do not involve training data like SynFlow (Tanaka et
al., 2020), GraSP (Wang et al., 2020), SNIP (Lee et al., 2019, 2020b) and
FORCE (de Jorge et al., 2020) have been studied for only feedforward networks,
while we study RNNs.

Sparse-to-sparse Another line of work concerning sparse-to-sparse training is
most relevant to our study. This involves using a sparse interaction graph
which is used to mask gradient updates. Older works maintained a static graph
(Mocanu et al., 2016) and dealt only with feedforward networks but newer
methods such as dynamic sparse training (DST) (Evci et al., 2020; Liu et al.,
2021) have been proposed for both feedforward networks and RNNs which
dynamically improve the sparse graph and provide better performance. These
methods generally involve changing the topology of the sparse graph during
training. Ref. (Liu et al., 2021) considers static Erdos-Renyi (ER) type
sparse RNNs but for relatively denser values of sparsity (0.53 and 0.67) and
more complex architectures like stacked LSTMs and Recurrent Highway Networks
(Zilly et al., 2017). Here we explore more extreme values of sparsity ($\sim
5\%$ and below) and show that they are optimal in the context of multitask
learning regimes.

Lastly, static sparse networks have also found common usage in reservoir
computing architectures, where large sparse networks are preferred to fully-
connected networks to increase heterogeneity across nodes and allow for
“richer” dynamics (Jaeger, 2001; Lukoševičius and Jaeger, 2009).

##  2 Results

###  2.1 Locality masked RNNs (LM-RNNs)

Figure 1: Local connectivity constraint (locality masking) and schematic of
cognitive multitasking RNN.(a) In LM-RNNs neurons are arranged on a two-
dimensional sheet, with nonzero weights permitted for nodes up to a distance
$\leq d$ apart. (b) Locality masking on a two-dimensional sheet can be treated
as a sparse mask on the hidden-to-hidden weights of an RNN (c) Schematic of
the RNN setup in the context of 20-Cog-tasks and Mod-Cog: the network receives
inputs encoding directions on two rings, a fixation signal and a rule input.
The network is trained to output a fixation signal and a direction on a ring
of output nodes. (d) A battery of graph theoretic metric to distinguish the
connectivity graph of LM-RNNs from a random sparse (Erdos-Renyi) graph (left
to right): Graph diameter, Clustering coefficient, Average path length.

We restrict ourselves to simple RNNs for interpretability in the context of
systems neuroscience. Our RNNs follow dynamics defined by:

$\displaystyle\mathbf{h}_{t+1}$
$\displaystyle=\phi(\mathbf{W}\mathbf{h}_{t}+\mathbf{W}_{in}\mathbf{u}_{t}+\mathbf{b}^{h}),$
$\displaystyle\mathbf{o}_{t+1}$
$\displaystyle=\mathbf{W}_{out}\mathbf{h}_{t+1}+\mathbf{b}^{o}.$

Corresponding to the biological arrangement on neurons on a two-dimensional
cortical sheet, we arrange the nodes of an RNN on the lattice points of a two-
dimensional plane, as shown in Fig. 1a. Then, we constrain the weights for
recurrent connections within the nodes of the RNN to be always zero for pairs
nodes that lie at a Euclidean distance of larger than $d$. The training of the
RNN then proceeds in the usual fashion by using back propogation of the loss
to update the unconstrained weights. We refer to such an RNN as a Locality
Masked RNN (LM-RNN).

This constraint on the weights of the RNN is implemented through a graph $G$,
whose nodes are the units of the RNN, and edges correspond to pairs of units
with unconstrained weights, determined by the spatial distance $d$.
Operationally, the adjacency matrix of the graph, $\mathbf{G}$, is point-wise
multiplied with the interaction matrix $\mathbf{W}$ after each gradient step,
effectively constraining which elements of the interaction matrix can be
learnt by gradient descent:

$\mathbf{W}\leftarrow\mathbf{G}\otimes\mathbf{W}$ (1)

This graph adjacency matrix $\mathbf{G}$ is static and unchanged throughout
training.

In effect, the two-dimensional LM-RNN consists of a sparse subgraph $G$ of the
fully connected network, with each node connected to the $\sim\pi d^{2}$
nearest nodes to it. We posit that this sparse subgraph is like a “winning
lottery ticket”, such that when trained in isolation the LM-RNN achieves
comparable performance to a fully recurrently trained network. Moreover, we
will demonstrate that these winning lottery tickets perform better in a more
data-efficient manner than fully connected counterparts with a similar number
of nodes or a similar number of synapses. This approach can be implemented
easily in all training frameworks and is agnostic to the specific optimization
algorithm being used.

Constructing a sparse graph in this particular fashion is distinct from a
sparse random graph. To distinguish between our locality masks and sparse
random graphs (Erdős-Rényi networks) with the same number of edges, we borrow
several metrics from graph theory. In particular we examine three metrics —
the average length of the shortest path between nodes, the graph diameter
(i.e., the longest shortest path between two nodes) and correlation
coefficient which (i.e., the density of mutually connected triplets of
nodes)(Börner et al., 2007). Notably, these metrics are properties fundamental
to the structure of the connectivity in a graph, and are invariant to re-
lableing and permutation of nodes in the graph. As can be seen in Fig.1d,
there is a sharp contrast between the graph of an LM-RNN when compared with a
random sparse RNN, with LM-RNNs having longer diameters and path lengths, but
smaller clustering coefficients.

###  2.2 LM-RNNs learn the ‘20-Cog-tasks’ more rapidly than fully-connected
RNNs

Figure 2: LM-RNNs learn 20-Cog-tasks faster than fully connected networks with
matched neuron or synapse number: (a) LM-RNNs for all choices of locality mask
sizes, $d$, perform better than fully-connected RNNs with the same number of
nodes. This includes $d=0$, i.e., a disconnected pool of autapses which also
outperforms the fully-connected network. Inset: performance at $2\times
10^{3}$ gradient steps across different values of $d$ demonstrates a small
optimal $d$ that leads to the best performance. (b) LM-RNNs also outperform
fully-connected RNNs constructed with the same number of synapses.
RNN($N=196$) and RNN($N=256$) have $5.2\times 10^{4}$ and $8.3\times 10^{4}$
parameters respectively; $N=625$ autapses, LM-RNN($N=25\times 25$, $d=2$) and
LM-RNN($N=25\times 25$, $d=4$) have $4.4\times 10^{4}$, $5.2\times 10^{4}$ and
$7.4\times 10^{4}$ parameters respectively

We apply LM-RNNs to a dataset used commonly in systems neuroscience, a set of
20 cognitive tasks introduced in (Yang et al., 2019), which we henceforth
refer to as the 20-Cog-tasks. Each of these 20 tasks are constructed on the
same input stimulus modalities — two rings of input units are used that each
support a single activity bump, encoding a one-dimensional circular variable
(which could represent direction of motion, for example), which we represent
with vectors $\mathbf{u}_{t}^{\text{ring1}}(\theta_{1})$ and
$\mathbf{u}_{t}^{\text{ring2}}(\theta_{2})$. Along with the two rings, the
input into the RNN also comprises two additional inputs: first, a one-hot
encoded rule input vector, indicating which task is to be performed, which we
denote $\mathbf{u}^{\text{task-rule}}$(“task name”); and second, a fixation
input, a decrease of which is treated a ‘go’ signal for the RNN to provide the
appropriate output, which we denote $u^{\text{fix}}_{t}$.

The expected output for each task is a response direction, which is again
encoded in a ring of output units (which could represent, for example, a reach
or saccade direction). These networks are trained using supervised learning
with a cross entropy loss where the supervised target is a one-hot vector
$\mathbf{y}$ representing the required location of the bump on the ring, and
the model’s output probabilities are constructed through a soft-max of the
outputs, $\mathbf{o}_{t}$.

$L_{CE}(\mathbf{o}_{t},\mathbf{y})=-\sum_{i}\mathbf{y}_{i}\log\frac{e^{\mathbf{o}_{t,i}}}{\sum_{j}e^{\mathbf{o}_{t,j}}}$
(2)

A schematic of the setup of the RNN is shown in Fig. 1c. For each trial of
each task, the inputs are constructed as a gaussian bump on each of the two
rings whose mean is drawn independently from a uniform distribution on the
rings.

We compare LM-RNNs with different values of $d$ against fully-connected RNNs
with the same number of neurons (and hence many more parameters; cf. Fig. 2a)
and fully-connected RNNs of a smaller size but with the same number of
parameters (cf. Fig. 2b). In all cases, LM-RNNs for _any_ value of $d$ are far
more sample-efficient and learn the tasks with same asymptotic performance as
compared to the fully-connected counterparts. We also compare the performance
of these models at the same fixed number of gradient steps early in training
to show sample efficiency differences (Fig. 2a, inset). We hypothesize that
this increased efficiency for LM-RNNs may be due to the ability to use a high-
dimensional computational space, while having a significantly smaller number
of parameters to be learned, resulting in the faster training observed at a
similar level of performance.

###  2.3 ‘20-Cog-tasks’ are rapidly learned with simple autapse networks

Figure 3: A suite of 20 cognitive tasks induces apparent modularity but is
equally well-learned by a network of autapses (extreme spatial masking). (a)
An autapse network from Fig.1 trained on the original 20-Cog-tasks showing the
formation of 12 specialized clusters; (b) The weights of model including the
diagonal hidden to hidden matrix which clearly show the existence of no
modular structure. (c) Normalized rule-input weight correlations show block
structure that is consistent with the 20-Cog-tasks family structure. (d) Rule
input weights are orthogonal to fixation input weights (e) Rule input weights
are orthogonal to stimulus input weights and (inset) stimulus input weight
correlations show a circulant structure. (f) A histogram of autapse weights
shows the existence of 2 clusters of autapses, those with autapse weight close
to 1 and those with autapse weight close to 0. (g) Ablating the small weight
autapses results in no loss of task performance while ablating the high weight
autapses reduces all task performances to random chance, apart from the 2
reaction-time tasks rt-go and rt-anti which do not need memory. (h) Explicitly
adding the appropriate input vectors is sufficient to solve the tasks without
the need for dynamics: (left) for task go and (right) for task anti. (i) A
pool of frozen autapses can learn the 20-Cog-tasks faster than a pool of
autapses and reach the same asymptotic performance.

While we demonstrated that LM-RNNs at all $d$ perform better than fully-
connected networks, we particularly note that $d=0$, (i.e., a ‘network’ where
each node is only connected to itself; in this case the network is simply a
pool of disconnected autapses, and $\mathbf{G}$ is an identity matrix) also
performs better than a fully-connected network in terms of learning speed
while reaching the _same asymptotic performance as a larger fully connected
network._ Remarkably, as seen in Fig. 3, this pool of autapses continues to
show ‘modularity’ in the network through the nodal-task-variance based metrics
similar to the results of fully connected RNNs in (Yang et al., 2019) —
however this apparent modularity clearly cannot be a result of any modular
structures in the network due to the absence of any inter-node network
connections. The autapse networks have no lateral connectivity and thus no way
to share and reuse subtask structure across neurons. This suggests that such a
task variance metric may simply be reflecting correlations between common
inputs and similar input weights to hidden neurons. We verify this hypothesis
in Fig. 3c where we plot the correlation between projection of the rule inputs
to the hidden nodes, i.e., $\mathbf{b}^{\text{task-rule}}\text{(``task
name'')}=\mathbf{W}^{\text{task-rule}}\mathbf{u}^{\text{task-
rule}}\text{(``task name'')}$ where $\mathbf{W}^{\text{task-rule}}$ is the
submatrix of input weights formed by the rule-input appropriate columns of
$\mathbf{W}_{in}$. Since the $\mathbf{u}^{\text{task-rule}}$ is presented as
simply one-hot encoded vectors, the correlation of the rule inputs is simply
$[\mathbf{W}^{\text{task-rule}}]^{T}\mathbf{W}^{\text{task-rule}}$. We observe
that this correlation matrix of input projections in itself appears to cluster
corresponding to the common subtask structure of 20-Cog-tasks.

We thus hope that our results motivate the study of better metrics and
techniques to inspect functional modularity in RNNs, which we leave for future
work.

While these results are in themselves indicative of the advantages conferred
by LM-RNNs, we note that the 20-Cog-tasks are evidently too simplistic to make
any strong claims, since they do not even require a network of connected
neurons to accomplish the task. We present here first a simplified analysis
demonstrating how a pool of disconnected autapses can solve 20-Cog-tasks, and
thereafter present a more rigorous battery of cognitive tasks to more robustly
demonstrate the utility of LM-RNNs.

###  2.4 Mechanistic analysis of the pool of autapses: A game of vector
addition

For mechanistic interpretability, we first examine the dynamics of a single
_linear_ autapse in the presence of an input
$b_{t}=\mathbf{W}_{in}\mathbf{u}_{t}$,

$h_{t+1}=Wh_{t}+b_{t}.$ (3)

This gives

$h_{t}=W^{t}h_{0}+\sum_{n=0}^{t}W^{t-n}b_{n}.$ (4)

For a constant input, and for $0\leq W<1$ this can be simplified to give

$h_{t}=\left[h_{0}-\frac{b}{1-W}\right]W^{t}+\frac{b}{1-W}$

Hence, we see that the autapse weight $W$ defines an effective timescale for
the autapse dynamics. Over the weight-dependent timescale $\tau=-\frac{1}{\log
W}$ the autapse relaxes to a fixed point given by $h^{*}=\frac{b}{1-W}$. Thus,
autapses with low weight ($W\approx 0$) very quickly converge to their
associated bias dependent fixed point given by $h^{*}\approx b$ while autapses
with high weight ($W=1$) effectively function as perfect memory, retaining
their initial state $h_{0}$ and perform addition of the network inputs as they
are received:

$h_{t}=h_{0}+\sum_{n=0}^{t}b_{n}.$ (5)

Examining the weights of autapses in the trained autapse pool reveals that the
weights appear to be seprable into two classes that correspond to the
described above (Fig. 3f) — those with weights close to zero, that would be
expected to rapidly approach a fixed point; and those with weights close to
one, that would be expected to perform vector addition. We also observe that
the rule inputs are approximately orthogonal to the fixation and ring inputs,
Fig.3d,e, suggesting that the dynamics due to the rule inputs act in a
subspace that is independent from the fixation and input stimuli.

We hypothesized that performing vector addition would be sufficient to be able
to solve the 20-Cog-tasks. We verified this in two ways: firstly, we found
that ablating autapses with lower weights resulted in no loss in performance,
whereas ablating the larger weight synapses lead to significant performance
deficits reducing the performance on almost all tasks to chance 111The chance
performance for the delay match to sample family of tasks dms,dnms,dmc,dnmc is
50% due to the way samples are drawn: half of the trials are matching and the
other half are non-matching, refer to methods of (Yang et al., 2019). The
performance of reaction-time tasks rt-go and rt-anti is not affected since
they do not require memory., Fig. 3g; secondly, we found that explicit
addition of the $\mathbf{b}^{\text{task-rule}}$(“task rule”) vectors to the
inputs from the other modalities was sufficient to generate outputs that
performed the task, Fig. 3h.

####  2.4.1 A frozen pool of autapses

Motivated by these ablation studies, we trained an autapse pool with
untrainable fixed autapse weights set to 1. We refer to this pool as the
“frozen autapse pool". This setup also learns all 20 tasks notably faster than
a regular autapse pool, Fig. 3i. In this case the autapses are effectively
“copy gates", storing perfect memory of their previous input and adding them
to the input vector currently being received (cf. equation 5).

###  2.5 Mod-Cog: An expanded battery of cognitive tasks

Figure 4: Mod-Cog: A more-complex suite of upto 132 cognitive tasks. Schematic
of the tasks in Mod-Cog, that extend the 20-Cog-tasks. (a,b) Tasks DlyGo_IntL
and DlyGo_IntL as interval estimation extensions to the DlyGo task from
20-Cog-tasks for two different lengths of delay periods. (c,d) Tasks Go_SeqR
and Go_SeqL as sequence generation extensions to the Go task from 20-Cog-
tasks. (e) The compositional extension DlyGo_IntL_SeqR that combines both
interval estimation as well as sequence generation. (f) Mod-Cog introduces
significantly more complex tasks as compared to 20-Cog-tasks, which can no
longer be solved by a pool of autapses, regardless of their number.

The reason the 20-Cog-tasks were trivially solved by a pool of (frozen)
autapses is that the tasks were static, involving memory and fixed points but
no dynamical computation like integration and sequence generation. These
computations involve the manipulation of the information held in working
memory. A circuit with integration properties is able in principle to
powerfully generalize across tasks in a way that networks that exhibit the
same set of states only as stable fixed points are not able to (Klukas et al.,
2020; Khona and Fiete, 2022) . To perform a more robust demonstration of the
utility of LM-RNNs, we construct a battery of new tasks based on the principle
of integration, and related to cognitive science problems such as interval
estimation, physical and mental navigation, and sequence generation. We build
a set of modular and compositionally constructed tasks, using the neurogym
framework (Molano-Mazon et al., 2022), which in turn was built on the AI
opengym environment.

In particular, we build extensions, that incorporate additional complexity in
two main forms: integration and sequence generation.

In the case of integration, we consider the set of ‘delay’ based tasks in the
20-Cog-tasks. In the 20-Cog-tasks, 12 out of 20 tasks involve a delay period
in the presented input, wherein the network is expected to persistently hold
the input presented in an internal memory before performing a task-relevant
computation. To incorporate interval estimation in these tasks, we require the
output to be discplaced with respect to the orignally expected output by a
magnitude dependent on the length of the delay period. To this end, we choose
the delay length randomly from a uniform distribution (as opposed to the fixed
delay length considered in 20-Cog-tasks). As representative examples, in Fig.
4a,b we show the inputs and expected outputs for two different delay period
lengths in the DlyGo_IntL task, constructed as an interval estimation
extension to the DlyGo task from 20-Cog-tasks. For each of the 12 tasks, the
interval-dependent-discplacement may be either of clockwise or anti-clockwise,
resulting in the introduction of 24 new tasks.

In the case of sequence generation, the output of each task is modified to not
be a single static direction, but instead a time-varying output corresponding
to a drifting direction starting at a particular point (dependent on the
particular task). The direction of drift can be changed dependent on the
particular task. As representative examples, in Fig. 4c,d we show the inputs
and expected outputs for the Go_SeqL and Go_SeqR tasks, constructed as an
sequence generation extensions to the Go task from 20-Cog-tasks. This
introduces 40 new tasks based on the earlier set of 20 tasks, with the output
of each task drifting either clockwise or anti-clockwise.

This completes the construction of the 64 new tasks that we use in conjunction
with the original 20 tasks as the tasks used for our main set of results
hereafter in this paper. We refer to this set of 84 tasks as Mod-Cog. We note
however that our modifications to the tasks are modular in nature (which is
similar in spirit to the already existing modular subtask structure in the
20-Cog-tasks). This allows for an additional extension of 48 more tasks that
may be generated by a composition of the sequence generation and interval
estimation extensions (such as the DlyGo_IntL_SeqR task shown in Fig. 4e). For
simplicity, we do not use these additional 48 tasks in our main results;
however they are included in the repository of tasks that we provide at github
link (will be inserted upon acceptance; provided as .zip file in supplementary
material).

The rule input used for Mod-Cog is encoded as a one-hot vector, similar to the
setup used in (Yang et al., 2019). This ensures that, by construction, the
rule input cannot be directly used as a signal to help decompose tasks into
having common subtasks.

To demonstrate that Mod-Cog is significantly harder than 20-Cog-tasks, we
demonstrate in Fig. 4f that a pool of autapses is incapable of acheiving
significant performance levels, in sharp contrast with the 20-Cog-tasks.
Moreover, this is independent of the number of autapses — even pools that are
$\sim 6$ times larger than those necessary for solving 20-Cog-tasks are unable
to produce larger than 50% performance accuracy.

###  2.6 RNN and LM-RNN performance on Mod-Cog

Figure 5: Faster learning and better asymptotic performance of LM-RNNs and
sparse RNNs on Mod-Cog (a) LM-RNNs for all values of $d$ perform equally well
or better than a fully-connected network with the same number of nodes. This
improvement takes the form of faster learning as well as better asymptotic
performance. (b) Network performance at $10^{4}$ gradient steps for different
values of $d$ and networks of size $50\times 50$, demonstrating an optimal
locality size that leads to the fastest learning. (c) LM-RNN performance for
varying system size for a fixed network sparsity of $\sim$4%, as compared with
fixed random sparse networks with the same sparsity. Performance for sparse
RNNs is similar to or only slightly worse than LM-RNNs with the same sparsity
(d) Network performance as a function of system size ($N^{2}=\text{System
Size}$) and sparsity of the locality mask (i.e., the fraction of nonzero
entries in the hidden-to-hidden weight matrix). At larger system sizes, the
optimal sparsity for best performance is lower. (d) (e)

As earlier, we examine the performance of LM-RNNs with varying $d$ on Mod-Cog,
and compare them with fully-connected RNNs as a function of the number of
gradient steps in training (cf. Fig. 5a). Here again we see that LM-RNNs, for
appropriately chosen values of $d$ train significantly more rapidly as
compared to fully connected networks. Due to the increased task complexity (as
evidenced by Fig. 4f), locality masks corresponding to very small values of
$d$ result in suboptimal performance (which is nonetheless similar to the
$d\to\infty$ corresponding to the fully connected network). Instead,
intermediate small values $d$ outperform all other values of $d$, as shown in
Fig. 5b, indicating an optimal nontrivial locality mask $d$. For smaller
networks, the optimal value of $d$ corresponds to increasingly larger
fractions of all edges in the network (cf. Fig. 5d), indicating that the
optimal may depend more directly on the complexity of the tasks to be solved,
rather than scaling with the number of nodes in the network.

For most LM-RNNs, a _random_ sparse graph with the same number of incoming
edges from each node performs almost as well as the graph chosen through
locality masking, as shown in Fig. 5c. Nevertheless, in each case the locality
mask performs as well as or slightly better than the random sparse graph,
while performing significantly better than dense fully-connected networks. For
the case of small values of $d$, we hypothesize that the slight improvement of
locality masks may arise from the presence of disconnected components in
random sparse graphs in networks with low degrees. For clustering
visualizations based on nodal task variance (Yang et al., 2019), see Appendix
Figs. 7,9,8,10 and 11.

We also examined small-world networks(Watts and Strogatz, 1998) as graphs that
interpolate between random sparse graphs and the locality masks of LM-RNNs. In
particular, we considered graphs with a fixed number of total synapses
corresponding to an LM-RNN with $d=8$. Small-world graphs were constructed
with this number of synapses: connections were formed between nodes within a
‘local radius’ distance of each other, and random sparse connections were
added until the target total number of synapses. A local radius of zero then
corresponds to a completely random sparse graph, and a local radius of 8
corresponds to the LM-RNN that we have been considering thus far. We observed
that there was no significant variation of performance across different local
radi at $10^{3}$ gradient steps, however, at $2\times 10^{3}$ gradient steps
the LM-RNN appears to perform slightly better than any small world network,
Fig. 5f (left).

###  2.7 Controls – comparisons with various baselines for sparsity

We perform comparisons across 3 baselines. First, fully-connected networks
with the same number of nodes; second, fully-connected networks with the same
number of synapses; and third, fully-connected networks with the same number
of nodes, but with an additional $L_{1}$ regularization term in the loss
function to promote the discovery of sparse solutions through training. As we
demonstrate in Table 1, LM-RNNs reach a higher performance earlier than all
other comparable models. While sparse networks acheived through $L_{1}$
regularized models perform better than fully-connected models at some choices
of regularization strengths, they acheive this better performance slower than
LM-RNNs with static sparsity. Thus while sparsity is clearly benefecial to
improved performance in the multitask setting of Mod-Cog, choosing this
sparsity in a fixed, task-independent fashion at the start of training results
in faster training.

| Performance at | No. of nonzero | No. of nonzero
---|---|---|---
| 10k gradient steps | weights | hidden-to-hidden weights
LM-RNN($\mathbf{N=50\times 50,d=6}$) | $\mathbf{0.799\pm 0.007}$ | $\mathbf{6.17\times 10^{5}}$ | $\mathbf{2.82\times 10^{5}}$
LM-RNN($\mathbf{N=50\times 50,d=10}$) | $\mathbf{0.815\pm 0.005}$ | $\mathbf{1.13\times 10^{6}}$ | $\mathbf{7.92\times 10^{5}}$
RNN($N=676$) | $0.69\pm 0.01$ | $5.47\times 10^{5}$ | $4.57\times 10^{5}$
RNN($N=2500$) | $0.71\pm 0.02$ | $6.58\times 10^{6}$ | $6.25\times 10^{6}$
$L_{1}$ RNN($N=2500$), $\lambda=10^{-4}$ | $0.59\pm 0.02$ | $4.00\times 10^{5}$ | $6.51\times 10^{4}$
$L_{1}$ RNN($N=2500$), $\lambda=10^{-5}$ | $0.72\pm 0.01$ | $5.16\times 10^{5}$ | $1.81\times 10^{5}$
$L_{1}$ RNN($N=2500$), $\lambda=10^{-6}$ | $0.73\pm 0.02$ | $1.02\times 10^{6}$ | $6.87\times 10^{5}$
$L_{1}$ RNN($N=2500$), $\lambda=10^{-7}$ | $0.71\pm 0.01$ | $1.86\times 10^{6}$ | $1.52\times 10^{6}$
Table 1: Comparison across networks with similar number of trainable
parameters and nonzero weights. $L_{1}$ RNNs are fully-connected RNNs with an
$L_{1}$ regularization to promote sparse solutions. In this case, the number
of nonzero weights is counted as the number of weights above a small threshold
in the trained RNN. See Appendix Fig.6 for learning curves

##  3 Discussion

Through our results, we have demonstrated that a simple fixed sparse graph can
provide a large increase in the sample-efficiency of the training process in
single-layer recurrent networks. These results could in principle be extended
to other architectures and tasks but we restricted our experiments to simple
RNNs and cognitive tasks for their relevance to systems and computational
neuroscience.

As RNNs trained on multitask learning problems become more popular as models
of PFC and other associated brain regions (Driscoll et al., 2022; Hummos,
2022; Riveland and Pouget, 2022; da Costa et al., 2019; Duncker et al., 2020;
Masse et al., 2022; Kao et al., 2021), we need to be more cognizant about how
the computational complexity of the task set used affects learnt
representations. By demonstrating that a pool of unconnected autapses can
solve the 20-Cog-tasks (Yang et al., 2019), we have shown that this apparently
complex set of tasks can be solved without any communication between neurons.
This raises the hypothesis that appropriately tuned input weights
corresponding to the “rule inputs" along with static memory are enough to
solve many tasks. Here we constructed Mod-Cog as a set of tasks with increased
complexity by adding more modular subcomponents that require the RNN to
perform non-trivial computations. Thus we provide a more reasonable multitask
setting that leads to richer solutions and may be a better testbed for
exploring shared motifs and representations across modular subtasks. Another
possible direction for future study to increase task complexity for 20-Cog-
tasks has been to eliminate rule inputs and force the network to infer the
task needed to be solved. This would likely involve some flavor of predictive
coding. A recent work Hummos (2022) makes progress in this direction.

We have found that given a certain amount of task complexity and network size,
there is an optimal amount of locality masking that provides the most benefit
to learning, both in terms of sample efficiency and asymptotic performance.
While we have shown this result for recurrent networks, qualitatively similar
results on an optimal value of sparsity have been derived analytically for
cerebellum-like feedforward architectures (Litwin-Kumar et al., 2017). It
remains an open question to theoretically investigate the relationship between
task complexity and the amount of sparsity that is needed: if the network is
too sparse, it will not have enough expressivity to perform well on the
dataset, while if the network is too dense, the benefits provided by sparsity
will not be exploited.

Although our matrices are extremely sparse and would be well suited to sparse
matrix representations, we still maintain dense matrix dataypes for all of the
training and evaluation processes since standard libraries like PyTorch do not
have native support for these data structures. As sparse matrices get more
common and their usefulness more apparent, as has been pointed out before (Liu
et al., 2021), it will be very useful for native deep learning software and
hardware implementations on GPUs to exploit the potential efficiencies of very
sparse matrix structures.

##  4 Acknowledgements

We thank Guangyu Robert Yang for open-sourcing the 20 cognitive tasks set and
the NeuroGym framework (Molano-Mazon et al., 2022) released under an MIT
License. This work was supported by the MathWorks Science Fellowship to MK,
the Simons Foundation through the Simons Collaboration on the Global Brain,
the ONR, and the Howard Hughes Medical Institute through the Faculty Scholars
Program to IRF.

## References

  * Börner et al. [2007] Katy Börner, Soma Sanyal, Alessandro Vespignani, et al.  Network science.  _Annu. rev. inf. sci. technol._ , 41(1):537–607, 2007.
  * da Costa et al. [2019] Pedro F. da Costa, Sebastian Popescu, Robert Leech, and Romy Lorenz.  Elucidating cognitive processes using lstms.  In _Conference on Cognitive Computational Neuroscience_ , 2019.  URL https://ccneuro.org/2019/proceedings/0000272.pdf.
  * de Jorge et al. [2020] Pau de Jorge, Amartya Sanyal, Harkirat S Behl, Philip HS Torr, Gregory Rogez, and Puneet K Dokania.  Progressive skeletonization: Trimming more fat from a network at initialization.  _arXiv preprint arXiv:2006.09081_ , 2020.
  * Driscoll et al. [2022] Laura Driscoll, Krishna Shenoy, and David Sussillo.  Flexible multitask computation in recurrent networks utilizes shared dynamical motifs.  _bioRxiv_ , 2022.
  * Duncker et al. [2020] Lea Duncker, Laura Driscoll, Krishna V Shenoy, Maneesh Sahani, and David Sussillo.  Organizing recurrent network dynamics by task-computation to enable continual learning.  In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, _Advances in Neural Information Processing Systems_ , volume 33, pages 14387–14397. Curran Associates, Inc., 2020.  URL https://proceedings.neurips.cc/paper/2020/file/a576eafbce762079f7d1f77fca1c5cc2-Paper.pdf.
  * Ercsey-Ravasz et al. [2013] Mária Ercsey-Ravasz, Nikola T Markov, Camille Lamy, David C Van Essen, Kenneth Knoblauch, Zoltán Toroczkai, and Henry Kennedy.  A predictive network model of cerebral cortical connectivity based on a distance rule.  _Neuron_ , 80(1):184–197, 2013.
  * Evci et al. [2020] Utku Evci, Trevor Gale, Jacob Menick, Pablo Samuel Castro, and Erich Elsen.  Rigging the lottery: Making all tickets winners.  In _International Conference on Machine Learning_ , pages 2943–2952. PMLR, 2020.
  * Finzi et al. [2022] Dawn Finzi, Eshed Margalit, Kendrick Kay, Daniel LK Yamins, and Kalanit Grill-Spector.  Topographic DCNNs trained on a single self-supervised task capture the functional organization of cortex into visual processing streams.  In _SVRHM 2022 Workshop @ NeurIPS_ , 2022.  URL https://openreview.net/forum?id=E1iY-d13smd.
  * Flesch et al. [2022] Timo Flesch, David G Nagy, Andrew Saxe, and Christopher Summerfield.  Modelling continual learning in humans with hebbian context gating and exponentially decaying task signals.  _arXiv preprint arXiv:2203.11560_ , 2022.
  * Frankle and Carbin [2018] Jonathan Frankle and Michael Carbin.  The lottery ticket hypothesis: Finding sparse, trainable neural networks.  _arXiv preprint arXiv:1803.03635_ , 2018.
  * Frankle et al. [2019] Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin.  Stabilizing the lottery ticket hypothesis.  _arXiv preprint arXiv:1903.01611_ , 2019.
  * Han et al. [2015] Song Han, Jeff Pool, John Tran, and William Dally.  Learning both weights and connections for efficient neural network.  _Advances in neural information processing systems_ , 28, 2015.
  * Hopfield [1982] John J Hopfield.  Neural networks and physical systems with emergent collective computational abilities.  _Proceedings of the national academy of sciences_ , 79(8):2554–2558, 1982.
  * Hummos [2022] Ali Hummos.  Thalamus: a brain-inspired algorithm for biologically-plausible continual learning and disentangled representations.  _arXiv preprint arXiv:2205.11713_ , 2022.
  * Jaeger [2001] Herbert Jaeger.  The “echo state” approach to analysing and training recurrent neural networks-with an erratum note.  _Bonn, Germany: German National Research Center for Information Technology GMD Technical Report_ , 148(34):13, 2001.
  * Kao et al. [2021] Ta-Chu Kao, Kristopher Jensen, Gido van de Ven, Alberto Bernacchia, and Guillaume Hennequin.  Natural continual learning: success is a journey, not (just) a destination.  _Advances in Neural Information Processing Systems_ , 34, 2021.
  * Khona and Fiete [2022] Mikail Khona and Ila R Fiete.  Attractor and integrator networks in the brain.  _Nature Reviews Neuroscience_ , pages 1–23, 2022.
  * Khona et al. [2022] Mikail Khona, Sarthak Chandra, and Ila R Fiete.  From smooth cortical gradients to discrete modules: spontaneous and topologically robust emergence of modularity in grid cells.  _bioRxiv_ , pages 2021–10, 2022.
  * Kingma and Ba [2014] Diederik P Kingma and Jimmy Ba.  Adam: A method for stochastic optimization.  _arXiv preprint arXiv:1412.6980_ , 2014.
  * Klukas et al. [2020] Mirko Klukas, Marcus Lewis, and Ila Fiete.  Efficient and flexible representation of higher-dimensional cognitive variables with grid cells.  _PLoS computational biology_ , 16(4):e1007796, 2020.
  * Kusupati et al. [2020] Aditya Kusupati, Vivek Ramanujan, Raghav Somani, Mitchell Wortsman, Prateek Jain, Sham Kakade, and Ali Farhadi.  Soft threshold weight reparameterization for learnable sparsity.  In _International Conference on Machine Learning_ , pages 5544–5555. PMLR, 2020.
  * Lee et al. [2020a] Hyodong Lee, Eshed Margalit, Kamila M Jozwik, Michael A Cohen, Nancy Kanwisher, Daniel LK Yamins, and James J DiCarlo.  Topographic deep artificial neural networks reproduce the hallmarks of the primate inferior temporal cortex face processing network.  _bioRxiv_ , 2020a.
  * Lee et al. [2019] Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr.  SNIP: SINGLE-SHOT NETWORK PRUNING BASED ON CONNECTION SENSITIVITY.  In _International Conference on Learning Representations_ , 2019.  URL https://openreview.net/forum?id=B1VZqjAcYX.
  * Lee et al. [2020b] Namhoon Lee, Thalaiyasingam Ajanthan, Stephen Gould, and Philip H. S. Torr.  A signal propagation perspective for pruning neural networks at initialization.  In _International Conference on Learning Representations_ , 2020b.  URL https://openreview.net/forum?id=HJeTo2VFwH.
  * Litwin-Kumar et al. [2017] Ashok Litwin-Kumar, Kameron Decker Harris, Richard Axel, Haim Sompolinsky, and LF Abbott.  Optimal degrees of synaptic connectivity.  _Neuron_ , 93(5):1153–1164, 2017.
  * Liu et al. [2021] Shiwei Liu, Decebal Constantin Mocanu, Yulong Pei, and Mykola Pechenizkiy.  Selfish sparse rnn training.  In _International Conference on Machine Learning_ , pages 6893–6904. PMLR, 2021.
  * Louizos et al. [2017] Christos Louizos, Max Welling, and Diederik P Kingma.  Learning sparse neural networks through $l\\_0$ regularization.  _arXiv preprint arXiv:1712.01312_ , 2017.
  * Lukoševičius and Jaeger [2009] Mantas Lukoševičius and Herbert Jaeger.  Reservoir computing approaches to recurrent neural network training.  _Computer Science Review_ , 3(3):127–149, 2009\.
  * Maass [2011] Wolfgang Maass.  Liquid state machines: motivation, theory, and applications.  _Computability in context: computation and logic in the real world_ , pages 275–296, 2011.
  * Maass et al. [2002] Wolfgang Maass, Thomas Natschläger, and Henry Markram.  Real-time computing without stable states: A new framework for neural computation based on perturbations.  _Neural computation_ , 14(11):2531–2560, 2002\.
  * Markov et al. [2013] Nikola T Markov, Mária Ercsey-Ravasz, David C Van Essen, Kenneth Knoblauch, Zoltán Toroczkai, and Henry Kennedy.  Cortical high-density counterstream architectures.  _Science_ , 342(6158):1238406, 2013.
  * Marton et al. [2021] Christian David Marton, Guillaume Lajoie, and Kanaka Rajan.  Efficient and robust multi-task learning in the brain with modular task primitives.  _arXiv preprint arXiv:2105.14108_ , 2021.
  * Masse et al. [2022] Nicolas Y Masse, Matthew C Rosen, Doris Y Tsao, and David J Freedman.  Rapid learning with highly localized synaptic plasticity.  _bioRxiv_ , 2022.
  * Mocanu et al. [2016] Decebal Constantin Mocanu, Elena Mocanu, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta.  A topological insight into restricted boltzmann machines.  _Machine Learning_ , 104(2):243–270, 2016.
  * Molano-Mazon et al. [2022] Manuel Molano-Mazon, Joao Barbosa, Jordi Pastor-Ciurana, Marta Fradera, Ru-Yuan Zhang, Jeremy Forest, Jorge del Pozo Lerida, Li Ji-An, Christopher J Cueva, Jaime de la Rocha, et al.  Neurogym: An open resource for developing and sharing neuroscience tasks.  _PsyArXiv_ , 2022.
  * Moore and Chaudhuri [2020] Eli Moore and Rishidev Chaudhuri.  Using noise to probe recurrent neural network structure and prune synapses.  In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, _Advances in Neural Information Processing Systems_ , volume 33, pages 14046–14057. Curran Associates, Inc., 2020.  URL https://proceedings.neurips.cc/paper/2020/file/a1ada9947e0d683b4625f94c74104d73-Paper.pdf.
  * Narang et al. [2017] Sharan Narang, Erich Elsen, Gregory Diamos, and Shubho Sengupta.  Exploring sparsity in recurrent neural networks.  _arXiv preprint arXiv:1704.05119_ , 2017.
  * Obeid and Konkle [2021] Dina Obeid and Talia Konkle.  Wiring minimization of deep neural networks reveal conditions in which multiple visuotopic areas emerge.  _Journal of Vision_ , 21(9):2135–2135, 2021.
  * Riveland and Pouget [2022] Reidar Riveland and Alexandre Pouget.  A neural model of task compositionality with natural language instructions.  _bioRxiv_ , 2022.
  * Rousseeuw [1987] Peter J Rousseeuw.  Silhouettes: a graphical aid to the interpretation and validation of cluster analysis.  _Journal of computational and applied mathematics_ , 20:53–65, 1987.
  * Savarese et al. [2020] Pedro Savarese, Hugo Silva, and Michael Maire.  Winning the lottery with continuous sparsification.  _Advances in Neural Information Processing Systems_ , 33:11380–11390, 2020.
  * Tanaka et al. [2020] Hidenori Tanaka, Daniel Kunin, Daniel L Yamins, and Surya Ganguli.  Pruning neural networks without any data by iteratively conserving synaptic flow.  In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, _Advances in Neural Information Processing Systems_ , volume 33, pages 6377–6389. Curran Associates, Inc., 2020.  URL https://proceedings.neurips.cc/paper/2020/file/46a4378f835dc8040c8057beb6a2da52-Paper.pdf.
  * Theodoni et al. [2022] Panagiota Theodoni, Piotr Majka, David H Reser, Daniel K Wójcik, Marcello GP Rosa, and Xiao-Jing Wang.  Structural attributes and principles of the neocortical connectome in the marmoset monkey.  _Cerebral Cortex_ , 32(1):15–28, 2022.
  * Wang et al. [2020] Chaoqi Wang, Guodong Zhang, and Roger Grosse.  Picking winning tickets before training by preserving gradient flow.  In _International Conference on Learning Representations_ , 2020.  URL https://openreview.net/forum?id=SkgsACVKPH.
  * Watts and Strogatz [1998] Duncan J Watts and Steven H Strogatz.  Collective dynamics of ‘small-world’networks.  _nature_ , 393(6684):440–442, 1998.
  * Wen et al. [2018] Wei Wen, Yuxiong He, Samyam Rajbhandari, Minjia Zhang, Wenhan Wang, Fang Liu, Bin Hu, Yiran Chen, and Hai Li.  Learning intrinsic sparse structures within long short-term memory.  In _International Conference on Learning Representations_ , 2018.  URL https://openreview.net/forum?id=rk6cfpRjZ.
  * Yang et al. [2019] Guangyu Robert Yang, Madhura R Joglekar, H Francis Song, William T Newsome, and Xiao-Jing Wang.  Task representations in neural networks trained to perform many cognitive tasks.  _Nature neuroscience_ , 22(2):297–306, 2019.
  * Zhou et al. [2019] Hattie Zhou, Janice Lan, Rosanne Liu, and Jason Yosinski.  Deconstructing lottery tickets: Zeros, signs, and the supermask.  _Advances in neural information processing systems_ , 32, 2019.
  * Zilly et al. [2017] Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutnık, and Jürgen Schmidhuber.  Recurrent highway networks.  In _International conference on machine learning_ , pages 4189–4198. PMLR, 2017.

##  Appendix A Methods and Hyperparameters

PyTorch was used for all simulations. All networks were trained with
supervised learning using a cross entropy loss. The optimizer used was Adam
[Kingma and Ba, 2014] with a learning rate of $10^{-3}$. Each trial was drawn
randomly and independently and the tasks were randomly interleaved. The
Neurogym [Molano-Mazon et al., 2022] environment was used to create tasks and
the training data for the model.
For every performance curve, we trained 15 RNNs with different random seeds
and used the averaged curve for plotting and computing the optimal locality
mask sizes.
An expanded description of the Mod-Cog tasks and how to create them will be
made available at the Github repository after acceptance.

To measure the number of clusters that the hidden nodes of the RNN partition
into to solve a task, we use first use agglomerative hierarchical clustering
222https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html
to obtain a linkage tree for the variance of each node across different inputs
for a given task. Then, the silhouette score [Rousseeuw, 1987] is evaluated
for each possible linkage-based cluster partition and the partition with the
highest score is selected to represent the clustering of the RNN.

Graph theoretic measures shown in Fig. 1d were computed using the Python
package ‘networkx’ version 2.8.4.

Figure 6: Performance curves of models trained with varying values of sparsity
(L1) regularization showing that a fixed local mask (of similar sparsity, cf.
Table 1) is better. Figure 7: An LM-RNN(N=20x20,d=2) trained on 84 Mod-Cog
tasks showing the formation of clusters  Figure 8: An LM-RNN(N=20x20,d=6)
trained on 84 Mod-Cog tasks showing the formation of clusters  Figure 9: An
RNN(N=400) trained on 84 Mod-Cog tasks showing the formation of clusters
Figure 10: 24 Clusters formed in an LM-RNN(N = 50 $\times$ 50, d = 10) trained
on 84 Mod-Cog tasks. Figure 11: 33 Clusters formed in an RNN(N=2500) trained
on 84 Mod-Cog tasks, contrast with previous figure where the number of
clusters is smaller.


# Two-Timescale Transmission Design for Wireless Communication Systems Aided
by Active RIS

Zhangjie Peng, Tianshu Li, Cunhua Pan, ,
Xianfu Lei , , and Shi Jin Z. Peng and T. Li are with the College of
Information, Mechanical and Electrical Engineering, Shanghai Normal
University, Shanghai 200234, China $(\text{e-mail<EMAIL_ADDRESS>1000479056@smail.shnu.edu.cn})$. _(Corresponding authors: Cunhua Pan.)_ C. Pan
and S. Jin are with the National Mobile Communications Research Laboratory,
Southeast University, Nanjing 210096, China. (e-mail<EMAIL_ADDRESS>jinshi@seu.edu.cn).X. Lei is with the School of Information Science and
Technology, Southwest Jiaotong University, Chengdu 610031, China
(xflei@home.swjtu.edu.cn).

###### Abstract

This paper considers an active reconfigurable intelligent surface (RIS)-aided
communication system, where an $M$-antenna base station (BS) transmits data
symbols to a single-antenna user via an $N$-element active RIS. We use two-
timescale channel state information (CSI) in our system, so that the channel
estimation overhead and feedback overhead can be decreased dramatically. A
closed-form approximate expression of the achievable rate (AR) is derived and
the phase shift at the active RIS is optimized. In addition, we compare the
performance of the active RIS system with that of the passive RIS system. The
conclusion shows that the active RIS system achieves a lager AR than the
passive RIS system.

###### Index Terms:

Two-timescale CSI, active reconfigurable intelligent surface (RIS), achievable
rate (AR).

##  I Introduction

Reconfigurable intelligent surface (RIS) has attracted extensive research
attention, which has been envisioned as one of the potential key technologies
in 6G communication systems [1]. In particular, an RIS is equipped with a
large number of passive and low-cost reflecting elements, each of which can
induce an independent phase shift on the incident signals to enhance the
received signal. Due to its passive nature, the RIS possesses appealing
features of low cost, low power consumption and easy deployment [2, 3].

However, the passive RIS suffers from the multiplicative fading effects, where
the propagation link experiences a product of channel attenuation of two
individual links. To address this issue, a novel concept named active RIS was
proposed in [4, 5]. In an active RIS, each reflecting element is comprised of
additional reflection-type amplifier, which not only adjusts the phase shift
of the incident signals, but amplifies the incident signal power. The authors
of [6] demonstrated that when both the passive RIS and the active RIS systems
are assumed to have the same total power consumption, the active RIS
outperforms the passive RIS in most cases.

The existing contributions on the active RIS mostly consider the instantaneous
channel state information (CSI). However, this transmission design scheme
requires a high pilot overhead and a high feedback overhead. To address this
issue, a two-timescale CSI scheme is proposed. The beamforming vector at the
base station (BS) could be designed on the basis of the instantaneous CSI [3],
while the active RIS configuration is based on the statistical CSI, which only
depends on the angle and location information that generally remain invariant
in a long term [7]. In addition, due to the slow varying of the statistical
CSI, the computational complexity and feedback overhead can be greatly reduced
[8].

Against the above background, we propose a two-timescale CSI-based
transmission design for the active RIS-aided wireless system. Specifically, we
summarize the contributions of this paper in short: 1) we derive a closed-form
expression of the achievable rate (AR) of the considered system; 2) we propose
a genetic algorithm (GA) to solve the phase shift optimization problem (PSOP);
3) this expression is extended to the downlink system.

$R_{U}\approx\log_{2}\left(1+\frac{p_{t,U}\eta_{U}^{2}\mathbb{E}\left\\{\lVert\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\rVert_{2}^{4}\right\\}}{\eta_{U}^{2}\mathbb{E}\left\\{\lVert\mathbf{g}_{U}^{H}\mathbf{\Phi}_{U}^{H}\mathbf{H}_{U}^{H}\mathbf{H}_{U}\mathbf{\Phi}_{U}\rVert_{2}^{2}\right\\}\sigma_{V,U}^{2}+\sigma_{N,U}^{2}\mathbb{E}\left\\{\lVert\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\rVert_{2}^{2}\right\\}}\right)$
(11)

$\mathbb{E}\left\\{|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{m}|^{2}\right\\}=\gamma_{U}K_{1}K_{2}\underset{w_{1}}{\underbrace{|\left[\mathbf{a}_{M}\left(\phi_{r}^{a},\phi_{r}^{e}\right)\right]_{m}f_{U}|^{2}}}+\gamma_{U}K_{1}\underset{w_{2}}{\underbrace{\mathbb{E}\Big{\\{}\Big{|}\left[\mathbf{a}_{M}\left(\phi_{r}^{a},\phi_{r}^{e}\right)\right]_{m}\sum_{n=1}^{N}{\left[\mathbf{a}_{N}^{*}\left(\varphi_{t}^{a},\varphi_{t}^{e}\right)\right]_{n}e^{j\theta_{nU}}}\left[\mathbf{\tilde{g}}_{U}\right]_{n}\Big{|}^{2}\Big{\\}}}}$

$+\gamma_{U}K_{2}\underset{w_{3}}{\underbrace{\mathbb{E}\Big{\\{}\Big{|}\sum_{n=1}^{N}{\big{[}\mathbf{\tilde{H}}_{U}\big{]}_{mn}e^{j\theta_{nU}}}\big{[}\mathbf{a}_{N}\left(\varphi_{r}^{a},\varphi_{r}^{e}\right)\big{]}_{n}\Big{|}^{2}\Big{\\}}}}+\gamma_{U}\underset{w_{4}}{\underbrace{\mathbb{E}\Big{\\{}\Big{|}\sum_{n=1}^{N}{\big{[}\mathbf{\tilde{H}}_{U}\big{]}_{mn}e^{j\theta_{nU}}}\big{[}\mathbf{\tilde{g}}_{U}\big{]}_{n}\Big{|}^{2}\Big{\\}}}}$
(13)

##  II System Model

We consider an uplink wireless communication system, where a single-antenna
user transmits data information to an $M$-antenna BS via an $N$-element active
RIS. The active RIS can be employed at the facade of buildings, which can
provide a strong line-of-sight (LoS) component in wireless links. Hence, the
Rician fading model is considered in the RIS-related channels. In addition,
the channel between the user and the BS is assumed to be blocked by the
obstacles. The uplink channel matrix between the active RIS and the BS is
$\mathbf{H}_{U}\in\mathbb{C}^{M\times N}$. The uplink channel vector between
the user and the RIS is $\mathbf{g}_{U}\in\mathbb{C}^{N\times 1}$.

Specifically, $\mathbf{H}_{U}$ and $\mathbf{g}_{U}$ are respectively given by

$\mathbf{H}_{U}=\sqrt{\alpha_{U}}\left(\sqrt{\frac{K_{1}}{K_{1}+1}}\overline{\mathbf{H}}_{U}+\sqrt{\frac{1}{K_{1}+1}}\widetilde{\mathbf{H}}_{U}\right),$
(1)
$\vspace{-0.1cm}\mathbf{g}_{U}=\sqrt{\beta_{U}}\left(\sqrt{\frac{K_{2}}{K_{2}+1}}\overline{\mathbf{g}}_{U}+\sqrt{\frac{1}{K_{2}+1}}\widetilde{\mathbf{g}}_{U}\right),$
(2)

where $K_{1}$ and $K_{2}$ are the Rician factors, which are respectively
defined as the power ratio of the LoS components and the non-line-of-sight
(NLoS) components. In (1) and (2), the NLoS components
$\widetilde{\mathbf{H}}_{U}$ and $\widetilde{\mathbf{g}}_{U}$ consist of
independent and identical distribution (i.i.d.) entries, all of which follow
the distribution of $\mathcal{CN}(0,1)$. The LoS components
$\overline{\textbf{H}}_{U}$ and $\overline{\textbf{g}}_{U}$ can be written as

$\mathbf{\bar{H}}_{U}=\mathbf{a}_{M}\left(\phi_{r}^{a},\phi_{r}^{e}\right)\mathbf{a}_{N}^{H}\left(\varphi_{t}^{a},\varphi_{t}^{e}\right),\
\ \ \ \
\mathbf{\bar{g}}_{U}=\mathbf{a}_{N}\left(\varphi_{r}^{a},\varphi_{r}^{e}\right),$
(3)

with

$\mathbf{a}_{X}\left(\vartheta^{a},\vartheta^{e}\right)\\!\\!=\\!\\!\\!\left[\\!\\!\\!\begin{array}[]{c}1,\cdots,e^{j2\pi\frac{d}{\lambda}\left(x\sin\vartheta^{a}\sin\vartheta^{e}+y\cos\vartheta^{e}\right)},\cdots,\\\
e^{j2\pi\frac{d}{\lambda}\left(\left(\sqrt{X}-1\right)\sin\vartheta^{a}\sin\vartheta^{e}+\left(\sqrt{X}-1\right)\cos\vartheta^{e}\right)}\\\
\end{array}\\!\\!\\!\right]^{T}\\!\\!\\!\\!\\!\\!,\\!\\!\\!$ (4)

where $X\in\left\\{M,N\right\\}$, $0\leqslant x,y\leqslant\sqrt{X}-1$. The
uplink angles $\varphi_{r}^{a}$ and $\varphi_{r}^{e}$ are respectively the
azimuth and elevation angles of arrival (A-AoA and E-AoA) at the RIS from the
user while $\phi_{r}^{a}$ and $\phi_{r}^{e}$ are the A-AoA and E-AoA at the
RIS from the BS. $\varphi_{t}^{a}$ and $\varphi_{t}^{e}$ are respectively the
azimuth and elevation angles of departure (A-AoD and E-AoD) from the RIS to
the BS. $d$ is the element spacing and $\lambda$ is the carrier wavelength. To
facilitate analysis, we set $d=\frac{\lambda}{2}$ in this letter [2].

Different from the passive RIS, the active RIS stands to benefit from external
power supply to amplifing the incident signals, while the thermal noise is
amplified at the same time. Hence, the uplink signal received by the BS is

$\mathbf{y}_{U}=\sqrt{p_{t,U}}\mathbf{H}_{U}\mathbf{\Lambda}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}x+\mathbf{H}_{U}\mathbf{\Lambda}_{U}\mathbf{\Phi}_{U}\mathbf{v}_{U}+\mathbf{n}_{U},$
(5)

where $p_{t,U}$ is the transmission power of the user. The scalar $x$
represents its transmitted symbol satisfying
$\mathbb{E}\big{\\{}\left|x\right|^{2}\big{\\}}=1$. The vector
$\mathbf{v}_{U}\in\mathbb{C}^{N\times 1}\sim{\cal
CN}\left(\mathbf{0},\sigma_{V,U}^{2}\mathbf{I}_{N}\right)$ is the uplink
thermal noise at the RIS. The vector $\mathbf{n}_{U}\in\mathbb{C}^{M\times
1}\sim\mathcal{C}\mathcal{N}\left(\mathbf{0},\sigma_{N,U}^{2}\mathbf{I}_{M}\right)$
is the additive white Gaussian noise (AWGN) at the BS. The power amplification
factor matrix
$\bm{\Lambda}_{U}=\mathrm{diag}\left(\eta_{1U},\eta_{2U},\cdots,\eta_{NU}\right)$
and the phase shift matrix
$\mathbf{\Phi}_{U}=\mathrm{diag}\left(e^{j\theta_{1U}},e^{j\theta_{nU}},\cdots,e^{j\theta_{NU}}\right)$,
where $\theta_{nU}$ is the phase shift of the $n$th RIS element. For
simplicity, the amplification factors for elements in the active RIS are
assumed to be identical, i.e.,
$\eta_{1U}\\!=\\!\eta_{2U}\\!=\\!\cdots\\!=\\!\eta_{NU}\\!=\\!\eta_{U}$. Then,
$\eta_{U}$ can be obtained as

$\displaystyle\vspace{0.2cm}\eta_{U}=$
$\displaystyle\sqrt{\frac{p_{r,U}}{\mathbb{E}\left\\{\lVert\sqrt{p_{t,U}}\mathbf{\Phi}_{U}\mathbf{g}_{U}\rVert_{2}^{2}+\lVert\mathbf{\Phi}_{U}\mathbf{v}_{U}\rVert_{2}^{2}\right\\}}}$
$\displaystyle=$
$\displaystyle\sqrt{\frac{p_{r,U}}{N\left(p_{t,U}\beta_{U}+\sigma_{V,U}^{2}\right)}},$
(6)

where $p_{r,U}$ is the uplink amplification power at the active RIS.

In this paper, we adopt a two-timescale transmission design protocol due to
its low channel estimation overhead and reduced computational complexity. The
BS uses maximal ratio combining (MRC) technique to decode its received signal.
Therefore, the signal received at the BS can be written as

$r_{U}=\left(\mathbf{H}_{U}\mathbf{\Lambda}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right)^{H}\mathbf{y}_{U}.$
(7)

Thus, the uplink AR is given by

$\vspace{0.1cm}R_{U}=\mathbb{E}\left\\{\log_{2}\left(1+{\gamma}_{U}\right)\right\\},$
(8)

where $\gamma_{U}$ is the signal-noise-ratio (SNR) defined by

$\vspace{0.2cm}\\!\\!\gamma_{U}\\!=\\!\frac{p_{t,U}\eta_{U}^{2}\lVert\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\rVert_{2}^{4}}{\eta_{U}^{2}\lVert\mathbf{g}_{U}^{H}\mathbf{\Phi}_{U}^{H}\mathbf{H}_{U}^{H}\mathbf{H}_{U}\mathbf{\Phi}_{U}\rVert_{2}^{2}\sigma_{V,U}^{2}\\!+\\!\sigma_{N,U}^{2}\lVert\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\rVert_{2}^{2}}.\\!\\!\\!$
(9)

$\displaystyle\xi=$
$\displaystyle\gamma_{U}^{2}M^{2}K_{1}^{2}K_{2}^{2}|f_{U}|^{4}+2\gamma_{U}^{2}MK_{1}K_{2}|f_{U}|^{2}\left(2MNK_{1}+MNK_{2}+MN+2M+NK_{2}+N+2\right)$
$\displaystyle+\gamma_{U}^{2}MN^{2}\left(K_{2}^{2}+2K_{1}K_{2}+2K_{1}+2K_{2}+1\right)+\gamma_{U}^{2}M\left(M+1\right)N\left(2K_{1}+2K_{2}+1\right)$
$\displaystyle+\gamma_{U}^{2}M^{2}N^{2}\left(2K_{1}^{2}+K_{2}^{2}+2K_{1}K_{2}+2K_{1}+2K_{2}+1\right)$
(20)

$\vspace{-0.6cm}\\!\\!\\!\\!\nu\\!=\\!\frac{M^{2}\alpha_{U}\gamma_{U}}{\left(K_{1}\\!+\\!1\right)}\left(K_{2}\left(N\\!+\\!2K_{1}|f_{U}|^{2}\\!+\\!K_{1}^{2}N|f_{U}|^{2}\right)\\!+\\!N\\!+\\!2K_{1}N\\!+\\!K_{1}^{2}N^{2}\right)+\alpha_{U}\gamma_{U}MN\left(K_{2}N\\!+\\!K_{1}K_{2}|f_{U}|^{2}\\!+\\!N\\!+\\!K_{1}N\right)\\!\\!\\!\\!\\!\\!\\!\\!\\!$
(24)

##  III Achievable Rate Analysis and Phase Shift Design

In this section, we first derive an approximate expression for the AR of the
uplink system aided by the active RIS. Then, we compare the AR in the passive
RIS system, which has the same total transmission power $p_{U}$ as the active
RIS system. Finally, the AR maximization problem is formulated and solved by
tuning the phase shift.

###  III-A Achievable Rate Analysis

######  Theorem 1.

The uplink AR of the active RIS-aided system can be approximated as

$\\!\\!R_{U}\\!\approx\\!\log_{2}\\!\Bigg{(}\\!1\\!+\\!\frac{p_{t,U}p_{r,U}\xi}{\\!\\!\\!N\\!\left(p_{t,U}\beta_{U}\\!+\\!\sigma_{V,U}^{2}\right)\delta\sigma_{N,U}^{2}+p_{r,U}\nu\sigma_{V,U}^{2}}\\!\Bigg{)},$
(10)

where $\delta,\xi,\nu$ are given by (12), (II), and (24), respectively.

Proof: By using Lemma 1 in [9], $R_{U}$ in (8) can be approximated as (11) at
the bottom of this page. The term
$\mathbb{E}\left\\{||\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}||_{2}^{2}\right\\}$
in (11) can be written as

$\mathbb{E}\left\\{||\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}||_{2}^{2}\right\\}\\!=\\!\sum_{m=1}^{M}{\mathbb{E}\left\\{|[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}]_{m}|^{2}\right\\}}\triangleq\delta,$
(12)

where $[\mathbf{a}]_{m}$ is the $m$th entry of $\mathbf{a}$. Then, we expand
$\mathbb{E}\left\\{|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{m}|^{2}\right\\}$
in (13) at the bottom of this page. In (13),
$\gamma_{U}=\frac{\alpha_{U}\beta_{U}}{\left(K_{1}+1\right)\left(K_{2}+1\right)}$
and $f_{U}$ is given by

$f_{U}\triangleq\mathbf{a}_{N}^{H}\left(\varphi_{t}^{a},\varphi_{t}^{e}\right)\mathbf{\Phi\bar{g}}_{U}=\sum_{n=1}^{N}{e^{j2\pi\frac{d}{\lambda}\left(xk+yq\right)+j\theta_{nU}}\,\,},$
(14)

where
$k=\sin\varphi_{r}^{a}\sin\varphi_{r}^{e}-\sin\varphi_{t}^{a}\sin\varphi_{t}^{e}$
and $q=\cos\varphi_{r}^{e}-\cos\varphi_{t}^{e}$.

To obtain
$\mathbb{E}\left\\{|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{m}|^{2}\right\\}$,
we calculate every terms in (13), for instance,

$\displaystyle w_{2}$
$\displaystyle=\mathbb{E}\Big{\\{}\sum_{n=1}^{N}{|\left[\mathbf{a}_{N}^{*}\left(\varphi_{t}^{a},\varphi_{t}^{e}\right)\right]_{n}e^{j\theta_{nU}}}\left[\mathbf{\tilde{g}}_{U}\right]_{n}|^{2}\Big{\\}}$
$\displaystyle=\mathbb{E}\Big{\\{}\sum_{n=1}^{N}{|}\left[\mathbf{\tilde{g}}_{U}\right]_{n}|^{2}\Big{\\}}=N.$
(15)

Similarly, the other terms in (13) can be obtained as

$\displaystyle w_{1}=|f_{U}|^{2},w_{3}=N,w_{4}=N.$ (16)

Substituting (III-A) and (16) into (13), we have

$\displaystyle\mathbb{E}\left\\{|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{m}|^{2}\right\\}$
$\displaystyle\;\;\;\;\;\;\;\;\;\;=\gamma_{U}\left(K_{1}K_{2}|f_{U}|^{2}+K_{1}N+K_{2}N+N\right).$
(17)

Thus, the term $\delta$ in (12) can be derived as

$\delta=M\gamma_{U}\left(K_{1}K_{2}|f_{U}|^{2}+\left(K_{1}+K_{2}+1\right)N\right).$
(18)

Furthermore, the term
$\mathbb{E}\left\\{||\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}||_{2}^{4}\right\\}$
in (11) can be written as

$\mathbb{E}\left\\{||\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}||_{2}^{4}\right\\}=\sum_{m=1}^{M}{\mathbb{E}\left\\{|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{m}|^{4}\right\\}}$
$\vspace{-0.2cm}\\!\\!+2\\!\\!\sum_{m=1}^{M-1}{\\!\sum_{h=m+1}^{M}{\\!\\!\\!\\!\\!\mathbb{E}\left\\{|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{m}|^{2}|\left[\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right]_{h}|^{2}\right\\}}}\\!\triangleq\\!\xi.$
(19)

By using the similar method for calculating (13), we can obtain $\xi$ given by
(II) at the bottom of this page.

We then transform the last expectation in (11) as

$\displaystyle\mathbb{E}\left\\{\mathbf{g}_{U}^{H}\mathbf{\Phi}_{U}^{H}\mathbf{H}_{U}^{H}\mathbf{H}_{U}\mathbf{H}_{U}^{H}\mathbf{H}_{U}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right\\}$
$\displaystyle\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;=\mathbb{E}\left\\{\mathbf{g}_{U}^{H}\mathbf{\Phi}_{U}^{H}\mathbb{E}\left\\{\mathbf{W}_{U}\mathbf{W}_{U}\right\\}\mathbf{\Phi}_{U}\mathbf{g}_{U}\right\\}\triangleq\nu,$
(21)

where $\mathbf{W}_{U}=\mathbf{H}_{U}^{H}\mathbf{H}_{U}$ is a non-central
Wishart matrix following
$\mathcal{W}\left(M,\mathbf{A}_{U},\mathbf{\Sigma}_{U}\right)$ with
$\mathbf{A}_{U}=\sqrt{\frac{\alpha_{U}K_{1}}{K_{1}+1}}\mathbf{\bar{H}}_{U}$
and $\mathbf{\Sigma}_{U}=\frac{\alpha_{U}}{K_{1}+1}\mathbf{I}_{N}$. According
to [10], the non-central Wishart matrix $\mathbf{W}_{U}$ can be approximated
by a central Wishart distribution
$\mathcal{W}\left(M,\mathbf{0},\mathbf{\bar{\Sigma}}_{U}\right)$ with

$\mathbf{\bar{\Sigma}}_{U}\\!=\\!\mathbf{\Sigma}_{U}\\!+\\!\frac{1}{M}\mathbf{A}_{U}^{H}\mathbf{A}_{U}\\!=\\!\frac{\alpha_{U}}{K_{1}+1}\Big{(}\mathbf{I}_{N}\\!+\\!\frac{K_{1}}{M}\mathbf{\bar{H}}_{U}^{H}\mathbf{\bar{H}}_{U}\Big{)}.$
(22)

According to [11], we obtain
$\mathbb{E}\left\\{\mathbf{W}_{U}\mathbf{W}_{U}\right\\}$ given by

$\displaystyle\mathbb{E}\left\\{\mathbf{W}_{U}\mathbf{W}_{U}\right\\}=\frac{\alpha_{U}^{2}MN}{K_{1}+1}\Big{(}\mathbf{I}_{N}+\frac{K_{1}}{M}\mathbf{\bar{H}}_{U}^{H}\mathbf{\bar{H}}_{U}\Big{)}$
$\displaystyle+\\!\frac{M^{2}\alpha_{U}^{2}}{\\!\left(\\!K_{1}\\!+\\!1\right)^{2}}\\!\Big{(}\\!\mathbf{I}_{N}\\!+\\!\frac{2K_{1}}{M}\mathbf{\bar{H}}_{U}^{H}\mathbf{\bar{H}}_{U}\\!+\\!\frac{K_{1}^{2}}{M^{2}}\mathbf{\bar{H}}_{U}^{H}\mathbf{\bar{H}}_{U}\mathbf{\bar{H}}_{U}^{H}\mathbf{\bar{H}}_{U}\\!\Big{)}\\!\\!.\\!\\!\\!$
(23)

Utilizing (III-A) and the fact that
$\mathrm{tr}(\mathbf{AB})=\mathrm{tr}(\mathbf{BA})$, we can further derive
$\nu$ as (24) at the bottom of this page.

By substituting (II), (12)–(24) into (11), we can obtain (10). Thus, the proof
is completed. $\blacksquare$

Remark 1: We denote
$\mathrm{\gamma_{BS}^{U}}=\frac{p_{r,U}}{\sigma_{N,U}^{2}}$, and
$\mathrm{\gamma_{RIS}^{U}}=\frac{p_{t,U}}{\sigma_{V,U}^{2}}$. When
$\mathrm{\gamma_{BS}^{U}}\rightarrow\infty$, the AR in (10) converges to

$R_{U}\rightarrow\log_{2}\\!\left(1+\frac{\xi}{\nu}\mathrm{\gamma_{RIS}^{U}}\right).$
(25)

When $\mathrm{\gamma_{RIS}^{U}}\rightarrow\infty$, we have

$R_{U}\rightarrow\log_{2}\\!\left(1+\frac{\xi}{N\beta_{U}\\!\delta}\mathrm{\gamma_{BS}^{U}}\right).$
(26)

In one respect, the equations above show that the SNR $\gamma_{U}$ keeps a
linear relationship with $\mathrm{\gamma_{RIS}^{U}}$, when
$\mathrm{\gamma_{BS}^{U}}$ is high. On the other hand, when
$\mathrm{\gamma_{RIS}^{U}}$ is high, the SNR and $\mathrm{\gamma_{BS}^{U}}$
also keeps a linear relationship.

Then, we further introduce the power consumption of the considered system. The
uplink overall transmission power is denoted by

$p_{U}=p_{t,U}+p_{r,U}+N\left(p_{\text{SW}}+p_{\text{DC}}\right),$ (27)

where $p_{\text{DC}}$ is the direct current biasing power for each active RIS
element. $p_{\text{SW}}$ is the power consumed by each RIS element to switch
the phase shift and control the circuit. For comparison, we provide the AR of
the passive RIS system and its power consumption in the following corollary.
By setting $\eta_{U}=1$ and $\sigma_{V,U}^{2}=0$ in (II) and (10), we can
obtain the AR of uplink passive RIS system in the following corollary.

######  Corollary 1.

When the passive RIS system has the same overall transmission power $p_{U}$ as
the active RIS system, the AR of the uplink passive RIS system is given by

$\vspace{-0.1cm}R_{U}^{P}\approx\log_{2}\Big{(}1+\frac{p_{t,U}^{\prime}\xi}{\sigma_{N,U}^{2}\delta}\Big{)},$
(28)

where $p_{t,U}^{\prime}$ is the transmission power at the user in the passive
RIS system, and defined as

$\vspace{-0.1cm}p_{U}=p_{t,U}^{\prime}+Np_{\text{SW}}.$ (29)

$\\!\\!\\!\\!\\!\\!\tau\\!\overset{\left(b\right)}{=}\\!\frac{M^{2}\alpha_{D}\gamma_{D}}{\\!\left(K_{3}\\!+\\!1\\!\right)}\\!\left(\\!NK_{4}\\!+\\!N\\!+\\!2K_{3}K_{4}|f_{D}|^{2}\\!+\\!2K_{3}N+K_{3}^{2}K_{4}N|f_{D}|^{2}\\!+\\!K_{3}^{2}N^{2}\right)\\!+\\!MN\alpha_{D}\gamma_{D}\left(NK_{4}\\!+\\!N\\!+\\!K_{3}K_{4}|f_{D}|^{2}\\!+\\!K_{3}N\right)\\!\\!\\!\\!\\!\\!\\!\\!$
(44)

$\displaystyle\mathbb{E}\left\\{\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\rVert_{2}^{4}\right\\}\\!\\!=$
$\displaystyle
M^{2}\gamma_{D}^{2}K_{3}^{2}K_{4}^{2}|f_{D}|^{4}+2M\gamma_{D}^{2}K_{3}K_{4}|f_{D}|^{2}\left(2MNK_{3}+MNK_{4}+MN+2M+NK_{4}+N-2\right)$
$\displaystyle+M\gamma_{D}^{2}N^{2}\left(K_{4}^{2}+2K_{3}K_{4}+2K_{3}+2K_{4}+1\right)+\gamma_{D}^{2}M\left(M+1\right)N\left(2K_{3}+2K_{4}+1\right)$

$\vspace{-.4cm}+M^{2}\gamma_{D}^{2}N^{2}\left(2K_{3}^{2}+K_{4}^{2}+2K_{3}K_{4}+2K_{3}+2K_{4}+1\right)\triangleq\zeta$
(50)

###  III-B Phase Shift Design

We solve the PSOP to maximize the uplink AR by using the genetic algorithm
(GA)-based method in this subsection.

Specifically, the PSOP is formulated as follows

$\displaystyle\max_{\mathbf{\Phi}_{U}}\,\,R_{U}$ (30a)
$\displaystyle\mathrm{s}.\mathrm{t}.\,\,\,\theta_{nU}\in$
$\displaystyle\\{0,2\pi/2^{b},\ldots,2\pi(2^{b}-1)/2^{b}\\}$ $\displaystyle\
\forall n=1,\ldots,N.$ (30b)

We solve the above PSOP by tuning the phase shifts with the GA-based approach,
which is detailed in [12, Algorithm 1]. The proposed GA method consists of
population initialization, fitness evaluation, selection, crossover, and
mutation. In addition, we take into account the discrete phase shifts case
which uses $b$-bit quantification.

##  IV Extension to Downlink

In this section, we extend the active RIS-aided communication system to the
downlink system. This section contains the system model and AR analysis.

###  IV-A Downlink System Model

Similar to the uplink channels, the downlink channels $\mathbf{H}_{D}$ and
$\mathbf{g}_{D}$ follow Rician fading, which are respectively given by

$\mathbf{H}_{D}=\sqrt{\alpha_{D}}\Big{(}\sqrt{\frac{K_{3}}{K_{3}+1}}\overline{\mathbf{H}}_{D}+\sqrt{\frac{1}{K_{3}+1}}\widetilde{\mathbf{H}}_{D}\Big{)},$
(31)
$\vspace{-0.1cm}\mathbf{g}_{D}=\sqrt{\beta_{D}}\Big{(}\sqrt{\frac{K_{4}}{K_{4}+1}}\overline{\mathbf{g}}_{D}+\sqrt{\frac{1}{K_{4}+1}}\widetilde{\mathbf{g}}_{D}\Big{)},$
(32)

where the LoS components are
$\mathbf{\bar{H}}_{D}=\mathbf{a}_{N}\left(\psi_{r}^{a},\psi_{r}^{e}\right)\mathbf{a}_{M}^{H}\left(\omega_{t}^{a},\omega_{t}^{e}\right)$
and
$\mathbf{\bar{g}}_{D}=\mathbf{a}_{N}^{H}\left(\omega_{r}^{a},\omega_{r}^{e}\right)$.
And the NLoS components $\widetilde{\mathbf{H}}_{D}$ and
$\widetilde{\mathbf{g}}_{D}$ consist of i.i.d. entries, all of which follow
the complex Gaussian distribution of $\mathcal{CN}(0,1)$. The angles
$\psi_{r}^{a}$ and $\psi_{r}^{e}$ are respectively the A-AoA and E-AoA from
the RIS to the BS. $\omega_{t}^{a}$ and $\omega_{t}^{e}$ are respectively the
A-AoD and E-AoD at the BS to the RIS while $\omega_{r}^{a}$ and
$\omega_{r}^{e}$ are the A-AoD and E-AoD at the RIS to the user.

Then, the signal received at the user is given by

$r_{D}=\mathbf{g}_{D}\mathbf{\Lambda}_{D}\mathbf{\Phi}_{D}\left(\mathbf{H}_{D}\mathbf{w}_{D}s+\mathbf{v}_{D}\right)+n_{D},$
(33)

where $s$ represents the transmitted symbol from the BS with
$\mathbb{E}\left\\{\left|s\right|^{2}\right\\}=1$. The vector
$\mathbf{v}_{D}\in\mathbb{C}^{N\times 1}\sim{\cal
CN}\left(\mathbf{0},\sigma_{V,D}^{2}\mathbf{I}_{N}\right)$ is the downlink
thermal noise at the RIS. The vector $\mathbf{n}_{D}\in\mathbb{C}^{M\times
1}\sim\mathcal{C}\mathcal{N}\left(\mathbf{0},\sigma_{N,D}^{2}\mathbf{I}_{M}\right)$
is the AWGN at the user. The power amplification factor matrix
$\bm{\Lambda}_{D}=\eta_{D}\mathbf{I}_{N}$, where $\eta_{D}$ is the downlink
amplification factor. The phase shift matrix
$\mathbf{\Phi}_{D}=\mathrm{diag}\left(e^{j\theta_{1D}},e^{j\theta_{nD}},\cdots,e^{j\theta_{ND}}\right)$,
where $\theta_{nD}$ is the phase shift of the $n$th RIS element. The maximal
ratio transmission beamforming vector $\mathbf{w}_{D}$ is

$\mathbf{w}_{D}=\sqrt{\mu_{D}}\left(\mathbf{g}_{D}\mathbf{\Lambda}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\right)^{H},$
(34)

satisfying

$\mathbb{E}\left\\{\mathbf{w}_{D}^{H}\mathbf{w}_{D}\right\\}=p_{t,D},$ (35)

where $p_{t,D}$ is the downlink transmission power, and the beamforming
coefficient $\mu_{D}$ is

$\\!\\!\mu_{D}=\frac{p_{t,D}}{\mathbb{E}\left\\{\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\rVert_{2}^{2}\right\\}}=\frac{p_{t,D}}{\\!\\!\eta_{D}^{2}\frac{\alpha_{D}}{K_{3}+1}\left(K_{3}\varrho+M\beta_{D}N\right)}\\!,\\!\\!\\!\\!\\!\\!$
(36)

with

$\varrho=M\gamma_{D}\left(K_{3}K_{4}|f_{D}|^{2}+\left(K_{3}+K_{4}+1\right)N\right).$
(37)

In (37),
$\gamma_{D}=\frac{\alpha_{D}\beta_{D}}{\left(K_{3}+1\right)\left(K_{4}+1\right)}$
and $f_{D}$ is given by

$f_{D}\triangleq\mathbf{\bar{g}}_{D}\mathbf{\Phi}_{D}\mathbf{a}_{N}\left(\psi_{r}^{a},\psi_{r}^{e}\right)=\sum_{n=1}^{N}{e^{j2\pi\frac{d}{\lambda}\left(x\ell+yz\right)+j\theta_{nD}}\,\,},$
(38)

where $\ell=\sin\psi_{r}^{a}\sin\psi_{r}^{e}-\sin\psi_{t}^{a}\sin\psi_{t}^{e}$
and $z=\cos\psi_{r}^{e}-\cos\psi_{t}^{e}$.

Moreover, similar to the uplink system, we assume each RIS element shares the
same amplification factor $\eta_{D}$, which is given in the following Lemma.

######  Lemma 1.

When the downlink amplification power of the RIS is $p_{r,D}$, the
amplification factor $\eta_{D}$ can be obtained as

$\eta_{D}=\sqrt{\frac{p_{r,D}\frac{\alpha_{D}}{K_{3}+1}\left(K_{3}\varrho+M\beta_{D}N\right)}{p_{t,D}\tau+\sigma_{V,D}^{2}N\frac{\alpha_{D}}{K_{3}+1}\left(K_{3}\varrho+M\beta_{D}N\right)}}.$
(39)

Proof: From (33), we can obtain that

$\displaystyle
p_{r,D}\\!=\\!\mathbb{E}\left\\{\lVert\mathbf{\Lambda}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\mathbf{w}_{D}s\rVert_{2}^{2}\\!+\\!\lVert\mathbf{\Lambda}_{D}\mathbf{\Phi}_{D}\mathbf{v}_{D}\rVert_{2}^{2}\right\\}\\!$
(40)
$\displaystyle\\!\\!\\!\\!=\eta_{D}^{4}\mu_{D}\mathbb{E}\left\\{\lVert\mathbf{\Phi}_{D}\mathbf{H}_{D}\mathbf{H}_{D}^{H}\mathbf{\Phi}_{D}^{H}\mathbf{g}_{D}^{H}\rVert_{2}^{2}\right\\}\\!+\\!\mathbb{E}\left\\{\lVert\mathbf{\Lambda}_{D}\mathbf{\Phi}_{D}\mathbf{v}_{D}\rVert_{2}^{2}\right\\}\\!\\!.$

The first expectation in (40) can be rewritten as

$\displaystyle\mathbb{E}\left\\{\lVert\mathbf{\Phi}_{D}\mathbf{H}_{D}\mathbf{H}_{D}^{H}\mathbf{\Phi}_{D}^{H}\mathbf{g}_{D}^{H}\rVert_{2}^{2}\right\\}$
$\displaystyle\;\;\;\;\;\;\;\;\;\;\;\;=\mathbb{E}\left\\{\mathbf{g}_{D}\mathbf{\Phi}_{D}\mathbb{E}\left\\{\mathbf{W}_{D}\mathbf{W}_{D}\right\\}\mathbf{\Phi}_{D}^{H}\mathbf{g}_{D}^{H}\right\\}\triangleq\tau,$
(41)

where $\mathbf{W}_{D}=\mathbf{H}_{D}\mathbf{H}_{D}^{H}$ is a non-central
Wishart matrix following
$\mathcal{W}\left(M,\mathbf{A}_{D},\mathbf{\Sigma}_{D}\right)$ with
$\mathbf{A}_{D}=\sqrt{\frac{\alpha_{D}K_{3}}{K_{3}+1}}\mathbf{\bar{H}}_{D}^{H}$
and $\mathbf{\Sigma}_{D}=\frac{\alpha_{D}}{K_{3}+1}\mathbf{I}_{N}$. The
distribution of $\mathbf{W}_{D}$ can be approximated by
$\mathcal{W}\left(M,\mathbf{0},\mathbf{\bar{\Sigma}}_{D}\right)$ with

$\mathbf{\bar{\Sigma}}_{D}\\!=\\!\mathbf{\Sigma}_{D}\\!+\\!\frac{1}{M}\mathbf{A}_{D}^{H}\mathbf{A}_{D}\\!=\\!\frac{\alpha_{D}}{K_{3}+1}\left(\mathbf{I}_{N}\\!+\\!\frac{K_{3}}{M}\mathbf{\bar{H}}_{D}\mathbf{\bar{H}}_{D}^{H}\right).$
(42)

The term $\mathbb{E}\left\\{\mathbf{W}_{D}\mathbf{W}_{D}\right\\}$ in (IV-A)
can be obtained as [11]

$\displaystyle\mathbb{E}\left\\{\mathbf{W}_{D}\mathbf{W}_{D}\right\\}=M^{2}\mathbf{\bar{\Sigma}}_{D}^{2}+M{\rm
tr}\left(\mathbf{\bar{\Sigma}}_{D}\right)\mathbf{\bar{\Sigma}}_{D}$
$\displaystyle=\\!\\!M^{2}\\!\Big{(}\\!\frac{\alpha_{D}}{K_{3}+1}\\!\Big{)}^{2}\Big{(}\\!\mathbf{I}_{N}\\!+\\!2\frac{K_{3}}{M}\mathbf{\bar{H}}_{D}\mathbf{\bar{H}}_{D}^{H}\\!+\\!\frac{K_{3}^{2}}{M^{2}}\mathbf{\bar{H}}_{D}\mathbf{\bar{H}}_{D}^{H}\mathbf{\bar{H}}_{D}\mathbf{\bar{H}}_{D}^{H}\Big{)}$
$\displaystyle\quad+M\alpha_{D}N\frac{\alpha_{D}}{K_{3}+1}\Big{(}\mathbf{I}_{N}+\frac{K_{3}}{M}\mathbf{\bar{H}}_{D}\mathbf{\bar{H}}_{D}^{H}\Big{)}.$
(43)

With the aid of (IV-A), we can derive $\tau$ given by (44) at the bottom of
this page.

Substituting (IV-A) and (44) into (40), we have

$p_{r,D}=\eta_{D}^{4}\mu_{D}\tau+\eta_{D}^{2}\sigma_{V,D}^{2}N.$ (45)

In addition, substituting (36) into (45), the final result can be obtained in
(39). $\blacksquare$

From (33) and (34), the downlink AR is given by

$R_{D}=\mathbb{E}\left\\{\log_{2}\left(1+{\gamma}_{D}\right)\right\\},$ (46)

with

$\vspace{-0.1cm}\gamma_{D}=\frac{\mu_{D}\eta_{D}^{4}\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\rVert_{2}^{4}}{\eta_{D}^{2}\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\rVert_{2}^{2}\sigma_{V,D}^{2}+\sigma_{N,D}^{2}}.$
(47)

###  IV-B Downlink Achievable Rate

######  Theorem 2.

The downlink AR can be approximated as

$\displaystyle R_{D}\\!\approx\\!$ (48)
$\displaystyle\log_{2}\\!\\!\Bigg{(}\\!\\!1\\!+\\!\frac{\frac{p_{r,D}p_{t,D}\zeta}{\frac{\alpha_{D}}{K_{3}+1}\left(K_{3}\varrho+M\beta_{D}N\right)}}{\\!\\!\\!\\!p_{r,D}\beta_{D}N\sigma_{V,D}^{2}\\!+\\!\left(\\!\\!\frac{p_{t,D}\tau}{\frac{\alpha_{D}}{K_{3}+1}\left(K_{3}\varrho\\!+\\!M\beta_{D}N\\!\right)}\\!+\\!\sigma_{V,D}^{2}N\\!\right)\\!\sigma_{N,D}^{2}}\\!\\!\Bigg{)}\\!,\\!\\!\\!\\!\\!\\!$

where $\zeta$ is given by (50).

Proof: Similar to the uplink system, $R_{D}$ in (46) can be approximated as

$R_{D}\approx\log_{2}\Big{(}1+\frac{\mu_{D}\eta_{D}^{4}\mathbb{E}\left\\{\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\rVert_{2}^{4}\right\\}}{\eta_{D}^{2}\mathbb{E}\left\\{\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\rVert_{2}^{2}\right\\}\sigma_{V,D}^{2}+\sigma_{N,D}^{2}}\Big{)}.$
(49)

By utilizing the similar methods in Section III, the term
$\mathbb{E}\left\\{\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\mathbf{H}_{D}\rVert_{2}^{4}\right\\}$
in (49) can be derived as (50) at the bottom of this page. By substituting
(50) and
$\mathbb{E}\left\\{\lVert\mathbf{g}_{D}\mathbf{\Phi}_{D}\rVert_{2}^{2}\right\\}=\beta_{D}N$
into (49), we obtain

$R_{D}\approx\log_{2}\Big{(}1+\frac{\mu_{D}\eta_{D}^{4}\zeta}{\eta_{D}^{2}\beta_{D}N\sigma_{V,D}^{2}+\sigma_{N,D}^{2}}\Big{)}.$
(50)

In addition, substituting (36) and (39) into (50), we derive the final result
in (48), and the proof is completed. $\blacksquare$

Remark 2: We denote
$\mathrm{\gamma_{US}^{D}}=\frac{p_{r,D}}{\sigma_{N,D}^{2}}$, and
$\mathrm{\gamma_{RIS}^{D}}=\frac{p_{t,D}}{\sigma_{V,D}^{2}}$. When
$\mathrm{\gamma_{US}^{D}}\rightarrow\infty$, the AR in (48) converges to

$R_{D}\rightarrow\log_{2}\left(1+\frac{\zeta}{\tau}\mathrm{\gamma_{US}^{D}}\right).$
(51)

When $\mathrm{\gamma_{RIS}^{D}}\rightarrow\infty$, we have

$R_{D}\\!\rightarrow\log_{2}\Big{(}1+\frac{\zeta\mathrm{\gamma_{RIS}^{D}}}{\frac{\alpha_{D}\beta_{D}}{K_{3}+1}N\left(K_{3}\varrho+M\beta_{D}N\right)}\Big{)}.$
(52)

The equations above show similar results as it in the uplink system.

Moreover, we focus on the power consumption of the considered system. The
downlink overall transmission power is denoted by

$p_{D}=p_{t,D}+p_{r,D}+N\left(p_{\text{SW}}+p_{\text{DC}}\right).$ (53)

For comparison, the following corollary provides the achievable rate and the
power consumption of the passive RIS system. By setting $\eta_{D}=1$ and
$\sigma_{V,D}^{2}=0$ in (45) and (48), we can obtain the achievable rate of
the downlink passive RIS system in the following corollary.

######  Corollary 2.

When the passive RIS system has the same overall transmission power $p_{D}$ as
the active RIS system, the AR of the downlink passive RIS system is given by

$\vspace{-0.1cm}R_{D}^{P}\approx\log_{2}\Big{(}1+\frac{\mu_{D}^{\prime}\zeta}{\sigma_{N,D}^{2}}\Big{)},$
(54)

where $p_{t,D}^{\prime}$ is the transmission power at the BS in the passive
RIS system, and defined as

$p_{D}=p_{t,D}^{\prime}+Np_{\text{SW}}.$ (55)

The optimal phase shift for the downlink system can be obtained by using the
GA method, which is similar to the uplink system in Section III. For
simplicity, the details are omitted.

##  V Simulation Results

We analyze the performance of the proposed communication systems, by setting
$\sigma^{2}_{V,U}=\sigma^{2}_{V,D}=-70$ dBm,
$\sigma^{2}_{N,U}=\sigma^{2}_{N,D}=-80$ dBm, $M$ = 128, $N$ = 256, $K_{1}$ =
10, and $K_{2}$ = 1. For convenience, we set $p_{t,U}=p_{r,U}$ and
$p_{t,D}=p_{r,D}$ in this paper.

Figure 1: Uplink AR versus $p_{U}$.

In Fig. 1, we depict the uplink AR versus the transmission power. The uplink
rates are respectively obtained from the approximate analytical expression
results in (10) and Monte-Carlo simulation results in (8). The former matches
the latter well, which demonstrates the accuracy of our derivations. In
addition, the active RIS system outperforms the passive RIS system.
Furthermore, the rate with the optimal phase shifts obtained by the GA-based
method performs better than that with random phase shifts, which indicates the
importance of optimizing the phase shifts.

Figure 2: Downlink AR versus $p_{D}$.

Fig. 2 illustrates the downlink AR versus the transmission power. The uplink
rates are respectively obtained from the approximate expression results in
(48) and Monte-Carlo simulation results in (46). It is noticed that when the
total power increases from 10 dBm to 25 dBm, the passive RIS system
outperforms the active RIS one. Compared with the passive RIS, the active RIS
consumes additional power consumption $p_{\text{CD}}$, and thus its starting
power threshold is higher. However, when the power supply is enough to support
the operation of the active RIS, the performance of the active RIS system
quickly surpasses that of the passive RIS system.

##  VI Conclusion

This paper investigated an active RIS-aided two-timescale two-way transmission
communication. We derived a tight closed-form approximation for the AR, and
the simulation results demonstrated the correctness. Besides, we adopted the
GA method to solve the PSOP of the active RIS. For comparison, we also
simulated the AR achieved by the passive RIS system with both the optimized
phase shifts and the random phase shifts. Simulation results showed that the
active RIS system outperforms the passive RIS system when the minimum power
requirement of the active RIS is met.

## References

  * [1] C. Huang, A. Zappone, G. C. Alexandropoulos, M. Debbah, and C. Yuen, “Reconfigurable intelligent surfaces for energy efficiency in wireless communication,” _IEEE Trans. Wireless Commun._ , vol. 18, no. 8, pp. 4157–4170, Aug. 2019.
  * [2] Q. Wu and R. Zhang, “Towards smart and reconfigurable environment: Intelligent reflecting surface aided wireless network,” _IEEE Commun. Mag._ , vol. 58, no. 1, pp. 106–112, Jan. 2020.
  * [3] C. Pan _et al._ , “Reconfigurable intelligent surfaces for 6G systems: Principles, applications, and research directions,” _IEEE Commun. Mag._ , vol. 59, no. 6, pp. 14–20, Jun. 2021.
  * [4] Z. Zhang, _et al._ , “Active RIS vs. Passive RIS: Which will prevail in 6G?” Mar. 2021. [Online]. Available: https://arxiv.org/abs/2103.15154
  * [5] R. Long, Y.-C. Liang, Y. Pei, and E. G. Larsson, “Active reconfigurable intelligent surface-aided wireless communications,” _IEEE Trans. Wireless Commun._ , vol. 20, no. 8, pp. 4962–4975, Aug. 2021.
  * [6] K. Zhi, C. Pan, H. Ren, K. K. Chai, and M. Elkashlan, “Active RIS versus passive RIS: Which is superior with the same power budget?” _IEEE Commun. Lett._ , vol. 26, no. 5, pp. 1150–1154, May 2022.
  * [7] Y. Han, W. Tang, S. Jin, C.-K. Wen, and X. Ma, “Large intelligent surface-assisted wireless communication exploiting statistical CSI,” _IEEE Trans. Veh. Technol._ , vol. 68, no. 8, pp. 8238–8242, Aug. 2019.
  * [8] C. Hu, L. Dai, S. Han, and X. Wang, “Two-timescale channel estimation for reconfigurable intelligent surface aided wireless communications,” _IEEE Transactions on Communications_ , vol. 69, no. 11, pp. 7736–7747, Nov. 2021.
  * [9] Q. Zhang, S. Jin, K.-K. Wong, H. Zhu, and M. Matthaiou, “Power scaling of uplink massive MIMO systems with arbitrary-rank channel means,” _IEEE J. Sel. Topics Signal Process._ , vol. 8, no. 5, pp. 966–981, Oct. 2014.
  * [10] H. S. Steyn and J. Roux, “Approximations for the non-central Wishart distribution,” _South African Statist. J._ , vol. 6, pp. 165–173, 1972.
  * [11] J. A. Tague and C. I. Caldwell, “Expectations of useful complex wishart forms,” _Multidimensional Syst. Signal Process._ , vol. 5, no. 3, pp. 263–279, Jul. 1994. [Online]. Available: https:// doi.org/10.1007/BF00980709
  * [12] K. Zhi, C. Pan, H. Ren, and K. Wang, “Statistical CSI-based design for reconfigurable intelligent surface-aided massive MIMO systems with direct links,” _IEEE Wireless Commun. Lett._ , vol. 10, no. 5, pp. 1128–1132, May 2021.