arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.03099cs.CLcs.LG
收藏

基于微调大语言模型和句子袋的主题建模

Topic Modeling with Fine-tuning LLMs and Bag of Sentences

University of Liechtenstein(列支敦士登大学)

Johannes Schneider

AI总结:

本文提出FT-Topic方法,通过自动构建训练数据集并结合SenClu方法实现高效主题建模。

摘要:

大型语言模型(LLMs)越来越多地被用于主题建模,其性能优于传统的主题模型如LDA。通常,预训练的LLM编码器如BERT被直接使用,尽管微调已被证明能显著提升LLM的性能。挑战在于获得适合微调的标注数据集。在本文中,我们基于最近使用句子袋作为计算主题的单元的思路。基于这一思路,我们推导出一种称为FT-Topic的方法,用于执行无监督微调,主要依赖两个步骤来自动构建训练数据集。首先,一种启发式方法识别出被假设为同一主题或不同主题的句子组对。其次,我们移除可能被错误标记的句子对。所得到的数据集随后用于微调一个编码器LLM,该模型可以被任何使用嵌入的主题建模方法所利用。在本工作中,我们通过推导一种新的最先进的主题建模方法SenClu来证明其有效性。该方法通过期望最大化算法实现快速推理,并允许用户将句子组分配给单一主题,同时允许用户编码关于主题-文档分布的先验知识。代码可在https://github.com/JohnTailor/FT-Topic上获得。

英文摘要:

Large language models (LLMs) are increasingly used for topic modeling, outperforming classical topic models such as LDA. Commonly, pre-trained LLM encoders such as BERT are used out-of-the-box despite the fact that fine-tuning is known to improve LLMs considerably. The challenge lies in obtaining a suitable labeled dataset for fine-tuning. In this paper, we build on the recent idea of using bags of sentences as the elementary unit for computing topics. Based on this idea, we derive an approach called FT-Topic to perform unsupervised fine-tuning, relying primarily on two steps for constructing a training dataset in an automatic fashion. First, a heuristic method identifies pairs of sentence groups that are assumed to belong either to the same topic or to different topics. Second, we remove sentence pairs that are likely labeled incorrectly. The resulting dataset is then used to fine-tune an encoder LLM, which can be leveraged by any topic modeling approach that uses embeddings. In this work, we demonstrate its effectiveness by deriving a novel state-of-the-art topic modeling method called SenClu. The method achieves fast inference through an expectation-maximization algorithm and hard assignments of sentence groups to a single topic, while allowing users to encode prior knowledge about the topic-document distribution. Code is available at https://github.com/JohnTailor/FT-Topic

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

↑