Role-playing is essential for leveraging large language models as it enhances user interactions, making the models more relatable and engaging. This is typically achieved through carefully crafted prompts for closed-source models or fine-tuning open-source models with specific style instructions. We propose a novel method called the Style Weight Language Model (SWLM), which extracts stylistic features from target roles and expresses styles through dialogue. Specifically, we first fine-tune the language model using a widely available instruction dataset. Next, we extract the desired role features using a mixed corruption strategy and store them in specific Style Weight Increments, which are injected into non-style models as representations of the desired style. To balance instructions and style, we also group and train Task Weight Increments for instructions. Experimental results demonstrate that SWLM reduces input token length and API consumption compared to prompt methods. Additionally, SWLM decouples instructions from style, reducing reliance on high-quality datasets. Remarkably, using only unsupervised role datasets, SWLM performs comparably to methods fine-tuned with style instruction sets while offering greater scalability. By enhancing the fluidity of interactions and minimizing resource consumption, SWLM represents a significant advancement in role-playing applications.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Role-Playing Based on Large Language Models via Style Extraction

  • Chunzhen Jin,
  • Peng Cao,
  • Osmar Zaïane

摘要

Role-playing is essential for leveraging large language models as it enhances user interactions, making the models more relatable and engaging. This is typically achieved through carefully crafted prompts for closed-source models or fine-tuning open-source models with specific style instructions. We propose a novel method called the Style Weight Language Model (SWLM), which extracts stylistic features from target roles and expresses styles through dialogue. Specifically, we first fine-tune the language model using a widely available instruction dataset. Next, we extract the desired role features using a mixed corruption strategy and store them in specific Style Weight Increments, which are injected into non-style models as representations of the desired style. To balance instructions and style, we also group and train Task Weight Increments for instructions. Experimental results demonstrate that SWLM reduces input token length and API consumption compared to prompt methods. Additionally, SWLM decouples instructions from style, reducing reliance on high-quality datasets. Remarkably, using only unsupervised role datasets, SWLM performs comparably to methods fine-tuned with style instruction sets while offering greater scalability. By enhancing the fluidity of interactions and minimizing resource consumption, SWLM represents a significant advancement in role-playing applications.