CharPoet: A Chinese Classical Poetry Generation System Based on Token-free LLM

📄 arXiv: 2401.03512v3 📥 PDF

作者: Chengyue Yu, Lei Zang, Jiaotuan Wang, Chenyi Zhuang, Jinjie Gu

分类: cs.CL, cs.AI, cs.LG

发布日期: 2024-01-07 (更新: 2024-03-20)


💡 一句话要点

提出CharPoet以解决中国古典诗歌生成中的格式与内容控制问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 古典诗歌生成 无token LLM 格式控制 内容生成 自然语言处理

📋 核心要点

  1. 现有的自动生成中国古典诗歌的方法在格式和内容的控制上存在显著不足,传统系统依赖关键词输入,导致灵活性不足。
  2. 本文提出CharPoet,一个基于无token LLM的诗歌生成系统,通过字符级生成方式实现对格式和内容的精确控制。
  3. 实验结果表明,CharPoet在格式准确性上超过0.96,显著优于现有的Jiuge-GPT-2和GPT-4,同时在内容质量上也表现优异。

📝 摘要(中文)

自动生成中国古典诗歌引起了广泛的研究兴趣,但在格式与内容的有效控制上仍面临挑战。传统系统通常依赖关键词输入,导致内容控制有限。大型语言模型(LLMs)通过允许不受限制的用户指令改善内容控制,但逐字生成过程常常导致格式错误。为此,本文提出了基于无token LLM的CharPoet系统,能够在字符级别生成,从而实现对字符数量的精确控制。CharPoet在格式准确性上超过0.96,优于Jiuge-GPT-2(0.91)和GPT-4(0.38),在内容质量上超越传统系统,且与其他LLMs相当。该系统开源,提供了视频演示。

🔬 方法详解

问题定义:本文旨在解决中国古典诗歌生成中格式与内容控制的难题。现有方法多依赖关键词输入,导致生成内容的灵活性和准确性不足,尤其在格式方面容易出错。

核心思路:CharPoet通过无token的字符级生成方式,允许用户对生成的诗歌进行更精确的控制。这种设计使得系统能够在生成过程中保持格式的一致性,同时满足用户的内容需求。

技术框架:CharPoet的整体架构包括输入处理模块、字符生成模块和输出格式化模块。输入处理模块接收用户指令,字符生成模块基于无token LLM进行逐字符生成,输出格式化模块确保生成内容符合古典诗歌的格式要求。

关键创新:CharPoet的主要创新在于其无token生成机制,这一机制使得系统在字符级别上进行控制,显著提高了格式准确性,与传统的token生成方法相比,避免了逐字生成带来的格式错误。

关键设计:在设计中,CharPoet采用了预训练的LLM作为基础,结合特定的损失函数来优化格式和内容的生成。此外,系统在字符生成过程中引入了动态调整机制,以适应不同的用户需求和诗歌风格。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

CharPoet在格式准确性上达到了0.96,显著优于Jiuge-GPT-2的0.91和GPT-4的0.38,显示出其在格式控制方面的卓越性能。此外,CharPoet在内容质量上超越了传统生成系统,展现出与其他大型语言模型相当的生成能力。

🎯 应用场景

CharPoet的潜在应用场景包括教育、文化传播和创意写作等领域。它可以帮助学生学习古典诗歌的创作技巧,促进传统文化的传承。同时,该系统的开源特性也为研究者提供了一个良好的平台,推动相关领域的进一步研究与发展。

📄 摘要(原文)

Automatic Chinese classical poetry generation has attracted much research interest, but achieving effective control over format and content simultaneously remains challenging. Traditional systems usually accept keywords as user inputs, resulting in limited control over content. Large language models (LLMs) improve content control by allowing unrestricted user instructions, but the token-by-token generation process frequently makes format errors. Motivated by this, we propose CharPoet, a Chinese classical poetry generation system based on token-free LLM, which provides effective control over both format and content. Our token-free architecture generates in a character-by-character manner, enabling precise control over the number of characters. Pruned from existing token-based LLMs, CharPoet inherits their pretrained capabilities and can generate poetry following instructions like "Write me a poem for my mother's birthday." CharPoet achieves format accuracy above 0.96, outperforming Jiuge-GPT-2 (0.91) and GPT-4 (0.38). In terms of content quality, CharPoet surpasses traditional systems including Jiuge, and is comparable to other LLMs. Our system is open source and available at https://modelscope.cn/models/CharPoet/CharPoet. A video demonstration of CharPoet is available at https://youtu.be/voZ25qEp3Dc.