Cost-Efficient Strategies for Production Indonesian Sentiment Analysis: Open-Source Models, Commercial LLMs, and Hybrid Pipelines

Authors

  • Ridwan Ilyas Informatics Department, Faculty of Science and Informatics, Universitas Jenderal Achmad Yani, Indonesia
  • Mochammad Arif Bijaksana School of Computing, Telkom University, Indonesia

DOI:

https://doi.org/10.52436/1.jutif.2026.7.5.6297

Keywords:

cost-efficiency, IndoBERT, Indonesian sentiment analysis, knowledge distillation, large language models, model routing

Abstract

Production sentiment analysis for Indonesian must balance accuracy against operating cost, yet prior work benchmarks accuracy in isolation. This study aims to quantify how much accuracy is purchased per unit of monetary cost across three pipeline families, and to test whether hybrid pipelines can approach large language model accuracy at a fraction of the cost. We fine-tune four open-source encoders (IndoBERT-base, IndoBERT-large with Low-Rank Adaptation, IndoBERTweet, and IndoBERT-lite), evaluate four commercial large language model arms (Claude Haiku, Sonnet, and Opus under zero-shot and few-shot prompting), and build three hybrid pipelines—confidence routing, uncertainty cascading, and knowledge distillation—on four Indonesian sentiment datasets (SmSA, NusaX, UGM Twitter, and ID-SMSA). Accuracy is measured by Macro-F1 over three seeds, cost by a per-1,000-prediction model, and differences by McNemar's test with bootstrap confidence intervals. Paying for a large language model is statistically significant on only one of four datasets: on SmSA the best open-source encoder reaches 0.924 against 0.966 for Sonnet, whereas on the noisy UGM corpus the free encoder (0.708) significantly outperforms every paid model (≤0.651, p<0.001). Confidence routing is the consistent winner, reaching 0.947 on SmSA at only US$0.18 per 1,000 predictions—about 98% of full-model accuracy at one-ninth of the cost—and surpassing both pure endpoints on three of four datasets. The contribution is a statistically grounded, reproducible decision framework for selecting sentiment pipelines in low-resource languages that specifies when paying for large language models is justified and when free fine-tuned encoders suffice.

Downloads

Download data is not yet available.

References

S. Kemp, "Digital 2025: Indonesia," DataReportal, Feb. 2025. [Online]. Available: https://datareportal.com/reports/digital-2025-indonesia

B. Wilie et al., "IndoNLU: Benchmark and resources for evaluating Indonesian natural language understanding," in Proc. 1st Conf. Asia-Pacific Chapter Assoc. Comput. Linguistics and 10th Int. Joint Conf. Natural Lang. Process., 2020, pp. 843–857.

G. I. Winata et al., "NusaX: Multilingual parallel sentiment dataset for 10 Indonesian local languages," in Proc. 17th Conf. Eur. Chapter Assoc. Comput. Linguistics (EACL), 2023, pp. 815–834, doi: 10.18653/v1/2023.eacl-main.57.

A. F. Aji et al., "One country, 700+ languages: NLP challenges for underrepresented languages and dialects in Indonesia," in Proc. 60th Annu. Meeting Assoc. Comput. Linguistics (ACL), 2022, pp. 7226–7249, doi: 10.18653/v1/2022.acl-long.500.

S. Cahyawijaya et al., "NusaCrowd: Open source initiative for Indonesian NLP resources," in Findings Assoc. Comput. Linguistics: ACL 2023, 2023, pp. 13745–13818, doi: 10.18653/v1/2023.findings-acl.868.

A. F. Hidayatullah, "Code-mixed sentiment analysis on Indonesian-Javanese-English text using transformer models," in Proc. 8th Int. Conf. Inf. Technol., Inf. Syst. Elect. Eng. (ICITISEE), 2024, pp. 340–345, doi: 10.1109/ICITISEE63424.2024.10730138.

H. Ahmadian, T. F. Abidin, H. Riza, and K. Muchtar, "Hybrid models for emotion classification and sentiment analysis in Indonesian language," Appl. Comput. Intell. Soft Comput., vol. 2024, art. 2826773, 2024, doi: 10.1155/2024/2826773.

J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, "BERT: Pre-training of deep bidirectional transformers for language understanding," in Proc. NAACL-HLT, 2019, pp. 4171–4186, doi: 10.18653/v1/N19-1423.

F. Koto, J. H. Lau, and T. Baldwin, "IndoBERTweet: A pretrained language model for Indonesian Twitter with effective domain-specific vocabulary initialization," in Proc. Conf. Empirical Methods Natural Lang. Process. (EMNLP), 2021, pp. 10660–10668, doi: 10.18653/v1/2021.emnlp-main.833.

T. B. Brown et al., "Language models are few-shot learners," in Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 33, 2020, pp. 1877–1901.

S. Gretz et al., "Zero-shot topical text classification with large language models — an experimental study," in Findings Assoc. Comput. Linguistics: EMNLP 2023, 2023, pp. 9647–9676, doi: 10.18653/v1/2023.findings-emnlp.647.

F. Gilardi, M. Alizadeh, and M. Kubli, "ChatGPT outperforms crowd workers for text-annotation tasks," Proc. Nat. Acad. Sci. U.S.A., vol. 120, no. 30, art. e2305016120, 2023, doi: 10.1073/pnas.2305016120.

R. Zhang, Y. Li, Y. Ma, M. Zhou, and L. Zou, "LLMaAA: Making large language models as active annotators," in Findings Assoc. Comput. Linguistics: EMNLP 2023, 2023, pp. 13088–13103, doi: 10.18653/v1/2023.findings-emnlp.872.

X. He et al., "AnnoLLM: Making large language models to be better crowdsourced annotators," in Proc. NAACL-HLT (Industry Track), 2024, pp. 165–190, doi: 10.18653/v1/2024.naacl-industry.15.

L. Chen, M. Zaharia, and J. Zou, "FrugalGPT: How to use large language models while reducing cost and improving performance," Trans. Mach. Learn. Res. (TMLR), Dec. 2024.

I. Ong et al., "RouteLLM: Learning to route LLMs from preference data," in Proc. 13th Int. Conf. Learn. Representations (ICLR), 2025.

D. Ding et al., "Hybrid LLM: Cost-efficient and quality-aware query routing," in Proc. 12th Int. Conf. Learn. Representations (ICLR), 2024.

N. Pangakis and S. Wolken, "Knowledge distillation in automated annotation: Supervised text classification with LLM-generated training labels," in Proc. 6th Workshop Natural Lang. Process. Comput. Social Sci. (NLP+CSS), 2024, pp. 113–131, doi: 10.18653/v1/2024.nlpcss-1.9.

Y.-J. Lin, K.-Y. Chen, and H.-Y. Kao, "LAD: Layer-wise adaptive distillation for BERT model compression," Sensors, vol. 23, no. 3, art. 1483, 2023, doi: 10.3390/s23031483.

X. Zhu, J. Li, Y. Liu, C. Ma, and W. Wang, "A survey on model compression for large language models," Trans. Assoc. Comput. Linguistics (TACL), vol. 12, pp. 1556–1577, 2024, doi: 10.1162/tacl_a_00704.

W. Kwon et al., "Efficient memory management for large language model serving with PagedAttention," in Proc. 29th ACM Symp. Operating Syst. Principles (SOSP), 2023, pp. 611–626, doi: 10.1145/3600006.3613165.

C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, "On calibration of modern neural networks," in Proc. 34th Int. Conf. Mach. Learn. (ICML), 2017, pp. 1321–1330.

M. Xiong et al., "Can LLMs express their uncertainty? An empirical evaluation of confidence elicitation in LLMs," in Proc. 12th Int. Conf. Learn. Representations (ICLR), 2024.

A. Paleyes, R.-G. Urma, and N. D. Lawrence, "Challenges in deploying machine learning: A survey of case studies," ACM Comput. Surv., vol. 55, no. 6, pp. 1–29, 2022, doi: 10.1145/3533378.

A. H. Nasution, A. Onan, Y. Murakami, W. Monika, and A. Hanafiah, "Benchmarking open-source large language models for sentiment and emotion classification in Indonesian tweets," IEEE Access, vol. 13, pp. 94009–94025, 2025, doi: 10.1109/ACCESS.2025.3574629.

W. Zhang, X. Li, Y. Deng, L. Bing, and W. Lam, "A survey on aspect-based sentiment analysis: Tasks, methods, and challenges," IEEE Trans. Knowl. Data Eng., vol. 35, no. 11, pp. 11019–11038, 2023, doi: 10.1109/TKDE.2022.3230975.

A. M. Sopian, R. Ilyas, F. Kasyidi, and A. I. Hadiana, "SAER: Comparison of rule prediction algorithms on constructing a corpus for taxation-related tweet aspect-based sentiment analysis," J. Online Inform. (JOIN), vol. 9, no. 1, 2024, doi: 10.15575/join.v9i1.1275.

I. Tanjung, R. Ilyas, and Melina, "Semantic classification of sentences using SMOTE and BiLSTM," Int. J. Quant. Res. Model., vol. 5, no. 3, 2024, doi: 10.46336/ijqrm.v5i3.750.

M. T. Ramadhan, F. R. Umbara, and R. Ilyas, "Klasifikasi sentimen kebohongan berita menggunakan metode IndoBERT," J. Sosial dan Sains, vol. 5, no. 8, 2025, doi: 10.59188/jurnalsosains.v5i8.32425.

E. J. Hu et al., "LoRA: Low-rank adaptation of large language models," in Proc. 10th Int. Conf. Learn. Representations (ICLR), 2022.

R. Ferdiana, F. Jatmiko, D. D. Purwanti, A. S. T. Ayu, and W. F. Dicka, "Dataset Indonesia untuk analisis sentimen," J. Nas. Tek. Elektro dan Teknol. Inf. (JNTETI), vol. 8, no. 4, pp. 334–339, 2019, doi: 10.22146/jnteti.v8i4.533.

J. Hartanto, T. Liundi, R. Sutoyo, and E. W. Andangsari, "ID-SMSA: Indonesian stock market dataset for sentiment analysis," Data in Brief, vol. 60, art. 111571, 2025, doi: 10.1016/j.dib.2025.111571.

T. G. Dietterich, "Approximate statistical tests for comparing supervised classification learning algorithms," Neural Comput., vol. 10, no. 7, pp. 1895–1923, 1998, doi: 10.1162/089976698300017197.

Additional Files

Published

2026-10-10

How to Cite

[1]
R. Ilyas and M. . Arif Bijaksana, “Cost-Efficient Strategies for Production Indonesian Sentiment Analysis: Open-Source Models, Commercial LLMs, and Hybrid Pipelines”, J. Tek. Inform. (JUTIF), vol. 7, no. 5, pp. 5245–5258, Oct. 2026.