# Using Foundation Models
to Detect Policy Violations with Minimal Supervision

Sid Mittal, Vineet Gupta, Frederick Liu, Mukund Sundararajan
Google LLC
<EMAIL_ADDRESS>
###### Abstract

Foundation models, i.e. large neural networks pre-trained on large text
corpora, have revolutionized NLP. They can be instructed directly (e.g. Brown
et al. (2020))—this is called _hard prompting_ —and they can be tuned using
very little data (e.g. Lester et al. (2021))—this technique is called _soft
prompting_. We seek to leverage their capabilities to detect policy
violations. Our contributions are:

  * •

We identify a hard prompt that adapts chain-of-thought prompting to policy
violation tasks. This prompt produces policy violation classifications, along
with extractive explanations that justify the classification.

  * •

We compose the hard-prompts with soft-prompt tuning to produce a classifier
that attains high accuracy with very little supervision; the same classifier
also produces explanations. Though the supervision only acts on the
classifications, we find that the modified explanations remain consistent with
the (tuned) model’s response.

  * •

Along the way, we identify several unintuitive aspects of foundation models.
For instance, adding an example from a specific class can actually reduce
predictions of that class, and separately, the effects of tokenization on
scoring etc.

  * •

Based on our technical results, we identify a simple workflow for product
teams to quickly develop effective policy violation detectors.

##  1 Introduction

Trigger warning: Sections 2.1 and the appendices contain examples of toxic
comments.

###  1.1 Foundation Models, Prompting, Prompt Tuning

Natural language processing has been transformed by large language models
(Peters et al., 2018; Devlin et al., 2018; Brown et al., 2020; Chowdhery et
al., 2022), pre-trained on large corpora; these are also called _foundation
models_. Foundation models demonstrate excellent performance on a wide-variety
of tasks including translation, answering questions involving factual
knowledge, math problems, or common-sense reasoning Chung et al. (2022).

Foundation models can be instructed to perform a task; this is called
prompting (e.g. Brown et al. (2020)). They can also be fine-tuned efficiently
using very little data using an approach called soft-prompt tuning (e.g.
Lester et al. (2021); Li and Liang (2021)), discussed further in Section 3.

###  1.2 Toxicity Detection

We seek to leverage foundation models to detect policy violations. We will use
a toxicity detection task (tox, 2019) as a running-example; the task is to
identify if a piece of text is insulting, identity-hating, or contains obscene
references. These pieces of text could be comments about some content (news
article or video), or discussions in a forum. Currently, this task is
performed by a combination of humans and machines; humans label training data,
which machines use for supervised classification.

Issuing rater instructions, collecting training data, and building models
using supervised learning is a fairly labor intensive process. In contrast,
prompting can be used for one-off tasks where the cost of collecting data is
prohibitive, or to quickly modify instructions when guidelines change, or to
test new instructions for human raters.

We expect foundation models to have some knowledge of toxicity because they
are trained on portions of the web, news articles and even social media
conversations (see Section 3 in Chowdhery et al. (2022)). State-of-the-art
results have been achieved on the toxicity task by other Transformer based
language models such as BERT (Duchene et al., 2023), but there is no prior
benchmark that uses models as large as this work and with this little
supervision.

###  1.3 Roadmap

See abstract for a description of our contributions.

Section 2 describes the design of our prompt, including how we adapt chain-of-
thought reasoning, and produce extractive explanations. Section 3 describes
how we do soft-prompt tuning. Section 4.1 justifies aspects of our prompt
design using ablation studies. Section 4.2 discusses how performance varies as
we change the tuning dataset size. Sections 4.3, 4.4 and 4.5 indicate a useful
mental abstraction of foundation models.

##  2 Prompt Design

A hard prompt consists of text instructions and optionally a few examples of
the desired input/output. This is prepended to the inputs to the foundation
model. We discuss the major ideas in the design of our hard prompt below.

###  2.1 The Hard Prompt

Our hard prompt consists of a Guideline describing the task, followed by a few
examples, each consisting of a Comment, Answer, Explanation, Citation and
Keywords. The structure of the prompt allows the model to switch between
generative (for Explanation) and extractive modes (for Keywords and Citation).
Here is part of our prompt. (The full prompt is in Appendix A.)

    Toxic Policy:
    A toxic comment is one which is likely to make the conversation
    partner leave a discussion or give up on sharing their perspective.
    A comment violates the Toxic Policy if the author:
    (1) makes obscene references.
    ...
    (4) humiliates their conversation partner
    ...
    Question: Does the comment violate the Toxic Policy?
    ...
    <Comment> @ okay king of the Wikipedia Nazis. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’king of the Wikipedia Nazis’ so
    it violates ’(4) humiliates their conversation partner’.
    </Explanation>
    <Citations> (4) humiliates their conversation partner </Citations>
    <Keywords> king of the Wikipedia Nazis </Keywords>
    ---

###  2.2 Extractive Explanations

Citations and Keywords are examples of extractive explanations applied to
prompting. Extractive Explanations (DeYoung et al., 2019; Narang et al., 2020)
are excerpts from the input text that are produced along with the model’s
response; the excerpt justifies or explains the response. We produce two types
of excerpts: ‘Keywords’ that are drawn from the input text (Comment), and
‘Citations’ that are drawn from the Guideline.

###  2.3 Grounded Reasoning Chains

The structure of our prompt bears resemblance to Chain-of-Thought Prompts (Wei
et al., 2022), where models perform tasks in reasoning or mathematics by being
prompted using triples of the form <Question, Reasoning, Answer>. In their
case, reasoning is an argument or a derivation that helps the model arrive at
the right answer.

In contrast, we partition our reasoning into three steps. Two grounded steps
extract relevant keywords (e.g. ’king of the Wikipedia Nazis’ in the example
above) from the comment and the applicable citation (e.g. ’humiliates their
conversation partner’) from the guideline. The reasoning can be intuitively
interpreted as: The Answer is Yes/No because the excerpt ’Keywords’ violates
the guideline bullet ’Citation’. The third step is the ’Explanation’ block, a
natural language statement that articulates this argument. Our requirement to
tune a soft-prompt also influences the prompt design — see Section 4.2.

###  2.4 XML Tags

Most other works structure their prompts by using section headings, i.e.,

    Text: some text
    Reasoning: some reasoning
    Answer: some response

We found this to be fragile when there were long, multi-line comments. We
found it effective to use XML-style markup to demarcate the blocks. This
eliminates the fragility as we show in Section 4.1 — our models consistently
generated the correct XML-like structure. In addition section headings led to
tokenization problems (Section 4.5), which we avoid with XML and proper
spacing.

##  3 Soft Prompt Tuning

###  3.1 What is soft prompt tuning?

Soft prompt tuning Lester et al. (2021) trains a model on a few hundred or few
thousand examples. However, unlike classic fine-tuning, the model’s parameters
are frozen. Instead a few artificial tokens are prefixed to each input — the
embeddings of these tokens are tuned via gradient descent. These prefixed
tokens are called the ‘soft’ prompt. The advantage of this approach is that a
single (expensive) foundation model can be used for a variety of tasks.

###  3.2 Training Dataset Size

We choose a small subset of training examples as a dataset for prompt tuning.
This mimics how we intend to apply foundation models. If a lot of training
data is available, we could instead use smaller models like BERT; BERT models
are cheaper to operate, but need much more supervision. We therefore seek to
apply foundation models when a lot of labeled data is not yet available and
choose to work with datasets of size 50-5000.

###  3.3 Composing Prompt Tuning with Extractive Explanations

We assume that supervision is only available for the model’s prediction (toxic
or not). No supervision is available for the extractive explanations, because
it is harder to produce such supervision. However, we would like the tuned
model to produce extractive explanations. We therefore include the hard prompt
during tuning and inference.111One approach is to prompt tune the model
without the hard prompt, and add the hard prompt at inference time to get the
explanations. However this did not work — the resultant model did not produce
any explanations; it just returned the ’Yes’ or ’No’ over and over again.

There has been some prior work in combinations of soft and hard prompts, but
none to best of our knowledge with a similar setting to ours: using a hard
prompt to generate structured explanations, while tuning the soft prompt with
supervision from a binary label. The prior works Yu et al. (2022); Liu et al.
(2021) start with a classification task, and use the hard prompts to make the
task resemble the pretraining task. For instance, for a sentiment scoring
task, the hard prompt appends the review with a template such as "It was X",
where the output blank is scored for the probability of [great] or [terrible].
Han et al. (2021) extends this to the multiclass setting using prior knowledge
of each class. In contrast, the goal of the hard prompt in our case is to
provide guidelines to describe the task and to control the format of the
output.

##  4 Experiments

We perform experiments on the toxicity detection dataset from tox (2019). The
binary classification task is to predict whether a piece of text is toxic or
not, i.e. whether it contains abusive or hateful speech that causes the reader
to disengage from a conversation.

The dataset contains around 2M examples. We use the provided splits for train
and test. We also downsample the negative examples in order to create balanced
splits for train, validation (pulling examples from train split), and test. We
randomly sample to further create train samples of size 50, 100, 200, 500, 1k,
2k, and 5k in order to show scaling performance. Our test set is of size 5000.
Our results varied only slightly with test set re-sampling.

We focus our experiments on 3 models: 62B FLAN-cont-PaLM, 540B FLAN-PaLM, and
540B FLAN-U-PaLM Chung et al. (2022). In addition to being pretrained with
prior world knowledge, the instruction tuning from FLAN allows these models to
achieve superior few shot and zero shot performance on a variety of
benchmarks.

###  4.1 Ablation Studies

In this section, we justify aspects of our hard prompt (Section 2.1) using
ablation experiments. For all experiments in this section, we use 540B FLAN-U-
PaLM model Chung et al. (2022).

Experiment Positive Acc Negative Acc Balanced Acc Few-shot prompt (Section
2.1) 0.774 0.835 0.805 Prompt with no guideline 0.734 0.826 0.780 Answer-only
0.764 0.808 0.786 No XML Tags 0.727 0.861 0.794 Zero Shot 0.731 0.870 0.801

Table 1: Ablation studies of our proposed few-shot prompt. Positive and
negative accuracies are the recalls on the positive and negative examples in
the dataset respectively, also called sensitivity and specificity in the
literature.

A few clarifications about the meaning of the rows in the Table 1. The
’baseline’ is the few-shot prompt in Appendix A. All our ablations are
performed on this version. ’Prompt with no guideline’ consists only of the
few-shot examples without the instructions/guideline that precede it. Since
without the guidelines, it doesn’t make sense to have citations or
explanations, we remove those as well. ’Answer only’ removes the explanation,
citations and keywords from the prompt, just producing a Yes/No answer. ’No
XML tags’ replaces XML tags with section headings as discussed in Section 2.4.
’Zero shot’ is a prompt with only the guidelines, without any few shot
examples. We see that our baseline outperforms the ablations in all cases for
balanced accuracy. (Note that given the nature of the problem, positive
accuracy is more important, all else being equal.)

###  4.2 Prompt tuning

We tuned a prompt consisting of 100 tokens, each with an embedding of
dimension $8192$ for the 62B model. Similarly, we tune a prompt of 40 tokens
with an embedding dimension of $18432$ for the 540B models. We trained these
tokens with a basic Adam optimizer with clipped gradients. We chose a default
learning rate and schedule for all our experiments, and did not tune
hyperparameters further. We set sampling temperature to 0 and fixed the prompt
initialization, to reduce randomness.

We experimented with different sizes of the dataset, to see how few examples
we could get away with. We show the results of our experiments in Figures 1
and 2. We find that the AUC-ROC and accuracy with a dataset of size as small
as 50 is significantly higher than with just the hard prompt; adding more
examples only produces a gradual increase in accuracy. From the graph it
appears that accuracy would increase with even larger datasets (larger than
5000 in size), but the goal of this work (as discussed in Section 3) is to
explore the benefit of this technique when few training examples are
available.

Figure 1: AUC for different training examples sizes, for three different
models. $0$ indicates no prompt tuning. Figure 2: Balanced accuracy for
different training examples sizes, for three different models. $0$ indicates
no prompt tuning.

We also computed the AUC for soft prompt tuning without the few-shot prompt,
and found it to be slightly lower — for the 62B model the AUC without the few-
shot prompt is $0.938$, whereas with the few-shot prompt it was $0.951$ (with
a training set of size 5000 examples). Thus, not only does the presence of the
few-shot prompt during fine-tuning help produce extractive explanations
(Keywords and Citations), it is also increases performance slightly.

In Appendix D, we show several examples where the prediction of the few-shot
prompt differed from the soft prompt. We note that whenever the soft-prompt
changes the output, it also constructs a coherent explanation. Thus the
explanations (and also citations and keywords) always match the prediction, so
the tuned prompt continues to produce useful explanations.

Producing the answer section before the explanations, citations and keywords
has a couple advantages. It allows for us to use supervision since the labels
are the immediate next generation of the hard prompt. It also speeds up
training because we only need to generate a single token output.

###  4.3 Few-shot examples are exemplars

In traditional ML, examples determine where the decision boundary is drawn,
and the boundary is drawn to maximize margin between positive and negative
examples. Typically, adding more examples of a certain class, increases the
number of times that class is predicted. In contrast, with foundation models,
the few examples that we supply, mimic ‘exemplars’, i.e. typical examples, as
it would with humans. Adding examples from a class could reduce the number of
times that class is predicted. For instance, if examples of violations are all
very severe, only true severe violations will be predicted as violations. A
corollary to this is that if you add an example of a severe violation, the
model would tend to predict fewer violations. This will cause the model to
miss subtle cases nearer the boundary between the two classes.

As an experiment, we added an extreme comment from our training data: ‘‘Hey
faggot, where is the citation for M Magazine? Plus, your gay comment has
atrocious syntax." Our original few-shot prompt identified 1441 of the 5000
examples as toxic, but the prompt augmented with the extreme example
identified only 1166 examples as toxic, affirming our intuition that as the
exemplars became more extreme, the model labeled only the more extreme
examples toxic.

###  4.4 Correlation between scores and ratings

A decoder only language model, such as the one we used, operates as follows:

  1. 1.

Parse the input text as a sequence of tokens, which are predefined character
strings (determined at the time of training the model).

  2. 2.

Compute a probability distribution over all possible next tokens.

  3. 3.

Output the most probable next token.

  4. 4.

Append the output token to the input, go back to step (2).

Due to the nature of our prompt, the first token the model outputs is either
“Yes” or “No” — the probabilities of these two tokens sum to almost 1. We can
use the probability of “Yes” as a score for an example — if the score is above
0.5, the model outputs “Yes”, otherwise the model would output “No”. The score
can also be used as an estimate of the certainty of the model — if the score
is far from 0.5, the model is more certain. We studied the correlation between
the score and the average (across raters) rating of an example, and found the
correlation to be quite high (see Table 2). We could use this observation to
only route less certain examples to human raters, saving human effort.

###  4.5 Sensitivity to Tokenization

In the previous section, we observed that the sum of the ’Yes’ and ’No’
probabilities is nearly 1.0. However, if we remove the spaces around XML tags,
this is no longer true. So if we change
“$\langle$Answer$\rangle$␣Yes␣$\langle$Answer$\rangle$” to
“$\langle$Answer$\rangle$Yes$\langle$Answer$\rangle$”, the model additionally
considers the tokens “Yes$\langle$” or “No$\langle$” as possible responses,
among others. Thus we can no longer consider the score for “Yes” as the
uncertainty associated with the example. Consequently, the correlation between
the score and average ratings disappears (Table 2).

Create Guidelines and ExamplesEvaluateFix promptScore examplesSelect/label
examplesHuman evalTrain soft-promptScore new
dataAcceptEvaluateErrors?OK?Errors?Add to setCertain?Uncertain?Add to training
Figure 3: An example workflow for a policy rating task

Experiment Pearson Corr. Spearman Rank Corr. Kendall’s $\tau$ Few-shot prompt
(baseline) 0.6404 0.6531 0.4839 Few-shot prompt with fewer spaces -0.0867
-0.1224 -0.0879 Few-shot with tuning (5K examples) 0.8142 0.8261 0.6474

Table 2: Correlation between the score and the average (across raters) rating
for our experiments.

###  4.6 Keyword matching vs. Language Understanding

In Appendix C, we study a random sample of 10 comments that were labelled
toxic but were determined to be non-toxic by our model. 6 out of 10 Comments
should have been labeled non-toxic. This demonstrates an application of
foundation models to identify mislabeled examples. The examples shown are
labeled toxic as they contain words that often occur in toxic contexts (e.g.
idiot, Hitler, lazy), but in this case they are clearly not directed at any
individual or group. The foundation models seem to detect the nuance of
natural language better than raters in these examples.

The examples in Appendix D show an interesting side-effect of prompt tuning.
The predictions of the soft-prompt match the rater responses better. However,
sometimes the language nuances that the model was able to pick up with the
few-shot prompt are over-ridden by the training process. There is no free
lunch!

###  4.7 Some More Examples

In Appendix B, we list a few example outputs of the model with the few-shot
prompt. We show several outputs, some correct, some wrong, some toxic, some
not.

Some of these examples show the model’s ability to deal with nuances of
language. The model was correctly able to recognize that ‘muck-head’ is an
obscure insult and ‘shocked you can spell’ is a subtle way to humiliate
someone. In contrast, ‘hit the nail on the head’ is not an expression of
violence. It also recognized that ‘darn “Christina” holidays’ really meant
Christian holidays, hence is attacking religion.

Example 9 shows a case where the model is able to predict multiple reasons to
regard a comment as toxic.

The remaining examples show some errors made by the model. It is sometimes
more eager to declare a comment toxic, taking offence at phrases like “what is
wrong with this generation". It occasionally misses idioms and slang, assuming
that “beat me, sue you, retire” is a threat of violence. Occasionally it gets
the answer right for the wrong reason, as in example 10 — the sarcastic phrase
was “Did you really need me to explain that to you?", but it chose another
phrase that was not referring to the participants in the conversation.

##  5 Workflows

As we have shown, foundation models can attain excellent performance with very
little supervision (see Figures 2 and 1. This enables a new workflow that
relies on fewer labeled examples (rater supervision), and enables a product
team to implement new policies with greater velocity. We illustrate this in
Figure 3.

In the first step, we use a description of a policy along with a handful of
labeled examples as a few-shot prompt, and then run this on some data and
manually inspect the result, tweaking the prompt till it performs adequately.
This step is more art than science, but the discussions in Sections 2.1 can
serve as a guide.

The next task is creating a training set for soft-prompt tuning. We either
take a few dozen random examples and label them. We can use the technique in
Appendix E to inspect and fix labels. We then train a soft-prompt with this
data (see Section 3. We again evaluate this on a test sample, and modify the
hard prompt, or expand the training set.

After some iterations, we are ready to deploy the prompt. If the score
produced by the model is extreme, i.e. the model is more certain, then we can
accept the result. (As Section 4.4 shows, the scores are correlated with rater
uncertainty.) Otherwise the example is sent off for human evaluation, and
these examples can then be added to the soft-prompt training set for future
iterations.

##  6 Limitations

  * •

We have only evaluated the method for English language text.

  * •

We have not tested on adversarial behavior, i.e., someone trying to defeat the
classifier willfully.

  * •

The large language models that we use are not yet available widely.

  * •

Publicly available foundation models do not yet offer prompt tuning
interfaces.

## References

  * tox (2019) 2019\.  Jigsaw unintended bias in toxicity classification.
  * Brown et al. (2020) Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020.  Language models are few-shot learners.
  * Chowdhery et al. (2022) Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. 2022\.  Palm: Scaling language modeling with pathways.
  * Chung et al. (2022) Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Alex Castro-Ros, Marie Pellat, Kevin Robinson, Dasha Valter, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei. 2022.  Scaling instruction-finetuned language models.
  * Devlin et al. (2018) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018.  BERT: pre-training of deep bidirectional transformers for language understanding.  _CoRR_ , abs/1810.04805.
  * DeYoung et al. (2019) Jay DeYoung, Sarthak Jain, Nazneen Fatema Rajani, Eric Lehman, Caiming Xiong, Richard Socher, and Byron C. Wallace. 2019.  Eraser: A benchmark to evaluate rationalized nlp models.
  * Duchene et al. (2023) Corentin Duchene, Henri Jamet, Pierre Guillaume, and Reda Dehak. 2023.  A benchmark for toxic comment classification on civil comments dataset.
  * Han et al. (2021) Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. 2021.  Ptr: Prompt tuning with rules for text classification.
  * Lester et al. (2021) Brian Lester, Rami Al-Rfou, and Noah Constant. 2021.  The power of scale for parameter-efficient prompt tuning.  In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_ , pages 3045–3059, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
  * Li and Liang (2021) Xiang Lisa Li and Percy Liang. 2021.  Prefix-tuning: Optimizing continuous prompts for generation.
  * Liu et al. (2021) Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. 2021.  Gpt understands, too.
  * Narang et al. (2020) Sharan Narang, Colin Raffel, Katherine Lee, Adam Roberts, Noah Fiedel, and Karishma Malkan. 2020.  Wt5?! training text-to-text models to explain their predictions.  _CoRR_ , abs/2004.14546.
  * Peters et al. (2018) Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018.  Deep contextualized word representations.  In _Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers)_ , pages 2227–2237, New Orleans, Louisiana. Association for Computational Linguistics.
  * Wei et al. (2022) Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed H. Chi, Quoc Le, and Denny Zhou. 2022.  Chain of thought prompting elicits reasoning in large language models.  _CoRR_ , abs/2201.11903.
  * Yu et al. (2022) Ping Yu, Wei Wang, Chunyuan Li, Ruiyi Zhang, Zhanpeng Jin, and Changyou Chen. 2022\.  Stt: Soft template tuning for few-shot adaptation.

##  Appendix A Few-shot Prompt

    Toxic Policy:
    A toxic comment is one which is likely to make the conversation partner leave a discussion
    or give up on sharing their perspective. A comment violates the Toxic Policy if:
    (1) the author makes obscene references.
    (2) the author threatens violence against their conversation partner.
    (3) the author denigrates an individual or group based on their race, gender, religion or
    sexual preference.
    (4) the author humiliates their conversation partner.
    However there are exceptions. A comment does not violate the Toxic Policy if it is:
    (a) criticizing or debating or disagreeing with the edits someone made constructively.
    Question: Does the comment violate the Toxic Policy?
    <Comment> My addition to  talk page is not a personal attack. If it was, he would certainly
    know of the attack. I simply placed a request for discussion as to why  continually harasses
    and defames other wikipedia users. </Comment>
    <Answer> No </Answer>
    <Explanation> The comment does not violate the Toxic Policy. </Explanation>
    <Citations>  </Citations>
    <Keywords>  </Keywords>
    ---
    <Comment> You can’t fucking block me for 3 months for fucking personal attacks or harassment!
    You fucking stupid hellhole, you better motherfucking let me vandalize Wikipedia again FRICKEN
    NOW! </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’fucking block me’, ’fucking personal attacks’ so violates
    ’(1) the author makes obscene references’. It also mentions ’You fucking stupid hellhole’ so
    it violates ’(4) the author humiliates their conversation partner’. </Explanation>
    <Citations> (1) the author makes obscene references,(4) the author humiliates their conversation
    partner </Citations>
    <Keywords> fucking block me | fucking personal attacks | You fucking stupid hellhole </Keywords>
    ---
    <Comment> @ okay king of the Wikipedia Nazis. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’king of the Wikipedia Nazis’ so it violates ’(4) the author
    humiliates their conversation partner’. </Explanation>
    <Citations> (4) the author humiliates their conversation partner </Citations>
    <Keywords> king of the Wikipedia Nazis </Keywords>
    ---
    <Comment> important you and your family shall burn! you have been warned, if you do troll
    mikes talk page i will slaughter you in your sleep. bye... </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment says ’i will slaughter you’ so violates ’(2) the author threatens
    violence against their conversation partner’. </Explanation>
    <Citations> (2) the author threatens violence against their conversation partner </Citations>
    <Keywords> i will slaughter you </Keywords>
    ---
    <Comment> Please do not vandalize pages, as you did with this edit to Moriah. If you continue
    to do so, you will be blocked from editing.   (talk) </Comment>
    <Answer> No </Answer>
    <Explanation> The comment is ’(a) criticizing or debating or disagreeing with the edits someone
    made constructively’. </Explanation>
    <Citations> (a) criticizing or debating or disagreeing with the edits someone made
    constructively </Citations>
    <Keywords>  </Keywords>
    ---
    <Comment> ... </Comment>

##  Appendix B Example outputs produced by the model

The following are some examples of the outputs produced by the model:

  1. 1.

Human Rating: Non-toxic

        <Comment> The incentive to lie is that Wikileaks has most likely been
    under Russian thumbs for years already before the events of the 2016
    election. Have they published ANYTHING that would seriously embarrass
    the Kremlin in the last five years? No. They’re co-opted by the
    Russians. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’Russian thumbs’ so it violates
    ’(1) the author makes obscene references’. </Explanation>
    <Citations> (1) the author makes obscene references </Citations>
    <Keywords> Russian thumbs </Keywords>

  2. 2.

Toxic

        <Comment> so muck-head, your telling us they will leave this if we tax them
    fairly?....   You have to be dreaming or misinformed. </Comment>
    <Answer> Yes </Answer>
    <Explanation>The comment mentions ’muck-head’ so it violates ’(4) the author
    humiliates their conversation partner’.</Explanation>
    <Citations> (4) the author humiliates their conversation partner </Citations>
    <Keywords> muck-head </Keywords>

  3. 3.

Human Rating: Non-toxic

        <Comment> While I am shocked you can spell magisterium. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’shocked you can spell’ so it violates ’(4)
    the author humiliates their conversation partner’. </Explanation>
    <Citations> (4) the author humiliates their conversation partner </Citations>
    <Keywords> shocked you can spell </Keywords>

  4. 4.

Human Rating: Non-toxic

        <Comment> geez how come we have these types of accidents.  what is wrong with
    today’s generation.  back in my days (early 60s) many of our moms drove but
    no infant or toddler got runned over by their own mother, and we had bigger
    cars back then.  I’m having a hard time figuring out how this happened, and
    this is not the first time this type of accident happened in our island.  what
    is going on with these parents nowadays.  wake up and start caring where your
    child is before you go. this is just ridiculous. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’what is wrong with today’s generation’ so
    it violates ’(3) the author denigrates an individual or group based on their
    race, gender, religion or sexual preference’. </Explanation>
    <Citations> (3) the author denigrates an individual or group based on their
    race, gender, religion or sexual preference </Citations>
    <Keywords> what is wrong with today’s generation | what is going on with these
    parents nowadays | wake up and start caring where your child is before you
    go | this is just ridiculous </Keywords>

  5. 5.

Human Rating: Toxic

        <Comment> Is there no hoop too silly, too ridiculous for university
    administrators to jump through? </Comment>
    <Answer> No </Answer>
    <Explanation> The comment does not violate the Toxic Policy. </Explanation>
    <Citations>  </Citations>
    <Keywords>  </Keywords>

  6. 6.

Human Rating: Toxic

        <Comment> There is no place in our school system for the recognition of
    those darn "Christina" holidays. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment denigrates an individual or group based on their
    religion so it violates ’(3) the author denigrates an individual or group
    based on their race, gender, religion or sexual preference’. </Explanation>
    <Citations> (3) denigrates an individual or group based on
    their race, gender, religion or sexual preference </Citations>
    <Keywords> darn "Christina" holidays </Keywords>

  7. 7.

Human Rating: Non-toxic

        <Comment> Maybe the police are at fault, not United.  Anyway beat me, sue
    you, retire. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’beat me, sue you, retire’ so it violates
    ’(2) the author threatens violence against their conversation partner’.
    </Explanation>
    <Citations> (2) the author threatens violence against their conversation
    partner </Citations>
    <Keywords> beat me, sue you, retire </Keywords>

  8. 8.

Human Rating: Non-toxic

        <Comment> The serious content here is the social conservative agenda. There
    is no plausible plan to deal with girdlock. No carbon tax but also no
    alternative for combatting climate change. We shouldn’t flippantly dismiss
    this serious content; rather we should acknowlege that it isn’t good polciy.
    </Comment>
    <Answer> No </Answer>
    <Explanation> The comment is ’(a) criticizing or debating or
    disagreeing with the edits someone made constructively’. </Explanation>
    <Citations>(a) criticizing or debating or disagreeing with
    the edits someone made constructively</Citations>
    <Keywords>  </Keywords>

  9. 9.

Toxic

        <Comment> Where are the guys with three names when they are REALLY needed?
    This guy is a natural born mistake. I would call him a complete idiot but
    I am not sure he is complete yet. We can only hope for a cardiac event or a
    stray bus. </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’This guy is a natural born mistake’
    so it violates ’(4) the author humiliates their conversation partner’. It
    also mentions ’I would call him a complete idiot’ so it violates ’(4) the
    author humiliates their conversation partner’. It also mentions ’We can
    only hope for a cardiac event or a stray bus’ so it violates ’(2) the
    author threatens violence against their conversation partner’. </Explanation>
    <Citations> (4) the author humiliates their conversation partner,(2) the
    author threatens violence against their conversation partner </Citations>
    <Keywords> This guy is a natural born mistake | I would call him a complete
    idiot | We can only hope for a cardiac event or a stray bus</Keywords>

  10. 10.

Human Rating: Non-toxic

        <Comment> Then he comes off as being prejudiced against Moslems. Did you
    really need me to explain that to you? </Comment>
    <Answer> Yes </Answer>
    <Explanation> The comment mentions ’prejudiced against Moslems’ so it violates
    ’(3) the author denigrates an individual or group based on their race, gender,
    religion or sexual preference’. </Explanation>
    <Citations> (3) the author denigrates an individual or group based on their
    race, gender, religion or sexual preference </Citations>
    <Keywords> prejudiced against Moslems </Keywords>

  11. 11.

Human Rating: Non-toxic

        <Comment> Thank you for this great column. When I said much of the same stuff
    in the comment section I was attacked and had several comments blocked as
    "uncivil" when they were not.  Things that certain other commenters wrote
    were vile and nasty with swearing but they were ruled "civil".  Go figure.
    </Comment>
    <Answer> No </Answer>
    <Explanation> The comment does not violate the Toxic Policy. </Explanation>
    <Citations>  </Citations>
    <Keywords>  </Keywords>

  12. 12.

Human Rating: Toxic

        <Comment> Hit the head on the nail. </Comment>
    <Answer> No </Answer>
    <Explanation> The comment does not violate the Toxic Policy. </Explanation>
    <Citations>  </Citations>
    <Keywords>  </Keywords>

##  Appendix C False negatives produced by the model

The following is a sample of the comments that had a label "Toxic" but were
determined to be non-toxic by our model. We chose the first ten such examples,
to avoid cherry-picking.

  * •

The cops should have 15 patrol officers on that stretch of road every day.
They could make a mint off all the idiots who speed and pass illegally. This
comment is not really directed at a particular individual or group.

  * •

Killing someone, particularly oneself, with a knife is much more difficult
than with a gun. Golly! Never thought of that!. This could be considered toxic
(sarcasm).

  * •

Legally, the verdict was correct. I still believe XXXX did what he was accused
of. In a situation where there is a power imbalance (does’t have to be sexual
assault) the victim is screwed. It is wrong for YYYY to tell victims it has to
be this way. The legal system is skewed. The principal of reasonable doubt is
noble but the reality is that victims are at an UNFAIR disadvantage. Telling
them to suck it up is wrong.. This does not seem toxic.

  * •

Well said. People drive because it’s cheap and easy and they are lazy (myself
included sometimes). That doesn’t mean we should shoot ourselves in the foot
and create a sprawling garbage city like most of the US.. Not directed at any
individual.

  * •

Hypocrisy is a feature of politicians. This is not directed at any user.

  * •

You keep on believing that. Boulder.... 25 square miles of Utopian controlled
bliss surrounded by reality! Personal responsibility and the free market be
damned so good luck with that nanny state mentality.. This is likely toxic.

  * •

It may be easy to define some "hate groups" depending on what they do and what
they say. But what if someone like Hitler defines a "hate group" as being
"Jews" and seeks to exterminate them? And don’t claim that "Oh, that is
ridiculous. That would never happen in the United States." Well, it happened
in Germany.....and for many years the Germans, most of Europe, and the US
turned a blind eye.....because it wasn’t happening to them.. The comment is
not directed at any user.

  * •

Kicking a hard-working, plucky team who came this close to the finals? Why
would the Globe and Mail even publish such nasty drivel?. This is not directed
at any user.

  * •

That’s silly. This comment could be considered toxic.

  * •

Let us reflect on these words from Josesph Goebbels: "We enter parliament in
order to supply ourselves, in the arsenal of democracy, with its own weapons.
If democracy is so stupid as to give us free tickets and salaries for this
bear’s work, that is its affair. We do not come as friends, nor even as
neutrals. We come as enemies. As the wolf bursts into the flock, so we come.".
This comment might be considered toxic, depending on the context.

##  Appendix D Examples where the soft prompt changed the prediction of the
few-shot prompt

  * •

The cops should have 15 patrol officers on that stretch of road every day.
They could make a mint off all the idiots who speed and pass illegally.
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’idiots’ so it violates ’(4) the author
humiliates their conversation partner’.

  * •

Bullshit. When two friends and I were coming to Alaska we were crossing at
Vancouver. They took us one at a time into a little room and asked what the
penalty for possession of marijuana was where we were from. We were from
Oregon and at the time it was a 100 dollar fine for an ounce or under. He then
asked if we ever smoked any. I said I had a couple of "drags" at a party once
years before. My friends lied and said no, never. I was refused entry and they
were not. This happened a lot, so this guy is full of it.
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’Bullshit’ so it violates ’(1) the
author makes obscene references’.

  * •

At least we don’t have to discuss how badly the person deserved to die based
on his helmet status or how fast Lance Armstrong can ride a bike.
Human Rating: Non-toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’die’ so violates ’(2) the author
threatens violence against their conversation partner’.

  * •

These people you mention were courageous people indeed. But they didn’t die
for love, nor even for principles. They died for dogmas. That makes them
fools. (Not my words but the words of David Bowie, no less, regarding the
martyrdom of St Thomas More.)
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’die’ so violates ’(2) the author
threatens violence against their conversation partner’.

  * •

Well look on the bright side sunshine, at least I left his crazy mother out of
it.
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’crazy mother’ so it violates ’(4) the
author humiliates their conversation partner’.

  * •

There is no place in our school system for the recognition of those darn
"Christina" holidays.
Human Rating: Toxic.
Few-shot: Yes. The comment denigrates an individual or group based on their
religion so it violates ’(3) the author denigrates an individual or group
based on their race, gender, religion or sexual preference’. Keywords: darn
"Christina" holidays.
Soft-prompt: No.

  * •

Hopefully these two criminals are convicted and a judgment or restitution
takes away their assets, PFD, and Imig Audio and Video. Those Imig’s are shady
to say the least... Man up and show up in court!
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’criminals’ so it violates ’(1) the
author makes obscene references’.

  * •

no one believes your sick stupidity, oil is increasing in demand around the
world and has been responsible for our great standards of living and
technology,, you go live in a cave with a bike if you like but we will stick
with great fossil fuels
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’sick stupidity’ so it violates ’(1)
the author makes obscene references’.

  * •

Its not rocket science people. Icky weather makes for not so cool driving
conditions. Your not new to the world so common sense should tell you to SLOW
IT DOWN! Nobody is invincible. If you want to drive like a idiot go find a
secluded spot so you dont hurt others. Good gravy!
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Yes. The comment mentions ’idiot’ so it violates ’(4) the author
humiliates their conversation partner’.

  * •

Take what I say out of context. You do that all the time. You are just here to
troll and you mostly get away with it... Only 3 of your comments removed
today? I wonder how that happened.
Human Rating: Toxic.
Few-shot: Yes. The comment mentions ’troll’ so it violates ’(4) the author
humiliates their conversation partner’. Soft-prompt: No.

  * •

Dumb.
Human Rating: Toxic.
Few-shot: No.
Soft-prompt: Dumb is a toxic comment. (1) the author makes obscene
references,(4) the author humiliates their conversation partner

##  Appendix E Identifying mislabeled examples

We show top few examples when sorted by the magnitude of the difference
between the average rating of an example and the score produced by the few
shot prompt. This can be useful in identifying mislabeled examples. We show
the labels given by the raters.

  * •

I hope someone you love commits a crime that is legally classified as violent,
although it really isn’t. I want to be there to watch your loved ground
screaming into teeny, tiny pieces.
Human Rating: Non-toxic.

  * •

I would like to thank the snow god for kickin the a** of the frezin rain god!
Peace V.
Human Rating: Toxic.

  * •

Dumb drivers
Human Rating: Toxic.

  * •

Of course the comment you refer to is more funny than anything else, but
basically it is some sort of underhand advertising. I think it is meant to
illustrate that this comment section does not want to provide a forum for
advertising especially not to witchdoctors and penis enlargers. I fully agree
with that.
Human Rating: Toxic.

  * •

you’re getting goofy again Vic.
Human Rating: Toxic.

  * •

Great idea, Vicky. But be prepared - all of the usual trolls going to have a
heyday with this series. You and your contributors will be absolute idiots for
failing to foresee the dilemmas you found yourselves in. XXXX will almost
certainly use these articles as source material for his rant series (that
should be) titled Morons That Made A Mistake I Was Too Smart To Make. Most of
us are too self conscious to share experiences were were lucky to walk away
from. I would never admit that, uh, a friend of mine, once decided to try a
new route back to a familiar campsite at dusk. A slight deviation about 300
yards from the destination resulted in hours of walking in circles in the
rain. Oddly, my friend asserts that effective problem solving is compromised
as exhaustion sets in and darkness steals depth perception and contrast. He
eventually stumbled upon the place he began, then followed the familiar route
back. Sure hope Mr. XXXX doesn’t read this comment . . . .
Human Rating: Toxic.

  * •

Are you referring to those educated in our over-funded public schools, by
union card carrying educators? These low information voters? Yeah, thought so.
Human Rating: Toxic.

  * •

Millions of non Muslims work in the Arabian Gulf countries, including Saudi
Arabia. About 40,000 Canadians work in the UAE. For decades. Like Carville
said, it’s the economy, stupid.
Human Rating: Toxic.

  * •

Here Allie, I’ve got a ladder for you. Now, you can come down to the level
most of the human race resides at. BTW, I’ve also got a plate of humility and
self empathy if you still hungry.
Human Rating: Non-toxic.

  * •

"Haole" is a derogatory noun, because that is the typical context in which it
is used. As far as being a "contraction" of ha and ole, your description is
vague. There is, that I know of, no word on Hawaiian spelled ’ha’ole’ which
would include the consonant ’okina, which is not a contraction. The word
’haole’ is a combination of ’ha’ meaning "breath", and ’ole’ which is
"without". Therefore, the term for Caucasians is a word meaning without
breath, which equates in context to "without aloha". For this reason Dave
expounded on your mention of context with the fact that the context is
commonly properly understood as "[f’in] haole" when used. The word "haole" is
not akin to "black", it is akin to "nigger". Yes, I used it. But there’s not
really another way around this problem. Now go use it in SCLA.
Human Rating: Non-toxic.

  * •

Are you sad because the earth is short one Daesh?
Human Rating: Non-toxic.

  * •

The name was only ever an ironic icing to a shit-cake of gentrification.
Changing the name doesn’t change the fact that the restaurant aims to glorify
one of the biggest and most destructive colonial forces in history, in one of
Portland’s historically black neighborhoods.
Human Rating: Toxic.

  * •

Super dumb. A cow moose and a cow elk look nothing alike besides the fact that
they’re brown...and have fur.
Human Rating: Toxic.

  * •

He’s made more in a few years than you will make in your lifetime. Plus he’s
done more for his community than a tired white guy like you. (We all see thru
the name)
Human Rating: Non-toxic.


# Multi-cell NOMA: Coherent Reconfigurable Intelligent Surfaces Model With
Stochastic Geometry

Chao Zhang1, Wenqiang Yi1, Yuanwei Liu1, Qiang Wang2  1Queen Mary University
of London, London, UK  2Beijing University of Posts and Telecommunications,
Beijing, China

###### Abstract

$\Theta$ $\theta$ Reconfigurable intelligent surfaces (RISs) become promising
for enhancing non-orthogonal multiple access (NOMA) systems, i.e., enhancing
the channel quality and altering the SIC orders. Invoked by stochastic
geometry methods, we investigate the downlink coverage performance of RIS-
aided multi-cell NOMA networks. We first derive the RIS-aided channel model,
concluding the direct and reflecting links. The analytical results demonstrate
that the RIS-aided channel model can be closely modeled as a Gamma
distribution. Additionally, interference from other cells is analyzed. Lastly,
we derive closed-form coverage probability expressions for the paired NOMA
users. Numerical results indicate that 1) although the interference from other
cells is enhanced via the RISs, the performance of the RIS-aided user still
enhances since the channel quality is strengthened more obviously; and 2) the
SIC order can be altered by employing the RISs since the RISs improve the
channel quality of the aided user.

##  I Introduction

As a promising technique, non-orthogonal multiple access (NOMA) achieves new
freedom by sharing spectrum with power or code multiplexing methods. With the
aid of successive interference cancellation (SIC), various users in the same
resource block can be split and decoded, thereby the user connectivity and the
spectrum efficiency are enhanced significantly [1]. In spite of benefits,
several implementation challenges occur in the following aspects. 1) On the
one hand, the received power of the final decoded user is low while the
interference is increased from other NOMA users. In general, far users will be
decoded at the last decoding order, thereby the NOMA technique may contribute
to the atrocious performance of the far users. 2) On the other hand, the fixed
decoding order based on channel quality may cause a waste of resources. We
assume the first decoded user can achieve $10$ BPCU (bit per cell use) but
this user only need $6$ BPCU to transmit the message, which leads to $4$ BPCU
wasted. In order to cope with the challenges, reconfigurable intelligent
surfaces (RIS) are taken into the consideration.

The material of a RIS is considered as a two-dimensional-equivalent
reconfigurable meta-material, in which several elements such as scattering
particles or meta-atoms are involved [2]. With the aid of meta-surfaces, the
reflecting direction can be altered by the RIS towards the targeted user to
obtain the perfect electric field strength. Hence, with coherent reflecting
links, the RISs can enhance the channel quality of its aided user. By
exploiting the RISs near the last decoded user (the far user), the far user’s
channel gain is improved, thereby 1) the far user’s received power is
significantly enhanced; and 2) the decoding order can be changed to utilize
the resources perfectly. In this model, we harness stochastic geometry methods
to evaluate the spacial effects of multi-cell networks [3]. With the aid of
the RISs and NOMA technique, the motivations and contributions are revealed in
the following.

Motivated by 1) enhancing the channel quality of the last decoded NOMA user;
and 2) altering the SIC order to maintain that the user who required a high
transmit rate is employed at the first stage of the SIC order, we investigate
RIS-aided multi-cell NOMA networks. The main contributions can be summarized
as: 1) we first derive the RIS-aided channel model including the direct and
reflecting links, which reveals that the channel model in power domain can be
expressed as a Gamma distribution; 2) we derive closed-form expressions of
coverage probability for the paired NOMA users; and 3) numerical results
illustrate that both of the interference from other cells and the channel
quality of the RIS-aided user enhance but the enhancement of the channel
quality dominates the upper hand.

##  II System Model

Figure 1: Indication of the signal model: (a) RIS-aided channel links with $n$
elements: the direct and reflecting links; (b) RIS-aided multi-cell NOMA
networks: a NOMA pair concluding a typical user and a connected user as a
treatise; (c) Notions.

In this paper, RIS-aided downlink NOMA multi-cell networks are taken into
consideration, which concludes randomly deployed base stations (BSs), users
and RISs. With the respect to NOMA clusters, we evaluate a two-user scenario
in this treatise, where different NOMA pairs are served by orthogonal
frequencies to cancel intra-cell interference. We define one of the deployed
users as the typical user, which is exploited in a typical NOMA pair.
Additionally, we assume that the other paired user in the same resource block
has already been connected to the targeted BS. An RIS is allocated near the
typical user to enhance the performance of the users.

###  II-A Deployment of Devices

Invoked by stochastic geometry models, we deploy BSs and users as two
independent homogeneous Poisson point process (HPPP): 1)
$\Phi_{u}\subset\mathbb{R}^{2}$ with density $\lambda_{u}$; and 2)
$\Phi_{b}\subset\mathbb{R}^{2}$ with density $\lambda_{b}$. Among these users,
a typical user is randomly chosen from $\Phi_{u}$ and its location is fixed at
the origin of the considered plane $O$. For the typical user network, it is
deployed by a simplified Matern cluster process (MCP) pattern, which is one of
Poisson cluster process (PCP) models with a fixed number of nodes and fixed
positions in each cluster [4]. More specifically, this pattern concludes two
processes, i.e., a parent process to deploy the clusters and a daughter
process to allocate the nodes in each cluster. In this typical user network,
we consider that the deployment of BSs as the parent process is an independent
HPPP, which has been denoted as $\Phi_{b}\subset\mathbb{R}^{2}$ with density
$\lambda_{b}$. Additionally, we simplify the daughter process with a fixed
distance between the typical user and its aided RIS, namely $r_{RU}$. To
simplify the analysis, the connected user is not included in the user set
$\Phi_{u}$ and the distance between this user to its BS is invariable as
$r_{c}$.

The association criterion for the typical user is to select the BS with the
highest received power, which means that the distance between the RIS and the
associated BS is the nearest. Based on the typical user as the origin, the
locations of the RIS and the associated BS are denoted as
$r_{RU}=\mathbf{x}_{R}$ and $r_{BU}=\mathbf{x}_{B,near}$. Therefore, the
distance between the associated BS and the RIS is correspondingly expressed as

$\displaystyle
r_{BR}=\mathbf{x}_{BR}=\arg\min_{\mathbf{x}_{B}\in\Phi_{B}}\|\mathbf{x}_{B}-\mathbf{x}_{R}\|$
(1)

where $r_{RU}=\mathbf{x}_{R}$ is fixed, $\Phi_{B}\subset\Phi_{b}$,
$\Phi_{B}\subset\mathbb{O}(R_{L},\infty)$111The $\mathbb{O}(a,b)$ represents
an annulus with the inner radius $a$ and outer radius $b$. and the location of
arbitrary interfering BS can be denoted by
$\mathbf{x}_{I}\in\Phi_{b}\setminus\mathbf{x}_{B,near}$.

We assume the RIS is deployed near the typical user, thereby the distances
$r_{BR}$ and $r_{BU}$ are approximately equal, denoted as $r_{BR}\approx
r_{BU}$. Thus, based on 2-D HPPP statistics [3, 5], the PDF of the distance
between a BS and its $n^{th}$ nearest BS is derived as

$\displaystyle{f_{{r_{BU}}}}\left({x,n}\right)=\frac{{2{{\left({\pi{\lambda_{b}}}\right)}^{n}}}}{{\left({n-1}\right)!}}{x^{2n-1}}\exp\left({-\pi{\lambda_{b}}{x^{2}}}\right),$
(2)

thereby the PDF of $r_{BR}$ and $r_{BU}$ can be derived by (2) with $n=1$ as

$\displaystyle{f_{{r_{BR}}}}\left({x}\right)={f_{{r_{BU}}}}\left({x}\right)=2\pi{\lambda_{b}}{x}\exp\left({-\pi{\lambda_{b}}{x^{2}}}\right).$
(3)

###  II-B RIS-aided Channel Model

We assume the RIS has $n$ elements, and the BSs and the users are equipped
with a single antenna. Based on the deployment of the typical network, there
are three categories of important communication links in the considered NOMA
group: 1) BU links, the links between the typical user and the nearest BS; 2)
RU link, the link between the RIS and the typical user; and 3) BR link, the
link between the BS and the employed RIS. The BU links are the direct links
for the typical user. Additionally, the BR and RU links are compositions of
reflecting links aided by the employed RIS. Since the RIS is made of
elementary elements called scattering particles or meta-atoms, which is
capable of altering the wavefront of the radio waves, the phase responses for
the RIS reflect links and direct links can be altered as the same. Hence, with
the aid of RISs, the performance of the typical enables to be enhanced
significantly.

####  II-B1 Multi-path Model

We assume all the links of the typical and connected users are Rayleigh fading
channels, i.e., $h_{BU}$ for BU links, $h_{RU,i}$ for RU links, $h_{BR,i}$ for
BR links and $h_{c}$ for the links between the connected user and its BS,
where $i\in\left[1,n\right]$. Hence, the probability density function (PDF)
and cumulative distribution function (CDF) for Rayleigh fading channels can be
expressed as $f(x)=2x\exp\left({-{x^{2}}}\right)$ and $F(x)=1-\exp(-x^{2})$.
Since it is assumed that the RIS is employed near the typical user, we can
assume the channel gain of RU links is a constant.

####  II-B2 Interference Analysis

Since the RIS only reflects the signals faced the surface, the interference
BSs are split into two portions: 1) the interference BSs aided by the employed
RIS, and 2) the interference BSs without RIS. This is the key difference
between RIS-aided multi-cell networks and conventional multi-cell networks. We
define a coefficient $\rho_{I}\in[0,1]$ to indicate the percentage of the
interference BSs with the aid of RISs, thereby the rest BSs without the aid of
RISs is $1-\rho_{I}$.

####  II-B3 Path Loss Model

For each NOMA pair, the path loss model for the three links can be defined as
the conventional wireless communication models. Therefore, the path loss
expressions of the connected user and the typical user are as

$\displaystyle
P_{BR}(\mathbf{x}_{B,near},\mathbf{x}_{R})=C_{BR}\|\mathbf{x}_{B,near}-\mathbf{x}_{R}\|^{-\alpha_{t}},$
(4) $\displaystyle
P_{RU}(O,\mathbf{x}_{R})=C_{RU}\|\mathbf{x}_{R}\|^{-\alpha_{t}},$ (5)
$\displaystyle
P_{BU}(O,\mathbf{x}_{B,near})=C_{BU}\|\mathbf{x}_{B,near}\|^{-\alpha_{t}},$
(6) $\displaystyle
P_{c}(\mathbf{x}_{B,near},\mathbf{x}_{C})=C_{c}\|\mathbf{x}_{B,near}-\mathbf{x}_{C}\|^{-\alpha_{c}},$
(7)

where the $\\{C_{BR},C_{RU},C_{BU},C_{c}\\}$ are the intercepts for different
links, $\alpha_{c}$ is the path loss exponent for the connected user and
$\alpha_{t}$ is the path loss exponent for the typical user (including the
direct and reflecting links). Note that the distance between the connected
user and the associated BS is fixed. Therefore,
$r_{c}=\|\mathbf{x}_{B,near}-\mathbf{x}_{C}\|$ is a constant. Since we assume
the RIS is employed near the typical user, we assume the channel gain is
constant, denoted as $\left|h_{RU,i}\right|^{2}P_{RU}(O,\mathbf{x}_{R})=A$.

###  II-C Signal Model

We assume the connected user as the near user and the typical user as the far
user, thereby we exploit RISs to enhance the performance of the far user. In
the general NOMA case, the near user will accomplish the SIC process and the
messages from the far user are decoded firstly. However, since we harness the
RISs to enhance the channel quality of the far user, the rank of the channel
quality of two paired NOMA users can be altered by adjusting the number of
RIS’s elements $n$. Thus, we enable to acquire high flexibility on SIC
decoding orders with various values of $n$. In this treatise, we consider the
scenario where the strength of channel quality for the far user is better than
that of the near user since $n$ is large enough to change the SIC order.
Hence, the far user will cope with the SIC order and the messages of the near
user are at the first stage of the SIC process.

In order to guarantee the quality of service (QoS) of NOMA users, we assume
more transmit power is allocated from the associated BS to the typical user
than the connected user. Therefore, the signal-to-noise-ratio (SINR) of the
SIC process at the typical user is expressed as

$\displaystyle{\gamma_{{\rm{SIC}}}}=\frac{{{a_{c}}{P_{t}}{{\left|{\bf{{G_{RU}}}\Theta}{\bf{G_{BR}}}+{G_{BU}}\right|}^{2}}}}{{{a_{t}}{P_{t}}{{\left|{\bf{{G_{RU}}}\Theta}{\bf{G_{BR}}}+{G_{BU}}\right|}^{2}}+{I_{t,{\rho_{I}}}}+{\sigma^{2}}}},$
(8)

where

$\displaystyle{I_{t,{\rho_{I}}}}$
$\displaystyle={\rho_{I}}\sum\limits_{{{\bf{x}}_{I}}\in{\Phi_{b}}\setminus{{\bf{x}}_{B}}}{{P_{t}}{{\left|{{{\bf{G}}_{{\bf{RU}}}}{\bf{\Theta}}{{\bf{G}}_{{\bf{BR}}}}+{G_{BU}}}\right|}^{2}}}$
$\displaystyle\hskip
8.5359pt{\rm{+}}\left({1-{\rho_{I}}}\right)\sum\limits_{{{\bf{x}}_{I}}\in{\Phi_{b}}\setminus{{\bf{x}}_{B}}}{{P_{t}}{{\left|{{h_{BU}}}\right|}^{2}}{P_{BU}}(O,{{\bf{x}}_{B,near}})},$
(9)

and $a_{c}$ and $a_{t}$ are the power allocation parameters for the connected
and the typical user, $P_{t}$ is the transmit power of BSs in NOMA clusters
and $\sigma^{2}$ is the variance of additive white Gaussian noise (AWGN). With
respect to the channel matrixes,
${G_{BU}}={h_{BU}}\sqrt{{P_{BU}}(O,{{\bf{x}}_{B,near}})}$,
${\mathbf{G_{RU}}}={\mathbf{H_{RU}}}\sqrt{{P_{RU}}(O,{{\bf{x}}_{R}})}$,
$\mathbf{{G_{BR}}}={\mathbf{H_{BR}}}\sqrt{{P_{BR}}({{\bf{x}}_{B,near}},{{\bf{x}}_{R}})}$,
$\mathbf{H_{BR}}\buildrel\Delta\over{=}[h_{BR,1},h_{BR,2},\cdots,h_{BR,n}]^{H}$
is the $n\times 1$ channel gain matrix of $BR$ links,
$\mathbf{H_{RU}}\buildrel\Delta\over{=}[h_{RU,1},h_{RU,2},\cdots,h_{RU,n}]$ is
the $1\times n$ channel gain matrix of $RU$ links,
${\bf{\Theta}}\buildrel\Delta\over{=}diag[{\beta_{1}}{\phi_{1}},{\beta_{2}}{\phi_{2}},\cdots,{\beta_{n}}{\phi_{n}}]$
is the diagonal matrix, where $\beta_{n}\in[0,1]$ represents the power
consumption coefficient of RISs and $\phi_{n}=\exp(j\theta_{n})$ with
$j=\sqrt{(-1)}$ and $\theta_{n}\in[0,2\pi)$. Additionally, we set
$a_{c}>a_{t}$ and $a_{c}+a_{t}=1$. Regarding the interference
$I_{t,\rho_{I}}$, we assume $\rho_{I}\in[0,1]$ to evaluate the amount of BSs
with RIS-aided links since the signal from the back of RISs cannot pass
through the RISs, thereby the interference from other cells is split into two
parts.

Due to the SIC process, the messages of the connected user can be removed,
followed by decoding the data for the typical user. The decoding SINR after
the SIC process for the typical user can be expressed as

$\displaystyle{\gamma_{t}}=\frac{{{a_{t}}{P_{t}}{{\left|{{\mathbf{G_{RU}}}\mathbf{\Theta{G_{BR}}}+{G_{BU}}}\right|}^{2}}}}{{{I_{t,{\rho_{I}}}}+{\sigma^{2}}}}.$
(10)

The connected user enables to directly decode its messages by regarding the
other NOMA user’s signal as interference. Hence, we can express the decoding
SINR for the typical user as

$\displaystyle{\gamma_{\rm{c}}}=\frac{{{a_{c}}{P_{t}}{{\left|{{h_{c}}}\right|}^{2}}{P_{c}}({{\bf{x}}_{B,near}},{{\bf{x}}_{C}})}}{{{a_{t}}{P_{t}}{{\left|{{h_{c}}}\right|}^{2}}{P_{c}}({{\bf{x}}_{B,near}},{{\bf{x}}_{C}})+{I_{c}}+{\sigma^{2}}}},$
(11)

where

$\displaystyle{I_{c}}=\sum\limits_{{{\bf{x}}_{I}}\in{\Phi_{b}}\setminus{{\bf{x}}_{B}}}{{P_{t}}{{\left|{{h_{c}}}\right|}^{2}}{P_{c}}({{\bf{x}}_{I}},{{\bf{x}}_{C}})}.$
(12)

##  III RIS-aided Channel Model

The channels between the typical user and its associated BS are split into two
portions: 1) the reflecting links via RIS; and 2) the direct link via
conventional wireless communication methods. When signals with the same
frequency and waveform are transmitted from the BS, we consider the signals
from various links, i.e., the reflecting and direct links, are coherent. In
general, when we design the passive beamforming at the RISs, two directions
are involved: 1) one to obtain the maximum received power; and 2) the other to
reduce the interference via signal cancellation [6]. In this treatise, we aim
to enhance the performance of the typical user by the RISs, thereby we assume
that a perfectly coherent scenario is achieved by passive beamforming, which
means all channels are adjusted with the same phase.

We denote an equivalent channel between the typical user and its BS as
$g_{BU}\buildrel\Delta\over{=}{\mathbf{g_{RU}}}\mathbf{\Theta{G_{BR}}}+$
${G_{BU}}$. We assume
$h_{BR,i}={c_{BR,i}}\exp\left({-j{\theta_{BR,i}}}\right)$ with $i\in[1,n]$,
and $h_{BU}={c_{BU}}\exp\left({-j{\theta_{BR,i}}}\right)$, which are Rayleigh
variables in complex form. With the aforementioned assumption that the RISs
and the typical user are deployed near, we can simplify the equivalent channel
model $g_{BU}$ as

$\displaystyle{g_{BU}}$
$\displaystyle=\sqrt{{C_{t}}d_{t}^{-{\alpha_{t}}}}\left({A\sum\limits_{i=1}^{n}{{\beta_{i}}{c_{BR,i}}}\exp\left({-j\left({{\vartheta_{i}}+{\theta_{BR,i}}}\right)}\right)}\right.$
$\displaystyle\hskip
8.5359pt\left.{+{c_{BU}}\exp\left({-j{\theta_{BU}}}\right)}\right)=\sqrt{{C_{t}}d_{t}^{-{\alpha_{t}}}}f_{BU},$
(13)

where $f_{BU}$ is the small scale fading for the RIS-aided channel,
$P_{BR}(\mathbf{x}_{B,near})=P_{BU}(O,\mathbf{x}_{B,near})={C_{t}}d_{t}^{-\alpha_{t}}$,
$C_{t}$ is the intercept and $d_{t}$ is the distance between the typical user
and its BS, which has the PDF as (3).

Based on the assumption of the perfectly coherent scenario, the phases of all
the links can be adjusted as the result of
${\vartheta_{i}}+{\theta_{BR,i}}={\theta_{BU}}=\theta$ for all $i\in[1,n]$.
Hence, we can express the equivalent channel model in power domain as

$\displaystyle{\left|{{g_{BU}}}\right|^{2}}={C_{t}}d_{t}^{-{\alpha_{t}}}{\left({\sum\limits_{i=1}^{n}{A{\beta_{i}}{c_{BR,i}}}+{c_{BU}}}\right)^{2}}.$
(14)

###### Theorem 1

Since we consider the sub-links, i.e., the reflecting links through each RIS
element and the direct link, are independent Rayleigh fading channels,
$c_{BU}$ and $c_{BR,i}$ (for $i\in[1,n]$) are $n+1$ independent and
identically distributed variables. We assume the power consumption
coefficients for all RIS elements are the same, denoted as
$\beta_{1}=\beta_{2}=\cdots=\beta_{n}=\beta$. Hence, the distribution of the
channel model ${\left|{{g_{BU}}}\right|^{2}}$ in power domain is derived as

$\displaystyle{f_{{{\left|{{g_{BU}}}\right|}^{2}}}}\left(x\right)=\frac{1}{{2\Lambda\sqrt{\frac{x}{\Lambda}}}}{\cal
L}_{{S_{k}}}^{-1}\left\\{{{{\left({\frac{1}{2}\Psi\left({1,\frac{1}{2};\frac{{{s^{2}}}}{4}}\right)}\right)}^{K}}}\right\\}\left({\sqrt{\frac{x}{\Lambda}}}\right),$
(15)

where $\Lambda={C_{t}}d_{t}^{-{\alpha_{t}}}{\left({A\beta}\right)^{2}}$,
$K=n+1$, ${\cal L}_{{S_{k}}}^{-1}\left\\{\cdot\right\\}$ is inverse Laplace
transform, $\Psi\left({\cdot,\cdot;\cdot}\right)$ is Tricomi’s confluent
hypergeometric function and
$\Psi\left({1,\frac{1}{2};z}\right)=2-2\exp\left(z\right)\sqrt{\pi}\sqrt{z}{\rm{erfc}}\left({\sqrt{z}}\right)$
is a special case for Tricomi’s function.

###### Proof:

See Appendix A. ∎

Since the inverse Laplace transform of
${{{\left({\frac{1}{2}\Psi\left({1,\frac{1}{2};\frac{{{s^{2}}}}{4}}\right)}\right)}^{K}}}$
is tough to be obtained in Theorem 1, we cannot derive an efficient and
concise distribution. Based on the simulation results, the trend of the CDF
for the channel distribution in power domain can be closely approximated to a
Gamma distribution. Hence, we exploit a Gamma distribution to fit the targeted
RIS channel as Corollary 1 [7].

###### Corollary 1

The exact distribution for the RIS-aided channel model including the direct
and reflecting links can be fitted as a Gamma distribution. With the aid of
Matlab curve fitting tools, the PDF and CDF for the small-scale fading model
${\left|{{f_{BU}}}\right|^{2}}$ in power domain can be expressed as

$\displaystyle{f_{{{\left|{{f_{BU}}}\right|}^{2}}}}\left(x\right)$
$\displaystyle=\frac{{{x^{a-1}}}}{{\Gamma\left(a\right){b^{a}}}}\exp\left({-\frac{x}{b}}\right),$
(16) $\displaystyle{F_{{{\left|{{f_{BU}}}\right|}^{2}}}}\left(x\right)$
$\displaystyle=\frac{{\gamma\left({a,x/b}\right)}}{{\Gamma\left(a\right)}},$
(17)

where $a$ and $b$ are curve fitting coefficients with $a=n$, the scale
coefficient $b\approx n$ when $\beta=1$, $\Gamma(\cdot)$ is complete gamma
function and $\gamma(\cdot,\cdot)$ is the lower incomplete gamma function,
denoted as $\gamma(s,x)=\int_{0}^{x}t^{s-1}e^{-t}dt$.

##  IV Performance Evaluation

We evaluate the coverage performance of the typical user and the connected
user in this section. The expression of coverage probability for the two users
can be expressed as

$\displaystyle{{\rm{P}}_{cov,t}}=\Pr\left\\{{{\gamma_{{\rm{SIC}}}}>\gamma_{{\rm{SIC}}}^{th},{\gamma_{t}}>\gamma_{t}^{th}}\right\\},$
(18)
$\displaystyle{{\rm{P}}_{cov,c}}=\Pr\left\\{{{\gamma_{\rm{c}}}>\gamma_{\rm{c}}^{th}}\right\\}\,,$
(19)

where $\gamma_{{\rm{SIC}}}^{th}$, $\gamma_{t}^{th}$ and $\gamma_{\rm{c}}^{th}$
are the coverage thresholds.

###  IV-A Interference Analysis

Before the performance analysis, the Laplace transforms of the typical and
connected user are derived via Lemma 1 and Lemma 2. For the typical user, we
assume only the interference BSs that is facing the RISs have the RIS-aided
channels, thereby the interference BSs are split into two portions, i.e., 1)
BSs facing the RISs with RIS-aided channels; and 2) BSs behind the RISs with
conventional wireless communication channel (Rayleigh fading channels). For
the connected user, the interference BSs experience Rayleigh fading channels
without the aid of RISs.

###### Lemma 1

For the typical user, the Laplace transform of interference, concluding two
portions of interference BSs, is derived as

$\displaystyle{\cal
L}_{(s)}^{t}{\rm{=}}\exp\left({-\pi{\lambda_{b}}d_{t}^{2}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{t}}}},1;1-\frac{2}{{{\alpha_{t}}}};-{\xi_{\rm{1}}}s}\right)-1}\right)}\right)$
$\displaystyle\times\exp\left({-\pi{\lambda_{b}}d_{t}^{2}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{t}}}},a;1-\frac{2}{{{\alpha_{t}}}};-{\xi_{2}}s}\right)-1}\right)}\right),$
(20)

where
${\xi_{\rm{1}}}{\rm{=}}\frac{{\left({1-{\rho_{I}}}\right){P_{t}}{C_{t}}}}{{d_{t}^{{\alpha_{t}}}}}$,
${\xi_{2}}=\frac{{b{\rho_{I}}{P_{t}}{C_{t}}}}{{d_{t}^{{\alpha_{t}}}}}$ and
${}_{2}{F_{1}}\left({\cdot,\cdot;\cdot;\cdot}\right)$ is the hypergeometric
function.

###### Proof:

See Appendix B. ∎

###### Lemma 2

For the connected user with a coefficient, defined as
${\xi_{3}}=\frac{{s{P_{t}}{C_{c}}}}{{r_{c}^{{\alpha_{c}}}}}$, the Laplace
transform of interference can be derived as

$\displaystyle{\cal
L}_{(s)}^{c}{=}\exp\left({-\pi{\lambda_{b}}r_{c}^{2}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{c}}}},1;1-\frac{2}{{{\alpha_{c}}}};-{\xi_{3}}s}\right)-1}\right)}\right),$
(21)

###### Proof:

See Lemma 1. ∎

###  IV-B Coverage Probability

Based on the derivations of the Laplace transform, we derive the coverage
probability expressions of the typical user and connected user in the
following.

###### Theorem 2

Since the RISs enhance the channel quality of the typical user, we arrange the
typical user complete the SIC procedure. Hence, the coverage probability
concluding SIC process is derived as

$\displaystyle{{\rm{P}}_{cov,t}}=$ $\displaystyle
2\pi{\lambda_{b}}\sum\limits_{k=1}^{a}{{{\left({-1}\right)}^{k+1}}\binom{a}{k}}I_{1},$
(22)

where
$I_{1}=\int_{0}^{\infty}{x\exp\left({-{\Xi_{2}}{x^{{\alpha_{t}}}}}\right)\exp\left({-{\Xi_{1}}{x^{2}}}\right)}dx$,
$\Upsilon=\max\left({\frac{{\gamma_{{\rm{SIC}}}^{th}}}{{\left({{a_{c}}-\gamma_{{\rm{SIC}}}^{th}{a_{t}}}\right)}},\frac{{\gamma_{t}^{th}}}{{{a_{t}}}}}\right)$,
${\Xi_{2}}=\frac{{k{\eta_{t}}\Upsilon{\sigma^{2}}}}{{{P_{t}}{C_{t}}}}$ and
${\Xi_{1}}$ is expressed as

$\displaystyle{\Xi_{1}}$
$\displaystyle=\pi{\lambda_{b}}{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{t}}}},1;1-\frac{2}{{{\alpha_{t}}}};-k{\eta_{t}}\Upsilon\left({1-{\rho_{I}}}\right)}\right)$
$\displaystyle+\pi{\lambda_{b}}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{t}}}},a;1-\frac{2}{{{\alpha_{t}}}};-k{\eta_{t}}b\Upsilon{\rho_{I}}}\right)-1}\right).$
(23)

###### Proof:

After we defined a coefficient, denoted as
$\Upsilon=\max\left({\frac{{\gamma_{{\rm{SIC}}}^{th}}}{{\left({{a_{c}}-\gamma_{{\rm{SIC}}}^{th}{a_{t}}}\right)}},\frac{{\gamma_{t}^{th}}}{{{a_{t}}}}}\right)$,
the coverage probability is expressed as
${{\rm{P}}_{cov,t}}=\Pr\left\\{{{{\left|{{f_{BU}}}\right|}^{2}}>{{\Upsilon
d_{t}^{{\alpha_{t}}}\left({{I_{t,{\rho_{I}}}}+{\sigma^{2}}}\right)}\mathord{\left/{\vphantom{{\Upsilon
d_{t}^{{\alpha_{t}}}\left({{I_{t,{\rho_{I}}}}+{\sigma^{2}}}\right)}{{P_{t}}{C_{t}}}}}\right.\kern-1.2pt}{{P_{t}}{C_{t}}}}}\right\\}$.
with the aid of the closed boundary for Gamma distribution, i.e.,
${{\rm{P}}_{{{\left|{{f_{BU}}}\right|}^{2}}}}\left\\{{{{\left|{{f_{BU}}}\right|}^{2}}<x}\right\\}={\left({1-\exp(-{\eta_{t}}x)}\right)^{N}}$
with ${\eta_{t}}=\frac{{\rm{1}}}{b}{\left({a!}\right)^{-\frac{1}{a}}}$, the
expression of the coverage probability is derived as

$\displaystyle{{\rm{P}}_{cov,t}}{=}\sum\limits_{k=1}^{a}{{{\left({-1}\right)}^{k+1}}\binom{a}{k}}{\rm{E}}\left[{{e^{-\frac{{k{\eta_{t}}\Upsilon
d_{t}^{{\alpha_{t}}}}}{{{P_{t}}{C_{t}}}}{I_{t,{\rho_{I}}}}}}}\right]{\rm{E}}\left[{{e^{-\frac{{k{\eta_{t}}\Upsilon
d_{t}^{{\alpha_{t}}}{\sigma^{2}}}}{{{P_{t}}{C_{t}}}}}}}\right]$
$\displaystyle{=}\sum\limits_{n=1}^{a}{{{\left({-1}\right)}^{k+1}}}\binom{a}{k}{\rm{E}}\left[{{e^{-\frac{{k{\eta_{t}}\Upsilon
d_{t}^{{\alpha_{t}}}{\sigma^{2}}}}{{{P_{t}}{C_{t}}}}}}}\right]{\cal
L}_{(s)}^{t}\left({\frac{{k{\eta_{t}}\Upsilon
d_{t}^{{\alpha_{t}}}}}{{{P_{t}}{C_{t}}}}{I_{t,{\rho_{I}}}}}\right),$ (24)

and substituting the Laplace transform of interference for the typical user
into the coverage probability expression, the theorem is proved. ∎

###### Corollary 2

_Consider the special case when $\alpha_{t}=2$, the closed-form coverage
probability expression can be derived as _

$\displaystyle{{\rm{P}}_{cov,t}}=\sum\limits_{k=1}^{a}{{{\left({-1}\right)}^{k+1}}\binom{a}{k}}\frac{{\pi{\lambda_{b}}}}{{\left({{\Xi_{1}}+{\Xi_{2}}}\right)}}$
(25)

_which can be derived via Eq.[2.3.3.1] in[8]._

###### Corollary 3

_Conditioned on $\alpha_{t}=4$, we can derive the closed-form expression of
coverage probability for the typical user as _

$\displaystyle{{\rm{P}}_{cov,t}}{=}\sum\limits_{k=1}^{a}{\frac{{\pi{\lambda_{b}}}}{{2{{\left({-1}\right)}^{k+1}}}}\binom{a}{k}}\sqrt{\frac{\pi}{{{\Xi_{2}}}}}\exp\left({\frac{{\Xi_{1}^{2}}}{{4{\Xi_{2}}}}}\right){\rm{erfc}}\left({\frac{{{\Xi_{1}}}}{{2\sqrt{{\Xi_{2}}}}}}\right),$
(26)

_which can be proved by Eq.[2.3.15.4] in[8]._

###### Theorem 3

_Since the channel quality of the connected user is lower than the typical
user, the signals of the connected user will be directly decoded to ensure the
performance. Thus, the coverage probability of the connected user is derived
as_

$\displaystyle{{\rm{P}}_{cov,c}}=\exp\left({-{\Xi_{3}}r_{c}^{{\alpha_{c}}}}\right)\exp\left({-{\Xi_{4}}r_{c}^{2}}\right),$
(27)

_where
${\Xi_{4}}=\pi{\lambda_{b}}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{c}}}},1;1-\frac{2}{{{\alpha_{c}}}};-\frac{{{\eta_{c}}\gamma_{\rm{c}}^{th}}}{{{a_{c}}-\gamma_{\rm{c}}^{th}{a_{t}}}}}\right)-1}\right)$,
${\Xi_{3}}={{{\eta_{c}}\gamma_{\rm{c}}^{th}{\sigma^{2}}}\mathord{\left/{\vphantom{{{\eta_{c}}\gamma_{\rm{c}}^{th}{\sigma^{2}}}{\left({\left({{a_{c}}-\gamma_{\rm{c}}^{th}{a_{t}}}\right){P_{t}}{C_{c}}}\right)}}}\right.\kern-1.2pt}{\left({\left({{a_{c}}-\gamma_{\rm{c}}^{th}{a_{t}}}\right){P_{t}}{C_{c}}}\right)}}$
and ${\eta_{c}}=1$. _

###### Proof:

See Theorem 2. ∎

##  V Numerical Results

We exploit the numerical results to validate analytical coverage probability
for typical users (Theorem 2) and connected users (Theorem 3) as upper bounds.
Without otherwise specification, we set the numerical coefficients as: the
noise power as ${\sigma^{2}}=-170+10\log\left({f_{c}}\right)+{N_{f}}=-90$ dB
with the bandwidth $f_{c}$ as $10$ MHz and the noise figure $N_{f}$ as $10$
dB, transmit power of users $P_{t}$ as $\left[0,30\right]$ dBm, pass loss
exponents as $\alpha_{c}=\alpha_{t}=4$, density of BSs as
$\lambda_{b}=1/(300^{2}\pi)$, thresholds
$\gamma_{SIC}^{th}=\gamma_{t}^{th}=\gamma_{c}^{th}=10^{-2}$, and power
allocation coefficients $a_{c}=0.6$ and $a_{t}=0.4$. The number of the RISs
$n$ and power consumption coefficient $\beta$ is defined in the following
paragraphs.

Figure 2: CDF versus the value of $\left|f_{BU}\right|^{2}$ with various
numbers of RIS elements and power consumption coefficient. Figure 3: Coverage
probability versus transmit SNR with various numbers of RIS elements
$n=a=\\{5,10\\}$ and power consumption coefficient $\beta=\\{1,0.8\\}$. Figure
4: Coverage probability versus the number of RIS elements with $P_{t}=20$ dBm
and various power consumption coefficient $\beta=\\{1,0.8\\}$.

Fig. 2 illustrates that the validation of the RIS-aided channel model. One
observation is that the number of RIS elements $n$ is the same as the shape
coefficient of the Gamma distribution $a$. Another illustration is that the
CDF of the RIS-aided channel model with a large number of RIS elements
enhances more gently than the CDF with few RIS elements. Additionally, when we
decrease the power consumption coefficient of the RISs $\beta$, the shape
coefficient of the Gamma distribution $a$ is not influenced while the scale
coefficient $b$ declines.

The coverage performance versus transmit SNR is investigated via Fig. 3, which
demonstrates all the analytical results are upper bounds since we utilize a
close upper bound assumption to derive the coverage probability. One
observation is that increasing the number of RIS elements and power
consumption coefficient can enhance the performance of the typical user. This
is because enlarging the RIS element number and reducing the power consumption
can improve the channel quality of the typical user.

Considering the number of RIS elements $n$, Fig. 4 investigates the
performance varied by $n$. Two observations are apparent to explain that: 1)
the coverage probability with large numbers of RIS elements $n$ and power
consumption coefficient $\beta$ outperforms that of low $n$ and $\beta$; 2)
the RISs has no influence on the connected user since no RIS aids the
connected user.

##  VI Conclusion

This paper has investigated the coverage probability of a coherent scenario
for RIS-aided multi-cell NOMA frameworks, where stochastic geometry models are
exploited to capture the spatial effects of NOMA users. The RIS-aided channel
model concluding the reflecting links and the direct links has been derived,
which is closely modeled as a Gamma distribution. The analytical results have
revealed that 1) the shape coefficient of the Gamma distribution $a$ is equal
to the number of RIS elements $n$; and 2) the scale coefficient $b$ is equal
to $n$ when the power consumption coefficient $\beta=1$ holds. Based on the
channel model, the closed-form expressions of coverage probabilities have been
derived. Numerical results has shown the conclusions that: 1) RISs can enhance
the channel quality of its aided user; 2) the performance can be further
enhanced via increasing the number of RIS elements $n$ and the power
consumption coefficient $\beta$; and 3) RISs can provide high flexibility on
decoding orders via adjusting the number of elements $n$.

## Appendix A: Proof of Theorem 1

When the number of RIS elements $n$ is large enough, we can assume the channel
fading model as

$\displaystyle{\left|{{g_{BU}}}\right|^{2}}$
$\displaystyle={C_{t}}d_{t}^{-{\alpha_{t}}}{\left({\sum\limits_{i=1}^{n}{A{\beta_{i}}{c_{BR,i}}}+{c_{BU}}}\right)^{2}}$
$\displaystyle\approx{C_{t}}d_{t}^{-{\alpha_{t}}}{\left({A\beta{S_{K}}}\right)^{2}},$
(A.1)

where we set ${c_{n}}={c_{BU}}$, ${c_{k}}={c_{BR,k}}$ and
${S_{K}}=\sum\limits_{k=1}^{K}{{c_{k}}}$ for $K=n+1$.

Firstly, since the $K$ variables have the same density distributions, we can
briefly derive the distribution of the sum of $K$ independent random
variables, denoted as ${S_{K}}$. Noted that a property for the distribution of
${S_{K}}$ is expressed as

$\displaystyle{{\cal
L}_{{S_{K}}}}\left[{{f_{{S_{K}}}}\left(x\right)}\right]={\left\\{{{{\cal
L}_{{S_{K}}}}\left[{{f_{Rayleigh}}\left(x\right)}\right]}\right\\}^{K}},$
(A.2)

where ${f_{Rayleigh}}\left(x\right)$ is the PDF of Rayleigh fading channels.
Hence, according to Eq. [2.3.15.1] in table [8], the Laplace transform of
${S_{K}}$ can be calculated as

$\displaystyle{{\cal
L}_{{S_{K}}}}\left[{{f_{{S_{K}}}}\left(x\right)}\right]={\left({\Gamma\left(2\right)\exp\left({\frac{{{s^{2}}}}{8}}\right){D_{-2}}\left({\frac{s}{{\sqrt{2}}}}\right)}\right)^{K}},$
(A.3)

where ${D_{-V}}\left(\cdot\right)$ is the parabolic-cylinder function shown in
the index of notions in table [8].

Additionally, a special case with special values for the parabolic-cylinder
function is expressed as
${D_{-2}}\left({\frac{s}{{\sqrt{2}}}}\right)=\frac{1}{2}\exp\left({-\frac{{{s^{2}}}}{8}}\right)\Psi\left({1,\frac{1}{2};\frac{{{s^{2}}}}{4}}\right)$.
Hence, the PDF of ${{S_{K}}}$ is expressed as

$\displaystyle{f_{{S_{K}}}}\left(x\right)={\cal
L}_{{S_{k}}}^{-1}\left\\{{{{\left({\frac{1}{2}\Psi\left({1,\frac{1}{2};\frac{{{s^{2}}}}{4}}\right)}\right)}^{K}}}\right\\}\left(x\right).$
(A.4)

When variable $x$ with its PDF $f_{x}(x)$, the PDF for $y=ax^{2}$ can be
derived as
$f_{y}(y)=\frac{1}{2a\sqrt{(}y/a)}\left[f_{x}(\sqrt{(}y/a))+f_{x}(-\sqrt{(}y/a))\right],y>0$.
Hence, with the aid of the mentioned equation, the PDF of the equivalent
channel model in power domain ${\left|{{g_{BU}}}\right|^{2}}=\Lambda
S_{K}^{2}$ can be obtained.

## Appendix B: Proof of Lemma 1

Based on the Campbell theorem, the Laplace transform expression of the
interference for the typical user is derived as

$\displaystyle{\cal
L}_{(s)}^{t}{=}\underbrace{{\rm{E}}\left[{\prod\limits_{{{\bf{x}}_{I}}\in{\Phi_{r}}\setminus{{\bf{x}}_{B}}}{\exp}\left({-{\rho_{I}}s{P_{t}}{C_{t}}d_{I}^{-{\alpha_{t}}}{{\left|{{f_{BU}}}\right|}^{2}}}\right)}\right]}_{{I_{3}}}$
$\displaystyle\times\underbrace{{\rm{E}}\left[{\prod\limits_{{{\bf{x}}_{I}}\in{\Phi_{r}}\setminus{{\bf{x}}_{B}}}{\exp}\left({-s\left({1-{\rho_{I}}}\right){P_{t}}{{\left|{{h_{BU}}}\right|}^{2}}{C_{t}}d_{I}^{-{\alpha_{t}}}}\right)}\right]}_{{I_{2}}}.$
(B.1)

With the aid of probability generating functional (PGFL) and
$\int_{A}^{\infty}{\left({1-\frac{1}{{{{\left({1+s{y^{-\alpha}}}\right)}^{N}}}}}\right)ydy=\frac{{{A^{2}}}}{2}\left({{}_{2}{F_{1}}\left({-\frac{2}{\alpha},N;1-\frac{2}{\alpha};}\right.\left.{-\frac{{s}}{{{A^{\alpha}}}}}\right)}\right.}$
$\left.{-1}\right)$, $I_{2}$ and $I_{3}$ can be derived as

$\displaystyle
I_{2}{=}\exp\left({-\pi{\lambda_{b}}d_{t}^{2}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{t}}}},1;1-\frac{2}{{{\alpha_{t}}}};-{\xi_{\rm{1}}}s}\right)-1}\right)}\right),$
(B.2) $\displaystyle
I_{3}{=}\exp\left({-\pi{\lambda_{b}}d_{t}^{2}\left({{}_{2}{F_{1}}\left({-\frac{2}{{{\alpha_{t}}}},a;1-\frac{2}{{{\alpha_{t}}}};-{\xi_{2}}s}\right)-1}\right)}\right).$
(B.3)

## References

  * [1] S. M. R. Islam, N. Avazov, O. A. Dobre, and K. Kwak, “Power-domain non-orthogonal multiple access (NOMA) in 5G systems: Potentials and challenges,” _IEEE Commun. Surveys Tuts._ , vol. 19, no. 2, pp. 721–742, 2017.
  * [2] E. Basar, M. Di Renzo, J. De Rosny, M. Debbah, M. Alouini, and R. Zhang, “Wireless communications through reconfigurable intelligent surfaces,” _IEEE Access_ , vol. 7, pp. 116 753–116 773, 2019.
  * [3] D. Moltchanov, “Distance distributions in random networks,” _Ad Hoc Networks_ , vol. 10, no. 6, pp. 1146–1166, 2012.
  * [4] W. Yi, Y. Liu, E. Bodanese, A. Nallanathan, and G. K. Karagiannidis, “A unified spatial framework for UAV-aided mmwave networks,” _IEEE Trans. Commun._ , vol. 67, no. 12, pp. 8801–8817, 2019.
  * [5] J. G. Andrews, F. Baccelli, and R. K. Ganti, “A tractable approach to coverage and rate in cellular networks,” _IEEE Trans. Commun._ , vol. 59, no. 11, pp. 3122–3134, 2011.
  * [6] Y. Liu, X. Liu, X. Mu, T. Hou, J. Xu, Z. Qin, M. D. Renzo, and N. Al-Dhahir, “Reconfigurable intelligent surfaces: Principles and opportunities,” _arXiv preprint arXiv:2007.03435_ , 2020.
  * [7] A. Al-Hourani, S. Kandeepan, and S. Lardner, “Optimal lap altitude for maximum coverage,” _IEEE Wireless Commun. Lett._ , vol. 3, no. 6, pp. 569–572, 2014.
  * [8] A. P. Prudnikov, Y. A. Brychkov, and O. I. Marichev, _Integrals and series: special functions_ , ser. 1. New York: Gordon & Breach Sci. Publ., 1986.