[Paper Review] ChatGraph: Interpretable Text Classification by Converting ChatGPT Knowledge to Graphs
This paper proposes ChatGraph, a framework that converts knowledge from ChatGPT into structured knowledge graphs to enable interpretable text classification. By extracting semantic relationships via prompt-engineered LLM inference and training a linear classifier on the graph-structured data, ChatGraph achieves superior performance over direct ChatGPT use and outperforms existing explainable models while maintaining model interpretability through feature importance weights.
ChatGPT, as a recently launched large language model (LLM), has shown superior performance in various natural language processing (NLP) tasks. However, two major limitations hinder its potential applications: (1) the inflexibility of finetuning on downstream tasks and (2) the lack of interpretability in the decision-making process. To tackle these limitations, we propose a novel framework that leverages the power of ChatGPT for specific tasks, such as text classification, while improving its interpretability. The proposed framework conducts a knowledge graph extraction task to extract refined and structural knowledge from the raw data using ChatGPT. The rich knowledge is then converted into a graph, which is further used to train an interpretable linear classifier to make predictions. To evaluate the effectiveness of our proposed method, we conduct experiments on four datasets. The result shows that our method can significantly improve the performance compared to directly utilizing ChatGPT for text classification tasks. And our method provides a more transparent decision-making process compared with previous text classification methods.
Motivation & Objective
- To address the limitations of ChatGPT in text classification, particularly its lack of fine-tuning flexibility and interpretability.
- To develop a framework that leverages pre-trained LLM knowledge while enabling model transparency and explainability.
- To improve classification accuracy over direct LLM inference by distilling structured knowledge into a trainable, interpretable model.
- To create a data-centric approach that enhances performance without requiring model parameter updates.
- To enable integration of external knowledge (e.g., TF-IDF) into the knowledge graph for further performance gains.
Proposed method
- Using prompt-engineered ChatGPT to refine raw text by correcting grammar, spelling, and improving sentence clarity.
- Applying a second prompt to extract structured knowledge triples (subject-predicate-object) from the refined text.
- Converting the extracted knowledge graph into a text graph representation suitable for training a linear classifier.
- Training a linear model on the text graph with learnable weights to predict class labels, enabling feature importance interpretation.
- Integrating external knowledge such as TF-IDF weights into the text graph to enhance model performance.
- Evaluating interpretability via fidelity metrics using feature masking (random vs. top-importance features).
Experimental results
Research questions
- RQ1Can knowledge distilled from ChatGPT into a structured graph format improve text classification performance compared to direct LLM inference?
- RQ2Can the resulting model maintain high interpretability while achieving competitive accuracy?
- RQ3How does the performance of the proposed framework compare to existing explainable models like TF-IDF and TextGCN?
- RQ4To what extent does integrating external knowledge (e.g., TF-IDF) enhance the model’s predictive power?
- RQ5How accurately do the model’s feature importance scores reflect the true contribution of words to classification decisions?
Key findings
- ChatGraph significantly outperforms direct zero-shot and few-shot inference with ChatGPT on four benchmark datasets, including 20NG, R8, R52, and Ohsumed.
- On the R8 dataset, ChatGraph achieved a fidelity score of 24.44% under 0.1% top-feature masking, indicating strong alignment between feature importance and model decisions.
- With 1% top-feature masking, ChatGraph achieved a fidelity of 38.46% on R8, demonstrating robustness in interpretability evaluation.
- The model’s performance improved further when combined with TF-IDF features, showing the effectiveness of external knowledge integration.
- ChatGraph surpassed inherently explainable baselines like TF-IDF and TextGCN in both accuracy and interpretability, achieving a balance between performance and transparency.
- The method effectively mitigates token length limitations of ChatGPT by extracting knowledge before model inference, enabling use on long texts.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.