# BYOC: Personalized Few-Shot Classification
with Co-Authored Class Descriptions

Arth Bohra
University of California Berkeley
Berkeley, CA, USA
<EMAIL_ADDRESS>&Govert Verkes
Artem Harutyunyan
Pascal Weinberger
Giovanni Campagna
Bardeen, Inc.
San Francisco, CA, USA
<EMAIL_ADDRESS>
###### Abstract

Text classification is a well-studied and versatile building block for many
NLP applications. Yet, existing approaches require either large annotated
corpora to train a model with or, when using large language models as a base,
require carefully crafting the prompt as well as using a long context that can
fit many examples. As a result, it is not possible for end-users to build
classifiers for themselves.

To address this issue, we propose a novel approach to few-shot text
classification using an LLM. Rather than few-shot examples, the LLM is
prompted with descriptions of the salient features of each class. These
descriptions are coauthored by the user and the LLM interactively: while the
user annotates each few-shot example, the LLM asks relevant questions that the
user answers. Examples, questions, and answers are summarized to form the
classification prompt.

Our experiments show that our approach yields high accuracy classifiers,
within 82% of the performance of models trained with significantly larger
datasets while using only 1% of their training sets. Additionally, in a study
with 30 participants, we show that end-users are able to build classifiers to
suit their specific needs. The personalized classifiers show an average
accuracy of 90%, which is 15% higher than the state-of-the-art approach.

##  1 Introduction

Figure 1: Overview of how a user can construct and use a classifier with BYOC.

Text classification – the task of mapping a sentence or document to one class
of a predefined set – is a well-studied, fundamental building block in natural
language processing Maron (1961); Li et al. (2022), with applications such as
textual entailment Dagan et al. (2005); Bowman et al. (2016), sentiment
analysis Wang and Manning (2012); Socher et al. (2013), topic classification
Hingmire et al. (2013), intent and dialog act classification Godfrey et al.
(1992); Reithinger and Klesen (1997); Tur et al. (2010); Coucke et al. (2018);
Xu et al. (2021), and more.

Because a classification task targets a fixed set of classes, each of these
many applications of classification must be built separately. Furthermore,
classes are often highly domain-specific, and in certain scenarios must be
personalized to each user. Consider the example of classifying an email as
“Important” or “Not Important”. Many users would consider family emails to be
important, but some might decide to only prioritize work emails, or only
emails that require immediate action such as a reply. As a more extreme
example, most users would consider coupons to be junk mail, but some might
actively search for savings.

There exist a plethora of use cases where personalized classification is
necessary:

  * •

Classifying product or business reviews as useful according to someone’s
preferences.

  * •

Classifying user support requests as being pertinent to a particular product
component, so they can be routed to the relevant team.

  * •

Classifying an academic paper as likely relevant or not to someone’s research.

In all of these contexts, annotating a large dataset and then training a
domain-specific model is intractable. It is too expensive and time-consuming
for individual end-users to label the hundreds of examples needed to train a
high-quality classifier, and even more so if the criteria change frequently,
because each time the training set would need to be rebuilt from scratch.
Hence, we need a technique that can work well in a few-shot regime, where the
user only labels a limited number of examples.

To overcome this challenge, we propose to leverage Large Language Models
(LLMs), which have been shown to perform very well on a variety of
classification tasks Radford et al. (2019); Raffel et al. (2020); Brown et al.
(2020); Gao et al. (2021).

Prior work using LLMs for few-shot text classification proposed using task
demonstrations consisting of examples and their labels, and proposed to
include as many as possible to fit in the context length Brown et al. (2020);
Gao et al. (2021). There are two issues with this approach: (1) the context
length is limited, and with longer text only few examples can fit, and (2) the
prompt length can be significantly larger than the size of a single input,
increasing the computational cost.

At the same time, for many of these tasks, the mapping from text to classes
can be expressed in relatively simple rules. LLMs based on instruction tuning
Ouyang et al. (2022) can classify according to instructions expressed as text.
The challenge then becomes: how can we help end-users write meaningful and
sufficient instructions? End-users are not prompt engineers, and struggle to
write good instructions. In our experiments we found that users often forget
about relevant situations or conditions, leading to poor quality
classification.

We also observe that LLMs can be prompted to elicit information and ask
clarifying questions. Hence, we propose an interactive approach to help users
write high-quality classification prompts, which we call Build Your Own
Classifier (BYOC):

  1. 1.

The user provides the purpose of the classifier and the list of classes.

  2. 2.

They annotate a small amount of data. For each example, the LLM generates
questions that would be helpful to classify the example. The user answers the
questions, then selects the correct class for the example and explains why
they selected that class.

  3. 3.

The examples, questions, answers, labels, and explanations are summarized into
class descriptions: succinct textual representations of the classification
criteria and relevant aspects of the training data.

  4. 4.

At inference time, the LLM is prompted with only the generated class
descriptions.

Our experiments show that with only a small amount of additional work for each
training example, BYOC yields higher accuracy than including training data in
the LLM prompt. Indeed, we can improve the accuracy of few-shot text
classification to the point where we can be within 82% of fine-tuning a
dedicated model on a full dataset.

Our method is also suitable for personalization. In an experiment conducted
directly with end users, our approach improves over manually provided class
descriptions by 23%, and over the state of the art by 15%, while consuming 37%
fewer tokens at inference time.

###  1.1 Contributions

The contributions of this paper are as follows:

  * •

A novel approach to few-shot text classification using class descriptions in
lieu of task demonstrations. This approach is more computationally efficient
due to a shorter prompt.

  * •

A method, called BYOC, to interactively construct class descriptions for
classification, by prompting the LLM to ask relevant questions to the user.

  * •

Experimental results on the Web of Science dataset Kowsari et al. (2017) show
that a classifier built with BYOC is 9% better than the few-shot state of the
art, and reaches 82% of the accuracy of a model trained on a full dataset,
using only 1% of their training set.

  * •

BYOC enables non-experts to build classifiers with high-accuracy, with an
average accuracy of 90%, 15% higher than the equivalent few-shot baseline.
Additionally, the classifiers built with BYOC outperform a model trained for
all users at once, which underscores the need for personalization.

  * •

We built a prototype of BYOC within a commercial web automation platform. In a
study with 30 participants, we find that users find our approach
interpretable, and 80% would consider using it for their own use cases.

##  2 Related Work

#### Few-Shot Text Classification

Text classification using few-shot training sets has been studied before.
Previous methods proposed dedicated model architectures, based on prototype
networks Snell et al. (2017); Sun et al. (2019) or contrastive representation
learning Yan et al. (2018); Chen et al. (2022). These methods cannot take
advantage of large language models, especially API-based LLMs that are only
available as a text-based black box.

With LLMs, text classification is usually either zero-shot through providing
instructions and class names Radford et al. (2019); Raffel et al. (2020);
Ouyang et al. (2022); Sun et al. (2023), through transfer learning from
existing tasks Wang et al. (2021), or few-shot by task demonstrations Brown et
al. (2020); Gao et al. (2021), optionally with explanations Lampinen et al.
(2022). Task demonstrations are computationally expensive and limited by the
language model context window size. Additionally, it is unclear whether the
model can learn from demonstrations effectively Min et al. (2022). Finally, it
is known that end-users struggle to write high accuracy classification prompts
Reynolds and McDonell (2021); Jiang et al. (2022).

#### Prompt Construction

Concurrent to this work, Pryzant et al. (2023) proposed automatically
optimizing the prompt given few-shot data, using a search algorithm and LLM-
generated feedback. Wang et al. (2023) proposed summarizing few-shot examples
to obtain succinct prompts. Neither of those methods incorporates user
feedback to disambiguate challenging examples.

Kaneko et al. (2023) also proposed leveraging question generation for
classification. They propose to use interactivity at inference time; our goal
instead is to be able to classify non-interactively, and only use questions at
training time.

Finally, we note that natural language feedback was also proposed for
explainability Marasović et al. (2021); Yordanov et al. (2022); Wiegreffe et
al. (2022), but those approaches did not lead to an improvement in accuracy.

#### Data Augmentation

A different line of work proposed to augment the training data with
automatically generated or automatically labeled data.

In particular, one line of work observed that often a large unlabeled corpus
is available, and proposed using programmatic rules to label it in a weakly
supervised fashion Ratner et al. (2016, 2017). Later work then proposed
learning those rules from natural language explanations Hancock et al. (2018)
or extracting those rules from a pretrained language model Schick and Schütze
(2021); Pryzant et al. (2022). Weak supervision is not practical for end-user
personalized classification, because crafting the rules requires a high level
of expertise. Refining the rules also requires a large labeled validation set,
which is often not available.

A different line of work proposed to use LLMs to synthesize training data,
which is then used to train a smaller classifier Yoo et al. (2021); Ye et al.
(2022); Gao et al. (2023); Møller et al. (2023). As with using LLMs directly
for classification, the challenge is to instruct the LLM so the resulting
training data is personalized, and not a statistical average across many
users. At the same time, our approaches are complementary, and synthesis could
be used in the future to distill the LLM to a more computationally efficient
model.

##  3 Overview of BYOC

In this section, we present the process through which a user can build a
personalized classifier using BYOC. We do so by way of an example: Alice wants
to build an email classifier to categorize emails as “Important” and
“Unimportant”. The overall flow is summarized in Fig. 1.

###  3.1 High Level Planning

As the first step towards building a classifier, Alice provides a high-level
plan of what she wishes to classify, which provides the model with an initial
understanding of her objective. First, Alice writes a short purpose statement
of what she would like to accomplish: “I want to separate spam from my
important emails”. Then, she specifies the list of classes she wants to
classify into – two classes, in this example. For each class, Alice can
optionally write an initial description of what kind of text fits in each
class. For example, she can say that work emails are important, and promotions
are not. The descriptions play an important role in BYOC and will be
iteratively improved in later steps.

###  3.2 Interactive Training

Without training, the model would have a limited understanding of Alice’s
specific needs for classification. Instead, Alice interactively trains the
model with a small amount of data. The goal is two-fold: for Alice to
understand the model’s decision-making process to refine the prompt, and for
the model to learn about difficult examples and specific criteria relevant to
the task.

#### Training Data

First, the user selects a source of data to use for training. In our example,
Alice selects her email account, and BYOC uses her credentials to fetch and
show her an email.

#### Interactive QA

Below the email, BYOC presents Alice with a question, automatically generated
from the text of the email. The goal of the question is to clarify the meaning
of the text in the context of classification. Along with the question, BYOC
displays the model’s reasoning for asking the question, whether it is to
clarify, broaden, or confirm what is stated in the class descriptions. Alice
answers the question, addressing any confusion the model may have. Then Alice
is presented with another question related to the same email, either a follow-
up question or a new question altogether. Alice answers again, and the process
repeats up to a configurable number of questions for each email.

#### Prediction and Labeling

After Alice answers all questions, the model uses the responses to predict the
class of the current email. BYOC displays the prediction and its reasoning,
which enables Alice to assess the model’s decision-making process. Alice then
enters the correct classification of the email, and also corrects the model’s
reasoning, if necessary.

#### Prompt Refinement

Given the text, questions, answers, classification, and explanation for the
current example, BYOC automatically updates the class descriptions, adding or
removing any information to improve classification accuracy. Alice then
repeats this process on a new email, until she chooses to stop adding new data
to the training set.

After annotating all training examples, Alice can review the final refined
class descriptions. She can optionally edit the class descriptions to her
liking, making any corrections or adding any information that might be
missing.

Finally, Alice assigns a name to the classifier and saves it so she can use it
later.

###  3.3 Using the Classifier

After Alice creates the classifier, she can use it as a skill in the web
automation platform that BYOC is part of. For instance, she builds a program
that scans her inbox, applies the constructed classifier to each email, and if
the email is classified as “not important”, it is marked as read and archived.
Alternatively, she can use a program that triggers any new email and sends her
a text message when the email is classified as important. The same classifier,
once built, can be used in different programs. Moreover, she can share it with
others, like family members with similar email needs.

##  4 Prompting for Personalized Classification

In this section, we first present the formal definition of a classifier model
that uses class descriptions, and then present a method to interactively
compute those class descriptions.

###  4.1 Problem Statement

Given a sample $(x,y)$, where $x$ is the input text to be classified and $y\in
C$ is the class, our goal is to learn a function $f$ parameterized on $n_{C}$
and $d_{C}$

$\displaystyle f(x;n_{C},d_{C})$ $\displaystyle=\hat{y}$

such that, with high probability $\hat{y}=y$, that is, the predicted class is
equal to the true class. $n_{C}$ is the set of user-defined names of all
classes $c\in C$, and $d_{C}$ is the set of all class descriptions $d_{c}$.

We learn $d_{C}$ from the user-provided classifier purpose $p$, the class
names $n_{C}$, and a small set of labeled samples
$(x_{i},y_{i})\in\mathcal{D}$:

$\displaystyle d_{C}$ $\displaystyle=\text{BYOC}(p,n_{C},\mathcal{D})$

The function BYOC that computes the class descriptions is an interactive
function: in addition to the given inputs, it has access to an oracle (the
user) who can answer any question posed to them in natural language.

###  4.2 Computing Class Descriptions

BYOC proceeds iteratively for each sample $(x_{i},y_{i})$, updating $d_{C,i}$
at each step. The initial $d_{C,0}$ is provided by the user.

At each step, we ask the user questions in succession. The set of question and
answers $Q_{i}$ is initially empty, and it gets updated with each question
$q_{i,t}$ and answer $a_{i,t}$ ($1\leq t\leq M$):

$\displaystyle Q_{i,0}$ $\displaystyle=\emptyset$ $\displaystyle q_{i,t}$
$\displaystyle=\text{GenQuestion}(x,d_{C,i-1},Q_{i,t-1})$ $\displaystyle
a_{i,t}$ $\displaystyle=\text{User}(q_{i,t})$ $\displaystyle Q_{i,t}$
$\displaystyle=Q_{i,t-1}\cup\\{(q_{i,t},a_{i,t})\\}$

“User” denotes the user answering the question.

After collecting $M$ questions, where $M$ is a hyperparameter, BYOC computes:

$\displaystyle\hat{y}_{i},\hat{e}_{i}$
$\displaystyle=\text{InteractivePredict}(x_{i},p,n_{C},d_{C,i-1},Q_{i,M})$
$\displaystyle d_{c,i}$
$\displaystyle=\text{Update}(d_{C,i-1},c,x_{i},Q_{i,M},\hat{y}_{i},y_{i},e_{i})$

where $\hat{e}_{i}$ is a model-provided explanation for why the sample has the
given class, which we obtain through self-reflection Shinn et al. (2023), and
$e_{i}$ is the user’s own rewriting of $\hat{e}_{i}$.

The above procedure makes use of the following functions implemented with
LLMs:

  * •

GenQuestion: The model generates a question to clarify the meaning of the
classification task. We prompt the model to generate questions that refine or
broaden the scope of the current class descriptions and can generalize to
other examples, and in particular, questions that uniquely depend on the user
and are not answerable based on the given text.

  * •

InteractivePredict: The model attempts to make its own classification of the
text based on the current class descriptions and the questions answered by the
user for this sample. Access to the answers from the user, which is not
available for regular prediction, improves the accuracy and the quality of the
reflection obtained from the model.

  * •

Update: The model computes a new class description for a given class, given
the current class descriptions, the input, questions and answers, model- and
user-generated label, and user explanation. The model is prompted to
incorporate the information from the new answers, without discarding relevant
information from the existing descriptions. The model sees both the correct
and predicted labels, which allows it to weigh how important is the new
example.

These functions are implemented with individual calls to a black box LLM. All
functions incorporate chain of thought prompting Wei et al. (2022). Detailed
prompts are included in Appendix B.

###  4.3 Classifying With Class Descriptions

After obtaining the final class descriptions $d_{C}$, we compute a
classification on a new sample $x$ as:

$\displaystyle f(x)$ $\displaystyle=\text{Predict}(x,p,n_{C},d_{C})$

The function Predict concatenates a fixed preamble, the class names,
descriptions, and classifier purpose, and the input $x$ as a prompt to the
LLM, and then returns the class $c\in C$ whose name $n_{c}$ corresponds to the
output of the LLM. If no class corresponds to the output of the LLM, an error
is returned; note that this rarely happens in practice. As before, we apply
chain of thought to the LLM.

###  4.4 Handling Long Inputs

For certain problems a single input $x$ can be too long to fit in the LLM
prompt. To account for this, we propose to replace $x$ with a summarized
version, up to a threshold size $K$ in the number of tokens:

$\displaystyle\hat{x}$
$\displaystyle=\left\\{\begin{array}[]{ll}\text{Summarize}(x,n_{C},p)&|x|>K\\\
x&\text{otherwise}\end{array}\right.$

where $n_{C}$ are the class names and $p$ is the classifier purpose. The
threshold $K$ strikes a balance between computation cost, space in the context
for the class descriptions, and space for the input.

We propose a novel summarization approach specifically optimized for
classification. First, we split the input into chunks $x_{j}$ of equal size,
approximately respecting paragraph and word boundaries. We then compute the
summary of each chunk $s_{j}$, given the previous summary and the overall
purpose of the classifier $p$:

$\displaystyle s_{1}$ $\displaystyle=\text{SummarizeChunk}(p,x_{1})$
$\displaystyle s_{j}$ $\displaystyle=\text{SummarizeChunk}(s_{j-1},p,x_{j})$

SummarizeChunk is implemented by a call to the LLM. The prompt is included in
the appendix.

##  5 Evaluation

In this section, we evaluate the quality of our proposed approach. Our main
experiment is a personalized classification use-case where we attempt to
classify emails according to the user’s provided criteria. For comparison, we
also evaluate against an existing dataset for the classification of long text.

###  5.1 Experimental Setup

We compare the following approaches:

  * •

Zero-Shot: the model is prompted with class names and class descriptions
provided by users directly, followed only by the input to classify. Inputs
longer than the LLM context window are truncated.

  * •

\+ Summary: we use the same prompt as in Zero-Shot, but additionally inputs
longer than the LLM context window are summarized as described in Section 4.4.

  * •

\+ Few-Shot: in addition to the Zero-Shot prompt, the prompt includes few-shot
training examples, up to the token limit. Each few-shot example consists of
input and label. All inputs are summarized, if necessary.

  * •

\+ Explanation: as in the previous model, but additionally the explanation
from the user is included for each few-shot example. This is similar to the
approach used by Lampinen et al. (2022).

  * •

\+ QA: as in the previous model, but each few-shot example includes both the
explanation and all questions generated by BYOC for that example and the
answers from the user.

  * •

BYOC (our approach): the model is prompted with class names and class
descriptions obtained as described in Section 4.2.

For all experiments, we use the GPT-3.5-Turbo model as the LLM while
constructing the classifier, and the GPT4 model OpenAI (2023) as the LLM
during evaluation on the validation and test set. We use a temperature of 0
for classification to maximize reproducibility, whereas we use a temperature
of 0.3 to generate questions, in order to make them more varied and creative.

###  5.2 Personalized Classification

Our main goal is to support personalized classification. To evaluate BYOC
ability to do so, we perform a user study, in which we ask a group of users to
try and use BYOC to classify their emails. The study is both a way to collect
real data to evaluate BYOC as a model, and a way to study how well end-users
can interact with BYOC.

#### Experimental Setting

We have built an end-to-end prototype of BYOC with a graphical user-interface,
based on a commercial web browser automation platform. We recruit 30 English-
speaking users, 16 women and 14 men, to participate in our study. 10% of the
users are above the age of 50 years old, 20% are between the ages of 30 and
50, and 70% are under the age of 30. 13 users are in a technical field, 9 are
pursuing business, 6 are studying medicine, and 2 are in the arts.

We ask each user to build a personal classifier to categorize their emails as
important or unimportant. We use 30 emails from each user as the data source,
out of their most recent 100. For HTML emails, we remove HTML tags and only
use plain text.

10 of those emails are used in training: the user annotates them during the
interactive training flow (Section 3.2), together with the answers to the
questions generated by BYOC and the explanation for the classification. Each
user answers 3 questions for each training email. The remaining 20 emails are
used for validation and testing; users annotate them at the end after
constructing the classifier with BYOC. 10 of emails for each user are used for
validation and 10 for testing.

#### Dataset

We acquired a dataset of 900 emails from the 30 users participating in our
study. Due to the nature of most emails in an inbox being spam or unimportant
to users, 36% of the emails are classified as important, with the rest being
unimportant. Statistics of the dataset are shown in Table 1.

| Train | Dev | Test
---|---|---|---
# Examples | 300 | 300 | 300
# Tokens | 473,155 | 586,165 | 668,438
Table 1: Size of the BYOC email classification dataset.

#### Overall Accuracy

| # Tokens |
---|---|---
Approach | Build | Run | Accuracy
Zero-Shot | 0 | 1,628 | 66.7%
\+ Summary | 0 | 3,447 | 71.0%
\+ Few-Shot | 0 | 5,535 | 74.7%
\+ Explanation | 0 | 5,590 | 74.7%
\+ QA | 93,282 | 5,818 | 76.7%
BYOC | 170,411 | 3,681 | 90.0%
Fine-tuned | n/a | n/a | 78.3%
Table 2: Test-set accuracy and token counts of our proposed approach against
the different baselines for personalized email classification. Fine-tuned
refers to a single model trained on all training data simultaneously, while
other models are trained for each user separately.

Table 2 shows the results of our experiment. The table shows the accuracy of
the classifier on the test sets, as the percentage of examples classified
correctly across all users. The table also shows the number of prompt tokens
necessary to construct the classifier on average across users (“# Tokens
Build”), and to perform the classification on average across emails (“# Tokens
Run”).

BYOC improves over the state of the art of classification with user
explanations Lampinen et al. (2022) by more than 15%. The zero-shot approach
achieves a respectable accuracy of 67%. Adding summarization improves by 4% by
avoiding sudden truncation. Few-shot examples further improve accuracy by 3%,
but we find no measurable improvement by adding explanations. Asking questions
to the user is marginally effective.

Overall, our results indicate that while the questions answered by the user do
make a difference, the biggest improvement appears when the information
collected during the annotation stage is summarized into co-authored class
descriptions. Our approach enables the model to extract key insights from
every example in the training set, and discard the large amount of otherwise
irrelevant information in the training set.

BYOC is also more token-efficient when compared to previous approaches. Even
though it takes on average 170,411 tokens to build an email classifier for a
user, this cost is fixed. BYOC uses 1,909 fewer tokens for every example
compared to few-shot examples, and is comparable in cost to zero-shot with
summarization. In summary, besides the initial fixed cost when building the
classifier, BYOC is more accurate and cost-effective than the state of the
art.

#### Importance of Personalization

To evaluate how important it is to personalize the classifier, we also train a
single classifier using all 300 emails in the training set at once. As this
dataset is larger, we use a fine-tuned model, using a distilled BERT model
Sanh et al. (2019) with a classifier head connected to the embedding of the
first token.

Results for this experiment are shown in Table 2, in the “Fine-Tuned” line.
The fine-tuned model achieves higher accuracy than LLM baselines, but BYOC
still improves the accuracy by 13%. The increase in accuracy is likely due to
everyone’s differences in perception of what makes an important or unimportant
email. BYOC is more accurate because it enables the LLM to receive personal
information about each user.

#### User Evaluation

At the end of the study, we ask each user to also complete a short survey to
gather feedback on their interaction with BYOC.

Overall, on average on a scale of 1 to 10, users rate their experience with
BYOC an 8.6. When asked about whether they would actually take the time to
build a classifier, on a scale of 1 to 10, users rate their willingness a 9.
P1 reported, “Yes, although tedious, the questions made it capable of
differentiating junk and important emails.”

Furthermore, on a Likert scale between 1 and 5, on average users report their
likeliness to use the classifier in the future a 4.6, with 50% of them saying
they would use the classifier for personal use-cases, 40% using the classifier
for education, and 20% for work. Many users found use cases for BYOC beyond
emails. P2 reports: “I could see myself using it in order to give me specific
recommendations on things to eat, watch, or do and also to sort emails.” P3
stated a more specific use-case for themselves: “I could use a personalized
classifier to classify homework assignments in college to figure out which
ones should be prioritized.”

Beyond the higher level questions we asked about BYOC, we also asked users
about their experience with specific parts of the experiment. Users noticed
how the questions asked by the model reminded them about a lot of the cases
that they had forgotten about in their initial class descriptions. P4 states,
“Yes, the process was smooth because the questions allowed me to realize
further ways to classify the emails that I had initially forgotten.”
Furthermore, when talking about whether they liked the interactive experience
of answering questions, P5 reports: “I did, because they were used to
determine what groups certain things went in. The process felt like sorting in
real life.”

Additionally, all users believe that the model ultimately produced more
descriptive and accurate class descriptions than they had written initially.
P6 reports, “Yes, the model gave me better descriptions and allowed the
classifications to be more accurate to what I wanted.”

###  5.3 Comparison With Existing Approaches

We also wish to evaluate BYOC on an existing dataset, for comparison with
previous classification literature. We choose the task of academic paper topic
classification, in which the abstract of an academic paper is classified into
one of a fixed set of topics. We choose this task because it requires domain-
specific knowledge, especially around the specific usage of each class,
impairing the zero-shot ability of LLMs. The task also involves longer text,
which limits the number of few-shot examples that an LLM can process.

#### Dataset

We use the WOS-5736 dataset by Kowsari et al. (2017). The dataset contains
eleven classes of research paper abstract topics, with three parent classes:
biochemistry, electrical engineering, and psychology.

For each sub-class, we selected 3 abstracts at random belonging to that class,
and annotated them with BYOC, answering 3 questions each. As we are not
experts in the fields covered by the dataset, online sources including Google
and ChatGPT were also consulted to answer. Note that incorrect answers can
only impair accuracy; our results is thus a lower-bound of what can be
achieved by a domain expert. An example of questions and answers is in Fig. 2.
All data will be released upon publication.

The state-of-the-art approach on this dataset leverages a hierarchical model,
classifying first the text into one of the parent classes, and then into one
of the sub-classes. We use the same approach for this experiment. As the
abstracts are short, no summarization was necessary for this experiment.

#### Results

Approach | # Tokens | Accuracy
---|---|---
Zero-Shot | 631 | 58.7%
\+ Few-Shot | 3,873 | 65.9%
BYOC | 2,706 | 74.8%
HDLTex | n/a | 90.9%
Table 3: Accuracy and token counts on the Web of Science test set. Results for
HDLTex are as reported by Kowsari et al. (2017) and use the full training set,
while the other approaches use a few-shot training set.

Table 3 compares BYOC against the state of the art. Our model improves over
the few-shot approach by 9%, while consuming an average of 1,167 fewer tokens
per sample.

When compared to the state-of-the-art approach for this dataset Kowsari et al.
(2017), which used the full training set of 4,588 examples, our model is only
16% worse. If we take the state-of-the-art result as an upper bound over this
dataset, BYOC achieves 82% of the maximum possible accuracy with less than 1%
of their training set.

##  6 Conclusion

This paper presented a novel approach to few-shot text classification using
large language models (LLM). By having the user cooperate with an LLM we were
able to build highly accurate classifiers while annotating a very minimal
amount of data.

For many practical applications of classification, our method eliminates the
need for large annotated corpora. We have achieved high accuracy classifiers
that are competitive with models trained with orders of magnitude larger
datasets.

We also allow end-users to create their own classifiers without expecting them
to be proficient in prompt engineering. Through an interactive process of
question-answering and minimal annotation we are able to make LLM capture the
essential features of each class, enabling a precise classification. Our study
involving real participants has confirmed the usability and effectiveness of
our approach. The end-users were able to build classifiers for themselves
exhibiting an average accuracy of 90% and outperforming the state-of-the-art
approach. Overall, our methodology enables users to leverage the power of LLMs
for their specific needs, opening up new possibilities for practical
applications of text classification in various domains.

Lastly, we plan to make the result of this work available for anyone to try
through a commercial web automation platform.

## Limitations and Future Work

We have identified the following limitations of our approach:

  * •

BYOC uses the LLM as a text-based interface. This is a design decision driven
by the availability of API-based LLMs, but it might limit the maximum
achievable accuracy, compared to fine-tuning the model or using a method that
has access to LLM embeddings or logits. Additionally, using an LLM without
fine-tuning exposes a risk of hallucination, and it is possible that the user
is misled during training.

  * •

For long inputs it is possible that, due to the summarization step, relevant
criteria are omitted from the input of the model, which would lead to a wrong
classification. While our summarization technique is preferable over
truncating the input, future work should explore additional summarization
methods or alternatively encodings of the input.

  * •

Practically speaking, the number of samples that the user is willing to
annotate is usually very low, and it is therefore likely that rare features of
the text would not be accounted for in the classification prompt because they
would not be seen by the model during training and not brought up by the user.
We envision future work will investigate ways to improve the classifier while
in use, perhaps by detecting if the text does not seem to conform to any of
the classes according to the given descriptions.

Additionally, in order to keep the experiment consistent across users, we only
evaluate in the personalized setting with one binary classification task,
namely classifying important and unimportant emails. Future work should
investigate how the approach generalizes to different tasks, whether there are
tasks that benefit more or less from personalization, and whether the number
and detail of classes affect the quality.

## Ethics Statement

We see two main risks of personalized classification in the real world. First,
it is possible that users, who are not machine learning experts, are unable to
correctly estimate the quality of the classifier, and rely on it always being
correct. This is particularly problematic if the validation set used to assess
the model quality is small and not representative. As discussed in the
limitations sections, to mitigate this issue, we expect that real-world
deployment of BYOC will include a mechanism to detect when the model should
abstain from making a classification.

The second concern is the privacy risk from the use of third-party APIs on
sensitive personal data. OpenAI does not store or train on data processed
through their API. In the future, we expect particularly sensitive
applications will use open-source models such as LLaMa Touvron et al. (2023),
running on a device of the user’s choice.

Specifically regarding our user study, the study was conducted with willing
adult participants that expressed informed consent in writing, recruited
through direct connections. Participants were compensated for taking part in
the study. The email dataset will not be released. Examples provided in the
paper are from the authors and not the study participants.

## References

  * Bowman et al. (2016) Samuel R. Bowman, Jon Gauthier, Abhinav Rastogi, Raghav Gupta, Christopher D. Manning, and Christopher Potts. 2016.  A fast unified model for parsing and sentence understanding.  In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 1466–1477, Berlin, Germany. Association for Computational Linguistics.
  * Brown et al. (2020) Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D 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 Ziegler, Jeffrey Wu, Clemens Winter, Chris 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.  In _Advances in Neural Information Processing Systems_ , volume 33, pages 1877–1901. Curran Associates, Inc.
  * Chen et al. (2022) Junfan Chen, Richong Zhang, Yongyi Mao, and Jie Xu. 2022.  Contrastnet: A contrastive learning framework for few-shot text classification.  In _Proceedings of the AAAI Conference on Artificial Intelligence_ , volume 36, pages 10492–10500.
  * Coucke et al. (2018) Alice Coucke, Alaa Saade, Adrien Ball, Théodore Bluche, Alexandre Caulier, David Leroy, Clément Doumouro, Thibault Gisselbrecht, Francesco Caltagirone, Thibaut Lavril, et al. 2018.  Snips voice platform: an embedded spoken language understanding system for private-by-design voice interfaces.  _arXiv preprint arXiv:1805.10190_.
  * Dagan et al. (2005) Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005.  The pascal recognising textual entailment challenge.  In _Machine learning challenges workshop_ , pages 177–190. Springer.
  * Gao et al. (2023) Jiahui Gao, Renjie Pi, LIN Yong, Hang Xu, Jiacheng Ye, Zhiyong Wu, WEIZHONG ZHANG, Xiaodan Liang, Zhenguo Li, and Lingpeng Kong. 2023.  Self-guided noise-free data generation for efficient zero-shot learning.  In _The Eleventh International Conference on Learning Representations_.
  * Gao et al. (2021) Tianyu Gao, Adam Fisch, and Danqi Chen. 2021.  Making pre-trained language models better few-shot learners.  In _Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)_ , pages 3816–3830, Online. Association for Computational Linguistics.
  * Godfrey et al. (1992) John J Godfrey, Edward C Holliman, and Jane McDaniel. 1992.  Switchboard: Telephone speech corpus for research and development.  In _Acoustics, Speech, and Signal Processing, IEEE International Conference on_ , volume 1, pages 517–520. IEEE Computer Society.
  * Hancock et al. (2018) Braden Hancock, Paroma Varma, Stephanie Wang, Martin Bringmann, Percy Liang, and Christopher Ré. 2018.  Training classifiers with natural language explanations.  In _Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 1884–1895, Melbourne, Australia. Association for Computational Linguistics.
  * Hingmire et al. (2013) Swapnil Hingmire, Sandeep Chougule, Girish K Palshikar, and Sutanu Chakraborti. 2013\.  Document classification by topic labeling.  In _Proceedings of the 36th international ACM SIGIR conference on Research and development in information retrieval_ , pages 877–880.
  * Jiang et al. (2022) Ellen Jiang, Kristen Olson, Edwin Toh, Alejandra Molina, Aaron Donsbach, Michael Terry, and Carrie J Cai. 2022.  Promptmaker: Prompt-based prototyping with large language models.  In _Extended Abstracts of the 2022 CHI Conference on Human Factors in Computing Systems_ , CHI EA ’22, New York, NY, USA. Association for Computing Machinery.
  * Kaneko et al. (2023) Masahiro Kaneko, Graham Neubig, and Naoaki Okazaki. 2023.  Solving nlp problems through human-system collaboration: A discussion-based approach.  _arXiv preprint arXiv:2305.11789_.
  * Kowsari et al. (2017) Kamran Kowsari, Donald E Brown, Mojtaba Heidarysafa, Kiana Jafari Meimandi, , Matthew S Gerber, and Laura E Barnes. 2017.  Hdltex: Hierarchical deep learning for text classification.  In _Machine Learning and Applications (ICMLA), 2017 16th IEEE International Conference on_. IEEE.
  * Lampinen et al. (2022) Andrew Lampinen, Ishita Dasgupta, Stephanie Chan, Kory Mathewson, Mh Tessler, Antonia Creswell, James McClelland, Jane Wang, and Felix Hill. 2022.  Can language models learn from explanations in context? In _Findings of the Association for Computational Linguistics: EMNLP 2022_ , pages 537–563, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
  * Li et al. (2022) Qian Li, Hao Peng, Jianxin Li, Congying Xia, Renyu Yang, Lichao Sun, Philip S Yu, and Lifang He. 2022.  A survey on text classification: From traditional to deep learning.  _ACM Transactions on Intelligent Systems and Technology (TIST)_ , 13(2):1–41.
  * Marasović et al. (2021) Ana Marasović, Iz Beltagy, Doug Downey, and Matthew E Peters. 2021.  Few-shot self-rationalization with natural language prompts.  _arXiv preprint arXiv:2111.08284_.
  * Maron (1961) Melvin Earl Maron. 1961.  Automatic indexing: an experimental inquiry.  _Journal of the ACM (JACM)_ , 8(3):404–417.
  * Min et al. (2022) Sewon Min, Xinxi Lyu, Ari Holtzman, Mikel Artetxe, Mike Lewis, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2022.  Rethinking the role of demonstrations: What makes in-context learning work?  _arXiv preprint arXiv:2202.12837_.
  * Møller et al. (2023) Anders Giovanni Møller, Jacob Aarup Dalsgaard, Arianna Pera, and Luca Maria Aiello. 2023.  Is a prompt and a few samples all you need? using gpt-4 for data augmentation in low-resource classification tasks.
  * OpenAI (2023) OpenAI. 2023.  Gpt-4 technical report.
  * Ouyang et al. (2022) Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022\.  Training language models to follow instructions with human feedback.  _Advances in Neural Information Processing Systems_ , 35:27730–27744.
  * Pryzant et al. (2023) Reid Pryzant, Dan Iter, Jerry Li, Yin Tat Lee, Chenguang Zhu, and Michael Zeng. 2023\.  Automatic prompt optimization with" gradient descent" and beam search.  _arXiv preprint arXiv:2305.03495_.
  * Pryzant et al. (2022) Reid Pryzant, Ziyi Yang, Yichong Xu, Chenguang Zhu, and Michael Zeng. 2022.  Automatic rule induction for efficient semi-supervised learning.  _arXiv preprint arXiv:2205.09067_.
  * Radford et al. (2019) Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019.  Language models are unsupervised multitask learners.
  * Raffel et al. (2020) Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020.  Exploring the limits of transfer learning with a unified text-to-text transformer.  _The Journal of Machine Learning Research_ , 21(1):5485–5551.
  * Ratner et al. (2017) Alexander Ratner, Stephen H Bach, Henry Ehrenberg, Jason Fries, Sen Wu, and Christopher Ré. 2017.  Snorkel: Rapid training data creation with weak supervision.  In _Proceedings of the VLDB Endowment. International Conference on Very Large Data Bases_ , volume 11, page 269. NIH Public Access.
  * Ratner et al. (2016) Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Ré. 2016.  Data programming: Creating large training sets, quickly.  In _Advances in neural information processing systems_ , pages 3567–3575.
  * Reithinger and Klesen (1997) Norbert Reithinger and Martin Klesen. 1997.  Dialogue act classification using language models.  In _Fifth European Conference on Speech Communication and Technology_.
  * Reynolds and McDonell (2021) Laria Reynolds and Kyle McDonell. 2021.  Prompt programming for large language models: Beyond the few-shot paradigm.  In _Extended Abstracts of the 2021 CHI Conference on Human Factors in Computing Systems_ , pages 1–7.
  * Sanh et al. (2019) Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019.  Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter.  _ArXiv_ , abs/1910.01108.
  * Schick and Schütze (2021) Timo Schick and Hinrich Schütze. 2021.  Exploiting cloze-questions for few-shot text classification and natural language inference.  In _Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume_ , pages 255–269, Online. Association for Computational Linguistics.
  * Shinn et al. (2023) Noah Shinn, Beck Labash, and Ashwin Gopinath. 2023.  Reflexion: an autonomous agent with dynamic memory and self-reflection.  _arXiv preprint arXiv:2303.11366_.
  * Snell et al. (2017) Jake Snell, Kevin Swersky, and Richard Zemel. 2017.  Prototypical networks for few-shot learning.  _Advances in neural information processing systems_ , 30.
  * Socher et al. (2013) Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013.  Recursive deep models for semantic compositionality over a sentiment treebank.  In _Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing_ , pages 1631–1642, Seattle, Washington, USA. Association for Computational Linguistics.
  * Sun et al. (2019) Shengli Sun, Qingfeng Sun, Kevin Zhou, and Tengchao Lv. 2019.  Hierarchical attention prototypical networks for few-shot text classification.  In _Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)_ , pages 476–485, Hong Kong, China. Association for Computational Linguistics.
  * Sun et al. (2023) Xiaofei Sun, Xiaoya Li, Jiwei Li, Fei Wu, Shangwei Guo, Tianwei Zhang, and Guoyin Wang. 2023.  Text classification via large language models.
  * Touvron et al. (2023) Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. 2023.  Llama: Open and efficient foundation language models.
  * Tur et al. (2010) Gokhan Tur, Dilek Hakkani-Tür, and Larry Heck. 2010.  What is left to be understood in atis? In _2010 IEEE Spoken Language Technology Workshop_ , pages 19–24.
  * Wang et al. (2023) Huaxiaoyue Wang, Gonzalo Gonzalez-Pumariega, Yash Sharma, and Sanjiban Choudhury. 2023.  Demo2code: From summarizing demonstrations to synthesizing code via extended chain-of-thought.  _arXiv preprint arXiv:2305.16744_.
  * Wang and Manning (2012) Sida I Wang and Christopher D Manning. 2012.  Baselines and bigrams: Simple, good sentiment and topic classification.  In _Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)_ , pages 90–94.
  * Wang et al. (2021) Sinong Wang, Han Fang, Madian Khabsa, Hanzi Mao, and Hao Ma. 2021.  Entailment as few-shot learner.  _arXiv preprint arXiv:2104.14690_.
  * Wei et al. (2022) Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. 2022.  Chain of thought prompting elicits reasoning in large language models.  _arXiv preprint arXiv:2201.11903_.
  * Wiegreffe et al. (2022) Sarah Wiegreffe, Jack Hessel, Swabha Swayamdipta, Mark Riedl, and Yejin Choi. 2022\.  Reframing human-AI collaboration for generating free-text explanations.  In _Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_ , pages 632–658, Seattle, United States. Association for Computational Linguistics.
  * Xu et al. (2021) Liang Xu, Xiaojing Lu, Chenyang Yuan, Xuanwei Zhang, Huilin Xu, Hu Yuan, Guoao Wei, Xiang Pan, Xin Tian, Libo Qin, et al. 2021.  Fewclue: A chinese few-shot learning evaluation benchmark.  _arXiv preprint arXiv:2107.07498_.
  * Yan et al. (2018) Leiming Yan, Yuhui Zheng, and Jie Cao. 2018.  Few-shot learning for short text classification.  _Multimedia Tools and Applications_ , 77:29799–29810.
  * Ye et al. (2022) Jiacheng Ye, Jiahui Gao, Qintong Li, Hang Xu, Jiangtao Feng, Zhiyong Wu, Tao Yu, and Lingpeng Kong. 2022.  Zerogen: Efficient zero-shot learning via dataset generation.  _arXiv preprint arXiv:2202.07922_.
  * Yoo et al. (2021) Kang Min Yoo, Dongju Park, Jaewook Kang, Sang-Woo Lee, and Woomyoung Park. 2021\.  GPT3Mix: Leveraging large-scale language models for text augmentation.  In _Findings of the Association for Computational Linguistics: EMNLP 2021_ , pages 2225–2239, Punta Cana, Dominican Republic. Association for Computational Linguistics.
  * Yordanov et al. (2022) Yordan Yordanov, Vid Kocijan, Thomas Lukasiewicz, and Oana-Maria Camburu. 2022.  Few-shot out-of-domain transfer learning of natural language explanations in a label-abundant setup.  In _Findings of the Association for Computational Linguistics: EMNLP 2022_ , pages 3486–3501, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.

##  Appendix A Question Generation Example

Text

The significant co-occurrence between men’s violence against female partners
and child abuse and neglect is well documented. It is less clear how child
safety should be managed in family violence research with their mothers. This
issue is salient to isafe, a New Zealand-based Internet intervention study
testing improvement in safety decisions and mental health outcomes for women
experiencing intimate partner violence. This article discusses the
legislative, professional, and ethical considerations that contribute to the
development of the child safety protocols and discusses the development of the
isafe protocol. Hypothetical scenarios of the application of the isafe
protocol are used to illuminate the issues and provide a basis for future
discussion.

Questions

  1. 1.

Question: Are there any specific keywords or phrases in the text that are
commonly associated with any of the classes?
Answer: abuse; children; ethics; responsible conduct of research

  2. 2.

Question: In the context of this text, what criteria would differentiate the
child abuse class from the depression class?
Answer: The criteria differentiating the child abuse class from the depression
class include the nature of the behavior (physical, emotional, or sexual abuse
towards a child), the perpetrator-victim relationship (parent or caregiver
abusing the child), the focus on child safety and well-being, and legal
obligations surrounding child protection.

  3. 3.

Question: Are there any specific ethical considerations mentioned in the text
that could help us better understand the criteria for the child abuse class?
Answer: The specific ethical considerations mentioned in the text are not
provided, making it difficult to precisely identify criteria for the child
abuse class. However, based on the text’s context, it can be inferred that
ethical considerations could include ensuring the safety and well-being of the
child, protecting their rights, maintaining confidentiality, adhering to
professional standards, and navigating the complexities of intervening in
cases of child abuse. These considerations likely inform the development of
child safety protocols and guide decision-making processes in the iSafe study.

Figure 2: Example of questions and answers generated on one abstract from the
Web of Science dataset Kowsari et al. (2017).

##  Appendix B Prompts Used for Experiments

###  B.1 Question Generation

System Instructions:

⬇

You are taking part in an interactive study where the goal is to build a
personalizable classifier for a user. This means strictly following the user’s
class descriptions and criteria for classification. If a user doesn’t cover a
certain case, it means trying to find patterns in the user’s thoughts or
criteria to make a best guess.

The goal of this stage in the process of building a classifier is to annotate
some training data, so we can refine the user’s class description and better
understand their criteria. The way we choose to annotate our training data is
by asking user’s questions about the text to better help us understand the
classification task at large.

This doesn’t mean asking questions about what the current text means or the
specific context of the text, as answering these questions won’t always allow
us to generalize the answer to other examples.

The questions that you ask must be ones that if answered, could help us
broaden and improve the scope of the user’s class descriptions. The questions
should relate to the class names and descriptions provided, and should even
ask clarifying questions about the class descriptions if needed. The questions
should not be vague or obvious. They should be questions that only the user
who is trying to perform classification would know, not questions with answers
that are obvious to anyone.

Some other questions may include how might you differentiate between classes,
if you are deciding between two classes for this specific text.

You could also ask if there are any specific keywords or phrases that are
commonly associated with a certain class. Also, do not just directly ask the
user what class the text belongs to - this is not the goal of this stage.
Don’t just ask these question, since these are just examples of questions you
could ask.

In the prompt, we also display questions that were previously asked by the
model, followed by the user’s responses to those questions. If needed, your
questions should build upon previously asked questions and answers, so you can
better understand the user’s intent.

Additionally, along with the question you ask, also explain why you asked the
given question and what you hope to understand from the user by asking the
question.

Your response should be formatted like:

Thoughts: <thoughts>

Question: <question>

Explanation: <explanation>

User Instructions

⬇

For this classification task, the classes that the user chose were: <class_1>,
<class_2>, .... <class_n> name. Here is a description of the task at hand (why
the user wants to build this classification task):
<classification_task_description>

Each class also has a corresponding class description, which describes the
criteria the text must follow to belong to a given class. Here are the class
descriptions of each class.

<class_1_name>: <class_1_description>

<class_2_name>: <class_2_description>

..

<class_n_name>: <class_n_description>

Here is the current text that we are annotating:

\--- Start of text \---

${text}

\--- End of text \---

Based on this text and the classes we are trying to classify the text under,
we generated the following questions and answers about the text to help us
classify it. There might be no questions generated yet.

<question_1>

<answer_1>

<question_2>

<answer_2>

<question_m-1>

<answer_m-1>

We want to ask another question about the text to help us improve or broaden
the scope of the class descriptions, as per the instructions provided. The
question could also be a follow up question to the previous questions. What
should it be and why?;

###  B.2 Few-shot Classification (During Interactive Annotation)

System Instructions:

⬇

You are taking part in an interactive study where the goal is to build a
personalizable classifier for a user. More specifically, you need to create a
classifier that classifies the text of a user into classes of their own
choosing. This means strictly following the user’s class descriptions and
criteria for classification. If a user doesn’t cover a certain case, it means
trying to find patterns in the user’s thoughts / criteria to make a best
guess.

The goal of this stage in the process is to classify training data, so we can
understand if the current class descriptions are covering enough use-cases for
them to be generalized and deployed for all texts. In this prompt, we are
focusing on a single text and trying to classify it into one of the classes
the user has inputted.

Additionally, for your reference, we have also asked the user a series of
questions to help us classify this text. Use those questions in order to make
your classification.

If you are not provided any information or questions, then make your best
guess as to what class the text belongs to.

Furthermore, beyond just the classification, also explain your thoughts as you
decide what class the text belongs to. After making the classification, then
reflect on why you chose that class. Your response should be formatted like:

Thoughts: <thoughts>

Class: <class>

Reflection: <reflection>

User Instructions:

⬇

For this classification task, the classes that the user chose were: <class_1>,
<class_2>, .... <class_n> name. Here is a description of the task at hand (why
the user wants to build this classification task):
<classification_task_description>

Each class also has a corresponding class description, which describes the
criteria the text must follow to belong to a given class. Here are the class
descriptions of each class.

<class_1_name>: <class_1_description>

<class_2_name>: <class_2_description>

..

<class_n_name>: <class_n_description>

Here is the current text that we are annotating:

\--- Start of text \---

${text}

\--- End of text \---

Based on this text and the classes we are trying to classify the text under,
we generated the following questions and answers about the text to help us
classify it. There might be no questions generated yet.

<question_1>

<answer_1>

<question_2>

<answer_2>

<question_m>

<answer_m>

Now, given this information, classify the text above - make sure to
incorporate your thoughts and a reflection as well.‘;

###  B.3 Refining Class Descriptions

System Instructions:

⬇

You are taking part in an interactive study where the goal is to build a
personalizable classifier for a user. More specifically, you need to create a
classifier that classifies the text of a user into classes of their own
choosing. This means strictly following the user’s class descriptions and
criteria for classification. If a user doesn’t cover a certain case, it means
trying to find patterns in the user’s thoughts / criteria to make a best
guess.

The goal of this stage in the process is to update the class descriptions that
the user has inputted, based on the training data we are annotating. In this
prompt, we are focusing on a single text, which the user has answered
questions about and explained to us why that example belongs in a given class.

Using this information, and the correct class of the text, we need to update
the class description of the correct class, to broaden it’s scope to contain
more examples/possibilities.

Furthermore, beyond just the classification, also explain your thoughts as you
decide what class the text belongs to. After making the classification, then
reflect on why you chose that class. Your response should be formatted like:

Thoughts: <thoughts>

Description: <updated_class_description_for_class>

Reason: <reason_why_you_updated_the_class_description>

User Instructions:

⬇

For this classification task, the classes that the user chose were: <class_1>,
<class_2>, .... <class_n> name. Here is a description of the task at hand (why
the user wants to build this classification task):
<classification_task_description>

Each class also has a corresponding class description, which describes the
criteria the text must follow to belong to a given class. Here are the class
descriptions of each class.

<class_1_name>: <class_1_description>

<class_2_name>: <class_2_description>

..

<class_n_name>: <class_n_description>

Here is the current text that we are annotating:

\--- Start of text \---

${text}

\--- End of text \---

Based on this text and the classes we are trying to classify the text under,
we generated the following questions and answers about the text to help us
classify it. There might be no questions generated yet.

<question_1>

<answer_1>

<question_2>

<answer_2>

<question_m>

<answer_m>

Using these questions and answers, we classified the text. Our initial
classification was <model_prediction>. The actual class of the text is
<correct_class> The user explained the reason that this was the correct class
was this explanation: <user_explanation>

We want to update the description of the class <class_to_be_updated> to be
more accurate based on this new information. Without changing or altering the
meaning in the current description, what is a better class description for the
class: <class_to_be_updated>

If there is nothing to add to the current class description from this example,
then just copy the current class description word for word.

###  B.4 Summarization

System Instructions:

⬇

I had a long thread of text and I wanted to take the summary, so I split it
into smaller parts. We will provide the summary of the first <i-1> parts of
the essay and the summary of the <i> part.

Use these summaries as context to provide a summary of the entire essay, Don’t
make the length of the summary of this one part of the text equal to length of
the the summary of multiple parts of text.

Make the summary of the new thread proportional to how many parts of the text
have been summarized so far.

For example, if the summary of about 5 parts of the text are 400 words, the
length of the summary of the sixth part should be around 80 words.

Remember, the focus of the summary should also be on:
<classification_task_description>;

User Instructions:

⬇

Summarize the following text with a focus on preserving context. Format the
reponse with style: free-text. Summarize with the context:
<classification_task_description> and with a focus: we want to eventually
perform classification on this text.

Summary of First <i-1> parts: <summary_of_previous_sections>

Part <i>: <current part>


#  Maximum temporal amplitude and designs of experiments
for generation of extreme waves

Marwan1,2, Andonowati1, and N. Karjanto3 1Department of Mathematics and Center
for Mathematical Modelling and Simulation Bandung Institute of Technology,
Jalan Ganesha 10, Bandung 40132, Indonesia 2Department of Mathematics, Syiah
Kuala University Jalan Teuku Nyak Arief 441, Banda Aceh 23111, Indonesia
3Applied Analysis and Mathematical Physics, Department of Applied Mathematics
University of Twente, PO Box 217, 7500 AE Enschede, The Netherlands

###### Abstract

This paper aims to describe a deterministic generation of extreme waves in a
typical towing tank. Such a generation involves an input signal to be provided
at the wavemaker in such a way that at a certain position in the wave tank,
say at a position of a tested object, a large amplitude wave emerges. For the
purpose, we consider a model called a spatial nonlinear Schrödinger equation
describing the spatial propagation of a slowly varying envelope of a signal.
Such a model has an exact solution known as (spatial) Soliton on a Finite
Background (SFB) that is a nonlinear extension of Benjamin-Feir instability.
This spatial-SFB is characterized by wave focusing leading to almost time-
periodic extreme waves that appear in between phase singularities. Although
phase singularities and wave focusing have been subject to a number of
studies, this spatial-SFB written in the field variables has many interesting
properties among which are the existence of many critical values related to
the modulation length of the monochromatic signal in the far fields. These
properties will be used in choosing parameters for designing experiments on
extreme wave generation. In doing so, a quantity called maximum temporal
amplitude (MTA) is used. This quantity measures at each location the maximum
over time of the wave elevation. For a given modulation length of SFB and
desired maximum amplitude at a position in a towing tank, the MTA readily
shows the maximum signal that is required at the wavemaker and the amplitude
amplification factor of the requested signal. Some examples of such a
generation in realistic laboratory variables will be displayed.

Keywords: extreme waves, nonlinear Schödinger equation, Soliton on a Finite
Background, maximum temporal amplitude, amplitude amplification factor.

##  1 Introduction

The motivation of this paper stems from the need of hydrodynamic laboratories
to generate ’extreme waves’, also often called freak or rogue waves that do
not break while running downward in the wave tank. In a realistic situation
involving large spatial and temporal interval, such a generation is not easy.
This is due to the physical limitation of the wavemakers as well as the
nonlinear behavior that dominate the deformation of propagating signals from
the wavemakers. The dominant nonlinear effects in large wave generations can
be seen from the previous theoretical [1, 2], numerical [3, 4] as well as
experimental investigation on bi-chromatic waves such as in [5]. Depending on
the input amplitudes as well as frequencies, large deformation and amplitude
increase can be found. The location of the maximum amplitude increase within
the wave tank also depends on these parameters.

In a generation of extreme waves in hydrodynamic laboratories, it is desirable
that the position for which the extreme waves emerge located at the position
of the tested object. A typical question in such a generation is that given
the position within the towing tank for the extreme signal to appear, given
the amplitude of such a signal within some frequency region, whether a signal
can be provided as an input to the wavemakers (with their limitation) such
that the requested signal appears in the desired position.

Using an exact solution of a spatial nonlinear Schrödinger equation (NLSE)
called spatial Soliton on a Finite Background (SFB), it is indeed possible to
generate waves of reasonably large within the wave tank of 200 m. This SFB is
a nonlinear extension of Benjamin-Feir [6] characterized by wave focusing that
is almost time periodic. It is recently observed that such an exact solution
has numerous interesting properties when it is written in the field variables.
Phase singularities; the phenomena of merging and splitting of waves; for
which the extreme elevations are sandwiched between them are among these
properties. Similar studies on wave focusing and phase singularities have been
carried out previously such as in [7, 8, 9, 10, 11, 12]. Here, we are
interested in its direct application on the extreme wave generation in a
hydrodynamic laboratory.

The content of the paper is as follows. In Section 2, we present a brief
overview of the model used in this paper as well as the explicit formula for
the spatial SFB. Some interesting features of spatial SFB will also be
presented in this section. In Section 3, we will show a direct extreme wave
generation based on the properties of spatial-SFB and the transformation into
laboratory coordinates as well as its interpretation. Examples of realistic
time and spatial laboratory scales of this wave generation will be presented
here. We present concluding remarks in the final section.

##  2 Mathematical description

Korteweg-de Vries equation is known as an asymptotic model for uni-directional
surface gravity waves. If $\eta(x,t)$ denotes the wave elevation, looking for
a solution in the form of a harmonic mode centered at a frequency $\omega_{0}$
modulated by a slowly varying envelope $\psi(\xi,\tau)$, then this complex-
valued amplitude $\psi(\xi,\tau)$ satisfies spatial NLSE in the form

$\frac{\partial\psi}{\partial\xi}+i\beta\frac{\partial^{2}\psi}{\partial\tau^{2}}+i\gamma|\psi|^{2}\psi=0.$

Here, the slow variable $\xi=x$ and the shifted time variable
$\tau=t-x/\Omega^{\prime}(k_{0})$ are introduced while parameters $\beta$ and
$\gamma$ depend on the wavenumber $k_{0}$ of the monochromatic and the central
wave frequency $\omega_{0}$, where the latter two quantities are related by
the linear dispersion relation $\omega_{0}=\Omega(k_{0})=\sqrt{k_{0}\tanh
k_{0}}$, see [13].

Figure 1: Contour plot of the wave elevation $\eta(x,t)$ where the extreme
wave appears in between the phase singularities signified by merging of two
waves into one and splitting one wave into two (left panel) and the
corresponding modulus of the complex-valued envelope $|\psi(\xi,\tau)|$ (right
panel).

Different from temporal NLSE that is often used to describe the evolution of
ocean waves, spatial NLSE is suitable to describe the propagation of envelope
in the signaling problem such as in the problem of wave generation. In [14],
it is shown that the temporal NLSE has an exact solution called SFB. Writing
the complex-valued amplitude of such SFB in the form of
$\psi(\xi,\tau)=a(\xi,\tau)e^{i\theta(\xi,\tau)}$, then the wave elevation
reads $\eta(x,t)=2a(\xi,\tau)\cos\phi$ for a real-valued amplitude
$a(\xi,\tau)$ and phase $\phi=\theta(\xi,\tau)+k_{0}x-\omega_{0}t$, with
$\omega_{0}$ and $k_{0}$ are the frequency and wavenumber of the monochromatic
wave, respectively.

This SFB $\psi(\xi,\tau)=a(\xi,\tau)e^{i\theta(\xi,\tau)}$ has three
parameters $(a_{0},\nu,\omega_{0})$; the real-valued amplitude in the far
field $2a_{0}$, the modulated frequency $\nu$ describing the perturbation on
the monochromatic by a long time signal, and the monochromatic wave frequency
$\omega_{0}$. If $\tilde{\nu}=\nu/\nu_{\ast}$,
$\nu_{\ast}=a_{0}\sqrt{\gamma/\beta}$, then $\tilde{\nu}$ lies in the region
of Benjamin-Feir instability; $0<\tilde{\nu}<\sqrt{2}$. The final parameter
$\omega_{0}$ is absorbed in the coefficients of the NLSE equation.

The largest elevation of SFB is at $(\xi,\tau)=(0,0)$ and at a far distance
from the position $\xi=0$, $a(\xi,\tau)\approx a_{0}$, where the surface wave
is monochromatic in time. Some properties of SFB include the amplitude ratio
compared to the one of monochromatic in the far field satisfies
$1<a(\xi,\tau)/a_{0}<3$ and in the limiting case $\lim\limits_{\nu\rightarrow
0}a(\xi,\tau)/a_{0}=3$ giving the largest possible amplification factor of
three from this monochromatic background.

Figure 2: A wave signal at the extreme position $\xi=0$ for $\omega_{0}=2.5$,
$a_{0}=0.0207$ and $\nu=0.3014$.

It has been known that these extreme elevations appear in between two phase
singularities; a phenomenon when two waves are merging into one wave or one
wave is splitting into two. The phenomenon can be seen in a close-up contour
plot of the elevation in Figure 1. The envelope corresponding to this spatial
SFB is shown in Figure 1 where the locations (or instants) of the phase
singularities, also known as ‘wavefront dislocations’ [15], are clearly
visible; they are the instants when the envelope touches the $xt$-plane.

In Figure 2, we display a time signal with an SFB envelope at $\xi=0$ for the
three parameter values $\omega_{0}=2.5$, $a_{0}=0.0207$ and $\nu=0.3014$ and
so $T=2\pi/\nu=28.8458$. We observe that the extreme elevation is almost
repeated in time with periodicity of $T$.

To give an easier interpretation related to the problem of wave generation
later, in what follows we require that at $(\xi,\tau)=(0,0)$,
$\psi(0,0)=m_{0}$. Let suppose that the frequency of the monochromatic wave
$\omega_{0}$ is given, which is the center frequency of the wave group being
generated. If the amplification factor $\alpha$ is defined as a quotient
between the elevation at the extreme position and in the far field, that is
$\alpha=m_{0}/a_{0}$, then the three parameters of SFB
$(a_{0},\nu,\omega_{0})$ can be recovered from $a_{0}=m_{0}/\alpha$ and
$\nu=\nu(\omega_{0},\alpha)=a_{0}\sqrt{\gamma(\omega_{0})/\beta(\omega_{0})}\sqrt{2-(\alpha-1)^{2}/2}$.

##  3 Results

In what follows, we use the laboratory coordinates for the case of a wave tank
with depth $H$ of 5 m. The wave tank at MARIN (Maritime Research Institute
Netherlands, Wageningen) is taken as reference tank; see [4]. The length of
that tank is 200 m, and thus the extreme waves and the amplitude amplification
should appear within a distance of 200 m from the wavemaker. It is our
intention to be able to compare the results here with numerical computation
obtained from a numerical wave tank as well as measurement in the near future.
Although here we do not describe precisely on the technical restriction of
wavemaker, our aim is that the required signal can be fed easily to the
wavemakers.

Let $x_{\text{wg}}=0$ be the location of the wavemaker and $x_{\text{ship}}$
be the location in the tank such that the signal generated at the wavemaker
achieves its extreme. If $\eta_{\text{lab}}(x_{\text{lab}},t_{\text{lab}})$ is
the elevation of a signal with SFB envelope in the laboratory variables at
$x_{\text{lab}}$, let us define at a given position, the maximum temporal
amplitude (MTA) in the form

$M(x_{\text{lab}})=\max_{t_{\text{lab}}}\;\eta_{\text{lab}}(x_{\text{lab}},t_{\text{lab}})$

and $x_{\text{ship}}$ corresponding to $\xi=0$ in NLSE spatial variable and so
the translation from the laboratory variables to NLSE variables are as follows
$\xi=x-x_{\text{ship}}$ and
$\tau=t-(x-x_{\text{ship}})/\Omega^{\prime}(k_{0})$, where
$\omega_{0}=\Omega(k_{0})=\sqrt{k_{0}\tanh k_{0}}$ and
$\omega_{0}=\omega_{\text{lab}}/\sqrt{g/H}$ for the laboratory frequency
$\omega_{\text{lab}}$ and gravitational acceleration $g$.

Example |  $\alpha$ |  $\tilde{\nu}$ |  $2a_{0}^{\text{lab}}$ |  $\nu_{\text{lab}}$ |  $T_{\text{lab}}$ |  $M(0)$ | $\alpha_{\text{actual}}$
---|---|---|---|---|---|---|---
1 |  2.0000 |  $\sqrt{3/2}$ |  0.2500 |  0.6238 |  10.0723 |  0.2707 | 1.8468
2 |  2.2642 |  1.0959 |  0.2208 |  0.4930 |  12.7439 |  0.2481 | 2.0151
3 |  2.4142 |  1 |  0.2071 |  0.4220 |  14.8906 |  0.2391 | 2.0916
4 |  2.7321 |  $1/\sqrt{2}$ |  0.1830 |  0.2636 |  23.8337 |  0.2276 | 2.1967
5 |  2.9412 |  0.3405 |  0.1700 |  0.1179 |  53.2941 |  0.2247 | 2.2253
Table 1: Samples of extreme wave generation based on SFB. The position of the
ship ($x_{\text{ship}}$) is taken to be 125 m from the wavemaker and the MTA
at the ship position is $M(x_{\text{ship}})=0.5$ m.

The amplification factor $\alpha=M(x_{\text{ship}})/2a_{0}^{\text{lab}}$ where
$2a_{0}^{\text{lab}}$ is the amplitude in the laboratory variable of the
monochromatic wave in the far field. The actual amplification factor is given
by $\alpha_{\text{actual}}=M(x_{\text{ship}})/M(0)$. In what follow we list a
number of examples of extreme waves generated based on SFB. The position of
the ship is taken to be 125 m from the wavemaker while the MTA of the signal
at the ship position is $M(x_{\text{ship}})=0.5$ m and
$\omega_{\text{lab}}=3.5$.

Figure 3: Wave signals for $\alpha=2.4142$ at the wavemaker (left panel) and
at 125 m from the wavemaker (right panel).

Further, we plot wave signals at the wavemaker and at the ship position 125 m
away from the wavemaker for $\alpha=2.4142$ and $\alpha=2.7321$, corresponding
to Examples 3 and 4 in Table 1. See Figures 3 and 4, respectively. The MTA
$M(x_{\text{lab}})$, as well as the corresponding maximum temporal steepness,
defined as the product of wave elevation and local steepness,
$\eta_{\text{lab}}\,k_{\text{lab}}$, for both examples are displayed in Figure
5.

##  4 Concluding remarks

We have considered a model called spatial NLSE that is suitable to describe
the propagation of slowly varying envelopes in signaling problems such as in
the wave generation often performed in a hydrodynamic laboratory. This NLSE
has an exact solution called spatial SFB with interesting properties related
to wave focusing and phase singularity. Written in the field variables, it is
interesting to see that the extreme waves appear in between the phase
singularities signified by merging of two waves into one and splitting one
wave into two.

Figure 4: Wave signals for $\alpha=2.7321$ at the wavemaker (left panel) and
at 125 m from the wavemaker (right panel).

We have used properties of SFB in the generation of extreme waves in realistic
laboratory coordinates. Examples of realistic time and spatial laboratory
scales of this wave generation have been presented. The results show that the
generation of such extreme waves is possible to be conducted in hydrodynamic
laboratories. Future research will focus on both numerical and experimental
evidence to validate the theoretical prediction.

Figure 5: Maximum temporal amplitude (solid lines) and maximum temporal
steepness (dashed lines) for $\alpha=2.4142$ (black, upper part) and
$\alpha=2.7321$ (blue, lower part) corresponding to $\tilde{\nu}=1$ and
$\tilde{\nu}=\sqrt{2}$, respectively.

### Acknowledgement

The authors are very grateful to Prof. E. (Brenny) van Groesen (University of
Twente and LabMath Indonesia) for insight and discussion throughout the
execution of this research. They would like to thank Dr. Gert Klopman
(University of Twente and Witteveen$+$Bos, The Netherlands) for many useful
hints on the wave generation. This research is conducted party at Bandung
Institute of Technology, Indonesia and partly at the University of Twente, The
Netherlands and is funded by the Indonesian International Research Linkage
Programme (RUTI 2002/2005) in a framework of international cooperation with
the University of Twente under the project ‘Prediction and Generation of
Deterministic Extreme Waves in Hydrodynamic Laboratories’ (TWI.5374) of the
Netherlands Organization of Scientific Research NWO, subdivision Applied
Sciences STW.

## References

  * [1] van Groesen E, Andonowati, and Soewono E (1999) Nonlinear effects in bichromatic surface waves, Proceedings of the Estonian Academy of Sciences: Physics–Mathematics, 48(3/4): 206–229.
  * [2] Andonowati and van Groesen E (2003) Optical pulse deformation in second-order nonlinear media, Journal of Nonlinear Optical Physics and Materials, 12(02): 221–234.
  * [3] Westhuis J, van Groesen E, and Huijsmans RHM (2000) Long time evolution of unstable bichromatic waves, Proceedings of the 15${}^{\text{th}}$ International Workshop on Water Waves and Floating Bodies, Caesarea, Israel, 184–187.
  * [4] Westhuis J, van Groesen E, and Huijsmans RHM (2001) Experiments and numerics of bichromatic wave groups, Journal of Waterway, Port, Coastal, and Ocean Engineering, 127(6): 334–342.
  * [5] Stansberg CT (1998) On the nonlinear behaviour of ocean wave groups, In Edge BL and Hemsley JM (Editors), Ocean Wave Measurement and Analysis: Proceedings of the Third International Symposium Waves 97, Virginia Beach, VA, American Society of Civil Engineers (ASCE), 1227–1241.
  * [6] Benjamin TB and Feir JE (1967) The disintegration of wave trains on deep water Part 1. Theory, Journal of Fluid Mechanics 27(3): 417–430.
  * [7] Karjanto N, van Groesen E, and Peterson P (2002) Investigation of the maximal amplitude increase from the Benjamin-Feir instability, Journal of Indonesian Mathematical Society, 8(4): 39–47. arXiv:1110.4686 [physics.flu-dyn]
  * [8] Andonowati, Kusumawinahyu WM, and van Groesen E (2003) Steepness of extreme waves caused by wave focussing in the Benjamin-Feir instability regime, In Jirka GH and Uijttewaal WSJ (Editors), Shallow Flows: Research Presented at the First International Symposium on Shallow Flows (ISSF) 2003, Delft, The Netherlands, 205–209.
  * [9] Akhmediev NN, Eleonskii VM, and Kulagin NE (1987) Exact first-order solutions of the nonlinear Schrödinger equation, Theoretical and Mathematical Physics 72(2): 809–818.
  * [10] Ma YC (1979) The perturbed plane-wave solutions of the cubic Schrödinger equation, Studies in Applied Mathematics 60(1): 43–58.
  * [11] Peregrine DH (1983) Water waves, nonlinear Schrödinger equation and their solutions, Journal of Australian Mathematical Society. Series B. Applied Mathematics (The ANZIAM Journal) 25(1): 16–43.
  * [12] Dysthe KB and Trulsen K (1999) Note on breather type solutions of the NLS as models for freak-waves, Physica Scripta T82: 48–52.
  * [13] van Groesen E (1998) Wave groups in uni-directional surface-wave models, Journal of Engineering Mathematics 34(1-2): 215–226.
  * [14] Akhmediev NN and Ankiewicz A (1997) Solitons: nonlinear pulses and beams, Chapman & Hall.
  * [15] Nye JF and Berry MV (1974). Dislocations in wave trains, Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences 336(1605): 165–190.


# Note on power hypergraphs with equal domination and matching numbers

###### Abstract

We present some examples that refute two recent results in the literature
concerning the equality of the domination and matching numbers for power and
generalized power hypergraphs. In this note we pinpoint the flaws in the
proofs and suggest how they may be mended.

María José Chávez de Diego
Dpto. de Matemática Aplicada I, Universidad de Sevilla,
Avda. Reina Mercedes s/n, Sevilla, Spain,
<EMAIL_ADDRESS>
Pablo Montero Moreno,
María Trinidad Villar-Liñán
Dpto. de Geometría y Topología, Universidad de Sevilla,
C/ Tarfia s/n, 41012 Sevilla, Spain,
<EMAIL_ADDRESS><EMAIL_ADDRESS>

##  1 Preliminaries

A (finite) hypergraph $H=(V,E)$ consists of a (finite) set $V$ and a
collection $E$ of non-empty subsets of $V$. The elements of $V$ are called
vertices and the elements of $E$ are called hyperedges, or symply edges of the
hypergraph. A $k-$uniform  hypergraph is a hypergraph such that each edge
consists of $k$ vertices. A simple graph with no isolated vertices is a
2-uniform hypergraph. Two vertices of $H$, $u$ and $v$, are adjacent if there
is an edge $e$ such that $u,v,\in e$. The number of edges containing a vertex
$v$ is called the degree of $v$.

Given a hypergraph $H=(V,E),$ $D\subset V$ is a dominating set of $H$ if for
every $v\in V-D$ there exists $u\in D$ such that $u$ and $v$ are adjacent. The
minimum cardinality of a dominating set of $H$, $\gamma(H)$, is its domination
number. A matching in $H$ is a set of disjoint hyperedges. The matching number
of $H$, $\nu(H)$, is the maximum size of a matching in $H$. A subset $T\subset
V$ is a transversal (or a vertex cover) of $H$ if $T$ has nonempty
intersection with every hyperedge of $H$. The transversal number of $H$,
$\tau(H),$ is the minimum size of a transversal of $H$.

According to [2], a power hypergraph $H$ is obtained from a graph $G$ by
adding at least one vertex to each edge of $G$; thus, every hyperedge of a
power hypergraph contains at least one vertex whose degree is one. The
generalized power hypergraph of a simple graph $G$, denoted $H^{k,s}$, is
obtained by blowing up each vertex into a $s$-set and each edge into a
$k$-set, where $1\leq s\leq\frac{k}{2}$.

Clearly, $H^{k,1}$ is the $k$-uniform power hypergraph. Next we recall a
useful notation.

######  Notation 1.

([4]) Let $G=(V,E)$ be a simple graph. For any $k\geq 3$ and $1\leq
s\leq\frac{k}{2}$, the generalized power hypergraph of $G$, denoted by
$G^{k,s}$, is defined as the $k$-uniform hypergraph with the vertex set
$\\{{\bf v}\,:\,v\in V\\}\cup\\{{\bf e}\,:\,e\in E\\}$, and the edge set
$\\{{\bf u}\cup{\bf v}\cup{\bf e}\,:\,e=\\{u,v\\}\in E\\}$, where ${\bf v}$ is
a $s$-set containing $v$ and ${\bf e}$ is a $(k-2s)$-set corresponding to $e$.
$G^{k,s}$ is called the generalized power hypergraph obtained from $G$.
Particularly, for $s=1$, $G^{k,1}$ is the kth-power hypergraph of $G$.

It is not difficult to check that the domination number is not hereditary for
power hypergraphs in general. However, the next result holds.

######  Proposition 1.

([2]) Let $H=(V,E)$ be a simple graph, for $k\geq 3,\,1\leq s\leq k/2$ natural
numbers, let $H^{k,s}$ denote the generalized power hypergraph obtained from
$H$. We get:

  1. 1.

$\nu(H^{k,s})=\nu(H)$ and $\tau(H^{k,s})=\tau(H)$.

  2. 2.

$\gamma(H^{k,\frac{k}{2}})=\gamma(H)$.

  3. 3.

$\gamma(H^{k,s})=\tau(H^{k,s}),$ if $1\leq s<k/2.$

##  2 Counterexamples to two theorems in Dong et al., 2020.

A main result from [2] stablishes lower and upper bounds for domination number
of power and generalized power hypergraph.

In particular, for any connected generalized power hypergraph $\,H^{k,s}\,$
and $\,k\geq 3$, if $1\leq s<\frac{k}{2}$, we have

$\nu(H^{k,s})\leq\gamma(H^{k,s})\leq 2\nu(H^{k,s})$

and if $s=\frac{k}{2},$ we get
$\gamma(H^{k,\frac{k}{2}})\leq\nu(H^{k,\frac{k}{2}})$. (See Theorems 2.1 and
3.1 in [2]).

Dong et al. [2] also demonstrate that these bounds are sharp and they give
characterizations of extremal hypergraphs for them. Namely the two following
theorems are stated and proved.

######  Theorem 1.

(Theorem 2.2, [2]) For any connected power hypergraph $H$ of rank $r\geq 3$,
$\gamma(H)=\nu(H)$ if and only if $H\in{\mathcal{H}}_{1}$.

######  Theorem 2.

(Theorem 3.4, [2]) For any connected generalized power hypergraph $H^{k,s},$
$\gamma(H^{k,s})=\nu(H^{k,s})$ if and only if
$H^{k,s}\in{\mathcal{H}}^{k,s}_{1}$ for $1\leq s<\frac{k}{2}$ or
$H^{k,s}\in{\mathcal{H}}^{k,k/2}_{1}$ for $s=\frac{k}{2}$.

However, we present some examples that refute these results concerning the
equality of the domination and matching numbers for power and generalized
power hypergraphs.

Firstly, let us start by considering the family ${\mathcal{H}}^{k,s}_{1}$, for
$k\geq 3$ and $1\leq s<\frac{k}{2}$, consisting of generalized power
hypergraphs obtained from bipartite connected graphs and ${\mathcal{H}}_{1}$
($={\mathcal{H}}_{1}^{k,1}$) denotes the set of power hypergraphs obtained
from bipartite connected graphs.

We next study separately the cases $1\leq s<\frac{k}{2}$ and $s=\frac{k}{2}$.

###  2.1  The case $1\leq s<\frac{k}{2}$

It is not difficult to refute Theorems 1 and 2 by considering the following
counterexamples.

######  Example 1.

Let $H=C_{p}\vee C_{q}$ denotes the wedge of two cycles joined by a common
vertex, $p,q\geq 3$, being $p$ or $q$ an odd number. The following identities
hold.

  * •

$\nu(H)=\left\lfloor\frac{p}{2}\right\rfloor+\left\lfloor\frac{q}{2}\right\rfloor;$

  * •

$\tau(H)=\left\lceil\frac{p}{2}\right\rceil+\left\lceil\frac{q}{2}\right\rceil-1$

From Proposition 1, we get $\gamma(H^{k,s})=\tau(H^{k,s})=\tau(H)$ for $1\leq
s<k/2.$ Set
$n=\nu(H)=\left\lfloor\frac{p}{2}\right\rfloor+\left\lfloor\frac{q}{2}\right\rfloor,$
and let us distinguish two cases.

  1. 1.

If $p$ and $q$ are both odd numbers, then
$\left\lceil\frac{p}{2}\right\rceil+\left\lceil\frac{q}{2}\right\rceil-1=n+1$
and, therefore

$\gamma(H^{k,s})=n+1=\nu(H)+1=\nu(H^{k,s})+1.$

  2. 2.

If $p$ is even and $q$ is odd, then
$\left\lceil\frac{p}{2}\right\rceil+\left\lceil\frac{q}{2}\right\rceil-1=n$,
and hence

$\gamma(H^{k,s})=n=\nu(H^{k,s}).$

Observe that every graph of the form $C_{p}\vee C_{q}$, being $p$ even and $q$
odd, is not bipartite while the corresponding generalized power hypergraph is
extremal for the equality of domination and matching numbers. Therefore, if
$s=1$ we found counterexamples for Theorem 1 and, if $1<s<\frac{k}{2}$, the
counterexamples refute Theorem 2.

Next, we point out what seems to be the main confusion in the characterization
given by Dong et al. in [2].

The proofs of both Theorems 2.2 and 3.4 in [2] are quite similar for the case
$1\leq s<k/2$, hence we focus on reasoning only Theorem 2.2. For the necessary
condition it is affirmed that the equality of domination and matching numbers
is raised only by bipartite graphs; however, it is also raised for other
graphs, as we have seen in Example 1. The misunderstanding is produced because
they use König’s Theorem as a characterization of graphs with equal
transversal and matching numbers. But the fact is that the bipartiteness is
only a sufficient condition, not a necessary one as we check from [5].

######  Theorem 3.

(König’s Theorem, [5])  If $G$ is a bipartite graph, then $\tau(G)=\nu(G).$

Let us notice that the graphs $G$ satisfying $\tau(G)=\nu(G)$ are called
König-Egerváry graphs or said to have the König- Egerváry property. Trivially,
bipartite graphs are examples of such graphs. König-Egerváry graphs have been
extensively studied in the literature; see [1] and the references there.
Hence, knowing the family of König-Egerváry graphs would lead us to complete
the correct characterization of power and generalized power hypergraphs with
equal domination and matching numbers.

We next sketch a proof.

Let us denote the family ${\mathcal{K}E}^{k,s}_{1}$, for $k\geq 3$ and $1\leq
s<\frac{k}{2}$, consisting of generalized power hypergraphs obtained from
König-Egerváry graphs. For any $H^{k,s}\in\mathcal{K}E^{k,s}_{1},$ by
Proposition 1, we get $\nu(H^{k,s})=\nu(H)=\tau(H)=\gamma(H^{k,s})$.
Conversely, if $H^{k,s}$ is a generalyzed power hypergraph obtained from a
graph $H$ and such that $\nu(H^{k,s})=\gamma(H^{k,s})$, then by Proposition 1,
$\tau(H^{k,s})=\gamma(H^{k,s})$ and $\nu(H)=\tau(H)$ hold and, consequently,
we reach $H^{k,s}\in\mathcal{K}E^{k,s}_{1}.$

Different characterizations of König-Egerváry graphs are given in terms of
forbidden subgraphs ([1] and references there in). Unfortunately, we have not
found a description of the family of König-Egerváry graphs in an analougous
way as the families ${\mathcal{G}}_{1}$ and ${\mathcal{G}}_{\geq 2}$.

###  2.2  The case $s=\frac{k}{2}$

The family ${\mathcal{H}}^{k,k/2}_{1}$ contains the generalized power
hypergraphs obtained from connected graphs of the family
${\mathcal{G}}_{1}\cup{\mathcal{G}}_{\geq 2}$. The family of graphs
${\mathcal{G}}_{\geq 2}$ was defined by Randerath and Volkmann in [6] and it
was depicted in [3] as the following nine graphs.

Figure 1: Graphs in $\mathcal{G}_{\geq 2}$ also are included in [2].

On the other hand, the family of graphs ${\mathcal{G}}_{1}$ was defined by
Kano et al. in [3] by using some terminology and notation which are recalled
here. The minimum degree of a graph $G$ is denoted by $\delta(G).$ $End(G)$
denotes the set of end-vertices (i.e., vertices of degree one) of $G$. An edge
incident with an end-vertex is called a pendant edge. A vertex adjacent to an
end-vertex is called a stem, and $Stem(G)$ denotes the set of stems of $G$. A
graph with a single vertex is called a trivial graph. The corona $G\circ
K_{1}$ of a graph $G$ is the graph obtained from $G$ by adding a pendant edge
to each vertex of $G$. A connected graph $G$ of order at least three is called
a generalized corona if $V(G)=End(G)\cup Stem(G)$.

Then the family $\mathcal{G}_{1}$ is that one in which each graph $G$ is the
complete graph $K_{2}$ or a generalized corona, or for each component $G_{j}$
of $G\setminus(End(G)\cup Stem(G))$ for $j\geq 1$ satisfies one of the
following:

  1. i)

$G_{j}$ is a trivial graph.

  2. ii)

$G_{j}$ is a connected bipartite graph with bipartition $V_{1}$ and $V_{2}$,
where $1\leq\left|V_{1}\right|<\left|V_{2}\right|$. Let
$U_{G_{j}}=V(G_{j})\cap N_{G}(Stem(G))$. Then $\emptyset\neq
U_{G_{j}}\subseteq V_{2}$ and for any two distinct vertices $x_{1},x_{2}\in
V_{1}$ that are adjacent to a common vertex of $V_{2}$, there exist two
distinct vertices $y_{1},y_{2}\in V_{2}\setminus U_{G_{j}}$ such that
$N_{G_{j}}(y_{i})=\left\\{x_{1},x_{2}\right\\},$ $i\in\left\\{1,2\right\\}$.

  3. iii)

$G_{j}$ is a graph isomorphic to (f), (g), (h) or (i) shown in the precedent
figure, and $\gamma(G_{j}\setminus
V_{1})=\gamma(G_{j})~{}\forall~{}\emptyset\neq V_{1}\subseteq U_{G_{j}}\subset
V(G_{j})$, where $U_{G_{j}}=V(G_{j})\cap N_{G}(Stem(G))$.

The following example refutes Theorem 3.4 in Dong et al., [2] for
$s=\frac{k}{2}.$

######  Example 2.

Let us consider the graph $G=K_{2,n}$, $n\geq 2$. Hence
$\gamma(G^{k,\frac{k}{2}})=2=\nu(G^{k,\frac{k}{2}}).$ However, it is easy to
check that $G$ does not belong to $\mathcal{G}_{1}\cup\mathcal{G}_{\geq 2}$.

An analysis of the proof of Theorem 3.4 in [2] for the case $s=\frac{k}{2}$
(observe that the case $s=\frac{k}{2}$ does not appear in Theorem 2.2 in [2])
shows that the necessary condition is based on necessary conditions of Lemmas
3.2 and 3.3 in [2]. However, Lemma 3.2 in [2], as stated, is quite misleading.

We include here the complete characterization of graphs with equal matching
and domination numbers summarized from [2, 3, 6].

######  Lemma 1.

([2, 3]) Let $G$ be a connected graph with $\delta(G)=1$. Then
$\gamma(G)=\nu(G)$ if and only if $G\in\mathcal{G}_{1}.$

######  Lemma 2.

([3, 6]) Let $G$ be a connected non bipartite graph with $\delta(G)\geq 2$.
Then $\gamma(G)=\nu(G)$ if and only if $G\in\mathcal{G}_{\geq 2}.$

######  Lemma 3.

([3, 6]) Let $G$ be a connected bipartite graph with $\delta(G)\geq 2$ and
bipartition of vertex set $X\cup Y$ with $|X|\leq|Y|$. Then $\gamma(G)=\nu(G)$
if and only if $G$ possesses the following properties:

  1. 1.

$\nu(G)=\gamma(G)=|X|;$

  2. 2.

for any two distinct vertices $x_{1},\,x_{2}\in X$ that are adjacent to a
common vertex of $Y,$ there exist two distinct vertices $y_{1},\,y_{2}\in Y$
such that $y_{i}$ is adjacent precisely to $\\{x_{1},x_{2}\\},$ for $i=1,2$.

As a consequence, by using Proposition 1, the characterization of generalized
power hypergraphs $H^{k,\frac{k}{2}}$ with equal domination and matching
numbers is immediately deduced.

Aknowledgements. Authors are very thankful to Dr. Antonio Quintero Toscano for
his helpful coments while preparing this note.

## References

  * [1] Bonomo, F., Dourado, M. C., Durán, G., Faria, L., Grippo L. N. and Safe, M. D. Forbidden subgraphs and the König-Egerváry property. Discrete Applied Mathematics, 161 (2013), 2380–2388
  * [2] Dong, Y., Young Sohn, M., Liang, Z. Domination and matching in power and generalized power hypergraphs. Journal of Combinatorial Optimization, 39 (2020), 425–436.
  * [3] Kano, M., Wu, Y. and Yu, Q. Star-Uniform Graphs. _Graphs and Combinatorics_ 26 (2010), 383–394
  * [4] Khan, M., Fan, Y. On the spectral radius of a class of non-odd-bipartite even uniform hypergraphs, Linear Algebra and its Applications, 480 (2015), 93–106.
  * [5] König, D. Graphen and Matrizen, Matematikai és fizikai lapok 38 (1931), 116–119.
  * [6] Randerath, B., Volkmann, L. Characterization of graphs with equal domination and matching number, Utilitas Mathematica, 55 (1999), 65–72.