---
title: Adversarial Topic-aware Prompt-tuning (ATOP)
url: https://www.emergentmind.com/topics/adversarial-topic-aware-prompt-tuning-atop
type: topic
---

# Adversarial Topic-aware Prompt-tuning (ATOP)

Searching arXiv for the specified paper and closely related cross-topic AES work to ground the article.
Adversarial Topic-aware Prompt-tuning (ATOP) is a cross-topic automated essay scoring (AES) method that is designed to score essays from an unlabeled target topic by learning from essays drawn from several labeled source topics. It is formulated to address a central difficulty in cross-topic AES: the discrepancy between topics. ATOP combines prompt-tuning, adversarial learning, pseudo-labeling, and a unified regression-classification framework in order to learn both topic-shared and topic-specific representations from a pre-trained language model (PLM). The method is introduced for both holistic and multi-trait essay scoring, and is evaluated on the ASAP++ dataset, where it is reported to outperform prior state-of-the-art baselines [2508.05987].

## 1. Problem formulation and motivation

Cross-topic AES studies the setting in which a model is trained on several source topics and must score essays from a target topic for which no labels are available during training. In the formulation used by ATOP, the source data are
\[
\mathbf{S}=\{(\mathbf{X}_i,\mathbf{Y}_i,\mathbf{C}_i)\}_{i=1}^N
\]
where \(\mathbf{X}_i=\{x_s^i\}\) denotes essays, \(\mathbf{Y}_i\) their scores, and \(\mathbf{C}_i\) classification labels derived from scores. The target topic is
\[
\mathbf{T}=\{x_t\}_{t=1}^{|\mathbf{T}|}
\]
with no score labels. Each essay may have a holistic score and, in the multi-trait setting, multiple trait scores. The task is to learn a transferable scoring function
\[
\hat{\mathbf{y}}=\phi(\mathbf{S},\mathbf{T},x_t;\theta).
\]

The method is motivated by three limitations attributed to prior cross-topic AES systems. First, earlier methods mainly learn topic-shared features by aligning source and target distributions or by extracting topic-invariant properties such as grammar, coherence, and structure. Second, they tend to neglect topic-specific features, even though traits such as topic adherence, word choice, and content relevance are topic-sensitive. Third, full fine-tuning of PLMs such as BERT can be computationally costly, may overwrite useful pre-trained knowledge, and may be ill-suited to comparatively small AES datasets [2508.05987].

ATOP is proposed to address these issues by jointly modeling topic-shared and topic-specific information. The core intuition is to use prompt-tuning to make a PLM encode both kinds of knowledge, while coordinating them through adversarial training and pseudo-label supervision. This suggests a shift away from viewing cross-topic AES as a purely invariant-feature learning problem and toward a hybrid formulation in which transfer requires both alignment and controlled topic adaptation.

## 2. Topic-aware prompt design

ATOP introduces a learnable topic-aware prompt composed of a shared prompt and a topic-specific prompt. The shared prompt is intended to capture common essay-quality features across topics, whereas the topic-specific prompt is intended to encode topic-sensitive cues.

The topic-shared prompt is defined as
\[
\mathbf{p}_{\text{shared}}=\{\mathbf{e}_1,\mathbf{e}_2,\ldots,\mathbf{e}_n\},
\]
where \(n\) is the number of shared prompt vectors. For each topic \(i\), the topic-specific prompt is
\[
\mathbf{p}_{\text{specific}}^i=\{\mathbf{e}_{i,1},\mathbf{e}_{i,2},\ldots,\mathbf{e}_{i,m}\},
\]
where \(m\) is the number of topic-specific prompt vectors.

For an essay \(x=\{w_1,\ldots,w_l\}\), the PLM input is constructed by prepending the prompts:
\[
\mathbf{x}=[e(\text{[CLS]}),\mathbf{p}_{\text{shared}},\mathbf{p}_{\text{specific}}^i,e(\mathbf{x}),e(\text{[SEP]})].
\]
The PLM \(\mathcal{M}\) then outputs the representation
\[
\mathbf{h}_{[\text{CLS}]}=\mathcal{M}(\mathbf{x}),
\]
which is used as the essay representation.

Within this design, the shared prompt is meant to extract cross-topic, topic-agnostic writing-quality signals, while the specific prompt injects topic-sensitive information needed for topic adherence and content relevance. Because the PLM is kept frozen and only the prompt parameters are learned, ATOP is parameter-efficient relative to full fine-tuning. The paper characterizes this as the first prompt-tuning approach for cross-topic AES [2508.05987].

A common misconception in cross-topic scoring is that topic invariance is sufficient. ATOP is constructed against that assumption. Its prompt decomposition encodes the view that transfer quality depends not only on preserving general indicators of writing proficiency but also on representing the aspects of quality that vary with prompt content and topic expectations.

## 3. Unified regression and classification framework

ATOP formulates AES as both regression and classification. The regression branch predicts numerical scores, including holistic and trait scores, while the classification branch predicts a coarse-grained holistic score category.

In the regression branch, the essay representation is concatenated with handcrafted features:
\[
\mathbf{h}=[\mathbf{h}_{[\text{CLS}]};\mathbf{f}],
\]
where \(\mathbf{f}\) includes features such as length, text complexity, sentiment, and text variation. For each trait \(j\), a nonlinear projection is computed:
\[
\mathbf{h}'_j=\text{relu}(\mathbf{w}_j\cdot \mathbf{h}+\mathbf{b}_j).
\]
To model inter-trait dependencies, ATOP applies attention over trait representations:
\[
\mathbf{F}=[\mathbf{h}'_1,\mathbf{h}'_2,\ldots,\mathbf{h}'_K],
\]
\[
\mathbf{v}_i^j=\frac{\exp(\text{score}(\mathbf{h}'_j,\mathbf{F}_{-j,i}))}{\sum_l \exp(\text{score}(\mathbf{h}'_j,\mathbf{F}_{-j,l}))},
\]
\[
\mathbf{o}_j=\sum \mathbf{v}_i^j \mathbf{F}_{-j,i},
\]
\[
\mathbf{n}_j=[\mathbf{h}'_j;\mathbf{o}_j].
\]
The predicted score is
\[
\hat y_j=\sigma(\mathbf{w}_j^y\cdot \mathbf{n}_j+b_j^y).
\]
The regression objective is mean squared error:
\[
\mathcal{L}_{mse}=\sum_{n=1}^{N}\mathcal{L}_n,
\]
\[
\mathcal{L}_n=\frac{1}{|\mathbf{S}_n|\times K}\sum_{i=1}^{|\mathbf{S}_n|}\sum_{j=1}^{K}(\hat y_{i,j}-y_{i,j})^2.
\]
A mask operation is used for traits missing from some topics.

In the classification branch, holistic scores are discretized into four classes: excellent, good, moderate, and poor. A classifier \(C\), implemented as an MLP with softmax, maps \(\mathbf{h}\) to class probabilities:
\[
\hat c = C(\mathbf{h}).
\]
For source topic \(j\), the cross-entropy loss is
\[
\mathcal{L}_{c,j}=-\frac{1}{|\mathbf{S}_j|}\sum_{i=1}^{|\mathbf{S}_j|} c_i\log \hat c_i,
\]
and the total source classification loss is
\[
\mathcal{L}_{sce}=\sum_{j=1}^{N}\mathcal{L}_{c,j}.
\]

The joint use of regression and classification is not merely multi-task augmentation. In the ATOP formulation, it also provides a mechanism for controlling the effect of alignment on score prediction. The paper states that classification is more stable with respect to feature scale changes than regression, and this claim directly informs the adversarial training design [2508.05987].

## 4. Adversarial learning and pseudo-labeling

A key component of ATOP is adversarial training for the topic-shared prompt. The stated motivation is that aggressive source-target feature alignment can shift feature scale, and regression is sensitive to such changes. For that reason, ATOP applies adversarial alignment only in the classification branch.

For each source topic \(i\), a discriminator
\[
g_i:\mathbb{R}^h\to \{0,1\}
\]
predicts whether an essay comes from source topic \(i\) or the target topic. The probability of being target is defined as
\[
p(y=1|x)=\frac{\exp(g_{i,1}(\mathbf{h}_{[\text{CLS}]}))}{\sum_{j\in\{0,1\}} \exp(g_{i,j}(\mathbf{h}_{[\text{CLS}]}))}.
\]
The adversarial loss is
\[
\mathcal{L}_{adv}= -\sum_{i=1}^{N}\Big[ \sum_{x\in \mathbf{S}_i}\log(1-p(y=1|x)) + \sum_{x'\in \mathbf{T}}\log p(y=1|x') \Big].
\]
A gradient reversal layer (GRL) is used so that the discriminator learns to distinguish source from target while the shared prompt learns to confuse the discriminator. The intended outcome is a topic-invariant, robust, and transferable shared representation.

Topic-specific prompts require target-topic supervision, but the target essays are unlabeled. ATOP addresses this with neighbor-based pseudo-labeling. It stores target essay features and soft labels in a memory bank \(\mathbf{B}\). For a target essay \(x_t\),
\[
\mathbf{f}_t=\mathbf{h}_t,\qquad \mathbf{p}_t=C(\mathbf{h}_t).
\]
To reduce noise, the soft predictions are sharpened:
\[
\tilde p_{t,k} = \frac{p_{t,k}^{\tau}}{\sum_k p_{t,k}^{\tau}},
\]
where \(\tau\) is a temperature coefficient. The memory bank is updated by exponential moving average:
\[
\overline{\mathbf{f}}_t=\lambda \overline{\mathbf{f}}_t + (1-\lambda)\mathbf{f}_t,
\]
\[
\overline{\mathbf{p}}_t=\lambda \overline{\mathbf{p}}_t + (1-\lambda)\mathbf{p}_t,
\]
where \(\lambda\) is a smoothing parameter.

For each target essay, the method finds its \(m\) nearest neighbors in the memory bank using cosine similarity. If \(\mathbf{N}_t\) denotes the neighbor index set, the pseudo soft label is
\[
\hat{\mathbf{p}}_t=\frac{1}{m}\sum_{i\in \mathbf{N}_t}\overline{\mathbf{p}}_t^i,
\]
and the pseudo class label is
\[
\hat y_t=\arg\max_k \hat p_{t,k}.
\]
The target cross-entropy loss is then
\[
\mathcal{L}_{tce}=-\frac{1}{|\mathbf{T}|}\sum_{t=1}^{|\mathbf{T}|}\sum_{k=0}^{C-1}\hat y_{t,k}\log C_k(\mathbf{h}_t),
\]
and the full classification loss is
\[
\mathcal{L}_{ce}=\mathcal{L}_{sce}+\mathcal{L}_{tce}.
\]

The paper explicitly attributes three functions to this pseudo-labeling procedure: it exploits local structure in representation space, assumes nearby essays have similar score categories, and reduces individual prediction noise by averaging neighbors. A plausible implication is that ATOP treats target adaptation as a local manifold-labeling problem rather than as direct self-training from single predictions.

## 5. Optimization procedure and implementation

The total ATOP objective is
\[
\mathcal{L}_{total}=\mathcal{L}_{ce}+\alpha \mathcal{L}_{mse}+\beta \mathcal{L}_{adv},
\]
where \(\alpha\) and \(\beta\) are trade-off weights. In the reported experiments, \(\alpha=10\) and \(\beta=1\) [2508.05987].

Training follows a two-stage alternating optimization scheme. In the first stage, the topic-specific prompts are frozen. The model computes \(\mathcal{L}_{ce}\), \(\mathcal{L}_{mse}\), and \(\mathcal{L}_{adv}\), and updates the shared prompt, classifier, trait predictors, discriminators, and PLM-related modules in the prompt pipeline using \(\mathcal{L}_{total}\). In the second stage, the topic-shared prompt and discriminators are frozen. The model computes \(\mathcal{L}_{ce}\) and \(\mathcal{L}_{mse}\), and updates the topic-specific prompts, classifier, and trait predictors using \(\mathcal{L}_{ce}+\alpha\mathcal{L}_{mse}\). The purpose of this alternation is to separate shared invariant knowledge from topic-specific adaptation.

ATOP is evaluated on ASAP++, an extended ASAP dataset with 12,987 essays across 8 topics and 3 genres: argumentative, narrative, and source-dependent. Trait sets vary by topic, and some traits are omitted when they are not present in source topics. Examples of traits listed in the paper are Cont, Org, WC, SF, Conv, TA, Lan, and Nar. Scores are normalized to \([0,1]\) and divided into the intervals \((0,0.4)\), \((0.4,0.6)\), \((0.6,0.8)\), and \((0.8,1)\), corresponding to poor, moderate, good, and excellent. The evaluation metric is Quadratic Weighted Kappa (QWK), which the paper describes as standard for AES.

The implementation uses BERT-base as the PLM backbone. Both shared and specific prompt lengths are set to \(8\). The PLM feature dimension is \(768\), reduced to \(100\) by a linear layer. Handcrafted features are \(86\)-dimensional, yielding a total input size of \(186\) for the trait-attention and MLP components. Training uses 30 epochs, batch size 4, the Adam optimizer, learning rate 0.01, decay rate 0.9, and decay step 2000. The system is implemented in PyTorch 1.9.0 and Python 3.7.5, and trained on 4 NVIDIA GTX TITAN GPUs [2508.05987].

## 6. Empirical results, ablations, and interpretation

ATOP is compared against Hi-att, AES aug, Bert-FT, PT-V2, PAES, CTS, PMAES, PLAES, and LLM-fs, with LLM-fs used for holistic regression only. These baselines cover classic deep AES, BERT fine-tuning, prompt-based AES, domain adaptation and alignment, meta-learning and contrastive learning, and LLM prompting.

On multi-trait regression by topic, ATOP achieves the best average QWK across topics, with 0.594 compared with 0.575 for the best baseline, PLAES, which the paper describes as an improvement of about 1.9%. On multi-trait regression by trait, ATOP again obtains the best average, with 0.590 versus 0.570 for PLAES. The paper states that it performs especially well on topic adherence, language, narrativity, and word choice, which are identified as traits where topic-specific information matters more. On holistic classification, ATOP reports an average QWK of 0.626, compared with 0.592 for the best baseline. On holistic regression, it reports 0.653 versus 0.621 for the best baseline [2508.05987].

The ablation study attributes distinct contributions to the main components. Removing adversarial training causes average performance drops of about 1.9% on the topic dimension and about 1.8% on the trait dimension. Removing topic-specific prompts causes drops of about 1.0% and about 1.1%, respectively. Removing classification modeling causes drops of about 1.4% on both topic and trait dimensions. These results are used to support the claims that adversarial training strengthens shared-feature learning, topic-specific prompts are important for topic-sensitive traits, and the unified regression-classification framework contributes to overall performance.

The paper also reports t-SNE visualizations. In the full model, source and target feature spaces are described as compact and overlapping. Without adversarial training, source-topic clusters separate more strongly. Without topic-specific prompts, target-topic features become scattered and less structured. The interpretation advanced in the paper is that adversarial learning improves topic-agnostic alignment, while topic-specific prompts help organize target-topic representations.

An important technical point is that ATOP does not treat adversarial alignment as uniformly beneficial. The paper notes that adversarial alignment can slightly hurt on some topics with large distribution gaps. This places ATOP in a more qualified position than methods that assume stronger alignment is always preferable.

## 7. Significance, limitations, and scope

ATOP is presented as a prompt-based, adversarial, topic-aware model for cross-topic AES that integrates a shared soft prompt for topic-invariant essay quality, a topic-specific soft prompt for target-sensitive features, adversarial training for shared-prompt robustness, neighbor-based pseudo-labeling for target-topic supervision, and a joint regression-classification objective. Within the reported experiments, the method is characterized as parameter-efficient compared with full fine-tuning and as consistently beneficial for both holistic and multi-trait scoring, especially on topic-dependent traits [2508.05987].

Its limitations are stated with similar specificity. The method still depends on pseudo-label quality, which may propagate errors. It uses BERT-base and handcrafted features, so performance may vary with other PLMs or feature sets. The strongest evidence is on ASAP++, and generalization to other domains is not directly established. The paper also notes that some topics with rigid structure may still favor feature-engineered methods.

These caveats delimit the scope of the contribution. The paper does not claim that topic-specific prompting eliminates the challenges of unlabeled target-topic adaptation, nor that adversarial transfer is uniformly safe for regression tasks. Instead, ATOP is positioned as a framework that attempts to balance topic invariance with topic sensitivity under the practical constraints of cross-topic AES. A plausible implication is that its broader significance lies not only in its reported QWK gains but also in its explicit decomposition of transferable essay scoring into shared and specific components, each trained under a different supervisory signal.

Source: https://www.emergentmind.com/topics/adversarial-topic-aware-prompt-tuning-atop