Evolution in the Usage of AI in Parliaments
Author: Monica Palmirani, Professor at the University of Bologna. Written on September, 2024
This publication is part of the book “Artificial Intelligence in Legislative Services: Principles for Effective Implementation”. To download the entire book, use the button below:
Introduction
Artificial intelligence is transforming our societies and everyday life, and its influence is rapidly extending to government institutions, including parliaments. Since most discussions have focused on AI’s role in administrative and judicial decision-making, its use in parliaments remains largely under-analysed, despite its potentially more disruptive impact.
However, the Parliaments are moving some steps forward using proofs-of-concept for experimenting, with new AI solutions, operative tools for main three purposes:
Administrative tasks: to minimise the burden, optimise efficiency, and improve the quality of administrative tasks of the civil servants. Using AI many repetitive jobs could be automatised (e.g., transcript of Assembly), some very time-consuming activities could be delegated (e.g., summarising and ordering the amendments), and some intellectual tasks can pre-process (e.g., consolidation of the bill);
Legislative tasks: to support the decision-maker and the members of parliament's legislative initiative. The AI helps to elicit hidden legal knowledge that the complex legal system doesn’t permit to inspect and manage easily and clearly. We could use AI to retrieve pertinent legal sources (e.g., eDiscovery), simulate the application of the new bill and so to evaluate the possible effects, check the compliance with existing norms, or measure the adherence of the norms with some policies (e.g., Climate Change, gender balance);
Participation tasks: to help the citizens, companies, and institutions to easily access and understand the legislative norms. Using a chatbot or conversational interface portal the end-users can interview the normative system database according to their needs. The query-answering system can support the information retrieval and some legal reasoning portals can return useful information concerning a specific case.
Considering the fundamental role of the Parliaments in the Democratic system, it is crucial to analyse the innovation of AI state of the art through the lens of general principles of law, with a particular emphasis on the theory of law and constitutional theory. If we let technology shape the legal domain without a solid grounding in legal theory, we risk weakening the values that support democracy and the rule of law. By placing AI’s role in parliamentary processes within a constitutional framework, we ensure that technological progress strengthens, rather than undermines, the foundation of our legal systems.
In this scenario, AI systems applied in the parliamentary domain need to follow guidelines for monitoring and governing all the production workflow, from the dataset selection to the evaluation of the results by legal experts. For this reason, the parliaments with a strong digital transformation roadmap are more equipped in terms of infrastructure, competencies, culture, and organisation to face this disruptive momentum of the AI age. Secondly, to make the AI effective, a solid digitalisation of the documentary system should be in a very advanced status, using advanced LegalXML standards and Semantic Web technology for annotating legal knowledge. With a Parliament based only on paper processes is impossible to catch the benefit of the AI revolution.
Consequently, the qualified and annotated legal datasets coming from previous research and technologies applied in the last decades in the Parliaments addressed to the digitalisation of some tasks are now pillars for achieving relevant results for enhancing the law-making process with assistive AI tools. To jump directly to the generative AI tools risks not capitalising on the enormous assets of legal knowledge embedded inside the digital documents. Hence, the work conducted by the AI and law community in the last thirty years is fundamental for preparing the necessary ground for the correct application of AI in Parliament.
After all, we have witnessed an evolution in the digitisation of legal sources, in particular inside of the parliaments or in the legislative drafting offices (e.g., government) in the last ten years oriented to improve not only the publication online of legal sources, but also to redesign the workflow in the lens of the digitisation of the documents flow.
From the digitisation of Parliaments to the AI through Open Data
The process of documentary digitisation was the necessary forerunner of the current hype of AI in Parliaments. It has gone through several phases:
Figure 1 – Evolution in the digitisation of legal sources.
In the 90s’ the Official Journals focused on publishing the legislation online on the Web to implement the principle of accessibility and also the Parliaments followed this trend for enhancing the transparency of the parliamentary activities. Later, open access to law online using the Web was the main goal for sharing legal sources in the ‘Web of Data ‘approach (Filtz 2020, 2021, Livermore 2019) creating Open Data collections of documents and legal ontologies. Consequently, we applied the same standard for a deep digital transformation of the law-making process, while enhancing workflows between institutions. The fourth step is to use all the open data and the legal document structure represented in open standards to enable legal data analytics, create new AI applications by using these legal big data, and also to transform portions of procedural rules into smart contracts that are immediately executable and enforceable (see https://dati.senato.it/sito/home that provide RDF format, ontology and AKN bulk in github).
Several official journals, national archives, and parliaments have sought to manage legal sources within legal corpora with the use of technologies like databases, XML, RDF-metadata, and logic formulas. Subsequently, they also set out to provide updated versions of the law at any moment in time (the so-called point-in-time mechanism). Using Formex, an SGML data standard now translated into XML (Formex v4) and integrated with ELI and ECLI, Eur-Lex began to consolidate the database of European Legislation in 1999 and now is moving the whole document collection to Akoma Ntoso using AKN4EU. Today the Publication Office of European Union is experimenting with the LLM for marking up the AKN4EU and for producing the consolidated versions (AI4XML project). The Emilia-Romagna Region (Italy) started to consolidate regulations back in 2003 using the NormeInRete (NIR) XML schema and now it promotes an important project of LLM called SAVIA for supporting the information retrieval of the relevant legislation using a conversational chatbot. The Senate of Italy adopted the Akoma Ntoso standard for bills, transcripts, and other kinds of documents also provided in Open Government Data and now is promoting the use of AI inside of the Parliament for extracting the amendments during the bill changes. On 30 June 2009, the Senate of Brazil launched the parliamentary consolidated database (LexMLBrazil) with a point-in-time function based on a customisation of the XML Akoma Ntoso schema and now some experiments with ChatGPT have been developed. The National Archives of the UK have progressively been transforming all UK legislation into XML, RDF, and Akoma Ntoso since 2012. Recently also the case-law is managed in AKN. The legislation in XML format permits to take advantage during the new bill drafting from large annotated corpora and in this way to favouring the consolidation of the amending draft bill. The AI in general and the LLM can improve this task that is under experimenting in UK. In 2017, the United Nations approved Akoma Ntoso as the official standard for their documentation (AKN4UN), and the EU institutions launched a similar project in 2018 with the AKN4EU initiative. WHO has been transforming all the workflow processes using AKN4UN to detect the “obligation to make periodical reports”. Especially inside of the WHO Assembly to have AKN documents improve interoperability between institutions, member states, and stakeholders and permit to take under hidden valuable knowledge. Moreover, LegalXML modelling provides a robust and solid digital serialisation of legal documents by applying principles of legal theory to annotate legal knowledge (e.g., temporal parameters, semantic web annotation, document structure, normative citations). The Chamber of Deputies of Italy on February 2024 launched a Manifestation of Interest in experimenting with generative AI to support the legislative initiative by the deputies and the operative tasks of the legislative offices. Now the Chamber of Deputies and the Italian Senate have been developing proof-of-concept of the use of LLM for extracting automatically the amendments from the modified bill, for ordering and classifying the amendments.
AI and Legislative Process in Parliaments
AI and Law communities over the last thirty years have developed widely shared theories and models that are capable of managing norms, values, principles, beliefs, interpretation, and argumentation (Sartor, Prakken, Rotolo, Boella, van der Torre). Other scholars use ML/NLP/AI non-symbolic techniques for extracting, classifying, and analysing legal knowledge and legal norms starting from the text (Ashely 2017). Many members of the AI&Law community have developed logic theories and methods for modelling norms in legal formulas and have also developed tools for managing the legal reasoning interaction with legal experts (Governatori, Palmirani, Boella). Some research projects started important investigations in the direction of “Law as Data” to extract data from legal texts and to improve information retrieval based on semantic and legal ontologies (Palmirani 2018, 2018a 2020,2022, Liga 2019, 2019a). The Lynx project aims to translate a legal system into a knowledge graph; ManyLaws mixes different legal metadata to improve searchability. What is new in these research endeavours is the aim to codify normative thought directly using programming languages without passing through any legal language. OpenFisca undertakes to codify significant fragment of legal system with programming; and Marcell, for example, uses AI to improve multilingualism in legal documents. These projects are currently isolated and not well integrated in a unique research vision, and especially they do not fully include the philosophy of law, legal theory analysis, or constitutional law, and do not create a robust legal framework for digital a legal system that is dynamic and diachronic in multilingual perspectives with multiple interpretations and meanings. The ERC project CompuLaw is one of the more advanced projects that take an interdisciplinary approach including legal-techno-social aspects. However, it is more focused on logic-symbolic and non-symbolic modelling of norms integrated with AI techniques like predictive law and eJustice. The ERC project HyperModeLex is focused on the legislation domain. The communication of the AI results is a fundamental task in light of the transparency and explicability principles contained in the Artificial Intelligence Act (AIA) (see Arts. 13 and 14 – Human oversight). It is important to mitigate the ‘black box’ effect (Pasquale 2015, Sovrano 2021, 2024). The Legal Design approach and methodology (Hagan 2020), based on graphic arts and human-computer interaction pillars, are oriented toward favouring the communication of legal knowledge using visualisation and dynamic interfaces. This visual approach permits a better understanding of the AI results in the light of human oversight and human-in-control principles and guarantees the autonomy of the decision-maker.
‘Rules as Code’, ‘Law as Code’,‘Digital-ready policy’
We need to go beyond the state of the art of the current theory of law in parliaments and take the challenge of ‘coding of the law’ by building a solid IT-based legal framework supported by the philosophy of law, theory of law, ethics, constitutional law, parliamentary regulation (Micklitz) and a clear roadmap (Von Lucke 2023). However, there are at least three different methodologies nowadays:
‘Rules as Code’: the legislative process is modelled with flow-chart analysis and coding for a better understanding of the implications and to produce ‘computable law’ easy to integrate into the information systems (e.g., eGov services);
‘Law as Code’: the legislative process starts with drafting legal text for later converting the norms into machine-computable format (e.g., Akoma Ntoso, USML, etc.);
‘Digital-ready policymaking’: the legislative process is modelled for checking compliance against some policies and forecasting the effects in society, it is designed using human-computer interaction principles and a legal design approach simplifying the legal language.
The Parliaments should decide which approach to adopt according to the type of law to model. Each approach has pros and cons. ‘Rule as Code’ is very computable in automatised software but it is also less flexible to the changes of the law; ‘Law as Code’ is flexible and oriented to model norms and principles for admitting multiple interpretations; ‘Digital-ready’ is a managerial and service-oriented approach good for technical norms (e.g., bank law, school law).
Hybrid AI approach in Parliaments
The above-mentioned approaches could take great advantages and rush the use of AI, especially non-symbolic AI (Machine Learning / Deep Learning/ Large Language Model). AI is rapidly evolving, and it is becoming evident that a hybrid technical framework combining machine learning, deep learning based on stochastic technologies, LLM, with semantic knowledge modelling, legal reasoning, and a symbolic rule-based approach (Palmirani 2020, Ashley 2020, Verhij) could produce better results in the legal domain. A retrieval augmented generation (RAG) definitely supports the updating and training task of LLM with the most relevant documents in the legislative system. However, the main problem with current applications of non-symbolic AI (ML/DL/LLM) in the legal domain is the lack of contextual information. This affects the ability to create useful relationships between different annotations, classifications, clustering, correlations, and regressions.
In more detail, the main problems in the current state of the art in ML/DL applications for legal documents include the following:
ML/DL/GenAI works without semantics, and much contextual information included in the legislative document is neglected, with an evident lower capacity for interpretation of similar concepts (e.g., palliative care, hospice care).
Legal citations are a consolidated best practice in legal disciplines, which entrust some important meta-role to external textual resources (e.g., definitions, derogations, modifications, integration of prescriptiveness, penalties, and conditions). This means that ML/DL/LLM should also consider the cited text, especially considering that some algorithms (e.g., similitude, grouping) can find similarities in texts (e.g., “art. 3” and “art. 13”) when the content is completely different. For this reason, the network of norms through citations should be included in the baseline of the experiments.
Temporal parameters are fundamental to creating a robust ML/DL dataset. The repealed acts should have less importance in the probabilistic model rather than the updated codifications. So, frequency, probabilistic calculus, and temporal series should be mitigated with criteria of relevance and legal validity (e.g., enter into force, enter into operational date).
Logic and semantic web annotation should also be integrated with ML/DL in order to understand the type and meaning of relationships that connect different sentences in the text (e.g., obligation and penalty, obligation, and derogation).
Context in legislation domain is fundamental. We find in the legislative provisions’ frequent conditions (e.g., jurisdiction exclusion like in the United Kingdoms) or logic operators (e.g., Boolean connectors in and, or, xor in the legislative definitions) that are neglected by LLM.
Legal language is different from the common language and the LLM/GENAI technique depends by the tokenization process that is different language by language (e.g., in German the word Rindfleischetikettierungsüberwachungsaufgabe is a composition of several words). The legislature language changes from one legislature to another legislature, including political narrative tone. For this reason, the LLM could not have the same accuracy from one legislation to another.
Implicit legal rules are not embedded in the legal language but in the institutions rules, in the competencies power written in the Constitution Law or in the Assembly regulation, in the hierarchy of legal sources coming from the theory of law. These rules should be added to the ML/DL/LLM using rule-based approach.
For these reasons, a hybrid architecture, one that includes symbolic and non-symbolic AI, is strongly advocated in integrating ML/DL legal knowledge with Semantic Web annotation and legal deontic logic modelling (Deakin 2020). Akoma Ntoso as a common interchange LegalXML standard could be a good bridge for creating a common annotated digital corpus for robust AI applications.
Figure 2 – AI and the legal domain.
Conclusions
AI is growing rapidly in many human activities and also inside of the Parliaments for improving administrative, legislative, and communication tasks. The Parliaments need to have a roadmap for deciding which methodology to adopt (e.g., ‘Digital-Ready policies) according to the legal tradition and the type of scenario. Additionally, they need to have clean technical frameworks (eg., Hybrid AI) for mitigating several risks (e.g., bias, discrimination, poisoning data, manipulation of the AI models, lack of explicability). Finally, guidelines for conducting the different projects should be followed for respecting the ethical, legal, and democratic principles (e.g., autonomy of the legislative decisions, legitimacy of the process, sovereignty of the infrastructure).