[论文解读] ContextGPT: Infusing LLMs Knowledge into Neuro-Symbolic Activity Recognition Models
ContextGPT 提出了一种提示工程方法,从预训练的大语言模型(LLMs)中提取关于人类活动及其情境约束的常识知识,从而实现将知识高效注入神经符号活动识别模型。该方法在显著减少人工投入的前提下,实现了与基于逻辑的本体模型相当的识别性能。
Context-aware Human Activity Recognition (HAR) is a hot research area in mobile computing, and the most effective solutions in the literature are based on supervised deep learning models. However, the actual deployment of these systems is limited by the scarcity of labeled data that is required for training. Neuro-Symbolic AI (NeSy) provides an interesting research direction to mitigate this issue, by infusing common-sense knowledge about human activities and the contexts in which they can be performed into HAR deep learning classifiers. Existing NeSy methods for context-aware HAR rely on knowledge encoded in logic-based models (e.g., ontologies) whose design, implementation, and maintenance to capture new activities and contexts require significant human engineering efforts, technical knowledge, and domain expertise. Recent works show that pre-trained Large Language Models (LLMs) effectively encode common-sense knowledge about human activities. In this work, we propose ContextGPT: a novel prompt engineering approach to retrieve from LLMs common-sense knowledge about the relationship between human activities and the context in which they are performed. Unlike ontologies, ContextGPT requires limited human effort and expertise. An extensive evaluation carried out on two public datasets shows how a NeSy model obtained by infusing common-sense knowledge from ContextGPT is effective in data scarcity scenarios, leading to similar (and sometimes better) recognition rates than logic-based approaches with a fraction of the effort.
研究动机与目标
- 通过减少对大规模标注数据集的依赖,解决情境感知人体活动识别(HAR)中的标注数据稀缺问题。
- 克服手动构建的基于逻辑的知识模型(如本体)在 HAR 中人力工程成本高且可扩展性差的问题。
- 探索使用预训练 LLM 作为构建本体的可扩展、低投入替代方案,以编码关于活动-情境关系的常识知识。
- 证明基于 LLM 提取的知识可有效注入神经符号 HAR 模型,从而在数据稀缺条件下提升性能。
提出的方法
- 设计一种提示工程框架,将高层次的情境信息(如语义位置、时间)转化为 LLM 可理解的自然语言提示。
- 使用系统提示引导 LLM 生成与给定情境一致的合理活动列表。
- 采用少量-shot 提示并结合手工设计的示例,以提高提示的一致性和任务对齐性。
- 将 LLM 生成的活动-情境一致性知识作为符号约束注入神经符号 HAR 模型。
- 利用 LLM 的预训练知识,动态推断有效的活动-情境对,而无需手动构建本体。
- 在两种公开的 HAR 数据集(DOMINO 和 ExtraSensory)上,于数据稀缺的训练设置下评估该方法。

实验结果
研究问题
- RQ1LLM 是否能够以与基于逻辑的本体相当或更优的方式有效检索关于活动-情境一致性的常识知识?
- RQ2使用 LLM 生成的知识在多大程度上减少了构建和维护 HAR 知识模型所需的人工投入?
- RQ3在数据稀缺场景下,注入 LLM 提取知识的神经符号 HAR 模型性能,与使用传统基于逻辑本体的模型相比如何?
- RQ4提示中少量-shot 示例的数量如何影响 LLM 生成与本体推导出的一致活动集合之间的对齐程度?
主要发现
- 即使在数据稀缺的训练条件下,ContextGPT 的识别率仍可与基于逻辑本体的方法相媲美。
- 与构建和维护基于逻辑的本体相比,该方法显著减少了人工投入,因为无需手动设计约束条件。
- 在 DOMINO 数据集上,使用 k=5 个 few-shot 示例的 ContextGPT 达到了 89.7% 的识别率,接近基于本体模型的 90.1%。
- 在 ExtraSensory 数据集上,使用 k=5 的 ContextGPT 达到了 92.3% 的识别率,与基于本体模型的性能相当。
- L2O 和 O2L 包含度指标表明,LLM 生成与本体推导出的一致活动集合之间存在中等程度的对齐,且随着 k 增加,O2L 值下降,表明 LLM 在示例增多时变得更加严格。
- LLM 方法对幻觉现象表现出鲁棒性,尤其在 ExtraSensory 数据集上,即使示例较少,L2O 包含度仍保持较高水平。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。