Template-to-Text: Hierarchical Structure-Aware Retrieval for Controllable Document Generation
Despite the remarkable generative capabilities of Large Language Models (LLMs), existing long-form document generation methods frequently suffer from structural collapse and logical drift as the document length increases. We identify the root cause as a persistent structural retrieval gap, where traditional Retrieval-Augmented Generation (RAG) paradigms focus almost exclusively on fine-grained factual snippets while neglecting the macro-level organizational logic required for coherent narratives. To bridge this gap, we propose a pioneering hierarchical structure-retrieved generation framework (HS-RAG) that reconceptualizes the generation task as a systematic retrieval-alignment-fusion process from template to text, marking a fundamental paradigm shift from spontaneous generation to grounded structural anchoring. The proposed framework introduces three core methodological innovations: 1) A novel dual-stream structural indexing mechanism that extracts retrievable prototypes from historical templates, effectively closing the structural retrieval gap; 2) An adaptive query-guided alignment algorithm that maps unstructured user intents into explicit hierarchical logical constraints; 3) A reinforcement learning (RL)-driven hierarchical relevance feedback optimization strategy designed to dynamically maximize the alignment between generated content, retrieved structures, and external knowledge. Extensive experiments across four diverse datasets demonstrate that our approach significantly outperforms state-of-the-art baselines, including GPT-5.2 and advanced RAG variants. Specifically, our framework achieves an exceptional Structure Match Rate (SMR) of 0.951 and a semantic fidelity score (BERTScore) of 0.921 on AcademicPapers dataset, outperforming the strongest SOTA baseline by 5.43% and 4.19%, respectively. These compelling quantitative indicators validate that explicit structural priors are essential for mitigating long-range incoherence in controllable document generation.