Deterministic and Probabilistic Components Force a Reproducibility Trade-Off in Code Summarisation
Researchers compared deterministic heuristic pipelines against a Mixtral LLM pipeline on design-pattern Java code. Deterministic components delivered reproducible, concise outputs, while the probabilistic LLM achieved stronger semantic alignment and contextual coverage.

Software teams building documentation or comprehension pipelines rarely get a clean comparison between deterministic and probabilistic components under identical conditions. A recent empirical study from Monash University and Singapore Management University isolates that choice in automated Java code summarisation.
Holding preprocessing and pattern identification fixed, the researchers benchmarked deterministic heuristic pipelines against a Mixtral large language model pipeline on design-pattern code. For engineering leads and architects, the results draw a sharp boundary: probabilistic models deepen semantic context, while deterministic rules guarantee brevity and repeatability.
In short
- Architectural impact: Isolating summary generation lets teams swap deterministic NLG or SWUM rules with Mixtral without changing upstream static analysis or pattern detection.
- Operational value: Deterministic pipelines eliminate output drift across repeated runs, keeping automated documentation concise and predictable for CI checks, diff reviews, and audit trails.
- Core trade-off: Mixtral outputs achieve stronger semantic alignment and contextual coverage, yet remain sensitive to prompt phrasing and run-to-run length variance.
Isolating Generation Strategies in a Shared Pipeline
Many tool evaluations conflate model quality with differences in parsing, chunking, or context extraction. The researchers avoided that trap by building on an existing Design Pattern Summarisation (DPS) system and varying only the final generation stage.
Design-pattern-centric Java artifacts from open-source GitHub repositories served as the controlled testbed. Because patterns encode explicit class roles, interactions, and architectural constraints, summaries must capture developer intent rather than just surface syntax.
The study compared a rule-based natural language generation (NLG) pipeline, a Software Word Usage Model (SWUM) method, and a Mixtral pipeline over identical pattern structures. Each pipeline was benchmarked against independent human-written reference summaries from the DPS corpus.
Semantic Depth Versus Strict Output Control
Evaluation combined BERTScore and Cosine Similarity metrics with Llama 3 rubric judgements. The rubric covered accuracy, conciseness, adequacy, code-context awareness, and design-pattern fidelity. Wilcoxon signed-rank tests, Friedman tests, and Spearman rank correlations checked whether metric differences and rubric rankings held consistently.
Probabilistic summaries from Mixtral scored higher on semantic alignment and contextual coverage. Learned representations helped the model infer intent across surrounding code interactions instead of relying solely on fixed templates.
Deterministic NLG and SWUM pipelines traded that contextual breadth for tight structural control. Both heuristic approaches produced shorter, repeatable summaries that stayed within strict formatting boundaries every time the pipeline ran.
Prompt Variance and the Case for Hybrid Pipelines
Multi-run and prompt-sensitivity checks exposed an operational catch for production teams. Even when prompts included explicit constraints, Mixtral outputs varied in phrasing and length across executions, though relative ranking trends stayed stable.
That instability matters for developer workflows where summaries feed downstream tooling, pull-request diffs, or automated compliance checks. A probabilistic component cannot serve as a drop-in replacement where exact repeatability is a hard requirement.
Teams designing code-comprehension workflows do not need to force a binary choice across the whole system. Keeping deterministic software on structural extraction and pattern identification preserves predictable inputs, leaving probabilistic generation only for tasks where semantic nuance outweighs variance.
This benchmark isolates generation on design-pattern Java files using Mixtral and a Llama 3 rubric. Whether that semantic edge holds across multi-module repositories or strict downstream schema contracts remains an open engineering test.






