Skip to main content
QUICK REVIEW

[Paper Review] ContextGPT: Infusing LLMs Knowledge into Neuro-Symbolic Activity Recognition Models

Luca Arrotta, Cláudio Bettini|arXiv (Cornell University)|Mar 11, 2024
Machine Learning in HealthcareComputer Science3 citations
TL;DR

ContextGPT proposes a prompt engineering method to extract common-sense knowledge about human activities and their contextual constraints from pre-trained Large Language Models (LLMs), enabling efficient knowledge infusion into neuro-symbolic activity recognition models. It achieves recognition performance comparable to logic-based ontologies with significantly reduced human effort.

ABSTRACT

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.

Motivation & Objective

  • Address the challenge of labeled data scarcity in context-aware Human Activity Recognition (HAR) by reducing reliance on large annotated datasets.
  • Overcome the high human engineering cost and limited scalability of manually constructed logic-based knowledge models (e.g., ontologies) for HAR.
  • Explore the feasibility of using pre-trained LLMs as a scalable, low-effort alternative to ontologies for encoding common-sense knowledge about activity-context relationships.
  • Demonstrate that LLM-derived knowledge can be effectively infused into neuro-symbolic HAR models to improve performance under data-scarce conditions.

Proposed method

  • Design a prompt engineering framework that converts high-level context (e.g., semantic location, time) into natural language prompts for LLMs.
  • Use a system message to guide the LLM to generate a list of plausible activities consistent with the given context.
  • Employ few-shot prompting with hand-crafted examples to improve prompt consistency and task alignment.
  • Infuse the LLM-generated activity-context consistency knowledge into a neuro-symbolic HAR model as symbolic constraints.
  • Utilize the LLM’s pre-trained knowledge to dynamically infer valid activity-context pairs without requiring manual ontology construction.
  • Evaluate the method using two public HAR datasets (DOMINO and ExtraSensory) under data-scarce training regimes.
Figure 1. A Neuro-Symbolic AI framework for context-aware HAR gathering knowledge from ContextGPT
Figure 1. A Neuro-Symbolic AI framework for context-aware HAR gathering knowledge from ContextGPT

Experimental results

Research questions

  • RQ1Can LLMs effectively retrieve common-sense knowledge about activity-context consistency in a way that matches or exceeds logic-based ontologies?
  • RQ2To what extent does using LLM-generated knowledge reduce the human effort required to build and maintain knowledge models for HAR?
  • RQ3How does the performance of a neuro-symbolic HAR model infused with LLM-derived knowledge compare to one using traditional logic-based ontologies in data-scarce scenarios?
  • RQ4How do the number of few-shot examples in the prompt affect the alignment between LLM-generated and ontology-derived consistent activity sets?

Key findings

  • ContextGPT achieves recognition rates comparable to those of logic-based ontology methods, even under data-scarce training conditions.
  • The method significantly reduces human effort compared to building and maintaining logic-based ontologies, as it requires no manual engineering of constraints.
  • On the DOMINO dataset, ContextGPT with k=5 few-shot examples achieved a recognition rate of 89.7%, close to the ontology-based model’s 90.1%.
  • On the ExtraSensory dataset, ContextGPT with k=5 achieved a recognition rate of 92.3%, matching the performance of the ontology-based model.
  • The L2O and O2L inclusion metrics indicate moderate alignment between LLM-generated and ontology-derived consistent activity sets, with O2L decreasing as k increased, suggesting LLMs become more restrictive with more examples.
  • The LLM-based approach shows robustness to hallucinations, especially on the ExtraSensory dataset, where L2O inclusion remained high even with fewer examples.
Figure 2. Overall architecture of ContextGPT
Figure 2. Overall architecture of ContextGPT

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.