Research Article

A L ightweight LLM- B ased M ethod for G enerating G ame NPC D ialogues, F ocusing on R ole C onsistency and T ask E xecution

Haocheng Li*
University of Shanghai for Science and Technology

* Corresponding author: [email protected]

Abstract

The big language model can improve the degree of freedom of the game NPC dialogue, but the lightweight model may still have problems such as role tone distortion, knowledge crossover, and task information omission in a specific worldview. This paper is based on Qwen3-1.7 B-Instruct for 6 GB local devices, using QLoRA to fine-tune the domain, and using dynamic constraint prompts to coordinate the six dimensions of role, world state, scene, task, historical dialogue, and player input. The text of 875 empty knights was cleaned and structured, and 4375 samples were obtained after enhancement, including 440 test sets. The evaluation system includes BLEU, ROUGE, Distinct, generative behavior, and LLM-as-a-Judge. The BLEU and ROUGE of the candidate model lr-5e5-epoch2 are higher than the benchmark model current-reference, but the average output is longer, and the EOS termination rate and Distinct are significantly reduced. DeepSeek Judge completed the analysis of 440 pairs of responses and preferred the benchmark model in the non-parlement sample with a winning rate of 55.71 % to 44.29 %. The results show that the improvement of reference similarity does not necessarily bring about the simultaneous improvement of role consistency and generation stability, and multi-dimensional evaluation helps to make a choice between task fit and role robustness.

Keywords: Game NPC Conversation; QLoRA; Dynamic constraint prompt; Role consistency; LLM-as-a-Judge
Published: October 27, 2026
DOI: 10.54254/2755-2721/2026.38166
Volume: ACE Vol.264
pp. 208-218
Download PDF

References

  1. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., & Polosukhin, I. (2017). Attention is all you need.Advances in Neural Information Processing Systems, 30. https://doi.org/10.48550/arXiv.1706.03762
  2. Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2022). LoRA: Low-rank adaptation of large language models.International Conference on Learning Representations. https://doi.org/10.48550/arXiv.2106.09685
  3. Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023). QLoRA: Efficient finetuning of quantized LLMs.Advances in Neural Information Processing Systems, 36, 10088-10115. https://doi.org/10.48550/arXiv.2305.14314
  4. Qwen Team. (2025, April 29). Qwen3: Think deeper, act faster. https://qwenlm.github.io/blog/qwen3/
  5. Gao, Q. C., & Emami, A. (2023). The Turing quest: Can transformers make good NPCs? InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop)(pp. 93-103). https://doi.org/10.18653/v1/2023.acl-srw.17
  6. Weir, N., Thomas, R., D'Amore, R., & Van Durme, B. (2024). Ontologically faithful generation of non-player character dialogues. InProceedings of the 2024 Conference on Empirical Methods in Natural Language Processing(pp. 9212-9242). https://doi.org/10.18653/v1/2024.emnlp-main.520
  7. Sadeq, N., Xie, Z., Kang, B., et al. (2024). Mitigating hallucination in fictional character role-play. InFindings of the Association for Computational Linguistics: EMNLP 2024(pp. 14467-14479). https://doi.org/10.18653/v1/2024.findings-emnlp.846
  8. Tu, Q., Fan, S., Tian, Z., et al. (2024). CharacterEval: A Chinese benchmark for role-playing conversational agent evaluation. InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)(pp. 11836-11850). https://doi.org/10.18653/v1/2024.acl-long.638
  9. Papineni, K., Roukos, S., Ward, T., & Zhu, W. J. (2002). BLEU: A method for automatic evaluation of machine translation. InProceedings of the 40th Annual Meeting of the Association for Computational Linguistics(pp. 311-318). https://doi.org/10.3115/1073083.1073135
  10. Lin, C. Y. (2004). ROUGE: A package for automatic evaluation of summaries. InText Summarization Branches Out(pp. 74-81).
  11. Zheng, L., Chiang, W. L., Sheng, Y., et al. (2023). Judging LLM-as-a-judge with MT-Bench and Chatbot Arena.Advances in Neural Information Processing Systems, 36, 46595-46623. https://doi.org/10.48550/arXiv.2306.05685
  12. Liu, Y., Iter, D., Xu, Y., Wang, Z., Zhu, S., & Zeng, M. (2023). G-Eval: NLG evaluation using GPT-4 with better human alignment. InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing(pp. 2511-2522). https://doi.org/10.18653/v1/2023.emnlp-main.153
  13. Van Nest, J. (2026, January 13). HollowKnightTextDatabase [Data set].GitHub. https://github.com/SAM-stack-star/HollowKnightTextDatabase