Abstract
LabelFusion is a fusion ensemble for text classification that learns to combine a traditional transformer-based classifier (e.g., RoBERTa) with one or more Large Language Models (LLMs such as OpenAI GPT, Google Gemini, or DeepSeek) to deliver accurate and cost-aware predictions across multi-class and multi-label tasks. The package provides a simple high-level interface (AutoFusionClassifier) that trains the full pipeline end-to-end with minimal configuration, and a flexible API for advanced users. Under the hood, LabelFusion integrates vector signals from both sources by concatenating the ML backbone's embeddings with the LLM-derived per-class scores -- obtained through structured prompt-engineering strategies -- and feeds this joint representation into a compact multi-layer perceptron (FusionMLP) that produces the final prediction. This learned fusion approach captures complementary strengths of LLM reasoning and traditional transformer-based classifiers, yielding robust performance across domains -- achieving 92.4% accuracy on AG News and 92.3% on 10-class Reuters 21578 topic classification -- while enabling practical trade-offs between accuracy, latency, and cost.
Abstract (translated)
LabelFusion 是一种用于文本分类的融合集成方法,它能够学习将传统的基于变压器的分类器(例如 RoBERTa)与一个或多个大型语言模型(LLM,如 OpenAI GPT、Google Gemini 或 DeepSeek)结合在一起,以在多类和多标签任务中提供准确且成本意识强的预测。该软件包提供了简单易用的高级接口 (AutoFusionClassifier),可以进行端到端的完整流水线训练,并需要最少的配置;同时,它还为高级用户提供了一个灵活的 API。 从内部机制来看,LabelFusion 通过将机器学习骨干模型(ML backbone)的嵌入与大型语言模型(LLM)生成的每个类别的得分相连接来整合来自两个来源向量信号——这些得分是通过结构化提示工程策略获得的。然后将这种联合表示输入到一个紧凑的多层感知器(FusionMLP)中,以产生最终预测结果。 这种方法通过学习融合能够捕捉大型语言模型推理和传统基于变压器分类器各自的优势,在多个领域中均表现出稳健性能——在 AG News 数据集上达到了 92.4% 的准确率,在包含十个类别的 Reuters 21578 主题分类数据集上则为 92.3%,同时还能实现准确性、延迟和成本之间的实用权衡。
URL
https://arxiv.org/abs/2512.10793