Preprint
Brief Report

This version is not peer-reviewed.

Local Large Language Model for Analysis of Regulations of Book Four of the Civil Code of Catalonia relating to Successions and the Notary Profession of Spain

Submitted:

04 April 2026

Posted:

07 April 2026

You are already at the latest version

Abstract
Large language models (LLMs) represent a cutting-edge breakthrough in the deep learning models designed for processing human languages. This study created a local LLM that used Book Four of the Civil Code of Catalonia relating to Successions and the regulations of the Notary Profession of Spain for summarization and answering questions in a context of increased security. The model summarized and replied to specific questions in a reasonable manner but was not absent of information loss and contextual misinterpretation. In the field of legal sciences, this technology represents an opportunity. However, only precise information and secure legal reliability should be considered valid.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

The current law, following the plan for the codification of Catalan civil law outlined by Law 29/2003, of December 30, the first law of the Civil Code of Catalonia [1], approved the fourth book of the Civil Code, dedicated to the law of succession [2].
Book Four represented both technical and other innovations that reflected legal policy decisions with clear social impact [3]. The latter included a comprehensive overhaul of the system of inheritance agreements, the reconsideration of inheritance rights in intestate successions between spouses or cohabitants, the modification of the rules for calculating the statutory share, the new regulation of the widow’s share, and the elimination of reserved portions [2].
Book Four maintained the succession principles of Catalan law as they are embodied in the Succession Code [4]: the principles of need of an heir, universality of the title of an heir, incompatibility of succession titles, prevalence of the voluntary title, and permanence of the succession title [2].
These principles, which distinguish Catalan inheritance law from many other legal systems, have worked reasonably well in inheritance practice and so far, their alteration has not been considered appropriate [2].
Book Four contains six titles and several provisions. Title I of Book Four contains the general provisions regarding succession upon death. Title II deals with testate succession and begins with a chapter on wills, codicils, and testamentary memoranda. Other topics include the nullity and ineffectiveness of wills and testamentary provisions, institution of heir and fiduciary provisions, hereditary substitutions, trusts, legacies and modes of succession, and executors. Title III describes contractual succession and donations mortis causa. Title IV deals with intestate succession. Title V with other inheritance rights determined by law. Title VI deals with the acquisition of inheritance, and Book Four finishes with several provisions [2].
The law of notaries in Spain dates back to 1862 [5]. The Decree of June 2, 1944, approving the regulations for the organization and system of the notary profession was published by the BOE number 189 in 1944 [6]. Notaries are both public officials and legal professionals, and this dual nature is reflected in the organization of the notarial profession [7]. As public officials, they exercise notarial public faith, which has and protects a dual purpose. In the realm of facts, the accuracy of what the notary sees, hears, or perceives through their senses. Inn the realm of law, the authenticity and probative force of the declarations of intent of the parties in the public instrument drawn up in accordance with the law. Notably, the notary profession enjoys full autonomy and independence in its function, and in its hierarchical organization, it directly depends on the Ministry of Justice and the Directorate General of Registries and Notaries. Title I and II contain articles on notaries. Title III describes the notarial function. Title IV: Notary organization structure. Title VI presents the disciplinary corrections, followed by several attachments [6].
A large language model (LLM) is an advancement in natural language processing technology. LLM were developed by the introduction of the transformer architecture. Relevant studies in this field were “Attention is all you need” by Ashish Vaswani et al. in 2017 [8] and “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding” by Jacob Devlin in 2018 [9], both from Google research.
LLM are AI systems based on transformers designed to understand, process, and generate human-like generated text [10]. They use of network architectures learn patterns, context, and semantics. The basic architecture includes an input layer (tokenization by braking the input text into smaller units such as words, subwords or characters), an embedding layer (the tokens are mapped into dense vectors using word embedding, and the order of tokens is set up by positional embedding), a transformer architecture (the relationship of each word is calculated by self-attention using queary (Q), key (K), and value (V) vectors, and multiple relationships are focused by multi-head attention), stacking layers (multiple blocks), and an output layer (an autoregressive model like GPT predicts the next word, a masked model like BERT predicts missing words, and a final softmax layer converts outputs into a probability distribution over the vocabulary (Figure 1).
A LLM is initially trained on models that contain billions of parameters using GPUs or TPUs and massive datasets from many sources. After pre-training, the models are fine-tuned and refined on specific datasets for particular tasks, and hyperparameters, including learning rate and batch size, are adjusted to obtain the best performance on a specific task. During training, the model minimizes a loss function, usually cross-entropy by adjusting weights by gradient descent [11] and backpropagation [12,13,14,15,16] (Figure 2).
A local LLM is an AI system that runs directly on your personal computer, sever, or local infrastructure instead of relying on cloud-based systems. Local LLMs are identical to their cloud counterparts and generate text, answer questions, write code, and process natural language. Appendix A explains the transformer in an interactive manner using a text-generative model [17]. The major benefits of local LLMs are enhanced privacy and security, cost-effectiveness for high-volume usage, ultra-low latency performance, and complete offline functionality. A local LLM is easily deployed and includes the following steps: hardware acquisition, selection of a runner such as Ollama [18] or LM Studio [19], runner installation, model download, testing the model, deployment, and use.
Meta developed and released the Meta Llama 3 family of LLMs, which are a collection of pre-trained and instruction, tuned generative text models in 8 and 70B sizes. The Llama 3 instruction models are optimized for dialogue [20]. The model input is text only, and the model output is text and code only. Llama 3 is an auto-regressive language model based on an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety. The Llama 3 model was released on April 18 2024 [20].
This study created a local LLM to query and analyze the regulations of Book Four of the civil code of Catalonia relating to successions and the notary profession of Spain.

2. Methods

GPT4All v3.10.0 was installed on a desktop workstation equipped with an AMD Ryzen 9 5900X CPU, 48.0 GB RAM, and NVIDIA GeForce RTX 4080 Super (16 GB) GPU.
The specific hardware details were as follows: 12-Core AMD Ryzen 9 5900X, 4900 MHz (49.25 x 99) CPU (Vermeer), ASRock B550M Pro4 motherboard, Dual DDR4 SDRAM bus type, 49076 physical memory (DIMM1/2: Crucial CT16G4DFRA32A.C8FF, and DIMM3/4: Crucial CT8G4DFRA32A.C8FP), AMD K19.2 IMC North Bridge chipset, AMI UEFI P3.40 BIOS, Microsoft Windows 10 IoT Enerprise LTSC 2021, and Gigabyte RTX 4080 Super WindForce V2 (GV-N408SWF3V2-16GD) Video Adapter (GPU).
Several chat models were locally installed, including Reasoner v1, Llama 3 8B Instruct, DeepSeek-R1-Distill-Qwen-14B, Mistral Instruct, Orca2 (Full), Wizard v1.2, Hermes, Snoozy, Phi-3 Mini Instruct, Meta-Llama-3-8B-Instruct.Q4_0.gguf, and orca-2-13b.Q4_0.gguf. All models were tested, but final analysis was performed using Llama 3 8B Instruct.
Llama 3 8B Instruct chat with local files included a folder with two-word docx files with the Spanish original versions:
  • Fourth Book of the Civil Code, dedicated to the law of succession (Ley 10/2008, de 10 de julio, del libro cuarto del Código civil de Cataluña, relativo a las sucesiones) [3]
  • The Decree of June 2, 1944, approving definitively the Regulations for the organization and system of the Notary Profession (Decreto 2 junio 1944, por el que se aprueba con carácter definitivo el Reglamento de la organización y régimen del Notariado) [7].
The settings were the following: 4 CPU threads, Llama 3 8B Instruct (Meta-Lama-3-8B-Instruct.Q4_0.gguf), 2048 context length, 128 prompt batch size, 0.4 Top-P, 0 Min-P, 32 GPU layers, 4096 max length, 0.7 temperature, 40 top-k, 64 repeat penalty tokens, and 1.18 repeat penalty.
The local docs settings allowed docx, pdf, txt, md, and rst file extensions. The compute device used for embeddings was NVIDIA GeForce RTX 4080 SUPER (CUDA). The number of characters per document snippet was set at 512. The max document snippets per prompt were 3.
Several questions relevant to the legal policy decisions of Book Four of the Civil Code related to the law of succession and regulations of the notary profession were asked, and results were compared with the original information.

3. Findings

3.1. General Findings

The local LLM managed to answer relevant questions in a reasonable and truthful manner. However, from a user point of view, although the text was well written and provided reasonable answers, the veracity of the replies was difficult to evaluate qualitatively without previously knowing the exact answers as described in the local files. Hallucinations with strikingly wrong answers were infrequent, but very specialized topics were difficult to evaluate.

3.2. Examples of Specific Questions

Examples of questions with correct LLM answers are as follows:
  • Question 1: Explain the difference between the legatee and heir.
Answer 1: “Based on the excerpts from the “Código Civil de Cataluña” (Spanish Civil Code), here’s a summary of the differences between a legatee and an heir:
Legatario/Legatee:
Receives specific assets or properties left behind by the testator through a legacy.
Does not inherit all of the testator’s assets, but only receives what is specifically bequeathed to them (Artículo 423-7).
Can have their share reduced if there are other legacies that need to be distributed first.
Heredero/Heir:
Inherits all assets left behind by the testator, including those not specifically disposed of in the will.
Has full control over managing these assets as they see fit (Artículo 462-4).
Can reduce excessive legacies if their distribution does not leave them with at least a quarter of the liquid estate’s value.
In summary:
Legatario/Legatee: Receives specific assets or properties through a legacy, but doesn’t inherit everything.”
  • Question 2: What is the “legítima”?
Answer 2: ”According to the excerpts from the “Código Civil de Cataluña” (Spanish Civil Code), the legitima refers to a portion of an inheritance reserved for the closest relatives, specifically:
Descendants: The minimum amount that must be left by a testator to their descendants.
Progenitors: The minimum amount that must be left by a testator to their ascendants.
The excerpts also establish rules and limitations regarding the legitima, including:
The testator cannot impose conditions, plazos or modes on legacies attributed to the legitima or imputable to it.
If the legacy has a value greater than what corresponds to the legitimario (the person entitled to receive the legitima), they must opt between accepting the legacy in its current form or claiming only their rightful share of the legitima.
If the legitimario accepts an inheritance or legacy subject to limitations, it is considered that they renounce exercising the option established by law.
In summary, the legitima refers to a minimum amount reserved for closest relatives (descendants and progenitors) in an inheritance, with specific rules governing its attribution, imputation, perception, and payment.”
  • Question 3: In what language can a will be written?
Answer 3: ”According to the excerpts from the “Código Civil de Cataluña” (Spanish Civil Code), a will can be written in either:
The official language of Catalonia, which is Catalan.
Additionally, if requested by the testator, another non-official language.
The notary public who witnesses the will must also sign it.”
  • Question 4:Which testamentary provisions are void?
Answer 4: ”According to the excerpts from the “Código Civil de Cataluña” (Spanish Civil Code), testamentary provisions that are void or revocable include:
Disposiciones Testamentarias: These can be revoked at any time, except for the recognition of non-marital children.
Testamentos anteriores: A new will supersedes and revokes all previous wills.
Additionally, according to the “Regimen del Notariado” (Notary Regulation), notarial positions that are:
Suppressed due to a demographic change and were not announced for provision in the Official Gazette (“Boletín Oficial del Estado”) will be abolished.
Served but must be suppressed: These notaries will continue serving until they leave their position or a certain period of time has passed, at which point they will become “Notarios excedentes de demarcación” (excess notaries) for all legal purposes.
These provisions are void and do not produce any effects.”
  • Question 5: Who cannot be a witness to a will?
Answer 5: ”Based on the excerpts from “Código Civil y Sucesiones” (Civil Code and Successions), it seems that there are certain individuals who cannot be witnesses to a will.
According to Article 421-19, notaries themselves cannot be witnesses to a will. This is because notaries have a specific role in verifying the authenticity of documents, including testaments, which requires them to maintain their impartiality and independence.
In other words, if a notary were to act as a witness to a will, it could compromise their ability to perform their duties objectively and fairly, potentially leading to questions about the validity or enforceability of the testament.”
  • Question 6:What happens if a notary falsifies a will?
Answer 6: “Consequences of a Notary Falsifying a Will.
According to the excerpts from “Regimen del Notariado” and “Código Civil y Sucesiones”, if a notary falsifies a will, it can have severe consequences.
Firstly, Article 143 states that documents authorized or intervened by a notary enjoy public faith. This means that any document bearing the notary’s signature is considered authentic and trustworthy.
However, if a notary were to falsify a will, they would be violating their professional duties as a notary. Notaries are responsible for verifying the authenticity of documents, including testaments, which requires them to maintain their impartiality and independence.
If a notary were found to have falsified a will, it could lead to:
Loss of credibility: The notary’s reputation would be severely damaged, making it difficult for them to continue practicing as a notary.
Legal consequences: The notary could face legal action, including criminal charges and fines.
Invalidation of the will: In extreme cases, the falsified will might be declared invalid or null and void by the courts.
In summary, if a notary were to falsify a will, it would have serious repercussions for their professional reputation, legal standing, and personal integrity.”
  • Question 7: What is the difference between a simple and a legal copy of a will?
Answer 7: “Simple Copy vs. Legal Copy of a Will
In the context of Notariado Sucesiones, there are two types of copies of a will: simple copy (simplex) and legal copy (auténtico).
Simple Copy (Simplex): A simple copy is an unofficial reproduction of the original will. It may be created by photocopying or scanning the document. This type of copy does not have any official standing, as it was not prepared under the supervision of a notary public.
Legal Copy (Auténtico): A legal copy, also known as an “auténtico,” is an officially certified reproduction of the original will. It is created by a notary public who verifies that the document is a true and accurate representation of the testator’s intentions. The notary public signs and seals the document to attest its authenticity.
Key differences between simple and legal copies:
Authenticity: A legal copy (auténtico) has official standing, as it was prepared under the supervision of a notary public who verified its accuracy.
Certification: Only a notary public can certify that a will is authentic. Simple copies do not have this certification.
In summary: if you need to prove the authenticity and validity of a will in court or for other legal purposes, it’s essential to use an officially certified legal copy (auténtico) rather than a simple copy.”
  • Question 8: What is the trustee’s responsibility?
Answer 8: ”Based on the excerpts, it appears that there is no specific mention of a “trustee” in these documents. However, I can infer some information about fiduciaries (fiduciantes) and their responsibilities from the text.
In the excerpt from Libro 4 Código Civil de Cataluña (Book 4 of the Catalan Civil Code), it seems that a fiduciary is responsible for:
Conservación y administración (conservation and administration): The fiduciary must manage and preserve the assets entrusted to them.
Responsabilidad del fiduciario (fiduciary’s responsibility): If something goes wrong, the fiduciary may be held accountable.
In general, a trustee is responsible for managing property or assets on behalf of another person, known as the beneficiary. The trustee must act in the best interests of the beneficiary and follow any instructions provided by them.”
  • Question 9: Is it possible to issue copies of revoked wills, and what is their use?
Answer 9: “According to the excerpts, it is possible to issue copies of revoked wills (Article 226), but their use is limited. The copy can only be used to “acreditar su contenido” (authenticate its content) and leave a record of its lack of validity.
In other words, the copy of a revoked will has no legal value or effect, it’s just a historical document that shows what was originally established in the will.”
  • Question 10: How long are protocols kept at the notary’s office?
Answer 10: “According to the excerpt, it seems that protocols are kept at the notary’s office for a period of time. The exact duration is not specified in this particular text.
However, we can infer from other excerpts that protocols are incorporated into each year’s protocol book (Protocolo Notarial) and are stored until they are transferred to an Archivo General de Protocolos (General Archive of Protocols).”

4. Discussion

Running local LLMs is a solution when there are privacy concerns, high subscription costs, and unreliable internet connections. Local LLMs allow complete control of sensitive data and are less expensive in the long term once the hardware has been purchased [21].
To achieve good performance with models of 7B, the recommended amount of RAM is 16 GB. For 13B models, the recommended amount is 32 GB. The use of GPU acceleration increases the speed of the local LLMs the cards that work best are NVIDIA, followed by Apple Silicon M hardware [22]. There are several tools to start using local LLMs such as Ollama, LM Studio, and LocalAI. In this study, we used GPT4all, a straightforward GUI-based method [23].
Llama 3 is an LLM AI model capable of generating text and code in response to prompts. Meta created the Llama 3 family, which included both 8 and 70B sizes pre-trained and instruction, tuned generative text models. Both models use grouped-query attention (GQA) for improved inference scalability [24,25,26,27]. The Llama 3 tuned models were optimized for dialogue use cases, such as the local files included in this study.
The Llama3-8b-instruct was designed to enhance natural language understanding and generation. It is characterized by instruction following, contextual understanding, scalability (with 8 billion parameters can handle language tasks with high accuracy and efficiency), fine-tuning capabilities, and multimodal integration (including images and audio). Overall, Llama3-8b-instruct is a lightweight and ultrafast variant for use when quick response times are needed most [28]. Additional information is found on the Hugging Face website [29].
Book Four of the Civil Code of Catalonia relating to Successions provides the legal framework for citizens to acquire inheritance. The text has many chapters and range from relevant ones like acquisition of inheritance, incapacity to inherit, types of wills, and illicit or erroneous motives in the institution of heir to less relevant and specialized like concurrence of multiple heirs, opposition of creditors, collatable assets, and will before a parish priest [1,4,5]. Because of its length only specialized lawyers have a deep knowledge of this field. Average citizens may not be aware that the book is freely available online and that it also appears in the Boletin Oficial del Estado, which is the official gazette of Spain, and other sites such as Noticias Juridicas and Civil Code of Catalonia and complementary legislation. All information is found in three specialized websites: https://www.boe.es/index.php, https://noticias.juridicas.com/, and the https://portaljuridic.gencat.cat/ca/normativa/dret-a-catalunya/Codis-legislacio/codi-civil-de-catalunya-i-legislacio-complementaria/.
Chat GPT is an artificial intelligence tool that emerged in 2022 and has been a game-changer for legal sciences. This new technology represents both an opportunity and a threat to the legal sector. It is unclear to what extent this transformation has been and will be a reality in the world of law. In today’s digital age, technical brilliance is no longer enough for legal professionals. The market demands other skills, such as digital and accounting competence, knowledge of new business models, and strong communication skills. Artificial intelligence platforms draw on the vast amounts of data from multiple sources available online. However, what sets them apart in the legal sector is that only information with precise and secure legal reliability is considered valid. Regarding legal security, confidentiality, and data protection, open platforms like ChatGPT pose a risk. In this respect, local LLMs may play a role in the future.

5. Conclusions

Large language models (LLMs) represent a cutting-edge breakthrough in the deep learning models designed for processing human languages. LLMs have many capabilities, such as language translation, text generation, question answering, sentiment analysis, and summarization. However, LLMs are associated with several risks, such as inaccurate translations, contextual misinterpretation, biased translations and amplification, information loss, privacy and data security breaches, and hallucinations. The use of a local LLM has the advantage of decreasing usage costs, increased reliability due to network outages, and increased security. The disadvantages are the high initial hardware costs, the necessity of technical expertise, and the limited availability of the most advanced LLM models.
In the field of legal sciences, this technology represents an opportunity. This study created a local LLM model to interact privately with Book Four of the Civil Code of Catalonia relating to Successions and the regulations of the Notary Profession of Spain. The local LLM managed to answer specific questions in a reasonable manner. However, only precise information and secure legal reliability should be considered valid. Therefore, all legal procedures should be performed by legal human specialists and agencies.

Supplementary Materials

The following supporting information can be downloaded at the website of this paper posted on Preprints.org. The Fourth Book of the Civil Code, dedicated to the law of succession (Ley 10/2008, de 10 de julio, del libro cuarto del Código civil de Cataluña, relativo a las sucesiones) and the Decree of June 2, 1944, approving definitively the Regulations for the organization and system of the Notary Profession (Decreto 2 junio 1944, por el que se aprueba con carácter definitivo el Reglamento de la organización y régimen del Notariado).

Author Contributions

Conceptualization, methodology, software, formal analysis, and writing, JC. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Ministry of Education, Culture, Sports, Science and Technology (MEXT), Grants-in-Aid for Scientific Research (KAKENHI) Japan Society for the Promotion of Science (JSPS) grant numbers 23K06454 and 25K10272.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

All data are available as Supplementary Data and upon request to Joaquim Carreras (joaquim.carreras@tokai.ac.jp).

Conflicts of Interest

None to declare.

Abbreviations

The following abbreviations are used in this manuscript:
AI Artificial intelligence
BERT Bidirectional transformers for language understanding
CPU Central processing unit
GPT Generative pre-trained transformer
GPU Graphics processing unit
LLM Large language model
RAM Random-access memory

Appendix A

Appendix A.1. Transformer Explainer: Example

Preprints 206657 i001

Appendix A.2. Transformer Explainer: Probability of “Expected” Token Being Sampled

Preprints 206657 i002

References

  1. Código de Leyes Civiles de Cataluña. Agencia Estatal Boletin Oficial del Estado (BOE). https://www.boe.es/biblioteca_juridica/codigos/codigo.php?id=150&modo=2&nota=0&tab=2.
  2. Ley 10/2008, de 10 de julio, del libro cuarto del Código Civil de Cataluña, relativo a las sucesiones. «DOGC» núm. 5175, de 17/07/2008, «BOE» núm. 190, de 07/08/2008. Entrada en vigor: 01/01/2009. Departamento: Comunidad Autónoma de Cataluña. Referencia: BOE-A-2008-13533. Permalink ELI: https://www.boe.es/eli/es-ct/l/2008/07/10/10/con.
  3. Noticias Juridicas. Ley 10/2008, de 10 de julio, del libro cuarto del Código civil de Cataluña, relativo a las sucesiones. Website: https://noticias.juridicas.com/base_datos/CCAA/ca-l10-2008.html (Last accessed on 3rd April 2026). .
  4. GenCat. Departament de Justicia. Llibre quart del Codi civil de Catalunya, relatiu a les successions. Website: https://repositori.justicia.gencat.cat/handle/20.500.14226/589#page=1 (Last accessed on 3rd April 2026).
  5. Ley del Notariado de 28 de mayo de 1862. Publicado en: «Gaceta de Madrid» núm. 149, de 29/05/1862. Entrada en vigor:19/06/1862. Departamento: Ministerio de Gracia y Justicia. Referencia: BOE-A-1862-4073. Permalink ELI: https://www.boe.es/eli/es/l/1862/05/28/(1)/con.
  6. Preliminary title. Fundamental principles. Article 1. Decreto 2 junio 1944, por el que se aprueba con carácter definitivo el Reglamento de la organización y régimen del Notariado. Órgano MINISTERIO DE JUSTICIA. Publicado en BOE núm. 189 de 07 de Julio de 1944. Vigencia desde 27 de Julio de 1944. Revisión vigente desde 08 de Noviembre de 2015.
  7. Noticias Juridicas. Ley de 28 de mayo 1862, Orgánica del Notariado. Website: https://noticias.juridicas.com/base_datos/Privado/ln.html (Last accessed on 3r April 2026).
  8. Attention Is All You Need. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin. arXiv:1706.03762.
  9. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova. arXiv:1810.04805.
  10. Zhang, E.Y.; Cheok, A.D.; Pan, Z.; Cai, J.; Yan, Y. From Turing to Transformers: A Comprehensive Review and Tutorial on the Evolution and Applications of Generative Transformer Models. Sci 2023, 5, 46. [CrossRef]
  11. Sebastian Ruder. An overview of gradient descent optimization algorithms. arXiv:1609.04747.
  12. ROBERT HECHT-NIELSEN. III.3 - Theory of the Backpropagation Neural Network**Based on “nonindent” by Robert Hecht-Nielsen, which appeared in Proceedings of the International Joint Conference on Neural Networks 1, 593–611, June 1989. © 1989 IEEE., Editor(s): Harry Wechsler, Neural Networks for Perception, Academic Press, 1992, Pages 65-93, ISBN 9780127412528. [CrossRef]
  13. LeCun, Y., Bottou, L., Orr, G. B., & Müller, K. R. (1998). Efficient backprop. In Neural networks: Tricks of the trade (pp. 9-50). Springer.
  14. Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1986). Learning representations by back-propagating errors. Nature, 323(6088), 533-536.
  15. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., & Polosukhin, I. (2017). Attention is all you need. In Advances in neural information processing systems (Vol. 30).
  16. Guenole, N. (no date) Psychometrics.ai: Transforming Behavioral Science with Machine Learning. Available at: https://psychometrics.ai (Accessed on 3rd April 2026).
  17. Aeree Cho, Grace C. Kim, Alexander Karpekov, Alec Helbling, Zijie J. Wang, Seongmin Lee, Benjamin Hoover, Duen Horng Chau. Transformer Explainer: Interactive Learning of Text-Generative Models. arXiv:2408.04619.
  18. Ollama. Website: https://ollama.com/ (last accessed on 3rd April 2026).
  19. LM Studio AI. Element Labs, Inc. (c) 2026. Website: https://lmstudio.ai/ (last accessed on 3rd April 2026).
  20. Llama 3 open-source AI model. Meta. Website: https://www.llama.com/models/llama-3/ (Last accessed on 3rd April 2026).
  21. Patil, R.; Gudivada, V. A Review of Current Trends, Techniques, and Challenges in Large Language Models (LLMs). Appl. Sci. 2024, 14, 2074. [CrossRef]
  22. Abdollahi, M.; Yeganli, S.F.; Baharloo, M.; Baniasadi, A. Hardware Design and Verification with Large Language Models: A Scoping Review, Challenges, and Open Issues. Electronics 2025, 14, 120. [CrossRef]
  23. Chen X, Ma W, Li D, Zhu F, Routray S, Guduri M, Margala M. Kalman-based Adaptive Moment Estimation Optimisation Algorithm to Enhance GPT in LLMs for Medical Sentiment Analysis of Patient Health-related Feedback. IEEE J Biomed Health Inform. 2025 Jan 10;PP. Epub ahead of print. PMID: 40030961. [CrossRef]
  24. Ke, Y.H.; Jin, L.; Elangovan, K.; Abdullah, H.R.; Liu, N.; Sia, A.T.H.; Soh, C.R.; Tung, J.Y.M.; Ong, J.C.L.; Kuo, C.F.; et al. Retrieval augmented generation for 10 large language models and its generalizability in assessing medical fitness. NPJ Digit Med 2025, 8, 187. [CrossRef]
  25. Tayebi Arasteh, S.; Lotfinia, M.; Bressem, K.; Siepmann, R.; Adams, L.; Ferber, D.; Kuhl, C.; Kather, J.N.; Nebelung, S.; Truhn, D. RadioRAG: Online Retrieval-Augmented Generation for Radiology Question Answering. Radiol Artif Intell 2025, 7, e240476. [CrossRef]
  26. Zhang, R.; Wang, Y.; Yang, W.; Wen, J.; Liu, W.; Zhi, S.; Li, G.; Chai, N.; Huang, J.; Xie, Y.; et al. PlantGPT: An Arabidopsis-Based Intelligent Agent that Answers Questions about Plant Functional Genomics. Adv Sci (Weinh) 2025, 12, e03926. [CrossRef]
  27. Zhong, W.; Liu, Y.; Liu, Y.; Yang, K.; Gao, H.; Yan, H.; Hao, W.; Yan, Y.; Yin, C. Performance of ChatGPT-4o and Four Open-Source Large Language Models in Generating Diagnoses Based on China’s Rare Disease Catalog: Comparative Study. J Med Internet Res 2025, 27, e69929. [CrossRef]
  28. Meta. Llama API. Meet the models. Website: https://llama.developer.meta.com/docs/models (Last Accessed on 4th April 2026).
  29. Hugging Face. meta-llama/Meta-Llama-3-8B-Instruct. Website: https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct (Last accessed on 4th April 2026).
Figure 1. LLM architecture.
Figure 1. LLM architecture.
Preprints 206657 g001
Figure 2. Gradient descent. Gradient descent is an optimization algorithm used to minimize the loss function in machine learning models. There are 3 major variants of the gradient descent algorithm, batch, stochastic, and mini-batch gradient descent.
Figure 2. Gradient descent. Gradient descent is an optimization algorithm used to minimize the loss function in machine learning models. There are 3 major variants of the gradient descent algorithm, batch, stochastic, and mini-batch gradient descent.
Preprints 206657 g002
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.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated