<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Conference and Labs of the Evaluation Forum, September</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Team bingezzzleep at PAN: A Writing Style Change Analysis Model Based on RoBERTa Encoding and Contrastive Learning for Multi-Author Writing Style Analysis</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Qida Wu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Leilei Kong</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhanhong Ye</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Foshan University</institution>
          ,
          <addr-line>Foshan, Guangdong</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2024</year>
      </pub-date>
      <volume>0</volume>
      <fpage>9</fpage>
      <lpage>12</lpage>
      <abstract>
        <p>The objective of writing style change detection is to identify the positions in multi-author documents where the author's writing style shifts. This paper elaborates on the strategy of using a comparative learning method adopted in the PAN 24 shared task and demonstrates the research progress in handling author style changes by utilizing RoBERTa as a pre-trained model encoder. By integrating comparative learning into the training of the encoder, its ability to capture subtle features between text pairs is enhanced. Additionally, data augmentation techniques were employed to expand the training set, thereby enhancing the model's generalization capability. On the oficial dataset across three dificulty levels, our method achieved F1 scores of 0.985, 0.818, and 0.807, respectively, where two exceeded the baseline method using comparative learning from the previous year, and one was on par with it.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Style Change Detection</kwd>
        <kwd>Contrastive Learning</kwd>
        <kwd>Sentence Representation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The task of multi-author writing style analysis requires participants to identify all changes in writing
style at the paragraph level within a given text. For each pair of consecutive paragraphs, the goal is to
assess whether there is a change in style between them [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. This analysis is crucial for applications
such as plagiarism detection, authorship attribution, and is instrumental in revealing the true identity
of the author, preventing academic misconduct and copyright infringement, and upholding academic
integrity and intellectual property protection.
      </p>
      <p>
        To efectively tackle this challenge, traditional methods often rely on text features such as vocabulary,
syntax, and structure to capture the author’s writing style [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. More recently, with the advancement
of pre-trained language models, new approaches have emerged that leverage these models for style
analysis [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], fine-tuning them on specific datasets to meet the task’s needs.
      </p>
      <p>
        In PAN 24, the task focuses more on addressing intrinsic style change detection, rather than relying
too much on thematic information as a signal for style change [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. For this reason, the competition
provides datasets at varying levels of complexity, with progressively less thematic information at each
level, encouraging participants to focus more on the subtle intrinsic changes in style rather than heavily
on thematic information.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Related work</title>
      <p>
        Pre-trained Language Models (PLMs) are an important technology in the field of Natural Language
Processing (NLP). They learn rich linguistic representations by pre-training on large-scale text datasets
and can then be fine-tuned for specific downstream tasks to improve performance. In past style change
detection tasks, Zhang et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] used a pre-trained BERT [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] model to estimate the similarity of writing
styles, and Lin et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] achieved the best results in 2022 by using three BERT-type pre-trained models
through ensemble learning.
      </p>
      <p>
        However, the task of writing style change detection is not a semantic matching problem, but a
problem of capturing writing style features of diferent texts. Therefore, contrastive learning can be
used, which can efectively capture and compare stylistic diferences between diferent texts, thereby
identifying changes in the author’s writing style. In PAN 23, Chen et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] applied a contrastive
learning-based method combined with the pre-trained DeBERTa model. Ye et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] trained using a
specialized contrastive learning loss and achieved the best results on hard datasets that year. In this
study, the contrastive learning method of CoSENT [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] was adopted, which efectively guides the
model to learn a more accurate and distinguishable semantic representation space, thereby enhancing
the model’s ability to capture subtle semantic diferences in text and improving its understanding of
complex linguistic phenomena.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Method</title>
      <p>In this study, we employed the method of contrastive learning to optimize the training process of the
RoBERTa [11] encoder. The goal is to utilize the cosine distance between two sentences to implement
these text classification tasks. The core feature is to bring the embeddings of paragraphs written by the
same author closer together in vector space, while pushing the embeddings of paragraphs by diferent
authors further apart.</p>
      <p>First, given a dataset , the method of contrastive learning can categorize the data into a set of
positive examples and a set of negative examples, where the set of positive examples is defined as Ω 
and the set of negative examples is defined as Ω . We aim to have the embeddings of the samples in
the Ω  set be as close as possible in vector space, and conversely for the Ω  set.</p>
      <p>In the testing phase, we obtain the embeddings of the two paragraphs in the vector space of the
paragraph pair to be tested, and map them through a linear layer to the classifier’s output space to
complete the classification task.</p>
      <p>Therefore, our model consists of three parts. The first part is the encoder block, where we use the
RoBERTa-base model to encode the inputs Ω  and Ω  respectively. Next is the contrastive learning
part, where during the training phase we apply  to optimize the outputs of Ω  and Ω  from the
encoder block. Finally, there is the classification part, where in the testing phase we use a connection
layer to complete the classification. The details of the contrastive learning training are in section 2.1.</p>
      <sec id="sec-3-1">
        <title>3.1. RoBERTa Encoder Training</title>
        <p>In the training stage, we convert the dataset  into two sets containing positive and negative examples.
These are defined as Ω  = {1, 2, . . . , } and Ω  = {1, 2, . . . , }, where Ω  is the set of
positive examples, with each  representing a paragraph pair (, ) with an unchanging author’s style,
and Ω  is the set of negative examples, with each  representing a paragraph pair (, ) with a
changing author’s style.</p>
        <p>Subsequently, each example is input into the encoder for encoding. For the positive examples  in
the paragraph pair (, ), we obtain the embedding representations u and u , and the same applies to
the negative examples , in order to obtain the embedding representations u and u for the paragraph
pair (, ). Then, the similarity between u and u is calculated using the cosine distance.</p>
        <p>To quantify the diference in similarity between positive and negative examples, we define a loss
function based on the comparison of cosine similarities. The loss function  is represented as follows:
 = −</p>
        <p>∑︁
(,)∈Ω,(,)∈Ω
log (1 +  · cos(u, u) − cos(u, u ))
(1)</p>
        <p>Here, Ω  denotes the set of positive instance pairs, Ω  denotes the set of negative instance pairs,
 is a hyperparameter greater than zero, used to balance the similarity diferences between positive
and negative instances. u represents the embedding representation of paragraph x. This loss function
encourages the model to reduce the cosine distance of positive pairs while increasing that of negative
pairs.</p>
        <p>Section 2.2’s Algorithm 1 provides a detailed description of the training process.</p>
        <p>In the test stage, for a test paragraph pair x, we pass it through the encoder using the method from
the training phase to obtain the embedding representation u. Then, we feed u into a fully connected
linear layer for linear transformation, resulting in a real-valued vector B. Then, we apply the sigmoid
activation function to convert it into a probability value that lies between 0 and 1. Paragraphs with a
probability value greater than 0.5 are classified as positive examples, and those with a probability value
less than 0.5 are classified as negative examples. These classifications are compared with the true labels,
and the F1 score is used for evaluation.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Encoder Training Algorithm</title>
        <p>The algorithm’s input includes: a set of positive instances Ω  and a set of negative instances Ω 
as training data,  is a hyperparameter greater than zero, used to balance the similarity diferences
between positive and negative instances, the number of training cycles  , and the encoder
model  that needs to be trained. The output is the trained model .</p>
        <p>The intermediate variables include: paragraph pairs (, ) and (, ) from the sets of positive and
negative instances, as well as their corresponding embedding representations (u, u ) and (u, u).
The specific process is as follows:</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Experiments</title>
      <sec id="sec-4-1">
        <title>4.1. Data Pre-processing</title>
        <p>PAN 24 provided three datasets of varying dificulty levels for this task, each dataset consists of a
training set (70%), a validation set (15%), and a test set (15%).</p>
        <p>Task 1 (easy): The paragraphs of the document cover various topics, allowing methods that utilize
thematic information to detect changes in authorship.</p>
        <p>Task 2 (medium): There is minimal thematic diversity within the document (though still present),
forcing methods to focus more on style to efectively address the detection task.</p>
        <p>Task 3 (hard): All paragraphs in the document are related to the same topic.</p>
        <p>
          For each dificulty level of the dataset, the documents are first read, then divided into paragraph
pairs, and the labels indicating whether the author’s style has changed are recorded. Subsequently, we
obtain a large number of high-quality paragraph pairs for training the encoder based on a special data
augmentation method [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Experimental Setup</title>
        <p>In this experiment, the hyperparameters for RoBERTa are set as follows: the batch size is set to 32, the
maximum sequence length is set to 512, and any excess will be truncated. The initial learning rate is set
to 1e-5, and the number of training epochs is set to 10.</p>
        <p>
          The baseline method selects the test set scores of Chen et al. [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] from last year, who used
DeBERTaBASE as the pre-trained encoder. It also includes two simple baseline scores released by the
oficial, one that always predicts 1, and the other that always predicts 0 [ 12]. The evaluation metric
chosen is the F1 score because it takes into account both precision and recall, and strikes a balance
between them, providing a more comprehensive assessment of the model.
        </p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Experimental Results</title>
        <p>The model is submitted to TIRA [13] for execution to obtain the final metrics of the model. Table
1 provides the scores achieved by the model presented in this paper on the oficial test set. Table 2
demonstrates the scores of the method presented in this paper on the validation set.</p>
        <p>In terms of experimental results, the RoBERTa model shows a significant improvement over the
baseline method on Task 1 and Task 3, and it performs roughly on par with the baseline method on
Task 2. This indicates that the RoBERTa model can exhibit superior performance when dealing with
documents that have a high or low degree of topic diversity. The RoBERTa model is capable of adapting
well to style transfer detection tasks of varying dificulties.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>This paper briefly introduces the work results of finetuning the RoBERTa encoder and linear classifier
using a contrastive learning method based on CoSENT, applied to the writing style change analysis in
the PAN 2024 shared task. Comparative experiments were conducted on datasets of varying dificulty
levels against baseline methods. The results indicate that the writing style change analysis model, which
leverages RoBERTa encoding and contrastive learning, performs exceptionally well in the multi-author
writing style analysis task. It can accurately identify shifts in author style, especially with the aid of
contrastive learning and data augmentation techniques.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This research is supported by the Social Science Foundation of Guangdong Province,
China(No.GD24CZY02)
[11] Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, V. Stoyanov,</p>
      <p>Roberta: A robustly optimized bert pretraining approach, arXiv preprint arXiv:1907.11692 (2019).
[12] J. Bevendorf, X. B. Casals, B. Chulvi, D. Dementieva, A. Elnagar, D. Freitag, M. Fröbe, D. Korenčić,
M. Mayerl, A. Mukherjee, et al., Overview of pan 2024: multi-author writing style analysis,
multilingual text detoxification, oppositional thinking analysis, and generative ai authorship
verification, in: European Conference on Information Retrieval, Springer, 2024, pp. 3–10.
[13] M. Fröbe, M. Wiegmann, N. Kolyada, B. Grahm, T. Elstner, F. Loebe, M. Hagen, B. Stein, M. Potthast,
Continuous integration for reproducible shared tasks with tira. io, in: European Conference on
Information Retrieval, Springer, 2023, pp. 236–241.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Bevendorf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Borrego-Obrador</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Chinea-Ríos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Franco-Salvador</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fröbe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Heini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kredens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mayerl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pęzik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Potthast</surname>
          </string-name>
          , et al.,
          <source>Overview of pan</source>
          <year>2023</year>
          :
          <article-title>Authorship verification, multi-author writing style analysis, profiling cryptocurrency influencers, and trigger detection: Condensed lab overview</article-title>
          ,
          <source>in: International Conference of the Cross-Language Evaluation Forum for European Languages</source>
          , Springer,
          <year>2023</year>
          , pp.
          <fpage>459</fpage>
          -
          <lpage>481</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>D.</given-names>
            <surname>Zlatkova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kopev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Mitov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Atanasov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hardalov</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Koychev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Nakov</surname>
          </string-name>
          ,
          <article-title>An ensemble-rich multi-aspect approach for robust style change detection, in: CLEF 2018 Evaluation Labs</article-title>
          and Workshop-Working Notes Papers, CEUR-WS. org,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Iyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Vosoughi</surname>
          </string-name>
          ,
          <article-title>Style change detection using bert</article-title>
          .,
          <string-name>
            <surname>CLEF</surname>
          </string-name>
          (Working Notes)
          <volume>93</volume>
          (
          <year>2020</year>
          )
          <fpage>106</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>E.</given-names>
            <surname>Zangerle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mayerl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Potthast</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Stein</surname>
          </string-name>
          ,
          <article-title>Overview of the Multi-Author Writing Style Analysis Task at PAN 2024</article-title>
          , in: G. Faggioli,
          <string-name>
            <given-names>N.</given-names>
            <surname>Ferro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Galuščáková</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. G. S.</surname>
          </string-name>
          Herrera (Eds.), Working Notes of CLEF 2024 -
          <article-title>Conference and Labs of the Evaluation Forum, CEUR-WS</article-title>
          .org,
          <year>2024</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Han</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L</given-names>
            .
            <surname>Kong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Miao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Peng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zeng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Cao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Xiao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Peng</surname>
          </string-name>
          ,
          <article-title>Style change detection based on writing style similarity</article-title>
          ,
          <source>Training</source>
          <volume>11</volume>
          (
          <year>1970</year>
          )
          <fpage>17</fpage>
          -
          <lpage>051</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , Bert:
          <article-title>Pre-training of deep bidirectional transformers for language understanding</article-title>
          , arXiv preprint arXiv:
          <year>1810</year>
          .
          <volume>04805</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>T.-M. Lin</surname>
            ,
            <given-names>C.-Y.</given-names>
          </string-name>
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Y.-W.</given-names>
          </string-name>
          <string-name>
            <surname>Tzeng</surname>
            ,
            <given-names>L.-H.</given-names>
          </string-name>
          <string-name>
            <surname>Lee</surname>
          </string-name>
          ,
          <article-title>Ensemble pre-trained transformer models for writing style change detection</article-title>
          .,
          <source>in: CLEF (Working Notes)</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>2565</fpage>
          -
          <lpage>2573</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>H.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Han</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Han</surname>
          </string-name>
          ,
          <article-title>A writing style embedding based on contrastive learning for multi-author writing style analysis</article-title>
          ,
          <source>Working Notes of CLEF</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Ye</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Qi</surname>
          </string-name>
          , Y. Han,
          <article-title>Supervised contrastive learning for multi-author writing style analysis</article-title>
          ,
          <source>in: Conference and Labs of the Evaluation Forum</source>
          ,
          <year>2023</year>
          . URL: https://api.semanticscholar. org/CorpusID:264441623.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>J. SU</surname>
          </string-name>
          ,
          <article-title>Cosent (1): A more eficient sentence vector scheme than sentence-bert</article-title>
          ,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>