Architectural Knowledge Management (AKM) is crucial for software development and Architectural Decision Records (ADR), an important artifact of AKM, provide a structured approach to capture Architectural Design Decisions (ADD). However, their adoption is limited due to the manual effort involved and insufficient tool support. Prior work shows that LLMs can support ADD generation, though basic prompting yields suboptimal results. This paper explores how LLMs can support architects in two complementary tasks: generating ADDs from Decision Contexts, and generating complete ADRs from titles. We propose Domain-specific Retrieval Augmented Few-shot Tuning (DRAFT), a novel approach that integrates Retrieval Augmented Few-shot Generation with Fine-tuning to generate. DRAFT operates in two phases: an offline phase that fine-tunes a model using retrieval-augmented prompts derived from historical ADRs, and an online phase that generates decisions or complete ADRs by combining retrieved examples with the fine-tuned model. Evaluated on 4344 ADRs across multiple LLMs using standard NLP metrics, DRAFT consistently produces outputs better aligned with real-world ADRs. A human evaluation with the authors and external architects, however, shows no uniformly preferred approach. DRAFT also maintains practical efficiency, reduces dependence- dence on proprietary models, and addresses organizational concerns around privacy, resource constraints, and inference costs.
Figures & tables
Figure 1. Sample ADR illustrating the standard Status, Context, Decision, and Consequences sections.
Figure 2. Retrieval Augmented Few-shot Generation (RAFG) pipeline at runtime.
Figure 3. Fine-tuning pipeline showing the offline training phase on context–decision pairs and the online inference phase using the fine-tuned model.
Figure 4. overview of DRAFT, illustrating both the offline component (retrieval augmented dataset construction and fine-tuning) and the online component (retrieval-augmented inference using the fine-tunedmodel)
Figure 5. Detailed system diagram of DRAFT showing the five major processes: (1) data cleaning, (2) embedding and indexing into a vector database, (3) prompt processing for both offline training and online inference, (4) generative LLM fine-tuning, and (5) inference handling to produce the final Design Decision.
Figure 6. Sample context–decision pair C′-D′ from an ADR used as a training data in the DRAFT offline phase.
Figure 7. Retrieved Context-Decision pairs for the example given in Figure 6 .
θgen←θgen−η∇θgenL
Algorithm 3 Generative LLM Fine-tuning
Figure 8. Sample Decision Context to illustrate DRAFT’s online inference
Figure 9. Few-shot inference prompt containing two retrieved context–decision pairs followed by the input context.
Figure 10. Design Decision generated by the DRAFT’s fine-tuned model for the sample context in Fig. 8
Figure 11. Overview of the experimental procedure, encompassing research question formulation, subject identification (model selection and dataset preparation), experimentation with four candidate approaches (zero-shot prompting, RAFG, fine-tuning, and DRAFT), and result analysis using effectiveness and efficiency metrics.
Model Type
Provider
Model Name
Size
Availability
Generative Model
OpenAI
gpt-5-high
unknown
proprietary
Google
Gemini-2.5-flash
unknown
proprietary
Alibaba
Qwen3-30b-a3b-instruct-2507
30B
open source
Google
Gemma-3-4b-it
4B
open source
Embedding Model
OpenAI
text-embedding-3-large
hidden
proprietary
Google
gemini-embedding-001
hidden
proprietary
Table 1. LLMs used in this study, listing provider, model name, size, and availability, for generative and embedding models.
Generative Model
Embedding Model
Gpt-5-high
text-embedding-3-large
Gemini-2.5-flash
gemini-embedding-001
Qwen3-30b-a3b-instruct-2507
Qwen3-Embedding-8B
Gemma-3-4b-it
Qwen3-Embedding-8B
Table 2. Pairing of generative and embedding models
Figure 12. Validation loss curves across 5 epochs for 3 LLMs on fine-tuning and DRAFT for both tasks
Model
Approach
ROUGE
BLEU
METEOR
BERTScore
1
Lsum
Precision
Recall
F1
Gemma-3-4b
Prompting
0.135
0.122
0.009
0.165
0.780
0.831
0.805
Finetuning
0.186
0.164
0.032
0.164
0.833
0.836
0.834
RAFG
0.191
0.165
0.020
0.159
0.849
0.838
0.843
DRAFT
0.179
0.159
0.031
0.162
0.828
0.835
0.831
Qwen-3-30B
Prompting
0.159
0.131
0.014
0.184
0.807
0.838
0.822
Table 3. Effectiveness results for Task 1 (Context → Decision) across all model–approach combinations, reporting ROUGE-1, ROUGE-Lsum, BLEU, METEOR, and BERTScore (precision, recall, F1) on the held-out test set of 870 ADRs.
Model
Approach
ROUGE
BLEU
METEOR
BERTScore
1
Lsum
Precision
Recall
F1
Gemma-3-4b
Prompting
0.221
0.208
0.013
0.222
0.808
0.821
0.814
Finetuning
0.269
0.255
0.062
0.245
0.831
0.829
0.830
RAFG
0.247
0.233
0.036
0.255
0.814
0.831
0.822
DRAFT
0.263
0.248
0.051
0.221
0.837
0.828
0.832
Qwen-3-30B
Prompting
0.242
0.227
0.026
0.226
0.809
0.825
0.817
Table 4. Effectiveness results for Task 2 (Title → Body) across all model–approach combinations, reporting ROUGE-1, ROUGE-Lsum, BLEU, METEOR, and BERTScore (precision, recall, F1) on the held-out test set of 870 ADRs.
Figure 13. Comparison of all four approaches (Prompting, Fine-tuning, RAFG, and DRAFT) across 4 LLMs on Task 1 (Context → Decision), measured by ROUGE-1, BLEU, METEOR, and BERTScore F1.
Figure 14. Comparison of all four approaches (Prompting, Fine-tuning, RAFG, and DRAFT) across four LLMs on Task 2 (Title → Body), measured by ROUGE-1, BLEU, METEOR, and BERTScore F1.
Metric
Model
Friedman
DRAFT-Finetune
DRAFT-Prompting
DRAFT-RAFG
Finetune-Prompting
RAFG-Prompting
ROUGE-1
Gemini-2.5
0.087 ***
0.533 ***
0.266 ***
0.147 ***
-0.398 ***
0.167 ***
Gemma-3-4b
0.088 ***
-0.061 ns
0.461 ***
-0.100 *
0.476 ***
0.479 ***
Qwen-3-30b
0.033 ***
-0.011 ns
0.247 ***
0.082 ns
0.274 ***
0.525 ***
ROUGE-L
Gemini-2.5
0.040 ***
0.353 ***
0.307 ***
0.174 ***
-0.163 ***
0.184 ***
Gemma-3-4b
0.142 ***
-0.077 ns
0.599 ***
-0.166 ***
0.622 ***
0.682 ***
Qwen-3-30b
0.096 ***
-0.013 ns
0.551 ***
0.399 ***
0.565 ***
0.591 ***
Table 5. Statistical significance of approach comparisons for Task 1. We report the effect sizes along with significance levels for Friedman omnibus test followed by Wilcoxon signed-rank tests with Holm correction. Significance levels: *** ( p<0.001 ), ** ( p<0.01 ), * ( p<0.05 ), ns = not significant.
Metric
Model
Friedman
DRAFT-Finetune
DRAFT-Prompting
DRAFT-RAFG
Finetune-Prompting
RAFG-Prompting
ROUGE-1
Gemini-2.5
0.084 ***
0.275 ***
0.552 ***
0.487 ***
0.327 ***
0.124 **
Gemma-3-4b
0.141 ***
-0.063 ns
0.446 ***
0.197 ***
0.594 ***
0.680 ***
Qwen-3-30b
0.004 *
0.109 *
0.041 ns
0.042 ns
-0.080 ns
-0.018 ns
ROUGE-L
Gemini-2.5
0.101 ***
0.287 ***
0.561 ***
0.511 ***
0.321 ***
0.091 *
Gemma-3-4b
0.290 ***
-0.024 ns
0.739 ***
0.480 ***
0.842 ***
0.803 ***
Qwen-3-30b
0.140 ***
0.067 ns
0.666 ***
0.668 ***
0.560 ***
-0.000 ns
Table 6. Statistical significance of approach comparisons for Task 2. We report the effect sizes along with significance levels for Friedman omnibus test followed by Wilcoxon signed-rank tests with Holm correction. Significance levels: *** ( p<0.001 ), ** ( p<0.01 ), * ( p<0.05 ), ns = not significant.
Raters
Approach
Task 1
Task 2
Closeness
Correctness
Closeness
Correctness
Authors ( n=64 )
Prompting
2.89
3.38 ∗
2.41
2.98
RAFG
2.99
3.55
2.44
3.09
Finetuning
2.95
3.48
2.63
3.09
DRAFT
3.20
3.68
2.72
3.25
Friedman p
0.049
0.028
0.065
0.165
Table 7. Human evaluation mean scores (1–5) for Task 1 and Task 2. Authors : two authors rated 64 samples. Experts : a senior architect and junior architects rated a 14-sample subset. All raters : all four raters on the same 14 samples. Bold marks the highest mean within each rater group. ∗ indicates a statistically significant difference from DRAFT (Wilcoxon signed-rank, Holm-corrected, p<0.05 ), tested only when the Friedman test is significant. κ : quadratic weighted Cohen’s kappa between the two raters. † Mean of the six pairwise weighted kappas among the four raters.
Model
Approach
(a) Task 1: C → D
(b) Task 2: T → B
Input
Output
Time (s)
Input
Output
Time (s)
Gemma-3-4b
Prompting
122
395
26.08
8
981
32.42
Finetuning
122
128
4.29
8
453
15.14
RAFG
559
79
3.88
811
680
25.48
DRAFT
559
140
5.17
811
313
11.51
Qwen3-30B
Prompting
122
275
74.82
8
500
155.20
Table 8. Efficiency results reporting mean input tokens, output tokens, and response time per model–approach combination for (a) Task 1 (C → D) and (b) Task 2 (T → B).
Figure 15. Mean output token counts per model and approach for Task 1 (left) and Task 2 (right), compared against ground truth lengths.
Figure 16. Mean response time (seconds) per model and approach for Task 1 (left) and Task 2 (right).
Department of Mechanical Engineering Centre of Technology Federal University of Santa Maria Santa Maria/RS, BR 97105-900, Brazil · Section for Fluid Power and Mechatronics Department of Management and Engineering Linköping University SE 581 83, Linköping, Sweden