Question-Driven Analysis and Synthesis: Building Interpretable Thematic Trees with LLMs for Text Clustering and Controllable Generation
Tiago Fernandes Tavares
TL;DR
This work addresses the interpretability gap in unsupervised text analysis by introducing Recursive Thematic Partitioning (RTP), an interactive framework that builds a binary tree of natural-language questions to partition a corpus. RTP produces interpretable, rule-based thematic hierarchies and demonstrates quantitative utility by using the trees as features for downstream classification, while also enabling Controllable Thematic Generation (CTG) through thematic-path prompts to guide text synthesis. The framework relies on a two-stage data reduction to manage context limits, recursive yes/no question generation, majority-vote partitioning, and stopping criteria that balance depth and leaf size. Empirical results on IMDB, Yelp, and AG News show RTP can outperform a strong keyword-based baseline in interpretability and, in some cases, in classification accuracy, with CTG providing principled control over generated content. Overall, RTP shifts text analysis from purely statistical discovery toward knowledge-driven, interactive modeling with practical implications for controlled generation and domain knowledge integration.
Abstract
Unsupervised analysis of text corpora is challenging, especially in data-scarce domains where traditional topic models struggle. While these models offer a solution, they typically describe clusters with lists of keywords that require significant manual effort to interpret and often lack semantic coherence. To address this critical interpretability gap, we introduce Recursive Thematic Partitioning (RTP), a novel framework that leverages Large Language Models (LLMs) to interactively build a binary tree. Each node in the tree is a natural language question that semantically partitions the data, resulting in a fully interpretable taxonomy where the logic of each cluster is explicit. Our experiments demonstrate that RTP's question-driven hierarchy is more interpretable than the keyword-based topics from a strong baseline like BERTopic. Furthermore, we establish the quantitative utility of these clusters by showing they serve as powerful features in downstream classification tasks, particularly when the data's underlying themes correlate with the task labels. RTP introduces a new paradigm for data exploration, shifting the focus from statistical pattern discovery to knowledge-driven thematic analysis. Furthermore, we demonstrate that the thematic paths from the RTP tree can serve as structured, controllable prompts for generative models. This transforms our analytical framework into a powerful tool for synthesis, enabling the consistent imitation of specific characteristics discovered in the source corpus.
