Formal Software Architecture Rule Learning: A Comparative Investigation between Large Language Models and Inductive Techniques
Abstract
:1. Introduction
2. Motivation
3. Fundamentals and Related Work
3.1. Inductive Rule Learning
3.2. Large Language Models
3.3. Software Architecture
4. Experiment
4.1. Experimental Setup
Listing 1. Code snippet of the Java class GateKeeper. |
package teammates.logic.api; import teammates.common.util.Const; public class GateKeeper { //out of scope } |
Listing 2. Resulting facts in the knowledge base. |
1 package(teammates_logic_api). 2 class(teammates_logic_api_GateKeeper). 3 importsClass(teammates_logic_api_GateKeeper, teammates_common_util_Const). 4 containsClass(teammate_logic_api, teammates_logic_api_GateKeeper). |
4.2. Conducted Experiments
Listing 3. Examples and counterexamples used in Experiment 1. |
# positive examples isAllowedToUse(teammates_logic_api, teammates_logic_core). isAllowedToUse(teammates_logic_backdoor, teammates_logic_api). # negative examples isAllowedToUse(teammates_logic_core, teammates_logic_backdoor). isAllowedToUse(teammates_logic_api, teammates_logic_backdoor). |
Listing 4. Flipped interaction prompt. |
I would like you to ask me for specific facts, so you are able to induce a first order logical rule that explains all the positive and none of the negative examples. You should ask questions until this condition is met or to achieve this goal (alternatively, forever) Allowed predicates to ask for are: package/1 containsPackage/2 class/1 containsClass/2 importsClass/2 Ask me questions one at a time. The positive examples are: isAllowedToUse(teammates_logic_api, teammates_logic_core). isAllowedToUse(teammates_logic_backdoor, teammates_logic_api). The negative examples are: isAllowedToUse(teammates_logic_core, teammates_logic_backdoor). isAllowedToUse(teammates_logic_api, teammates_logic_backdoor). |
5. Results
Tool | Learned Rule Body |
---|---|
Aleph | |
AMIE3 1. Rule | |
AMIE3 2. Rule | |
AnyBURL | |
ILASP (V4) | |
Popper | |
Google Bard | |
GPT-3.5 | |
GPT-4 |
Tool | Learned Rule Body |
---|---|
Aleph 1. Rule | isAllowedToUse(teammates_ logic_ api,teammates_ logic_ core). |
Aleph 2. Rule | isAllowedToUse(teammates_ logic_ backdoor,teammates_ logic_ api). |
AMIE3 | No run with explicit counter examples |
AnyBURL | No run with explicit counter examples |
ILASP (V4) | UNSATISFIABLE |
Popper | |
Google Bard | |
GPT-3.5 | |
GPT-4 | |
5.1. Results of Experiment 1
Tool | With Examples | With Examples and Counterexamples | ||
---|---|---|---|---|
Learning Time (s) | Accuracy | Learning Time (s) | Accuracy | |
Aleph | 0.010 | 1.0 | 0.097 | - |
AMIE3 | 0.150 | 1.0 | - | - |
AnyBURL | <1.000 | 1.0 | - | - |
ILASP | 4.922 | 1.0 | 1918.680 | - |
Popper | <1.000 | 1.0 | <1.000 | 1.0 |
# User Messages | Accuracy | # User Messages | Accuracy | |
Google Bard | 6 messages | 1.0 | 44 messages | 0.0 |
GPT-3.5 | 19 messages | 0.0 | 54 messages | 0.0 |
GPT-4 | 22 messages | 1.0 | 44 messages | 0.5 |
5.2. Results of Experiment 2
Learned Rule Body | # of Subsets |
---|---|
21 | |
2 | |
2 | |
2 |
6. Validity Considerations and Future Directions
6.1. Threats to Validity
6.2. Dimensions of Complexity Enhancement
7. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
GPT | Generative Pre-trained Transformer |
IRL | Inductive Rule Learning |
KB | Knowledge Base |
LLMs | Large Language Model |
ML | Machine Learning |
R | Research Question |
References
- Schindler, C.; Rausch, A. Towards Inductive Learning of Formal Software Architecture Rules. In Proceedings of the 57th Annual Hawaii International Conference on System Sciences (HICSS), Hawaiian Village, HI, USA, 3–6 January 2024; pp. 7302–7311. [Google Scholar]
- Komolov, S.; Dlamini, G.; Megha, S.; Mazzara, M. Towards Predicting Architectural Design Patterns: A Machine Learning Approach. Computers 2022, 11, 151. [Google Scholar] [CrossRef]
- Tibermacine, C.; Sadou, S.; Dony, C.; Fabresse, L. Component-based Specification of Software Architecture Constraints. In Proceedings of the 14th International ACM Sigsoft Symposium on Component Based Software Engineering, Boulder, CO, USA, 21–23 June 2011; pp. 31–40. [Google Scholar]
- Deiters, C.; Dohrmann, P.; Herold, S.; Rausch, A. Rule-based Architectural Compliance Checks for Enterprise Architecture Management. In Proceedings of the 2009 IEEE International Enterprise Distributed Object Computing Conference, Auckland, New Zealand, 1–4 September 2009; pp. 183–192. [Google Scholar]
- Pruijt, L.; Wiersema, W.; van der Werf, J.M.E.; Brinkkemper, S. Rule Type Based Reasoning on Architecture Violations: A Case Study. In Proceedings of the 2016 Qualitative Reasoning about Software Architectures (QRASA), Venice, Italy, 5–8 April 2016; pp. 1–10. [Google Scholar]
- Schindler, M.; Schindler, C.; Rausch, A. A Formalism for Explaining Concepts through Examples based on a Source Code Abstraction. Int. J. Adv. Softw. 2023, 16, 1–22. [Google Scholar]
- Cropper, A.; Dumančić, S. Inductive Logic Programming At 30: A New Introduction. J. Artif. Intell. Res. 2022, 74, 765–850. [Google Scholar] [CrossRef]
- Quinlan, J.R.; Cameron-Jones, R.M. FOIL: A Midterm Report. In Proceedings of the Machine Learning: ECML-93: European Conference on Machine Learning, Vienna, Austria, 5–7 April 1993; Proceedings 6. Springer: Berlin/Heidelberg, Germany, 1993; pp. 1–20. [Google Scholar]
- Gottlob, G.; Leone, N.; Scarcello, F. On the Complexity of Some Inductive Logic Programming Problems. In Proceedings of the Inductive Logic Programming: 7th International Workshop, ILP-97, Prague, Czech Republic, 17–20 September 1997; Proceedings 7. Springer: Berlin/Heidelberg, Germany, 1997; pp. 17–32. [Google Scholar]
- Law, M.; Russo, A.; Broda, K. The ILASP System for Inductive Learning of Answer Set Programs. arXiv 2020, arXiv:2005.00904. [Google Scholar]
- Cropper, A.; Morel, R. Learning programs by learning from failures. Mach. Learn. 2021, 110, 801–856. [Google Scholar] [CrossRef]
- Cunnington, D.; Law, M.; Lobo, J.; Russo, A. Inductive Learning of Complex Knowledge from Raw Data. arXiv 2022, arXiv:2205.12735. [Google Scholar]
- Dai, W.Z.; Muggleton, S. Abductive Knowledge Induction from Raw Data. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, Virtual, 19–26 August 2021; Zhou, Z.H., Ed.; International Joint Conferences on Artificial Intelligence Organization. pp. 1845–1851. [Google Scholar]
- Meilicke, C.; Chekol, M.W.; Ruffinelli, D.; Stuckenschmidt, H. Anytime Bottom-Up Rule Learning for Knowledge Graph Completion. In Proceedings of the IJCAI, Macao, China, 10–16 August 2019; pp. 3137–3143. [Google Scholar]
- Fan, L.; Li, L.; Ma, Z.; Lee, S.; Yu, H.; Hemphill, L. A Bibliometric Review of Large Language Models Research from 2017 to 2023. arXiv 2023, arXiv:2304.02020. [Google Scholar]
- Chen, W. Large Language Models are few(1)-shot Table Reasoners. arXiv 2022, arXiv:2210.06710. [Google Scholar]
- Zhao, W.X.; Zhou, K.; Li, J.; Tang, T.; Wang, X.; Hou, Y.; Min, Y.; Zhang, B.; Zhang, J.; Dong, Z.; et al. A Survey of Large Language Models. arXiv 2023, arXiv:2303.18223. [Google Scholar]
- Brants, T.; Popat, A.; Xu, P.; Och, F.J.; Dean, J. Large Language Models in Machine Translation. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), Prague, Czech Republic, 28–30 June 2007; pp. 858–867. [Google Scholar]
- Yenduri, G.; Ramalingam, M.; ChemmalarSelvi, G.; Supriya, Y.; Srivastava, G.; Maddikunta, P.K.R.; DeeptiRaj, G.; Jhaveri, R.H.; Prabadevi, B.; Wang, W.; et al. Generative Pre-trained Transformer: A Comprehensive Review on Enabling Technologies, Potential Applications, Emerging Challenges, and Future Directions. arXiv 2023, arXiv:2305.10435. [Google Scholar]
- Cano, C.A.G.; Castillo, V.S.; Gallego, T.A.C. Unveiling the Thematic Landscape of Generative Pre-trained Transformer (GPT) Through Bibliometric Analysis. Metaverse Basic Appl. Res. 2023, 2, 33. [Google Scholar] [CrossRef]
- Gill, A.S. Chat Generative Pretrained Transformer: Extinction of the Designer or Rise of an Augmented Designer. In Proceedings of the International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, Boston, MA, USA, 20 August 2023. [Google Scholar]
- Zhu, Q.; Luo, J. Generative Pre-Trained Transformer for Design Concept Generation: An Exploration. Proc. Des. Soc. 2021, 2, 1825–1834. [Google Scholar] [CrossRef]
- Bosch, J.; Molin, P. Software architecture design: Evaluation and transformation. In Proceedings of the ECBS’99. IEEE Conference and Workshop on Engineering of Computer-Based Systems, Nashville, TN, USA, 7–12 March 1999; pp. 4–10. [Google Scholar]
- Fu, Y.; Dong, Z.; He, X. A Method for Realizing Software Architecture Design. In Proceedings of the 2006 Sixth International Conference on Quality Software (QSIC’06), Beijing, China, 27–28 October 2006; pp. 57–64. [Google Scholar]
- Cervantes, H.; Kazman, R. Designing Software Architectures: A Practical Approach; Addison-Wesley Professional: Indianapolis, IN, USA, 2016. [Google Scholar]
- Liao, L. From Requirements to Architecture: The State of the Art in Software Architecture Design; Department of Computer Science and Engineering, University of Washington: Washington, DC, USA, 2002; pp. 1–13. [Google Scholar]
- Van Vliet, H.; Tang, A. Decision making in software architecture. J. Syst. Softw. 2016, 117, 638–644. [Google Scholar] [CrossRef]
- Feiler, P.H.; Lewis, B.; Vestal, S.; Colbert, E. An Overview of the SAE Architecture Analysis & Design Language (AADL) Standard: A Basis for Model-Based Architecture-Driven Embedded Systems Engineering. In Proceedings of the Architecture Description Languages: IFIP TC-2 Workshop on Architecture Description Languages (WADL), World Computer Congress, Toulouse, France, 22–27 August 2004; Springer: Berlin/Heidelberg, Germany, 2005; pp. 3–15. [Google Scholar]
- Feiler, P.H.; Gluch, D.P. Model-Based Engineering with AADL: An Introduction to the SAE Architecture Analysis & Design Language; Addison-Wesley: Cambridge, UK, 2012. [Google Scholar]
- Kherbouche, M.; Molnár, B. Formal Model Checking and Transformations of Models Represented in UML with Alloy. In Proceedings of the Modelling to Program: Second International Workshop, M2P 2020, Lappeenranta, Finland, 10–12 March 2020; Revised Selected Papers 1. Springer: Berlin/Heidelberg, Germany, 2021; pp. 127–136. [Google Scholar]
- Gamble, R.F.; Stiger, P.; Plant, R. Rule-based systems formalized within a software architectural style. Knowl.-Based Syst. 1999, 12, 13–26. [Google Scholar] [CrossRef]
- Bowen, J.P. Z: A formal specification notation. In Software Specification Methods: An Overview Using a Case Study; Springer: London, UK, 2001; pp. 3–19. [Google Scholar]
- Jackson, D. Alloy: A lightweight object modelling notation. ACM Trans. Softw. Eng. Methodol. (TOSEM) 2002, 11, 256–290. [Google Scholar] [CrossRef]
- Heyman, T.; Scandariato, R.; Joosen, W. Security in Context: Analysis and Refinement of Software Architectures. In Proceedings of the 2010 IEEE 34th Annual Computer Software and Applications Conference, Seoul, Republic of Korea, 19–23 July 2010; pp. 161–170. [Google Scholar]
- Stringfellow, C.; Amory, C.; Potnuri, D.; Andrews, A.; Georg, M. Comparison of Software Architecture Reverse Engineering Methods. Inf. Softw. Technol. 2006, 48, 484–497. [Google Scholar] [CrossRef]
- Singh, R. A Review of Reverse Engineering Theories and Tools. Int. J. Eng. Sci. Invent. 2013, 2, 35–38. [Google Scholar]
- Maffort, C.; Valente, M.T.; Bigonha, M.; Hora, A.; Anquetil, N.; Menezes, J. Mining Architectural Patterns Using Association Rules. In Proceedings of the International Conference on Software Engineering and Knowledge Engineering, Boston, MA, USA, 27–29 June 2013. [Google Scholar]
- Ali, M.; Mushtaq, H.; Rasheed, M.B.; Baqir, A.; Alquthami, T. Mining software architecture knowledge: Classifying stack overflow posts using machine learning. Concurr. Comput. Pract. Exp. 2021, 33, e6277. [Google Scholar] [CrossRef]
- TEAMMATES—Online Peer Feedback/Evaluation System for Student Team Projects. Available online: https://teammatesv4.appspot.com/web/front/home (accessed on 1 February 2024).
- Herold, S. SAEroConRepo. 2017. Available online: https://github.com/sebastianherold/SAEroConRepo (accessed on 14 May 2023).
- Schröder, S.; Buchgeher, G. Discovering Architectural Rules in Practice. In Proceedings of the 13th European Conference on Software Architecture—Volume 2, New York, NY, USA, 9 September 2019; ECSA’19. pp. 10–13. [Google Scholar]
- Srinivasan, A. The Aleph Manual. 2001. Available online: https://www.dcc.fc.up.pt/~ines/aulas/1920/TAIA/The%20Aleph%20Manual%20V6.pdf (accessed on 19 February 2024).
- Galárraga, L.A.; Teflioudi, C.; Hose, K.; Suchanek, F. AMIE: Association Rule Mining under Incomplete Evidence in Ontological Knowledge Bases. In Proceedings of the 22nd International Conference on World Wide Web, Rio de Janeiro, Brazil, 13–17 May 2013; pp. 413–422. [Google Scholar]
- Lajus, J.; Galárraga, L.; Suchanek, F. Fast and Exact Rule Mining with AMIE 3. In Proceedings of the The Semantic Web: 17th International Conference, ESWC 2020, Heraklion, Crete, Greece, 31 May–4 June 2020; Proceedings 17. Springer: Berlin/Heidelberg, Germany, 2020; pp. 36–52. [Google Scholar]
- Manyika, J.; Hsiao, S. An overview of Bard: An Early Experiment with Generative AI. Available online: https://ai.google/static/documents/google-about-bard.pdf (accessed on 14 December 2023).
- Achiam, J.; Adler, S.; Agarwal, S.; Ahmad, L.; Akkaya, I.; Aleman, F.L.; Almeida, D.; Altenschmidt, J.; Altman, S.; Anadkat, S.; et al. GPT-4 Technical Report. arXiv 2023, arXiv:2303.08774. [Google Scholar]
- White, J.; Fu, Q.; Hays, S.; Sandborn, M.; Olea, C.; Gilbert, H.; Elnashar, A.; Spencer-Smith, J.; Schmidt, D.C. A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT. arXiv 2023, arXiv:2302.11382. [Google Scholar]
- Liu, N.F.; Lin, K.; Hewitt, J.; Paranjape, A.; Bevilacqua, M.; Petroni, F.; Liang, P. Lost in the Middle: How Language Models Use Long Contexts. arXiv 2023, arXiv:2307.03172. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Schindler, C.; Rausch, A. Formal Software Architecture Rule Learning: A Comparative Investigation between Large Language Models and Inductive Techniques. Electronics 2024, 13, 816. https://doi.org/10.3390/electronics13050816
Schindler C, Rausch A. Formal Software Architecture Rule Learning: A Comparative Investigation between Large Language Models and Inductive Techniques. Electronics. 2024; 13(5):816. https://doi.org/10.3390/electronics13050816
Chicago/Turabian StyleSchindler, Christian, and Andreas Rausch. 2024. "Formal Software Architecture Rule Learning: A Comparative Investigation between Large Language Models and Inductive Techniques" Electronics 13, no. 5: 816. https://doi.org/10.3390/electronics13050816
APA StyleSchindler, C., & Rausch, A. (2024). Formal Software Architecture Rule Learning: A Comparative Investigation between Large Language Models and Inductive Techniques. Electronics, 13(5), 816. https://doi.org/10.3390/electronics13050816