arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.09688cs.CL
收藏

FreeCtrl:利用前馈层构建控制中心实现免学习可控文本生成

FreeCtrl: Constructing Control Centers with Feedforward Layers for Learning-Free Controllable Text Generation

Nanyang Technological University(南洋理工大学);Singapore-ETH Centre(新加坡-ETH中心);School of Electrical and Electronic Engineering(电气与电子工程学院)

Zijian Feng, Hanzhang Zhou, Zixiao Zhu, Kezhi Mao

AI总结:

本文提出免学习可控文本生成方法 FreeCtrl,通过动态调整大语言模型中属性相关的前馈神经网络向量权重来控制关键词输出概率,在单属性与多属性控制任务上均优于现有方法,兼顾了低学习成本与高性能。

摘要:

可控文本生成(CTG)旨在生成符合特定属性的文本,传统上采用基于学习的技术,如利用属性特定数据集进行训练、微调或前缀微调。这些方法虽然有效,但需要大量的计算和数据资源。相比之下,一些已提出的免学习替代方案虽然绕开了学习过程,但往往效果较差,体现了计算开销与模型效能之间的机器学习基本权衡。为克服这些局限,我们提出 FreeCtrl,一种免学习方法,通过动态调整选定的前馈神经网络(FFN)向量的权重来引导大语言模型(LLM)的输出。FreeCtrl 的核心原理在于:不同 FFN 向量的权重会影响输出中不同 token 出现的可能性。通过识别并自适应地调整与属性相关的 FFN 向量权重,FreeCtrl 能够控制生成内容中属性关键词的输出概率。在单属性和多属性控制上的大量实验表明,免学习的 FreeCtrl 优于其他免学习方法和基于学习的方法,成功解决了学习成本与模型性能之间的两难困境。

英文摘要:

Controllable text generation (CTG) seeks to craft texts adhering to specific attributes, traditionally employing learning-based techniques such as training, fine-tuning, or prefix-tuning with attribute-specific datasets. These approaches, while effective, demand extensive computational and data resources. In contrast, some proposed learning-free alternatives circumvent learning but often yield inferior results, exemplifying the fundamental machine learning trade-off between computational expense and model efficacy. To overcome these limitations, we propose FreeCtrl, a learning-free approach that dynamically adjusts the weights of selected feedforward neural network (FFN) vectors to steer the outputs of large language models (LLMs). FreeCtrl hinges on the principle that the weights of different FFN vectors influence the likelihood of different tokens appearing in the output. By identifying and adaptively adjusting the weights of attribute-related FFN vectors, FreeCtrl can control the output likelihood of attribute keywords in the generated content. Extensive experiments on single- and multi-attribute control reveal that the learning-free FreeCtrl outperforms other learning-free and learning-based methods, successfully resolving the dilemma between learning costs and model performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑