基于微调 LLM 和句子包的主题建模
计算与语言
2026-02-23 v2 机器学习
摘要
大型语言模型(LLM)越来越多地用于主题建模,优于诸如 LDA 等经典主题模型。通常,使用预训练的 LLM 编码器如 BERT 直接使用,尽管已知微调能显著改善 LLM。挑战在于获得适合微调的合适标注数据集。本文基于最近的想法,即将句子包作为计算主题的基本单元。基于这一想法,我们推导出一种称为 FT-Topic 的方法,通过两个步骤自动构建训练数据集。首先,一种启发式方法识别被假设属于相同主题或不同主题的句子组对。其次,我们移除可能被错误标注的句子对。 resulting 数据集 then 被用于微调一个编码器 LLM,可以被任何使用嵌入的主题建模方法所利用。在本文中,我们通过推导出一种称为 SenClu 的新型 state-of-the-art 主题建模方法来演示其有效性。该方法通过期望最大化算法实现快速推断并对句子组进行硬分配到单个主题,同时允许用户编码关于主题-文档分布的先验知识。代码可在 https://github.com/JohnTailor/FT-Topic 获取。
引用
@article{arxiv.2408.03099,
title = {Topic Modeling with Fine-tuning LLMs and Bag of Sentences},
author = {Johannes Schneider},
journal= {arXiv preprint arXiv:2408.03099},
year = {2026}
}
备注
This is the submitted journal version of enhanced with the novel fine-tuning part of "Efficient and Flexible Topic Modeling using Pretrained Embeddings and Bag of Sentences'' which appeared at the International Conference on Agents and Artificial Intelligence(ICAART) in 2024