arXiv:2512.14604stat.MLcs.LG2025-12

用大模型+函数分析,从稀疏文本中发现异常与模式

LLmFPCA-detect: LLM-powered Multivariate Functional PCA for Anomaly Detection in Sparse Longitudinal Texts

  • 用LLM将文本转为数值向量,再用多变量函数主成分分析提取核心特征
  • 在亚马逊评论和维基对话流上验证,比现有方法更准地识别异常与聚类
  • 适合做长时文本分析的科研人员和需要用户行为洞察的产品团队

稀疏纵向(SL)文本数据源于个体随时间反复生成文本(如客户评论、偶尔社交帖子、就诊电子病历),但观测频率和时间点在个体间差异显著。这类数据潜力巨大,但因缺乏专用方法且噪声多、异质性强、易含异常,模式挖掘困难。我们提出LLmFPCA-detect框架,结合大模型文本嵌入与函数数据分析,实现大规模SL文本数据的聚类发现与异常检测。首先,通过定制化LLM提示词将每段文本映射至特定数值空间;随后在该空间中进行稀疏多变量函数主成分分析(mFPCA),恢复群体主要特征,并生成个体层面得分。这些得分结合静态协变量,用于数据分段、无监督异常检测与推断,支持下游任务。特别地,利用LLM对分段与异常结果动态提取关键词;实验表明,基于聚类特异性函数主成分得分作为特征,可提升现有预测模型性能。我们在亚马逊客户评论轨迹与维基讨论页评论流两个公开数据集上验证框架稳定性与跨域适用性,表现优于当前最优基线。

原文摘要 · Abstract (English)

Sparse longitudinal (SL) textual data arises when individuals generate text repeatedly over time (e.g., customer reviews, occasional social media posts, electronic medical records across visits), but the frequency and timing of observations vary across individuals. These complex textual data sets have immense potential to inform future policy and targeted recommendations. However, because SL text data lack dedicated methods and are noisy, heterogeneous, and prone to anomalies, detecting and inferring key patterns is challenging. We introduce LLmFPCA-detect, a flexible framework that pairs LLM-based text embeddings with functional data analysis to detect clusters and infer anomalies in large SL text datasets. First, LLmFPCA-detect embeds each piece of text into an application-specific numeric space using LLM prompts. Sparse multivariate functional principal component analysis (mFPCA) conducted in the numeric space forms the workhorse to recover primary population characteristics, and produces subject-level scores which, together with baseline static covariates, facilitate data segmentation, unsupervised anomaly detection and inference, and enable other downstream tasks. In particular, we leverage LLMs to perform dynamic keyword profiling guided by the data segments and anomalies discovered by LLmFPCA-detect, and we show that cluster-specific functional PC scores from LLmFPCA-detect, used as features in existing pipelines, help boost prediction performance. We support the stability of LLmFPCA-detect with experiments and evaluate it on two different applications using public datasets, Amazon customer-review trajectories, and Wikipedia talk-page comment streams, demonstrating utility across domains and outperforming state-of-the-art baselines.

异常检测文本分析函数数据分析大模型应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。