GraphQAG: A Knowledge-Graph-Guided Visual Analytics Framework for Question-Answer Pairs Generation
2026-07-29 • Human-Computer Interaction
Human-Computer Interaction
AI summaryⓘ
The authors developed GraphQAG, a tool that helps create question-answer pairs from long documents by using a knowledge graph to understand complex relationships and information spread across different paragraphs. Their method breaks the document into parts, maps out important entities and their connections, and then guides a language model to generate better questions and answers based on this graph. Users can visually explore and improve the generated QA pairs, making sure they cover important content accurately. Tests with users and experts showed this approach helps find missing information and improve the QA sets effectively.
Question-answer pairsKnowledge graphLarge language modelsVisual analyticsEntity relationshipsMulti-hop pathsDocument segmentationKnowledge base constructionSemantic connectionsInteractive visualization
Authors
Yize Li, Ruiqi Yu, Tianya Pan, Ningxin Li, Songyue Li, Xiangyang Wu, Jinchang Li, Zhiguang Zhou
Abstract
Question-answer (QA) pairs are widely used in knowledge base construction, question-answering systems, and the post-training of large language models (LLMs). However, important knowledge in long documents is often distributed across multiple paragraphs and connected through complex entity relationships. Such fragmented and relational knowledge poses substantial challenges for existing QA generation methods, which often fail to adequately cover core document content, cross-paragraph semantic connections, and multi-entity relationships. We present GraphQAG, a knowledge graph-guided visual analytics framework for generating high-quality QA pairs from long documents. GraphQAG follows a three-stage workflow. First, it constructs a document knowledge graph by segmenting the document into paragraphs and extracting salient entities and relations. Second, it builds a graph-based generation space from entities, relations, and multi-hop paths to constrain and guide LLM-based QA generation. Third, it uses the knowledge graph as an interactive visual representation, enabling users to explore document knowledge structures, inspect the coverage and evidence provenance of generated QA pairs, and iteratively refine the QA pair set through graph-based interactions. We evaluated GraphQAG through a user study with 16 participants, two case studies, and expert interviews. The results indicate that GraphQAG effectively supports users in identifying knowledge coverage gaps, examining generated QA pairs, and refining the QA pair set. These findings demonstrate the usefulness of combining knowledge graphs, LLM-based generation, and visual analytics for producing more comprehensive and trustworthy QA pairs from long documents.