小语言模型通过嵌入几何分析,提升发票分类准确率。
Where A Small Language Model Helps in Invoice Categorisation, Understood Through Embedding Geometry

- 利用嵌入空间几何特性分析财务文本,发现局部同质簇与供应商强相关。
- 单卡微调SBERT达0.96准确率,小样本下对新客户仍保持0.9 F1。
- 揭示人类易读结构未必提升模型性能,适合财务自动化场景应用。
将发票正确归类至通用分类账(GL)代码是财务报告与税务合规的基础,依赖复杂的会计判断:类别取决于采购企业性质、供应商及发票内容。尽管人工智能正广泛应用于自动化任务,基于内部小型语言模型(SLMs)的方案可在降低成本的同时提升数据安全、保密性与可解释性。本文首先分析了小型句向量模型(SBERT)和经典小模型(DeBERTa)在预训练状态下的嵌入几何结构。金融语料的句向量空间整体呈各向异性,但由局部各向同性簇构成,这一发现将此前的词级结论拓展至金融领域的句向量层面,且这些簇与供应商身份高度相关。经单块GPU微调后,SBERT在发票分类任务中达到0.96准确率,优于零样本大模型和仅基于供应商身份的基线模型,并显著提升小规模、难分类类别及新客户的性能。在泛化问题上,仅需约100条客户专属发票即可使SBERT实现0.9的F1值,表明内建小模型方案极具潜力。结合几何分析进一步发现,预训练嵌入结构与分类性能密切相关,且出现反直觉现象:对人类有益的结构化输入并未提升小模型表现。
原文摘要 · Abstract (English)
Categorising invoices into the correct General Ledger (GL) code underpins financial reporting and tax compliance. This is a skilled accounting judgement rather than a routine task: the correct category depends subtly on the nature of the purchasing business, the vendor and the invoice text. Whilst AI is increasingly being adopted across industries to automate tasks, including invoice categorisation, implementations built on in-house small language models (SLMs) can simultaneously reduce cost and improve data security, confidentiality, and interpretability. We investigate this approach by first analysing the pre-trained embedding geometry of a small sentence transformer (SBERT) and classic SLM (DeBERTa). The sentence-embedding space of this financial corpus is globally anisotropic but composed of locally isotropic clusters, extending prior token-level findings to sentence embeddings in a financial setting, and these clusters are strongly correlated with the vendor identity. SBERT fine-tuned on a single GPU reaches 0.96 accuracy on invoice classification, above both a zero-shot LLM and a vendor identity baseline, increasing performance for smaller, challenging categories and new clients. For this important generalisation problem, SBERT reaches 0.9 F1 with roughly 100 client-specific invoices, showing that an in-house SLM implementation is promising. Combining these results with geometric analysis shows that pre-trained embedding geometry is associated with classification performance and reveals a counterintuitive finding that a structured input that would help a human reader does not improve the SLM performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。