LM-SODP: Language Model Self-Optimizing Discrete Prompt for Aspect Based Sentiment Analysis
Abstract
1. Introduction
- We introduce LM-SODP, a RL framework for multi chain prompt-based ABSA, achieving better performance than strong baselines such as MvP (Multi-view Prompting) [17] on four tasks with ten datasets.
- LM-SODP demonstrates that lightweight LMs can effectively guide larger LMs, highlighting the potential of prompt learning for broader applications.
- LM-SODP discovers distinctive linguistic patterns within LMs through optimized prompt instructions, which often diverge from human intuition.
2. Related Work
2.1. Aspect Based Sentiment Analysis Architectures
2.2. Prompt Instruction Optimization
2.3. Reinforcement Learning in NLP
2.4. Existing Research Gaps
3. Methodology
3.1. Discrete Prompt Generation
- Input sentence:
- Aspect label sequence: where
- Opinion label sequence: where
- Gold-standard labels: and
- incorporates token-level accuracy for both ATE and OTE.
- evaluates the quality of aspect–opinion pair extraction.
- ensures semantic consistency between aspects and opinions.
3.2. Multi-Order Prediction
- Input: This bread is fantastic!
- Aggregated output: [A] bread[O] fantastic[C] food[S] positive
4. Experiments and Discussion
4.1. Datasets and Metrics
4.2. Baselines
4.3. Experiment Results
4.4. Ablation Study and Discussion
4.5. Case Study
4.6. Limitations and Future Work
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Appendix B
| Prompt |
|---|
| According to the following sentiment elements definition: |
|
| Recognize all sentiment elements with their corresponding aspect terms, aspect categories, opinion terms and sentiment polarity in the following text with the format of [(‘aspect term’, ‘opinion term’, ‘aspect category’, ‘sentiment polarity’), …]: |
| Prompt and Examples |
|---|
| According to the following sentiment elements definition: |
|
| Recognize all sentiment elements with their corresponding aspect terms, aspect categories, opinion terms and sentiment polarity in the following text with the format of [(‘aspect term’, ‘opinion term’, ‘aspect category’, ‘sentiment polarity’), …]: |
| Examples: |
| Text: never again ! |
| Sentiment Elements: [(‘null’, ‘never’, ‘restaurant general’, ‘bad’)] |
| Text: the food was mediocre at best but it was the horrible service that made me vow never to go back. |
| Sentiment Elements: [(‘food’, ‘mediocre’, ‘food quality’, ‘bad’), (‘service’, ‘horrible’, ‘service general’, ‘bad’)] |
| Text: we had the lobster sandwich and it was fantastic. |
| Sentiment Elements: [(‘lobster sandwich’, ‘fantastic’, ‘food quality’, ‘great’)] |
| Text: they have it all – great price, food, and service. |
| Sentiment Elements: [(‘null’, ‘great’, ‘restaurant prices’, ‘great’), (‘food’, ‘great’, ‘food quality’, ‘great’), (‘service’, ‘great’, ‘service general’, ‘great’)] |
| Text: they even scoop it out nice (for those on a diet) not too much not to little. |
| Sentiment Elements: [(‘null’, ‘nice’, ‘food style_options’, ‘great’)] |
| Text: also it’s great to have dinner in a very romantic and comfortable place, the service it’s just perfect …they’re so friendly that we never want to live the place ! |
| Sentiment Elements: [(‘place’, ‘romantic’, ‘ambience general’, ‘great’), (‘place’, ‘comfortable’, ‘ambience general’, ‘great’), (‘service’, ‘perfect’, ‘service general’, ‘great’)] |
| Text: my friend from milan and myself were pleasantly surprised when we arrived and everyone spoke italian. |
| Sentiment Elements: [(‘null’, ‘pleasantly surprised’, ‘restaurant miscellaneous’, ‘great’)] |
| Text: i had their eggs benedict for brunch, which were the worst in my entire life, i tried removing the hollondaise sauce completely that was how failed it was. |
| Sentiment Elements: [(‘eggs benedict’, ‘worst’, ‘food quality’, ‘bad’)] |
| Text: the food is authentic italian – delicious ! |
| Sentiment Elements: [(‘food’, ‘authentic italian’, ‘food quality’, ‘great’), (‘food’, ‘delicious’, ‘food quality’, ‘great’)] |
| Text: a little pricey but it really hits the spot on a sunday morning ! |
| Sentiment Elements: [(‘null’, ‘pricey’, ‘restaurant prices’, ‘bad’), (‘null’, ‘hits the spot’, ‘restaurant general’, ‘great’)] |
| Hyperparameter | Description | Value |
|---|---|---|
| Policy Network LM | Frozen PLM for prompt generation | Distilled-GPT2 (82 M parameters) |
| MLP Hidden Size | Trainable MLP layer inserted into policy LM | 2048 |
| Training Steps | Total training iterations | 20 K |
| Batch Size | Number of prompts per batch | 16 |
| Learning Rate | Adam optimizer learning rate | |
| Sampling Method | Strategy for generating prompt candidates | top-256 sampling |
| Reward Scaling Factor | Multiplier to amplify reward signals | 5 |
| Reward Normalization | Stabilization technique | Input-specific z-score |
| Reward Function | Weight for incorrect predictions | 180 |
| Reward Function | Weight for correct predictions | 200 |
| Reward Function | Ensure the accuracy of basic annotations | 0.4 |
| Reward Function | Modeling aspect-opinion | 0.35 |
| Reward Function | Ensure sentiment consistency | 0.25 |
| Validation Frequency | Steps between validation evaluations | Every 10 steps |
| Algorithm A1 Training strategies for ATE and OTE in LM-SODP stage I |
| Require: Task LM (frozen), Policy LM , Training set Require: ▷ Three-level reward weights Ensure: Optimized prompt
|
| Hyperparameters | LM-SODP | LM-SODP (Low Resource) | |||
|---|---|---|---|---|---|
| 1%, 2%, 3%, 5% | 10%, 20% | 30% | 50% | ||
| Epoch | 20 | 100 | 50 | 30 | 20 |
| Batch Size | 32 | 16 | |||
| Learning Rate | |||||
| Optimizer | AdamW | ||||
| GPU | Nvidia RTX 3090 * 2 | ||||
| CUDA Version | 11.6 | ||||
| System | ubuntu22.04 | ||||
| Python Version | 3.8 | ||||
| GPU Memory Used | about 40 GB | ||||
| Runing Time | about 6 h | ||||
| Algorithm A2 Training strategies for ASC and ACD in LM-SODP stage I |
| Require: Task LM (frozen), Policy LM , Training set , Prompt length T Ensure: Optimized discrete prompt
|
| Algorithm A3 Multi-order result aggregation strategies in LM-SODP stage II |
| Require: Training dataset where optimized specific task prompt instructions ; Pre-trained LM; Number of orders m Ensure: Trained model M for inference
|
References
- Bu, K.; Liu, Y.; Ju, X. Efficient utilization of pre-trained models: A review of sentiment analysis via prompt learning. Knowl.-Based Syst. 2024, 283, 111148. [Google Scholar] [CrossRef]
- Deng, M.; Wang, J.; Hsieh, C.; Wang, Y.; Guo, H.; Shu, T.; Song, M.; Xing, E.P.; Hu, Z. RLPrompt: Optimizing Discrete Text prompt instructions with RL. In Proceedings of the EMNLP 2022, Abu Dhabi, United Arab Emirates, 7–11 December 2022; pp. 3369–3391. [Google Scholar]
- Shin, T.; Razeghi, Y.; Logan, R.L., IV; Wallace, E.; Singh, S. AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts. In Proceedings of the EMNLP 2020, Punta Cana, Dominican Republic, 8–12 November 2020; Volume 1, pp. 4222–4235. [Google Scholar]
- Petroni, F.; Rocktäschel, T.; Riedel, S.; Lewis, P.; Bakhtin, A.; Wu, Y.; Miller, A.H. Language Models as Knowledge Bases? In Proceedings of the EMNLP/IJCNLP 2019, Hong Kong, China, 3–7 November 2019; Volume 1, pp. 2463–2473. [Google Scholar]
- Hao, S.; Tan, B.; Tang, K.; Ni, B.; Shao, X.; Zhang, H.; Xing, E.P.; Hu, Z. BertNet: Harvesting Knowledge Graphs with Arbitrary Relations from Pretrained Language Models. In Proceedings of the ACL (Findings) 2023, Toronto, ON, Canada, 9–14 July 2023; pp. 5000–5015. [Google Scholar]
- Wen, Y.; Jain, N.; Kirchenbauer, J.; Goldblum, M.; Geiping, J.; Goldstein, T. Hard prompt instructions Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery. In Proceedings of the NeurIPS 2023, New Orleans, LA, USA, 10–16 December 2023. [Google Scholar]
- Mahajan, S.; Rahman, T.; Yi, K.M.; Sigal, L. Prompting Hard or Hardly Prompting: Prompt Inversion for Text-to-Image Diffusion Models. In Proceedings of the CVPR 2024, Seattle, WA, USA, 17–21 June 2024; pp. 6808–6817. [Google Scholar]
- Zhao, R.; Li, W.; Hu, Z.; Li, L.; Zou, Z.; Shi, Z.; Fan, C. Zero-Shot Text-to-Parameter Translation for Game Character Auto-Creation. In Proceedings of the CVPR 2023, Vancouver, BC, Canada, 18–22 June 2023; pp. 21013–21023. [Google Scholar]
- Wei, J.; Wang, X.; Schuurmans, D.; Bosma, M.; Ichter, B.; Xia, F.; Chi, E.H.; Le, Q.V.; Zhou, D. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. In Proceedings of the NeurIPS 2022, New Orleans, LA, USA, 28 November–9 December 2022. [Google Scholar]
- Liu, X.; Hu, M.; Xu, C.; Du, Z. SARA: Span-aware framework with relation-augmented grid tagging for conversational aspect-based sentiment quadruple analysis. Eng. Appl. Artif. Intell. 2025, 154, 110915. [Google Scholar] [CrossRef]
- Wang, X.; Liu, W. An aspect-level sentiment GCN model based on transformer and frequency domain. Eng. Appl. Artif. Intell. 2025, 154, 110938. [Google Scholar] [CrossRef]
- Wang, X.; Liu, L.; Chen, Z.; Wang, H.; Yu, B. GCN based on self-attention variational autoencoder and capsule contrastive learning for aspect-based sentiment analysis. Expert Syst. Appl. 2025, 279, 127172. [Google Scholar] [CrossRef]
- Zhang, W.; Deng, Y.; Li, X.; Yuan, Y.; Bing, L.; Lam, W. Aspect Sentiment Quad Prediction as Paraphrase Generation. In Proceedings of the EMNLP 2021, Punta Cana, Dominican Republic, 7–11 November 2021; Volume 1, pp. 9209–9219. [Google Scholar]
- Hu, M.; Wu, Y.; Gao, H.; Bai, Y.; Zhao, S. Improving Aspect Sentiment Quad Prediction via Template-Order Data Augmentation. In Proceedings of the EMNLP 2022, Abu Dhabi, United Arab Emirates, 7–11 December 2022; pp. 7889–7900. [Google Scholar]
- Smíd, J.; Král, P. Cross-lingual aspect-based sentiment analysis: A survey on tasks, approaches, and challenges. Inf. Fusion 2025, 120, 103073. [Google Scholar] [CrossRef]
- Liang, L.; Wang, G.; Lin, C.; Feng, Z. PTE: Prompt tuning with ensemble verbalizers. Expert Syst. Appl. 2025, 262, 125600. [Google Scholar] [CrossRef]
- Gou, Z.; Guo, Q.; Yang, Y. MvP: Multi-View Prompting Improves Aspect Sentiment Tuple Prediction. In Proceedings of the ACL 2023, Toronto, ON, Canada, 9–14 July 2023; Volume 1, pp. 4380–4397. [Google Scholar]
- Xu, G.; Yang, Z.; Xu, B.; Luo, L.; Lin, H. Span-based syntactic feature fusion for aspect sentiment triplet extraction. Inf. Fusion 2025, 120, 103078. [Google Scholar] [CrossRef]
- Huang, C.; Li, X.; Zheng, X.; Du, Y.; Chen, X.; Huang, D.; Fan, Y. Hierarchical and position-aware GCN with external knowledge and prompt learning for aspect-based sentiment analysis. Expert Syst. Appl. 2025, 278, 127290. [Google Scholar] [CrossRef]
- Dubey, G.; Dubey, A.K.; Kaur, K.; Raj, G.; Kumar, P. Adaptive contextual memory graph transformer with domain-adaptive knowledge graph for aspect-based sentiment analysis. Expert Syst. Appl. 2025, 278, 127300. [Google Scholar] [CrossRef]
- Gu, T.; He, Z.; Li, Z.; Wan, Y. Information-assisted and sentiment relation-driven for aspect-based sentiment analysis. Expert Syst. Appl. 2025, 278, 127308. [Google Scholar] [CrossRef]
- Wan, B.; Wu, P.; Han, P.; Li, G. Aspect-based sentiment analysis by knowledge and attention integrated GCN. Appl. Soft Comput. 2025, 171, 112763. [Google Scholar] [CrossRef]
- Yi, Q.; Kong, X.; Zhu, L.; Zhang, C.; Shen, G. DiffuSyn: A Diffusion-Driven Framework with Syntactic Dependency for Aspect Sentiment Triplet Extraction. IEEE Trans. Audio Speech Lang. Process. 2025, 33, 842–854. [Google Scholar] [CrossRef]
- Bao, Y.; Kong, X.; Yi, Q.; Zhang, C.; Zhu, L.; Shen, G. Label-Review-Opinion Generation for Cross-Domain Aspect-Based Sentiment Analysis. IEEE Trans. Audio Speech Lang. Process. 2025, 33, 1604–1605. [Google Scholar] [CrossRef]
- Bu, K.; Liu, Y.; Wang, W.; Cao, Z. PIN: A Prompt-Based Implicit Sentiment Analysis Network for Chinese. In Proceedings of the ICASSP 2025—2025 IEEE International Conference on Acoustics, Speech and Signal Processing, Hyderabad, India, 6–11 April 2025. [Google Scholar]
- Chen, Y.; Yang, G.; Wang, D.; Li, D. Eliciting knowledge from language models with automatically generated continuous prompt instructions. Expert Syst. Appl. 2024, 239, 122327. [Google Scholar] [CrossRef]
- Liang, N.; Liu, Y. DPO: Discrete Prompt Optimization for Vision-Language Models. IEEE Signal Process. Lett. 2025, 32, 671–675. [Google Scholar] [CrossRef]
- Sutton, R.S.; Barto, A.G. RL—An introduction. In Adaptive Computation and Machine Learning; MIT Press: Cambridge, MA, USA, 1998; pp. I–XVIII, 1–322. ISBN 978-0-262-19398-6. [Google Scholar]
- Silver, D.; Huang, A.; Maddison, C.J.; Guez, A.; Sifre, L.; van den Driessche, G.; Schrittwieser, J.; Antonoglou, I.; Panneershelvam, V.; Lanctot, M.; et al. Mastering the game of Go with deep neural networks and tree search. Nature 2016, 529, 484–489. [Google Scholar] [CrossRef] [PubMed]
- Watkins, C.J.C.H.; Dayan, P. Technical Note Q-Learning. Mach. Learn. 1992, 8, 279–292. [Google Scholar] [CrossRef]
- Ranzato, M.; Chopra, S.; Auli, M.; Zaremba, W. Sequence Level Training with Recurrent Neural Networks. In Proceedings of the ICLR (Poster) 2016, San Juan, Puerto Rico, 2–4 May 2016. [Google Scholar]
- Bahdanau, D.; Brakel, P.; Xu, K.; Goyal, A.; Lowe, R.; Pineau, J.; Courville, A.C.; Bengio, Y. An Actor-Critic Algorithm for Sequence Prediction. In Proceedings of the ICLR (Poster) 2017, Toulon, France, 24–26 April 2017. [Google Scholar]
- Shi, Z.; Chen, X.; Qiu, X.; Huang, X. Toward Diverse Text Generation with Inverse RL. In Proceedings of the IJCAI 2018, Stockholm, Sweden, 13–19 July 2018; pp. 4361–4367. [Google Scholar]
- Guo, H.; Tan, B.; Liu, Z.; Xing, E.P.; Hu, Z. Efficient (Soft) Q-Learning for Text Generation with Limited Good Data. In Proceedings of the EMNLP (Findings) 2022, Abu Dhabi, United Arab Emirates, 7–11 December 2022; pp. 6969–6991. [Google Scholar]
- Pontiki, M.; Galanis, D.; Papageorgiou, H.; Androutsopoulos, I.; Manandhar, S.; Al-Smadi, M.; Al-Ayyoub, M.; Zhao, Y.; Qin, B.; Clercq, O.D.; et al. SemEval-2016 Task 5: Aspect Based Sentiment Analysis. In Proceedings of the SemEval@NAACL-HLT 2016, San Diego, CA, USA, 16–17 June 2016; pp. 19–30. [Google Scholar]
- Zhang, W.; Deng, Y.; Li, X.; Bing, L.; Lam, W. Aspect-based Sentiment Analysis in Question Answering Forums. In Proceedings of the EMNLP (Findings) 2021, Punta Cana, Dominican Republic, 7–11 November 2021; pp. 4582–4591. [Google Scholar]
- Cai, H.; Xia, R.; Yu, J. Aspect-Category-Opinion-Sentiment Quadruple Extraction with Implicit Aspects and Opinions. In Proceedings of the ACL/IJCNLP 2021, Bangkok, Thailand, 1–6 August 2021; Volume 1, pp. 340–350. [Google Scholar]
- Xu, L.; Li, H.; Lu, W.; Bing, L. Position-Aware Tagging for Aspect Sentiment Triplet Extraction. In Proceedings of the EMNLP 2020, Punta Cana, Dominican Republic, 8–12 November 2020; Volume 1, pp. 2339–2349. [Google Scholar]
- Wan, H.; Yang, Y.; Du, J.; Liu, Y.; Qi, K.; Pan, J.Z. Target-Aspect-Sentiment Joint Detection for Aspect-Based Sentiment Analysis. In Proceedings of the AAAI 2020, New York, NY, USA, 7–12 February 2020; pp. 9122–9129. [Google Scholar]
- Peng, H.; Xu, L.; Bing, L.; Huang, F.; Lu, W.; Si, L. Knowing What, How and Why: A Near Complete Solution for Aspect-Based Sentiment Analysis. In Proceedings of the AAAI 2020, New York, NY, USA, 7–12 February 2020; pp. 8600–8607. [Google Scholar]
- Pontiki, M.; Galanis, D.; Papageorgiou, H.; Manandhar, S.; Androutsopoulos, I. SemEval-2015 Task 12: Aspect Based Sentiment Analysis. In Proceedings of the SemEval@NAACL-HLT 2015, Denver, CO, USA, 4–5 June 2015; pp. 486–495. [Google Scholar]
- Zhang, W.; Li, X.; Deng, Y.; Bing, L.; Lam, W. Towards Generative Aspect-Based Sentiment Analysis. In Proceedings of the ACL/IJCNLP 2021, Bangkok, Thailand, 1–6 August 2021; Volume 2, pp. 504–510. [Google Scholar]
- Lu, Y.; Liu, Q.; Dai, D.; Xiao, X.; Lin, H.; Han, X.; Sun, L.; Wu, H. Unified Structure Generation for Universal Information Extraction. In Proceedings of the ACL 2022, Dublin, Ireland, 22–27 May 2022; Volume 1, pp. 5755–5772. [Google Scholar]
- Mao, Y.; Shen, Y.; Yang, J.; Zhu, X.; Cai, L. Seq2Path: Generating Sentiment Tuples as Paths of a Tree. In Proceedings of the ACL (Findings) 2022, Dublin, Ireland, 22–27 May 2022; pp. 2215–2225. [Google Scholar]
- Gao, T.; Fang, J.; Liu, H.; Liu, Z.; Liu, C.; Liu, P.; Bao, Y.; Yan, W. LEGO-ABSA: A Prompt-based Task Assemblable Unified Generative Framework for Multi-Task Aspect-Based Sentiment Analysis. In Proceedings of the COLING 2022, Gyeongju, Republic of Korea, 12–17 October 2022; pp. 7002–7012. [Google Scholar]
- Li, X.; Bing, L.; Li, P.; Lam, W. A Unified Model for Opinion Target Extraction and Target Sentiment Prediction. In Proceedings of the AAAI 2019, Honolulu, HI, USA, 27–28 January 2019; pp. 6714–6721. [Google Scholar]
- Lafferty, J.D.; McCallum, A.; Pereira, F.C.N. Conditional Random Fields: Probabilistic Models for Segmenting and Labeling Sequence Data. In Proceedings of the ICML 2001, Williamstown, MA, USA, 28 June–1 July 2001; pp. 282–289. [Google Scholar]
- Bellemare, M.G.; Srinivasan, S.; Ostrovski, G.; Schaul, T.; Saxton, D.; Munos, R. Unifying Count-Based Exploration and Intrinsic Motivation. In Proceedings of the NIPS 2016, Barcelona, Spain, 5–10 December 2016; pp. 1471–1479. [Google Scholar]
- Chen, M.; Chen, G.; Wang, W.; Yang, Y. SEED-GRPO: Semantic Entropy Enhanced GRPO for Uncertainty-Aware Policy Optimization. arXiv 2025, arXiv:2505.12346. [Google Scholar]
- Cheng, D.; Huang, S.; Zhu, X.; Dai, B.; Zhao, W.X.; Zhang, Z.; Wei, F. Reasoning with Exploration: An Entropy Perspective. arXiv 2025, arXiv:2506.14758. [Google Scholar] [CrossRef]
- Zhang, X.; Wen, S.; Wu, W.; Huang, L. EDGE-GRPO: Entropy-Driven GRPO with Guided Error Correction for Advantage Diversity. arXiv 2025, arXiv:2507.21848. [Google Scholar]
- Vanlioglu, A. Entropy-guided sequence weighting for efficient exploration in RL-based LLM fine-tuning. arXiv 2025, arXiv:2503.22456. [Google Scholar]
- Rényi, A. On measures of entropy and information. In Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Contributions to the Theory of Statistics, Berkeley, CA, USA, 20–30 July 1961. [Google Scholar]
- Wang, J.; Liu, J.; Fu, Y.; Li, Y.; Wang, X.; Lin, Y.; Yue, Y.; Zhang, L.; Wang, Y.; Wang, K. Harnessing Uncertainty: Entropy-Modulated Policy Gradients for Long-Horizon LLM Agents. arXiv 2025, arXiv:2509.09265. [Google Scholar]




| Variable Name | Symbol | Description |
|---|---|---|
| Discrete Prompt | p | A sequence of T tokens prepended to the input to steer the LM |
| Prompt Sequence | P | Complete prompt sequence containing t tokens |
| Input Text | x | The input sentence for the task |
| Class Label | l | The ground-truth label for input x from a set L |
| Label Probability | The probability the LM assigns to the true label l | |
| Probability Gap | The difference between the true label’s probability and the highest probability among incorrect labels | |
| Correct Indicator | An indicator function (1 if prediction is correct, 0 otherwise) | |
| Reward Function | The reward signal for the RL agent based on classification performance | |
| Reward Weights | Scaling factors in the reward function to balance correct/incorrect signals. | |
| Policy Network | The parameterized RL policy that generates the prompt tokens | |
| Policy Parameters | The trainable parameters of the policy network (a small MLP) | |
| Vocabulary | The set of all possible tokens from which the prompt is built | |
| Aspect Label Sequence | BIOES label sequence for aspect terms | |
| Opinion Label Sequence | BIOES label sequence for opinion terms | |
| Gold Labels | Gold standard labels for the i-th token | |
| Token-level Reward | Reward measuring single token labeling accuracy | |
| Pair-level Reward | Reward measuring aspect–opinion pairing quality | |
| Sentiment Reward | Reward ensuring sentiment consistency | |
| Reward Weights | Weight coefficients for three-level rewards | |
| Precision | Precision for aspect–opinion pairs | |
| Recall | Recall for aspect–opinion pairs | |
| Training Dataset | D | Collection of training examples |
| Variable Name | Symbol | Description |
|---|---|---|
| Prediction Order | The i-th element prediction order permutation | |
| Order Set | Set of all possible element permutations | |
| Target Sequence | Target sequence constructed according to order | |
| Generation Score | Average conditional generation score for permutation | |
| Predicted Tuple Set | Predicted tuple set generated by order | |
| Indicator Function | Indicator function checking if tuple t is in | |
| Attention Representation | Representation vector after cross-attention | |
| Input Representation | Representation matrix of input text | |
| Aspect Term | a | Specific aspect term |
| Aspect Category | c | Predefined category that aspect belongs to |
| Opinion Term | o | Opinion term expressing sentiment |
| Sentiment Polarity | s | Sentiment polarity (positive/negative/neutral). |
| Element Representation | Text representation of corresponding elements (a: aspect term, c: category, o: opinion term, and s: polarity) | |
| Sentiment Tuple | Sentiment tuple containing all elements |
| Task: OTE |
| Manual Instruction: <S>In this task, you are given a sentence. The task is to extract all the specific words or phrases (opinion targets) that express a sentiment (positive, negative, or neutral) in the sentence. It might be ‘null’ for implicit opinion. |
| LM-SODP: Reviewer Information@@@ [MASK] Features: <S> |
| Task: ATE |
| Manual Instruction: <S>In this task, you are given a sentence. The task is to extract all the specific words or phrases (aspect terms) that represent an attribute or feature of an entity being evaluated in the sentence. List only the extracted words/phrases themselves. |
| LM-SODP: Review tARget@@@ [MASK] Features: <S> |
| Task: ASC |
| Manual Instruction: <S>In this task, you are given a sentence and a specific aspect term within that sentence. The task is to classify the sentiment expressed towards that specific aspect term as “positive”, “negative”, or “neutral”. |
| LM-SODP: <S>Sentiment|||## [ASPECT] @@@Totally => Absolutely[MASK] downright |
| Task: ACD |
| Manual Instruction: <S>In this task, you are given a sentence and a predefined set of aspect categories. The task is to determine which aspect category (or categories) from the predefined set the sentiment expressed in the sentence belongs to. The sentence may not explicitly mention the category name. |
| Predefined Aspect Categories: … |
| LM-SODP: Predefined Aspect Categories: …Category&aspect& <S> » [MASK] reported$$ |
| Task | Dataset | #C | Train (/P/Neu/Neg) | Dev (/P/Neu/Neg) | Test (/P/Neu/Neg) |
|---|---|---|---|---|---|
| ASQP | R15 | 13 | 834 (1005/34/315) | 209 (252/14/81) | 537 (453/37/305) |
| R16 | 13 | 1264 (1369/62/558) | 316 (341/23/143) | 544 (584/40/177) | |
| ACOS | Lap | 121 | 2934 (2583/227/1364) | 326 (279/24/137) | 816 (716/65/380) |
| Rest | 13 | 1530 (1656/95/733) | 171 (180/12/69) | 583 (668/44/205) | |
| ASTE | L14 | – | 906 (817/126/517) | 219 (169/36/141) | 328 (364/63/116) |
| R14 | – | 1266 (1692/166/480) | 310 (404/54/119) | 492 (773/66/155) | |
| R15 | – | 605 (783/25/205) | 148 (185/11/53) | 322 (317/25/143) | |
| R16 | – | 857 (1015/50/329) | 210 (252/11/76) | 326 (407/29/78) | |
| TASD | R15 | 13 | 1120 (1198/53/403) | 10 (6/0/7) | 582 (454/45/346) |
| R16 | 13 | 1708 (1657/101/749) | 29 (23/1/20) | 587 (611/44/204) |
| Task | Dataset | Availability |
|---|---|---|
| ASQP | R15, R16 | https://github.com/IsakZhang/ABSA-QUAD (accessed on 3 March 2025) |
| ACOS | Lap, Rest | https://github.com/NUSTM/ACOS (accessed on 3 March 2025) |
| ASTE | L14, R14, R15, R16 | https://github.com/xuuuluuu/Position-Aware-Tagging-for-ASTE (accessed on 3 March 2025) |
| TASD | R15, R16 | https://github.com/sysulic/TAS-BERT (accessed on 3 March 2025) |
| Task Dataset | ASQP | ACOS | ACSD | |||
|---|---|---|---|---|---|---|
| R15 | R16 | Lap | Rest | R15 | R16 | |
| ChatGPT-Zero shot (gpt-3.5-turbo) | 22.87 | – | – | 27.11 | – | 34.08 |
| ChatGPT-Few shot (gpt-3.5-turbo) | 34.27 | – | – | 37.71 | – | 46.51 |
| ChatGPT-Zero shot (gpt-4) | 35.16 | – | – | 39.64 | – | 46.71 |
| ChatGPT-Few shot (gpt-4) | 45.35 | – | – | 50.33 | – | 68.27 |
| Extract-Classify [37] | 36.42 | 43.77 | 35.80 | 44.61 | – | – |
| GAS [37] | 45.98 | 56.04 | – | – | 60.63 | 68.31 |
| Paraphrase [13] | 46.93 | 57.93 | 43.51 | 61.16 | 63.06 | 71.97 |
| Seq2Path [44] | – | – | 42.97 | 58.41 | 63.89 | 69.23 |
| DLO [14] | 48.18 | 59.79 | 43.64 | 59.99 | 62.95 | 71.79 |
| LEGO-ABSA [45] | 46.10 | 57.60 | – | – | 62.30 | 71.80 |
| SVP (random) [17] | 48.32 | 58.94 | 43.61 | 58.16 | 63.42 | 71.60 |
| SVP (heuristic) [17] | 49.02 | 59.56 | 43.83 | 59.38 | 61.98 | 71.57 |
| SVP (rank) [17] | 48.39 | 58.67 | 43.86 | 59.57 | 62.93 | 71.26 |
| MvP [17] | 51.04 | 60.39 | 43.92 | 61.54 | 64.53 | 72.76 |
| MvP (multi-task) [17] | 52.21 | 58.94 | 43.84 | 60.36 | 64.74 | 70.18 |
| LM-SODP | 54.53 | 62.06 | 46.94 | 63.27 | 66.72 | 73.78 |
| CI | ||||||
| The p-value between LM-SODP and MvP | 0.021 | 0.018 | 0.031 | 0.019 | 0.027 | 0.019 |
| Task Dataset | ASTE | |||
|---|---|---|---|---|
| L14 | R14 | R15 | R16 | |
| ChatGPT-Zero shot (gpt-3.5-turbo) | 36.05 | – | – | – |
| ChatGPT-Few shot (gpt-3.5-turbo) | 38.12 | – | – | – |
| ChatGPT-Zero shot (gpt-4) | 48.51 | 35.14 | 42.35 | 46.75 |
| ChatGPT-Few shot (gpt-4) | 60.42 | 40.58 | 48.35 | 58.45 |
| GAS [37] | 58.19 | 70.52 | 60.23 | 69.05 |
| Paraphrase [13] | 61.13 | 72.03 | 62.56 | 71.70 |
| UIE [43] | 62.94 | 72.55 | 64.41 | 72.86 |
| Seq2Path [44] | 64.82 | 75.52 | 65.88 | 72.87 |
| DLO [14] | 61.46 | 72.39 | 64.26 | 73.03 |
| LEGO-ABSA [45] | 62.20 | 73.70 | 64.40 | 69.90 |
| SVP (random) [17] | 62.36 | 71.64 | 62.31 | 71.59 |
| SVP (heuristic) [17] | 62.09 | 72.61 | 65.29 | 73.27 |
| SVP (rank) [17] | 63.83 | 72.71 | 63.57 | 71.79 |
| MvP [17] | 63.33 | 74.05 | 65.89 | 73.48 |
| MvP (multi-task) [17] | 65.30 | 76.30 | 69.44 | 73.10 |
| LM-SODP | 66.06 | 78.16 | 71.45 | 75.44 |
| CI | ||||
| The p-value between LM-SODP and MvP | 0.022 | 0.033 | 0.026 | 0.025 |
| Task | Methods | 1% | 2% | 5% | 10% | 20% |
|---|---|---|---|---|---|---|
| ASQP (R15) | Paraphrase [13] | 5.90 | 15.73 | 24.16 | 31.33 | 37.47 |
| DLO [14] | 10.03 | 15.94 | 29.13 | 35.89 | 40.34 | |
| MvP [17] | 13.46 | 22.58 | 32.44 | 38.48 | 41.82 | |
| LM-SODP | 14.12 | 24.18 | 34.20 | 40.06 | 43.77 | |
| ACOS (Rest) | Paraphrase [13] | 14.85 | 24.81 | 38.33 | 45.32 | 49.64 |
| DLO [14] | 19.84 | 29.84 | 38.47 | 43.45 | 46.47 | |
| MvP [17] | 23.84 | 32.57 | 42.89 | 47.77 | 53.54 | |
| LM-SODP | 25.62 | 35.10 | 44.98 | 50.01 | 55.33 | |
| TASD (R16) | Paraphrase [13] | 26.29 | 36.70 | 49.48 | 55.66 | 61.79 |
| DLO [14] | 29.66 | 41.17 | 50.44 | 58.27 | 62.43 | |
| MvP [17] | 34.00 | 41.76 | 52.58 | 58.93 | 64.53 | |
| LM-SODP | 34.90 | 42.13 | 53.79 | 60.00 | 65.75 | |
| ASTE (L14) | Paraphrase [13] | 16.29 | 29.20 | 38.61 | 45.20 | 52.88 |
| DLO [14] | 17.07 | 26.07 | 38.92 | 48.85 | 53.82 | |
| MvP [17] | 28.17 | 34.38 | 42.89 | 52.33 | 54.60 | |
| LM-SODP | 30.65 | 36.28 | 44.84 | 55.01 | 56.37 |
| Task | Methods | Transfer Source | 1% | 2% | 5% | 10% | 20% |
|---|---|---|---|---|---|---|---|
| ASQP (R15) | DLO (transfer) [14] | ASTE (R15) | 26.28 | 28.72 | 35.94 | 39.48 | 42.92 |
| MvP (transfer) [17] | 28.69 | 33.93 | 40.08 | 43.10 | 45.09 | ||
| LM-SODP (transfer) | 30.02 | 35.11 | 42.36 | 44.87 | 46.54 | ||
| ACOS (Rest) | DLO (transfer) [14] | ASTE (R16) | 31.06 | 40.55 | 43.23 | 45.74 | 47.98 |
| MvP (transfer) [17] | 39.24 | 42.72 | 49.78 | 52.53 | 55.28 | ||
| LM-SODP (transfer) | 41.08 | 44.07 | 51.26 | 53.98 | 57.09 | ||
| TASD (R16) | DLO (transfer) [14] | ASQP (R16) | 66.25 | 66.21 | 64.54 | 67.99 | 68.50 |
| MvP (transfer) [17] | 68.49 | 68.06 | 68.47 | 68.98 | 69.89 | ||
| LM-SODP (transfer) | 70.11 | 69.30 | 70.21 | 71.16 | 72.35 | ||
| ASTE (L14) | DLO (transfer) † [14] | ASQP (R16) | 44.76 | 48.86 | 51.22 | 56.43 | 56.71 |
| MvP (transfer) † [17] | 48.43 | 50.33 | 54.27 | 56.34 | 59.05 | ||
| LM-SODP (transfer) † | 50.32 | 52.86 | 56.73 | 58.50 | 61.16 |
| Methods | ASTE (L14) | ASQP (R15) | ||||
|---|---|---|---|---|---|---|
| 1% | 10% | 100% | 1% | 10% | 100% | |
| LM-SODP | 29.35 | 54.20 | 66.06 | 14.58 | 41.13 | 54.53 |
| LM-SODP w/o optimized prompt | 28.04 | 51.57 | 63.12 | 13.67 | 38.07 | 50.76 |
| LM-SODP w/o multi prediction (random) | 27.88 | 51.58 | 63.21 | 14.03 | 38.91 | 52.11 |
| LM-SODP w/o multi prediction (heuristic) | 29.14 | 54.07 | 65.94 | 13.92 | 39.11 | 52.37 |
| LM-SODP w/o multi prediction (rank) | 28.15 | 52.61 | 63.49 | 13.86 | 39.08 | 52.24 |
| LM-SODP with different verbalizers | ||||||
| - optimized prompt instruction | 28.29 | 53.47 | 65.63 | 13.25 | 40.79 | 53.84 |
| - manual prompt instruction | 26.11 | 50.15 | 61.47 | 11.61 | 37.16 | 49.37 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Bu, K.; Liu, Y. LM-SODP: Language Model Self-Optimizing Discrete Prompt for Aspect Based Sentiment Analysis. Entropy 2025, 27, 1195. https://doi.org/10.3390/e27121195
Bu K, Liu Y. LM-SODP: Language Model Self-Optimizing Discrete Prompt for Aspect Based Sentiment Analysis. Entropy. 2025; 27(12):1195. https://doi.org/10.3390/e27121195
Chicago/Turabian StyleBu, Kun, and Yuanchao Liu. 2025. "LM-SODP: Language Model Self-Optimizing Discrete Prompt for Aspect Based Sentiment Analysis" Entropy 27, no. 12: 1195. https://doi.org/10.3390/e27121195
APA StyleBu, K., & Liu, Y. (2025). LM-SODP: Language Model Self-Optimizing Discrete Prompt for Aspect Based Sentiment Analysis. Entropy, 27(12), 1195. https://doi.org/10.3390/e27121195

