An encoder-based AI system called SenseShift followed sentence-level sentiment targets more closely than the decoder-based approaches in the benchmark, an arXiv preprint reports. Its automated tests also produced contextual-fitness changes close to zero in the main in-domain and cross-dataset comparisons.
In the in-domain results, the larger model recorded a Delta Sentiment score of 0.20 on TinyStories and 0.26 on Yelp Reviews. Delta Sentiment is the mean absolute gap between target and generated sentiment, so lower values indicate closer adherence. The corresponding correlations were 0.790 and 0.71, while sentiment accuracy was 0.78 and 0.69.
Perplexity, a model-based fluency measure, was 53.6 for stories and 57.5 for reviews. Contextual-fitness change was -0.00 for stories and 0.04* for reviews. The paper assesses whether calibrated fitness change differs from zero using a two-sided t-test and reports point estimates without confidence intervals.
A sentence at a time
SenseShift uses bidirectional attention, quantized sentiment signals and iterative mask infilling to generate local sentences conditioned on a target sentiment intensity. During that process, parts of a sentence are hidden and filled back in step by step. Control-aware masked-language-model fine-tuning keeps the sentiment tokens visible and uses a 40% masking ratio.
The framework was deployed in ModernBERT base and large versions with 149 million and 395 million parameters. The evaluation compared it with prompting, activation steering and fine-tuning categories.
For the standardized test, researchers randomly selected one sentence from each document and assigned it a random target sentiment. Generated outputs were scored with VADER, an automated sentiment scorer, except in the zero-shot prompting condition.
Two text collections set the test’s boundaries
The training splits contained 4,439,352 TinyStories samples and 252,085 Yelp samples. TinyStories was 53.7% positive, 0.3% negative and 46.0% neutral, while Yelp was 41.0% positive, 4.3% negative and 54.8% neutral.
Each dataset held out 2,000 test samples unseen during training and validation. SenseShift was trained and validated independently on each dataset, then tested on both.
In the cross-dataset check, the large model trained on reviews and evaluated on stories recorded perplexity of 83.0, Delta Sentiment of 0.34, correlation of 0.62 and accuracy of 0.61, with contextual-fitness change of -0.00. When trained on stories and evaluated on reviews, it recorded perplexity of 31.4, Delta Sentiment of 0.15, correlation of 0.85 and accuracy of 0.85, with contextual-fitness change of 0.07*. The authors describe this block as a robustness check rather than evidence of generalization to unseen fields.
Two filling modes were compared
A separate ablation compared iterative infilling with whole-mask prediction. Across configurations, the reported perplexity was 5 to 10 times lower for iterative infilling; in the large story-trained model, the two values were 869.9 for whole-mask prediction and 53.6 for iterative infilling. Delta Sentiment reductions across configurations ranged from 0.15 to 0.25.
The lower-error pattern also appeared in stratified comparisons: SenseShift maintained a lower Delta Sentiment than the comparison models across target sentiment, relative sentence position and generation length.
Human judgments were less decisive
The human preference study involved eight annotators and 100 parallel documents, including 55 stories and 45 reviews. Outputs were anonymised and judged for contextual fit, grammatical fluency and sentiment following.
Within the in-domain comparison, outputs were judged equally fluent in 85.0% of samples and equally well-fitting in 46.9%. SenseShift’s sentiment was rated satisfactory in 31.0% of cases, compared with 28.3% for Gemma 2-2B, and it was judged equivalent to or better overall in 73.5%.
In the out-of-domain review comparison, based on 45 sentence pairs, SenseShift was selected for sentiment in 36.2% of cases versus 25.5% for Gemma 2-2B. Grammar was tied in 78.7%, while both models were selected overall in 46.1%, leaving the human results mixed on contextual fit and general quality.
What the results leave open
The automated results depend on VADER, which supplies both training labels and evaluation scores. The authors caution that it may miss implicit or contextually nuanced sentiment, so a stronger automated score does not necessarily mean people would judge every rewrite as having the requested tone.
The evidence is confined to TinyStories and Yelp Reviews, their two train-test swaps, the infilling comparison and the small preference study. The authors say the narrow corpora do not justify strong generalization claims about news, social media, formal writing or other unseen domains. The baseline set was constrained by a fixed compute budget and was not exhaustive.
The document is an arXiv preprint, version 1, dated 25 August 2026. It reports source code for the experimental setup and training, along with inference checkpoints in linked repositories.
Paper data and sources
Original title: SENSESHIFT: Continuous Sentiment-Controlled Text Generation via Encoder-based Mask Infilling
Authors: Shahed Masoudian, Markus Frohmann, Emmanouil Karystinaios et al.
Journal/Repository: arXiv
Status: Preprint, not yet peer-reviewed
First online: 2026-08-25
DOI: Not available
Original paper · Full text