Enhancing text quality evaluation with integrating content security attributes
With the rapid development of large language models (LLMs), the problem of generating unsecure and illegal content has become increasingly severe. Therefore, it is especially important to evaluate the security and compliance of content generated by LLMs for natural language generation (NLG) methods. Existing NLG evaluation methods primarily focus on textual quality (e.g., coherence, informativeness, and fluency) while overlooking content security attributes (e.g., pornography, advertising, or abuse). To address this gap, we propose a novel evaluation method, TotalScore , that not only integrates content security considerations but also enhances the assessment of text quality. Specifically, TotalScore comprises two parts: SecuScore and TextScore. SecuScore calculates the semantic cosine similarity between generated text and a collection of content security texts, leveraging a refined semantic similarity extraction method that captures multi-level semantic information from both local and global modules. Meanwhile, TextScore improves the evaluation of textual quality by combining a fine-tuned encoder–decoder model with a Term Frequency (TF) factor. Experimental results demonstrate that TotalScore outperforms existing approaches in textual quality evaluation and surpasses GPT-2 and GPT-3.5 in identifying content security risks. To our best knowledge, TotalScore is the first metric to integrate content security attributes into NLG evaluation, addressing the shortcomings of current methods by providing a comprehensive and reliable assessment that ensures alignment between text quality and content security in generated text. • Proposed TotalScore, a new comprehensive metric for evaluating NLG. • Developed SecuScore to evaluate content security through semantic similarity. • Introduced TextScore, exceeding current methods in assessing text quality.
Authors
- Juan Zhao (ORCID: https://orcid.org/0000-0002-0518-625X)
- Yudao Sun
Publication Details
- Journal
- Expert Systems with Applications
- Published
- 2025-03-22
- DOI
- https://doi.org/10.1016/j.eswa.2025.127234
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Peng Cheng Laboratory
- Chang'an University
- Fundamental Research Funds for the Central Universities