Learning to ask and answer in specialized documents: Exemplifying through modular integrated construction regulatory documents
针对专业领域问答中数据集成本高、模型不稳定问题,提出两阶段框架:先微调大模型生成问答对,再比较不同问答范式。以模块化集成建造监管文件为例,发现合成数据保留90-100%性能,领域微调模型效果最佳。
Large language models perform well in general question-answering tasks but face challenges in local contextual question-answering within specialized domains due to the high cost of domain-specific dataset curation and unstable model performance. To address these issues, this paper proposes a two-stage framework. In the first stage, “learning to ask,” fine-tuned LLMs generate question-answering pairs from contexts, guided by contextual relevance (i.e., question-context alignment) and answer fidelity (i.e., accuracy and faithfulness of the answer). The second stage, “learning to answer,” systematically compares different CQA paradigms, including fine-tuning, retrieval-augmented generation, and proprietary LLMs. The framework is demonstrated using modular integrated construction regulatory documents. Extensive experiments yield three main insights: (1) Synthetic data generation often mirrors training distributions, necessitating effective filtering; (2) Despite inherent biases, synthetic data retains 90–100% of the performance achieved with original data and appropriate models, demonstrating its practical utility; and (3) Domain-specific, fine-tuned models achieve the best performance, underscoring the importance of tailored adaptation. This work bridges gaps in synthetic data quality assurance and domain-aware language model customization, providing practical guidelines for applications in low-resource, expertise-driven, and privacy-sensitive domains. • Guidelines for local contextual question-answering systems in specialized domains. • Synthetic data generation for extracting question-answer pairs from contexts. • Introduction of quantitative metrics for assessing the quality of synthetic data . • Comparative analysis for establishing contextual question-answering paradigms.