The source code, datasets, and experimental results are available in the following GitHub repository: Exploratory Experiment.
LLM-based hierarchical MapReduce has been explored before. The difference between existing research and mine is that my approach uses full-scan hierarchical MapReduce for exhaustive specification extraction, aiming to achieve complete coverage without omitting any source information or introducing fabricated information.
What happens when we apply it to specification-driven development? MapReduce-based approaches have the potential to improve analytical accuracy across large-scale document collections. The key issue with this experiment seems to be not only the number of datasets, but also the reliability of the statistical methodology.
In the Full Load approach, I did not provide the LLM with input exceeding its context window. Nevertheless, the Full Load approach yielded lower recall and F1 scores than the MapReduce approaches.
These are metric calculations conducted on the same dataset. I recalculated the metrics using a more statistically rigorous methodology than in previous evaluations. For previous metric calculations, see the "statistical_analysis/old/" directory in my GitHub repository.
Summary
To consider IT system migration, this experiment attempts to extract specifications from existing detailed design documents. Note that I do not claim that this method will reduce the personnel, time, or cost required for the entire development of a new system, including requirements definition, testing, etc.
Background
Full-context processing can suffer from long-context utilization failures, such as "lost in the middle" and "context rot." On the other hand, RAG can miss relevant information during retrieval. This leads us to a question: Can we improve the quality and completeness of LLM-generated technical specifications by using MapReduce to systematically scan the entire source documentation and source code?
Objective
To generate specifications from existing detailed design documents using full load, 1-level hierarchical MapReduce, and 2-level hierarchical MapReduce approaches, and evaluate the accuracy of the generated specifications using precision, recall, and the F1 score.
Prerequisite
I used the following settings for this experiment:
• The design document is, of course, a synthetic sample.
• The model was gpt-6.1-sol, using low and xhigh reasoning effort.
• Full Load, one level MapReduce, and two level MapReduce were each tested once under low reasoning effort.
• Additional Full Load trials used xhigh reasoning effort.
• The metric calculations used a shared ledger of 638 atomic requirements and 142 negative controls. The ledger was subsequently revised.
• The approval processes differ between MapReduce and full-load approaches.
Main conclusion
• This experiment suggests that MapReduce-based approaches have the potential to improve analytical accuracy across large-scale document collections.
• It is highly likely that MapReduce approaches are superior to alternative methods. Nevertheless, recall still falls short of 100%, which is a critical limitation in large-scale specification-driven development.
• It is necessary to verify the validity of the experimental methods, including the source code logic and the calculation of TP, FP, TN, and FN.
• Currently, global and subglobal contexts are generated by standalone LLM calls, but in the future, these tasks might be handled by dedicated agents acting as the root node and fork nodes, respectively.
• With LLM-based MapReduce methods, pursuing semantic accuracy requires incurring high wall-clock time and input/output token costs. Conversely, pursuing high speed comes at the expense of semantic accuracy.
Limitations
• This experiment used a single dataset with a limited number of trials.
• The reliability of the metric calculations has not yet been established.
Approval Processes
The approval processes differ substantially between the full-load and hierarchical MapReduce approaches. Full-load approval examines the original source documents directly, whereas MapReduce approval relies on structured evidence extracted during the Map stage. This is because, in N-level MapReduce approaches, fork and leaf nodes return detailed data to their parent nodes, allowing them to run approval on it.
This experiment investigates whether full-load approaches with an approval process can achieve precision, recall, and F1 scores comparable to those of hierarchical MapReduce approaches.
An Application of Graph Theory
Given enough time, I can implement MapReduce-based approaches using directed acyclic graphs (DAGs) or directed graphs with cycles. When extending MapReduce approaches to more complex structures, using a DAG may yield higher accuracy and completeness than N-level MapReduce approaches. Using the types of the two entities and the attributes of the link between them, we attach global context and content, and send the chunks to the child nodes. Determining what dependencies exist between entities requires a separate algorithm. Of course, we can also generate the topology of given objects using an LLM.