用有限状态机历史引导大模型生成更多样化的结构化输出
Automata-Based Steering of Large Language Models for Diverse Structured Generation
- 基于状态机遍历历史动态引导大模型探索新结构模式
- 在保持生成效率的前提下,结构与内容多样性显著提升
- 适合需要多样化输出的测试用例生成等场景
大型语言模型(LLMs)被越来越多地用于生成结构化输出。尽管现有结构化生成方法能保证输出有效性,但往往缺乏多样性,这一局限性在我们的初步研究中得到证实。本文提出一种新方法,通过利用状态机遍历历史来引导大模型生成新颖的结构模式,以增强多样性。实验结果表明,该方法在维持相近生成效率的同时,显著提升了结构和内容多样性。此外,我们通过案例研究展示了该方法在生成开源库测试用例方面的有效性。
原文摘要 · Abstract (English)
Large language models (LLMs) are increasingly tasked with generating structured outputs. While structured generation methods ensure validity, they often lack output diversity, a critical limitation that we confirm in our preliminary study. We propose a novel method to enhance diversity in automaton-based structured generation. Our approach utilizes automata traversal history to steer LLMs towards novel structural patterns. Evaluations show our method significantly improves structural and content diversity while maintaining comparable generation efficiency. Furthermore, we conduct a case study showcasing the effectiveness of our method in generating diverse test cases for testing open-source libraries.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。