ARTIFICIAL INTELLIGENCE CHALLENGING CORE STATE FUNCTIONS. A FOCUS ON LAW-MAKING AND RULE-MAKING

: The use of AI in the public sector is emerging around the world and its spread affects the core States functions: the administrative, the judiciary, and the legislative. Nevertheless, a comprehensive approach to AI in the life-cycle of rules —from the proposal of a new rule to its implementation, monitoring and review— is currently lacking in the rich panorama of studies from different disciplines. The analysis shows that AI has the power to play a crucial role in the life-cycle of rules, by performing time-consuming tasks, increasing access to knowledge base, and enhancing the ability of institutions to draft effective rules and to declutter the regulatory stock. However, it is not without risks, ranging from discrimination, to challenges to democratic representation. In order to play a role in achieving law effectiveness while limiting the risks, a complementarity between human and AI should be reached both at the level of the AI architecture and ex post. Moreover, an incremental and experimental approach is suggested, as well as the elaboration of a general framework, to be tailored by each regulator to the specific features of its tasks, aimed at setting the rationale, the role, and adequate guardrails to AI in the life-cycle of rules. This agile approach would allow the AI revolution to display its benefits while preventing potential harms or side effects.

social benefit checks 5 , occupational safety 6 , food safety 7 , public procurement 8 , competition public enforcement 9 .Moreover, adjudication by or with the support of AI is increasing in many fields.For instance, workplace allocations to teachers according to their ranking level 10 , or subsidy grants 11 .AI is also improving administration of services, such as the numerous applications of so-called smart cities 12 .In addition, promising experiments promote a public administration which is collaborative towards citizens and firms.For instance, AI detects people who are eligible for benefits 13 , signals any risks of infringement in order to support compliance 14 , or identifies and communicates "with parties that may be affected by new or altered rules" 15 . 5In UK, a predictive system (no longer operational) was used in Hackney County to identify children and families vulnerable and at risk of child abuse, leveraging on data such as school attendance, housing information, economic indicators.The system was heavily criticized because of the lack of transparency over the risks indicators and the people involved (European Commission, JRC, Selected AI cases in the public sector, cit.).See also footnote 75. 6For AI in managing occupational safety and health inspections in construction sites in Lombardy Region (Italy), see OECD, DataDriven, InformationEnabled Regulatory Delivery, OECD Publishing, Paris, 2021, p. 14 ff. 7Since November 2019, the French Ministry of Agriculture use AI to target restaurant for health inspections (IAlim), leveraging on consumer feedback on online notification websites (European Commission, JRC, Selected AI cases in the public sector, cit.).In Lombardy Region (Italy), AI help in developing risk-based classification of food establishment leveraging on data such as positive/negative audit outcomes, resolution of previous nonconformities, or propensity for compliance (Alessio VIG-NA, "Modello di classificazione in base al rischio.Revisione dei metodi di pianificazione dei controlli ufficiali per la sicurezza alimentare in Lombardia", in Rassegna dell 'Osservatorio AIR, n. 3, 2023). 8For instance, machine learning can analyse data published on Tenders Electronic Daily-TED (the online version of the 'Supplement to the Official Journal' of the EU) and launch alerts when some risk indicator occur, e.g.short tender periods, limited number of proposals or contracts awarded competitively, large discrepancies between award value and contract amount (Alberto SANCHEZ-GRAELLS, Data-driven and digital procurement governance: Revisiting two well-known elephant tales, in Communications Law -Journal of Computer, Media and Telecommunications Law, vol.24, n. 4, 2019, p. 157 ff.). 9Cary COGLIANESE and Alicia LAY, Antitrust by algorithm, in Stanford Computational Antitrust, vol. 2, 2022, p. 1 ss. 10 In Italy, algorithm malfunction in the assignment of school substitutes (art.12, Order of the Italian Ministry of education, May 6, 2022) led to litigations (e.g.Rome tribunal, sezione lavoro, judgment n. 1463/2023).
11 For instance, the Slovenian "E-Sociala" optimise social benefits allocation and allow citizens to calculate their social rights (European Commission, JRC, Selected AI cases in the public sector, cit.). 12For instance, real time monitoring of traffic flow; information to consumers on the density of people in a given area of a city, or on a hazard on the street; automatic control of low-emission vehicle access to urban restricted areas (for Italian application see Report 3/2022 -Smart cities e intelligenza  artificiale, in Biolaw Journal, n. 1/2022, p. 253-259). 13In a Barcelona trial, IA identifies families eligible for a public benefits, informs them of their status with an SMS, and sends a link to accept the benefit (Juli PONCE SOLÉ, De como la calidad normativa y los sistemas algorítmicos, unidos a las aportaciones conductuales, pueden contribuir a la buena administración: a propósito del estudio El impacto de los trámites administrativos en el acceso a las prestaciones sociales.Una perspectiva conductual -Nudging aplicado a la Mejora de la Regulación y al Uso de Algoritmos y de Inteligencia Artificial, (wordpress.com)June 3, 2022.  1"GISA Self-assessment" is an open source digital service provided to firms working in the food and veterinary areas by the Campania Region (Italy), allowing an algorithmic calculation of firms' Footnote 15 in next page.As for the judiciary function, AI can both replace human judges, or (more likely) 16 support them.Examples of technical help are advanced case-law search engines 17 , speech-to-text applications 18 , and texts pseudonymization 19 .
What about AI in legislative and regulatory functions?
The applications of AI in the life-cycle of rules, from the drafting of new rules to the retrospective review of existing regulation, might appear less obvious.However, they are certainly no less promising and sensitive than those affecting other State functions 20 .Moreover, AI for regulatory and legislative functions presents a distinctive set of features that deserve to be classified.
A comprehensive approach to the life-cycle of rules is currently lacking in the rich panorama of studies dealing with AI in the public sector from a wide range of disciplinary perspectives, such as philosophy, drafting, legimatics, parliamentary law, administrative law, constitutional law, regulation, law & economics, political science, computer science, informatics.Some of these deal with the different phases of the the life-cycle of rules.There are some overlapping interests, but scholars hardly quote each other, which suggests that they rarely read each other's work.The example of drafting and regulation is emblematic: both approach machine processable rules from different points of view (the former analyzing the challenges posed to legislative drafting, and the latter the advantages and risks of automatic adjudication).Other phases tend to remain in the shadows, for instance, AI for ex ante impact assessment.
The paper proposes a comprehensive analysis of AI in law and the regulation life-cycle.From the proposal of a new rule to its implementation, monitoring and review, all these phases raise distinctive challenges and are approached with a dedicated analysis.It also claims that a reciprocal enrichment (if not a cross disciplinary risk level (Germana COLARUSSO and Cinzia MATONTI, "GISA Autovalutazione: un servizio digitale per la compliance volontaria in sicurezza alimentare e sanità pubblica veterinaria", in Rassegna dell 'Osservatorio AIR, n. 3, 2023). 15Cary COGLIANESE, "E-rulemaking: Information Technology and the Regulatory Process: New Directions in Digital Government Research", in Administrative Law Review, Vol.56.N. 2, 2004,  353 FF. 16 Johon MORISON and Adam HARKENS, Re-engineering Justice?Robot Judges, Computerised Courts and (Semi) Automated Legal Decision-Making, in Legal Studies, vol.39, n. 4, 2019,  pp.618-635 (p.634-635).See also Barbara MARCHETTI, "Giustizia amministrativa e transizione digitale.Spunti per riflettere su un futuro non troppo lontano", in Margherita RAMAJOLI (ed.), Una giustizia artificiale ?, Il Mulino, Bologna, 2023, pp. 59-90. 17 European Commission for the efficiency of justice-CEPEJ, European ethical charter on the use of artificial intelligence in judicial system and their environment, 2019.
18 Cinara ROCHA and João CARVALHO, "Artificial intelligence in the judiciary: uses and threats", in CEUR Workshop Proceedings, 2022. 19It is currently experimented by the Court of Cassation and the Ministry of Justice, in France, and by the Tribunal of Genoa, in Italy (European Commission, JRC, Selected AI cases in the public sector, cit.). 20 doctrinal discourse) 21 is crucial in order to support public authorities in dealing with legislative and regulatory processes reshaped by AI.
What above builds on some of the studies mentioned and on numerous concrete examples, in order to suggest an original approach grounded on previous works of effective administrative law 22 .The latter is seeking rules and implementing decisions with the capacity to achieve regulatory goals while minimising regulatory burdens and avoiding unwanted effects 23 .This approach leads to a juridical system, which support compliance and feed trust, respectively, a characteristic and an essential element of effective laws 24 .AI can be considered a new tool in building an effective administrative law, by performing time-consuming tasks, increasing access to knowledge base, allowing fine-tuning interventions, both in enforcement controls and in identifying people who is eligible for support.AI is also a technological support capable of amplifying the effectiveness of better regulation tools (such as consultation, impact assessment, and stock review), thus improving the effectiveness of rules.At the same time, however, the effectiveness of laws and regulations is also challenged by AI.
The paper is structured as follows.It begins by addressing the potential benefits and risks of drafting a law or regulation with the support of AI (Para.2).Next, it analyses the implication of machine processable rules and adjudication by AI (Para. 3).Then it approaches the key question of whether AI can actually act as legislator or regulator (Para.4).In the following paragraphs, the paper critically addresses the role of AI in improving better regulation tools: consultation (Para.5), ex ante impact assessment (Para.6), ex post evaluation (Para 7).It emerges that AI has the power to play a crucial role in the life-cycle of rules, but is not without risks, ranging from 21 Such as the one "developed around, for instance, the legal obligation to provide a meaningful explanation on the one hand and 'explainable machine learning' on the other, often co-authored by lawyers, computer scientists and philosophers" (Mireille HILDEBRANDT, "Code-driven Law: Freezing the Future and Scaling the Past", in Simon DEAKIN and Christopher MARKOU (eds.),Is law computable?Critical perspectives on law and artificial intelligence, Hart Publishing, Oxford, New  York, Dublin, 2020, chapter 3, p. 82-83).
22 "The administrative game is being played on a field identified by public policies and delimited primarily by countless rules, i.e., provisions that directly affect the organisation or activity of the endusers.However, the legislation (composed by rules and principles) is drafted in an approximate or nontransparent manner, is often unenforceable, is designed without regard to organisational data, is unenforced, generates elusive behaviour, is characterised by violations that are not adequately counteracted by the planned controls, and produces undesirable effects.Administrative decisions (which implement the rules) are frequently delayed, defensive, poorly motivated, challenged, sometimes perceived as unfair, or as too weak, sometimes not implemented even when the enforcement order comes from a judge.In short, the lack of effectiveness is the current stumbling stone of administrative law" (Guido CORSO,  Maria DE BENEDETTO, Nicoletta RANGONE, Diritto amministrativo effettivo.Una introduzione, Il  Mulino, Bologna, 2022, p. 19, the translation is ours). 23Maria MOUSMOUTI (Designing Effective Legislation, Edward Elgar Publishing, Cheltenham-UK, Northampton-USA, 2019) splits this definition into three concepts: efficacy (capacity to contribute to the policy goals and values), effectiveness (capacity to bring results) and efficiency (minimum costs for maximum benefits). 24 discrimination to challenges to democratic representation.In order to play a role in achieving law effectiveness while limiting the risks, this complementarity should be implemented both at the level of the AI architecture (by clearly set tasks and roles), and ex post (by allowing a complete human control of each analysis and regular evaluations of outputs).Moreover, an incremental and experimental approach is suggested, as well as the elaboration of a general framework, to be tailored by each regulator to the specific features of its tasks, aimed at setting the rationale, the role, and adequate guardrails to AI in the life-cycle of rules (Para.8).

DIGITALISATION AND AI FOR DRAFTING LEGISLATION AND REGULATION
Legislative drafting, traditionally viewed as a mere skill 25 , is now qualified as a new sub-discipline of law devoted to "the process of constructing a text of legislation" 26 .
The body of literature approaching the computer-based drafting system goes under the name of "legimatics" 27 and encompasses legal drafters and informatics 28 .An emerging field of LegalTech deals with technologies applied in the field of (public and private) law 29 .In these frameworks, automated or semi-automated drafting simplify complex but repetitive drafters' tasks, improve the way a rule is constructed 30 and is available digitally 31 . 25"Legislative technique: a craft to be valued" is the title of a special issue published in Il Foro italiano, 1985, V, 282 ss.
26 "A new sub-discipline of law is born.It has a theoretical basis in phronetic legislative drafting.It has its principles and values in the hierarchy depicted in the pyramid of values.It has a goal in effectiveness of legislation.And it has recognised tools to achieve that goal" (Helen XANTHAKI, "Legislative drafting: a new sub-discipline of law is born", in IALS Student Law Review, Vol. 1, Issue 1, 2013, pp.57-70, p. 57). 27Wim J.M. VOERMANS, Wolmoed FOKKEMA, Remco VAN WLJK, "Free the Legislative Process of its Paper Chains: IT-inspired Redesign of The Legislative Procedure Cycle", in The Loophole, January, 2012, pp.54-73 (p.58).On the need for drafters to cooperate with IT experts, see Giuseppe Ugo RESCIGNO, Relazione di sintesi; Atti del Seminario: Fonti, tecniche legislative, fattibilità, implementazione delle leggi e sistemi informativi, in Quaderni a cura del servizio studi legislativi e promozione culturale dell'Assemblea regionale siciliana, 28, 1990, pp. 753-754. 28Wim J.M. VOERMANS, Wolmoed FOKKEMA, Remco VAN WLJK, "Free the Legislative Process of its Paper Chains: IT-inspired Redesign of The Legislative Procedure Cycle", cit., p. 59.
29 LegalTech "draws on (i) advances in IT, (ii) progress in the study of the theory of law, (iii) the use of standards, (iv) understanding the business of lawmaking, and (v) the recognition of the need to consider the broader ethical and legal implications early on" (Monica PALMIRANI, Fabio VITALI, Willy VAN PUYMBROECK, Fernando Nubla DURANGO, Legal drafting in the era of artificial intelligence and digitization.Study commissioned by the EC, Directorate-General for Informatics Solutions for Legislation, Policy & HR, Brussels, 2022, p. 16, https://joinup.ec.europa.eu/collection/justice-lawand-security/solution/leos-open-source-software-editing-legislation/document/drafting-legislation-eraai-and-digitisation).
30 "The process of writing a rule can be laborious, especially if it contains many parts or addresses complex problems.In addition, writing a rule often involve inputs from a number of staff members Footnote 31 in next page In the last twenty years, the digitalisation of legislative sources has emerged 32 .Technologies supporting legislative drafting are now endorsed by the digital ready principle, introduced by the better regulation agenda of the European Union 33 , and many regulators and legislators around the world are using or experimenting with it 34 .For instance, the legislative drafting system SOLON translates into an algorithm 254 drafting guidelines of the Flemish government 35 .The European Commission has developed the software LEOS (Legislation Editing Open Software), which addresses the need to generate draft legislation in a legal XML format, thus facilitating the editing or reviewing of legislative texts, as well as supporting "interoperability between European institutions" 36 .The European Parliament has launched an open access advanced management amendment tool offered in open access (AT4AM) 37 .In Italy, the Parliament is experimenting with an algorithmic tool intended to support its amendment-writing activity; 38 UK and Scottish Parliaments and Governments from different professional backgrounds (e.g., lawyers, engineers, economists, and enforcement staff).Style-checking software, templates, and collaborative drafting tools are among the IT tool relevant to this task" (Cary COGLIANESE, "E-rulemaking Information Technology and Regulatory Policy", in cit., p. 390).
31 Elena GRIGLIO and Carlo MARCHETTI, "La 'specialità' delle sfide tecnologiche applicate al drafting parlamentare: dal quadro comparato all'esperienza del Senato italiano", in Osservatorio delle fonti, n. 3, 2022, pp.361-386, p. 369.  3"Several official journals, national archives, and parliaments have sought to manage legal sources within legal corpora with the use of technologies like databases, XML, RDFmetadata, and logic formulas" (Monica PALMIRANI, Fabio VITALI, Willy VAN PUYMBROECK, Fernando Nubla DURAN-GO, Legal drafting in the era of artificial intelligence and digitization, cit., p. 13). 33In this document, the 'digital by default' is promoted in forthcoming EU legislation "as an important tool to support digital transformation" (European Commission, Better regulation: Joining forces to make better laws, COM/2021/219 final).This approach is in line with the 2030 Digital Compass Communication (2030 Digital Compass: the European way for the Digital Decade, COM(2021) 118), and has been developed by the Better Regulation Toolbox 2021 (Tool 28, "Digital ready policymaking"). 34In 2021, one out of three parliamentary chambers at a global level (forty-nine per cent of 116 parliaments in 91 countries) "had systems for managing legislative text in digital format as it moves through deliberations" (Interparliamentary Union, World e-Parliament Report 2020, p. 5 and 52). 35Stijn DEBAENE, Raf VAN KUYCK and Bea VAN BUGGENHOUT, "Legislative Technique as Basis of a Legislative Drafting System", in Information and Communication Technology Law, vol.9,  issue 2, 2000, pp.149-159.In the Netherlands, the Legislative Design and Advisory system (LEDA) alerts drafters and draws attention to relevant directives for drafting rules, for instance providing "information in the form of model clauses to be considered, advice on structure, help for definitions" (Wim VOERMANS, Wolmoed FOKKEMA, Remco VAN WIJK, "Free the Legislative Process of its Paper Chains: IT-inspired Redesign of The Legislative Procedure Cycle", cit., p. 61. 36 https://joinup.ec.europa.eu/collection/justice-law-and-security/solution/leos-open-source-software-editing-legislation/release/330(accessed June 13, 2023). 37Elena GRIGLIO and Carlo MARCHETTI, "La "specialità" delle sfide tecnologiche applicate al drafting parlamentare: dal quadro comparato all'esperienza del Senato italiano", cit., p. 371.
38 "This system allows the user to directly edit the text of the provision and obtain the corresponding amendment proposal structured in the form of an amendment, according to the rules of technical drafting of legislative texts" (Laura TAFANI, "A Legislative Drafter's Perspective", in ChatGPT series, April 13, 2023, https://betteregulation.lumsa.it/chatgpt-essay-series-legislative-drafters-perspective,accessed on June 29, 2023).
Revista de Derecho Público: Teoría y Método Vol. 8 | Año 2023 developed a tool (Lawmaker) which create amendments by editing a copy of the bill 39 .
While digitalisation plays a crucial supporting role, AI takes it a step further.For instance, language processing tools are able to help in achieving clear, compelling writing, from grammar and spelling, to style, tone and incorrect legal citations, through suggestions that are comprehensive, and help to communicate more effectively as intended 40 .In the US House of Repesentatives, computational text analysis supports politicians, administrative staff and citizens understand a proposal impact by tracking how amendments change legislation and the impact of proposed legislation to current law 41 .
Recent advancements in AI might improve the supportive role and get closer to the core writing tasks, while at the same time challenging regulators and legislators.For instance, Large Language Models-LLMs 42 can help decision-makers move from legal jargon to citizens narrative, thus improving readability and accessibility of rules, administrative decisions 43 , and all communication with the public (e.g.guidelines or websites) 44 .Paradoxically, this same technology is challenging the traditional system of parliamentary scrutiny by allowing one amendment to be multiplied into millions by small textual or punctuation changes 45 .At the same time, the solution is likely to come from AI: the Italian Senate is experimenting with a "text clustering algorithms" in order to detect "massive amendments" 46 . 39Matt LYNC, "Lawmaker -the new legislative drafting service of the UK and Scotland", in The Loophole, n. 2, 2022, pp.24-39 (p.35). 40The already mentioned LEOS is currently piloting the use of AI to detect patterns, common errors, and good practices (https://joinup.ec.europa.eu/interoperable-europe/leos). 41The Select Committee on the Modernisation of Congress, Final Report n. 116-562, 2020, p. 72; see also Elena GRIGLIO and Carlo MARCHETTI, "La "specialità" delle sfide tecnologiche applicate al drafting parlamentare: dal quadro comparato all'esperienza del Senato italiano", cit., p. 384 and 369.
42 LLM, are also known as foundation models, forms the basis of many applications, such as Open AI's ChatGPT, Microsoft's Bing and many website chatbot (Ada Lovelace Institute, Explainer: what is a foundation model?, July 17, 2023). 43For instance, AI can monitor the clarity of tendering documents in order to "decrease the risk of bidders misunderstanding the tender material" and thus "lowering the total cost of the bid" (Deloitte, Study on up-take of emerging technologies in public procurement, DG GROW G.4, Final Report, February 2020, p. 15). 44Generative AI can improve public authorities' communication with the public, from legalese jargon to a more accessible voice tone or style (FCW, May 17, 2023 (Federal CIO says IDEA Act guidance coming this summer -FCW).In Spain, the "060 Service" (a contact point for all information concerning the services provided by the public administrations) uses Natural Language Processing to answer frequently asked questions and to "translate" legalese into plain language (European Commission, JRC, Selected AI cases in the public sector, cit.). 45For instance, "in 2016, AI was tested during the 17th legislature of the Italian Senate (with disruptive effects) for the production of amendments to the so-called ‹Renzi-Boschi› constitutional reform (A.S. no.1429): two senators of the ‹Northern League› presented approximately 82 million amendments produced on the basis of an algorithm capable of almost endlessly processing textual modification proposals of the bill" (Laura TAFANI, "A Legislative Drafter's Perspective", in ChatGPT series, cit.).
46 Tommaso AGNOLONI, Carlo MARCHETTI, Roberto BATTISTONI, Giuseppe BRIOTTI, Clustering Similar Amendments at the Italian Senate, paper presented at the 13th Edition of its Lan-To conclude, digitalisation requires careful human supervision, since rule-making and law-making are not a simple implementation of drafting rules, but an open processes in which the drafter "weighs different possible solutions in view of their relative appropriateness" 47 .Human supervision is all the more important when drafting moves to AI, since the recourse to this technology must respect the democratic separation of powers 48 , ensure the correct interpretation of the law translated into plain language, citizens narrative, or into a code, and avoid codified rules which result in discrimination (as will be articulated in the following paragraph).

ENCODING A RULE WHILE IT IS BEING DRAFTED AND ADJUDICATION BY AI
The digital ready principle, endorsed by the European institutions, is a developed reality in some countries 49 .The related concept of machine processable rules (or law as code) 50 , which arises in the legimatics 51 and LegalTech 52 frameworks, could open guage Resources and Evaluation Conference of the European Language Resources Association, Marseille 2022.According to the World e-Parliament Report 2020 (cit.), in 2021 6% Parliaments worldwide were using AI-based technologies (p. 5 and 56) and the percentage is increasing rapidly.For instance, AI-based voice recognition systems "is on the threshold of becoming a standard tool in drafting" (Daniel LOVRIC, The future of legislative drafting, Paper for Canadian Institute for the Administration of Justice-CIAJ Legislative Drafting Conference, 8-9 September 2022, Ottawa, p. 5: https://ciaj-icaj.ca/wpcontent/uploads/documents/2022/10/ld266_daniel-lovric_the-future-of-legislative-drafting-a-strategicapproach.pdf?id=15558&1683405114); it is used in Italy (Elena GRIGLIO and Carlo MARCHET-TI, "La "specialità" delle sfide tecnologiche applicate al drafting parlamentare: dal quadro comparato all'esperienza del Senato Italiano", cit., p. 379) and in Estonia to increase the accuracy of transcripts and changing traditional time-consuming stenographic work into a supervisory task (see https://www.riigikogu.ee/en/press-releases/others/the-riigikogu-has-a-new-system-for-making-verbatim-reports/,accessed June 17, 2023, quoted by the European Commission, JRC, Selected AI cases in the public sector, cit.).
48 "The rule of law implies that neither the legislature nor public administration get the last word on the meaning (the interpretation and application) of the law.Judgment is reserved for the courts.What if legislation is translated into computer code, that is, disambiguated, and what if at that very moment both its interpretation and application are de facto decided?What should courts decide if a legislature enacts law in the form of code?To what extent is the meaning of the law contestable in a court of law if the law has been disambiguated and caught in unbending rules that only allow for explicitly formulated (and formalised) exceptions?What if courts use the same software as the public prosecutor, or depend on the same legal technologies as Big Law?"(Mireille HILDEBRANDT, "Code-driven Law: Freezing the Future and Scaling the Past", cit., p. 70).
49 See, for instance, the Danish "Guidance on digital-ready legislation.On incorporating digitisation and implementation in the preparation of legislation" 2018 Guidance on digital-ready legislation (digst.dk),accessed in June, 16, 2023.
50 "The idea with "rules as code" is that the government would make its single coded version available via an API [Application Programming Interface] to the public, including developers, not just those in government" (Matthew WADDINGTON, "Machine-consumable legislation: A legislative drafter's perspective -Human v artificial intelligence", in The Loophole, June 2019, pp.22-52, p. 27).
Footnote 51 and 52 in next page the door to a new era in which rules should preferably be written in a dual format, the traditional and the codified.This enables a computer to read the logic of a rule.The rule as a code system has several advantages.Firstly, the simplification embraced by this approach is positive in itself, since it requires clarity, precision, and plain language 53 .In other words, unclear terminology, unnecessary complex phrases, inconsistency among paragraph and sentences should be avoided 54 .Attaining rules with such characteristics is a substantial part of legislative drafting exercise 55 and an element of the better regulation approach 56 .
Secondly, rules as a code enhances drafting activities, by enabling an automated detection of inconsistencies or incompatibilities among rules 57 .
Thirdly, this benefits the consistency of new rules with the regulatory stock, facilitates impact assessment of new rules 58 and their ex post review ones 59 (as will be 51 Leyman E. ALLEN and Charles S. SAXON, "Computer-Aided Normalizing and Unpacking: Some Interesting Machine-Processable Transformations of Legal Rules", in Charles WALTER (ed.), Computing Power and Legal Reasoning, St. Paul: West Pub.Co., 1985, pp.495-572 (p.495 ss.). 52Monica PALMIRANI, Fabio VITALI, Willy VAN PUYMBROECK, Fernando Nubla DU-RANGO, Legal drafting in the era of artificial intelligence and digitization, cit., p. 6. 53 According to the Danish Guidance on digital-ready legislation, "the rules should be worded clearly and simply, unambiguously and consistently.Simple rules do not necessarily mean a brief law text.It may require more words to make it unambiguous and clear what the rules are.This does not, however, change the overall legal principle that superfluous words in the law text should be avoided» (pp.8, 9).In the same vein is the European Commission Better Regulation Toolbox 2021, Tool#28 "Digital-ready policymaking", p. 23.
54 "Objective criteria in the legislation are a prerequisite for automation of case processing.(…) For example, the criterion "majority of the year" may be subject to discretion and interpretation whereas "more than 250 calendar days per year" can be assessed objectively.If fully automated case processing is introduced based on objective criteria (…) it must be ensured that the decision is sufficiently transparent to enable the citizen to assess his/her avenues of complaint and it must be possible to verify the decision" (Guidance on digital-ready legislation, cit., p. 11). 55  5 "Once rules are encoded, they can be tested, and that testing can be done automatically" (Jason MORRIS, "Rules as Code: How Technology May change the Language in which Legislation is Written, and What it Might Mean for Lawyers of Tomorrow", in Techshow, February 5, 2021, pp.2-16, p. 5). 59For instance, "the [US] Transportation Department's algorithmic tools exert a unique influence on the agency's rulemaking process.The department drafts its rules to fit a structured, agency-wide format designed to organize key meta-data elements, such as who or what the regulated entity is and who is responsible for enforcement.[It] (…) makes it relatively straightforward for subject-matter experts to encode the substance of Transportation Department rules into a "machine-readable" format, thus decreasing the cost of "teaching" the Transportation Department's algorithmic tools the semantic meaning of regulatory text and obviating the need for NLP" (Catherine M. SHARKEY and Cade MALLET, "Artificial Intelligence for Retrospective Regulatory Review", in The Regulatory Review, September 12, 2023).discussed in Para.6 and 7), as well as allow the traceability of automatic adjudication and adjudication through AI 60 .
Fourthly, rule as a code allows an automatic adjudication of machine readable unambiguous rules 61 , whose application does not imply discretion or room for appreciation (e.g. in case of electronic auction awarded on the basis of the price only 62 , or when the law sets an age limit for a given activity, such as aircraft piloting regulation setting an age limit for aircraft pilots) 63 .
Lastly, machine readable rules might support adjudication by AI.In the latter example, the age limit is the easiest criterion to enforce, but it could unjustifiably exclude very (if not the most) experienced pilots.Differently, the decision to renew a licence could be based on a risk-based assessment performed by AI 64 , allowing a tailored approach which is more effective in pursuing the public interest (i.e.safe flights) 65 .
The rule as a code raises some risks. 60Anoush DARABI, "New Zealand explores machine-readable laws to transform government", 11 May 2018, https://apolitical.co/solution-articles/en/new-zealand-explores-machine-readable-lawsto-transform-government. 61For instance, the European regulation n. 561/2006 (on the harmonisation of certain social legislation relating to road transport) prescribes daily rest or weekly rest period to road transport drivers.The law enforcement is supported by tachograph, which registers all activities."In practice, a police officer may pull a truck over for an inspection where the tachograph data is read and interpreted by some software.Depending on the verdict of the program, the driver may be instantly fined or sometimes even imprisoned.It is known that many erroneous automated verdicts are issued".This is mainly related to the lack of clarity of the legislation, as demonstrated by Ana de ALMEIDA BORGESA, Juan José CONEJERO RODRIGUEZ, David FERNANDEZ-DUQUE, Mireia GONZALEZ BEDMAR, Joost J. JOOSTEN ("To Drive or Not to Drive: A Logical and Computational Analysis of European Transport Regulations", in Information and Computation, vol.280, 2021). 62Art.33, Italian legislative decree n. 36/2023.Another provision which do not imply discretion is the article establishing the criteria for automatic exclusion from tenders (art.94 of the Italian legislative decree n. 36/2023 (public procurements legislation).
63 "The holder of a pilot licence who has attained the age of 60 years shall not act as a pilot of an aircraft engaged in commercial air transport" (annex I, European Regulation n. 1178/2012, laying down technical requirements and administrative procedures related to civil aviation aircrew). 64Cary COGLIANESE and David LEHR, "Regulating by Robot: Administrative Decision Making in the Machine Learning Era", in The GeorgeTown Law Journal, vol.105, 2017, pp.1147-1223  (p.1171). 65The algorithm could run "through all of the available data about the applicant-say, school records, medical records, social media postings, and fine-grained data from the flight recorders from previous training flights flown by the applicant" (Cary COGLIANESE and David LEHR, "Transparency  and Algorithmic Governance", in Administrative Law Review, vol.71, n. 1, 2019, pp.1-56, p. 10).The algorithm might also "account for how a pilot's age can both increase risks due to health limitations and decrease risks due to greater experience" (Cary COGLIANESE, "Moving toward personalised law", in The University of Chicago Law Review online, 2022, https://lawreviewblog.uchicago.edu/2022/03/09/bp-coglianese/)."In a personalized law regime, rather than establishing a one-for-all age threshold, these controls would be personalized, relying also on additional factors" (Omri Ben-SHAHAR and Ariel PORAT, Personalized Law.Different Rules for Different People, Oxford University Press, Oxford,  2021, p. 110-111).
Revista de Derecho Público: Teoría y Método Vol. 8 | Año 2023 Fourthly, automatic adjudication opens the door to discriminatory decisions whenever errors 73 or biases are embedded in the system 74, or when the quality of data is poor 75 .Adjudication by AI is challenged by similar risks.
Fifhtly, an incorrect interpretation of the law or regulation, as well as an inappropriate translation into the code can challenge the constitutional democracy76 .
Lastly, the automatic decision-making allowed by the "rule as a code" approach can lead to an erosion of decision-makers expertise77 .ted by Michael A. LIVERMORE, Rules by Rules, cit., p. 257-260.According to Cary COGLIANESE: "whether any particular algorithmic system will satisfy the standards of due process will depend on how well that system works and on the adequate validation of its performance" ("Regulating by robot.Administrative Decision Making in the Machine-Learning Era", cit., p. 1191).It has also been argued that rule as code risk leading to "computational legalisms" related to "the sheer speed of code's execution.(…) Its lack of delay collapses the hermeneutic gap, because not only does text (the source code) constitute both rule and reality, but its application is pre-determined and imposed immediately at the point of execution" (Laurence DIVER, "Computational legalism and the affordance of delay in law", in Journal of Cross-disciplinary Research in Computational Law, 2020, pp.2-15, p. 6). 73Mark KELMAN, The Heuristics Debate, Oxford University Press, Oxford, 2011, p. 21.On both bias and errors, see Cary COGLIANESE and Alicia LAI, "Algorithm v. Algorithm", in Duke Law Journal, vol.72, 2022, pp.1281-1340, p. 1293-1302."First, a model can simply fail to fit any data -training or test -well.In such a scenario, even if the training and test data were perfectly representative of real-world data, the model would be inaccurate when deployed.Second, an algorithm can fit its training and, perhaps, test data well, but fail to generalize and perform equally well in real-world data" (David LEHR and Paul OHM, "Playing with the Data: What Legal Scholars Should Learn About Machine Learning", in University of California, vol.51, 2017, pp.653-717, p. 711).
74 Sandra G.  Int. Quart., vol. 86, n. 2, 2019, p. 499-511. 75 Being collected by subjects who are in a conflict of interests, or extrapolated from assumptions not validated by the person concerned, e.g. when taken from people' digital footprint or collected for different purposes (Nello CRISTIANINI, "Shortcuts to Artificial Intelligence", in M. Pelillo and T. Scantaburlo, Machine we trust.Perspective on dependable AI, The Mit Press, Cambridge, Massachusetts, London, England, 2021, p. 15-16).Automated decisions in sensitive areas, such as teacher evaluation and social security have already devastated numerous people and prompted litigation in many legal systems.For instance, in 2021 the algorithm Systeem Risico Indicatie-SyRI used by the Dutch government to detect various forms of fraud (including social benefits, and taxes) wrongly accused 26,000 families and was judged in breach of article 8 of the European Convention on Human Rights by the Hague District Court.The Michigan Integrated Data Automated System-MiDAS used to interpret small mistakes as signs of unemployment fraud (Sofia RANCHIRDAS, "Empathy in the digital administrative State", in Duke Law Journal, vol.71, 2022, pp.1341-1389, p. 1348; see also Alejandro DE LA GARZA, "States' Automated Systems Are Trapping Citizens in Bureaucratic Nightmares With Their Lives on the Line", in Times, May 28, 2020).
A reasonable conclusion from the above is to suggest that legislation and regulations should be written in dual format in selected areas, according to the proportionality principle.On the one hand, designing a syntax suitable for both legal purposes and computer evaluation is not always feasible 78 or desirable: some rules may indeed be translated into a logical representation (e.g.road traffic laws) 79, other may not (e.g.principles and the principles-based regulation 80, or clauses such as "good faith" 81 ).On the other hand, write rules in dual format requires humans telling the computer what the law says, "and not the other way around" 82 .For the time being, this time-consuming exercise seems hardly compatible with the time pressure and multiple steps characterising the legislative and most, while it could be experimented in some sectorial regulation 83 .

IS THERE A ROOM FOR AI SETTING RULES?
Simple linear algorithms or AI seldom can substitute the sensitive role of law-makers and rule-makers 84 .Nonetheless, they can play a relevant supportive role.tation in the era of artificial legal intelligence.Speaking law to the power of statistics", in University of Toronto Law Journal, vol.68, n. 1, 2020, pp. 12-35, p. 33. 78 To be sure, "sometimes language may be inherently ambiguous.The statement that 'I saw the girl with the telescope' might mean either that the speaker looked through a telescope or that the girl was carrying one" (Simon CHESTERMAN, We, the Robots: Regulating artificial intelligence and the limits of the law, Cambridge University Press, Cambridge, 2022, p. 230).
79 "Road traffic laws, for example, state that exceeding a given speed limit constitutes an offence.Many jurisdictions use speed cameras that automatically record infringements and issue fines" (Simon CHESTERMAN, We, the Robots: Regulating artificial intelligence and the limits of the law, cit., p. 231). 80Robert BALDWIN, Martin CAVE, Martin LODGE, Understanding regulation.Theory, strategy, and practice, Oxford University Press, Oxford, second ed., 2012, p. 302-311.
81 "Terms such as 'good faith' or 'unconscionability' are notoriously difficult to define in terms that would be useful to a machine" (Simon CHESTERMAN, We, the Robots: Regulating artificial intelligence and the limits of the law, cit., p. 231).Moreover, "even if a law appears on its face to be expressed clearly, however -'no vehicles in the park' (…) -how it is to be applied in practice may be less so.We might agree that it covers automobiles, but what about bicycles, roller skates, toy cars?" (Simon CHESTER-MAN, We, the Robots: Regulating artificial intelligence and the limits of the law, cit., p. 233).
82 "Rules as Code is Not Artificial Intelligence": "as of now there are inadequate examples of oneto-one translations between rules and code to be able to train artificial intelligence to do the translation" (Jason MORRIS, "Rules as Code: How Technology May change the Language in which Legislation is Written, and What it Might Mean for Lawyers of Tomorrow", cit., p. 14).Therefore, "the much prised overall efficiency benefits may in practice be somewhat modified" (Michael GOTZE, "Political and systematic push for legal pre-accept of AI solutions", draft for the Symposium Public Administration and the EU Proposal for a Regulation of Artificial Intelligence, September 18-19, 2023). 83For instance, the above mentioned US "Transportation Department's practice of drafting regulations in a structured format which facilitates better comprehension of rules by computers" (Catherine M. SHARKEY and Cade MALLET, "Artificial Intelligence for Retrospective Regulatory Review", cit.).
84 "Rules are forward-looking, but they also involve complex normative judgments, not merely predictive ones.Determining the content of rules often requires making difficult choices about the entities to be regulated, the conduct or outcome that the rule tells these entities to achieve or avoid, and the nature and degree of the consequences that follow from adhering or not adhering to the rule's Firstly, a law or regulation can delegate an algorithm to set rules.For instance, according to the European regulation, electricity market operators (managing a bidding zone) 85 use algorithms to set electricity selling prices among electric utilities and to allocate interconnection capacity 86 .During the Covid 19 pandemic, an AI system conducted periodic risk assessments to classify Italian regions or municipalities into a color band to which a different regulation of economic and civil activities corresponded 87 .
Secondly, AI can play a role at a stage that may precede the rule-making or law-making 88 .For instance, decision-makers could use AI to detect compounds 89 or activities 90 that should be subject to regulation or to a stricter regulation.A need for new regulation might result from a retrospective review performed through AI (Para.7).AI might also support them in collecting and processing data from various sources, such as complaints 91 or enforcement activities, which may in turn reveal the need for a regulatory intervention or an updating of existing regulations.
Thirdly, AI can support humans in writing a law or regulation.For instance, translation software can already "render rules in plain language to assist with public understanding and compliance" 92 .In perspective, Large Language Models could "produce a rough but credible first legislative draft" 93, or a citizens' initiative bill.It commands.Machine-learning algorithms cannot directly make the choices about these different aspects of a rule's content not only because some of these choices are normative ones, but also because learning algorithms are merely predictive and thus unable to overlay causal interpretations on the relationship between possible regulations and estimated effects" (Cary COGLIANESE and David LEHR, "Regulating by Robot: Administrative Decision Making in the Machine Learning Era", cit., p. 1173) 85 Art. 7, comma 1, Regulation (EU) 2015/1222, establishing a guideline on capacity allocation and congestion management. 86Artt.36-37, Regulation (EU) 2015/1222, cit. 87Italian Ministry for Health, 30 April 2020. 88Information gathering, in the Karen YEUNG taxonomy ("Algorithmic regulation: A critical interrogation", in Regulation & Governance, vol.12, 2018, pp.505-523, p. 507).
89 Mariano-Florentino CUELLAR, "Cyberdelegation and the Administrative State", cit., p. 147. 90The US FDA uses AI techniques for postmarket surveillance to update rules and guidance (David Freeman ENGSTROM, Daniel E. HO, Cathrine M. SHARKEY, Mariano-Florentino CUELLAR, Government by Algorithm: Artificial Intelligence in Federal Administrative Agencies, cit., p. 53). 91For instance, consumer' complaints are reorganised by the Bank of Italy though AI (Regulation on the processing of personal data in the management of complaints from clients, 30th March 2022). 92Cary COGLIANESE, "E-rulemaking: Information Technology and the Regulatory Process: New Directions in Digital Government Research", cit., p. 16. 93 Daniel LOVRIC, "The future of legislative drafting", cit., p. 6.For instance, the US Congress is exploring the following functionalities in legislative process: "generating constituent response drafts and press documents; summarizing large amounts of text in speeches; drafting policy papers or even bills; creating new logos or graphical element for branded office resources and more" (Nihal could also translate comments received in a consultation into a text that could be referred to Parliament for discussion 94 .These examples raise some concerns. First, LLM producing a draft or translating comment in a text can challenge representative democracy whether application goes beyond the mere support to decision-makers (e.g., processing large quantity of data, selecting words or proposition) and make political choices 95 .
Second, AI can hinder the guarantee of participation in rule-making; in the electricity market and Covid examples, although the rule-making establishing the role of the algorithm was (in theory) open to stakeholders participation, the automatic rule-setting clearly excluded any stakeholder involvement 96 .
Third, AI can lower the quality of information available to decision-makers; 97 in the example of AI used at a stage that might precede regulation, an inadequate design of the algorithm can lead reports or complaints to receive less attention because of spelling mistakes or jargon 98 .
Lastly, there is a risk that decision-makers assume that the human drafter is becoming redundant, while "the kind of drafts that an AI system could produce would likely be very rough and contain fundamental flaws" 99 .
To conclude, humans would always be needed to supervise and integrate the AI produced text.Moreover, "humans must specify the targets, commands, and consequences of potential rules from which an embedded machine-learning system might choose the best.More importantly, humans can, at any time, choose to reject a machine-chosen rule, alter an algorithm's specifications, or even "pull the plug" on the system entirely" 100 .

AI FOR CONSULTATIONS
The rise of rule-making digitization twenty years ago appeared as a turning point, both in lowering regulators' costs and increasing stakeholders' engagement 101 (thus improving trust and the effectiveness of laws).Hopes were only partially fulfilled.On the one hand, the exponential increase in participation challenged the ability of regulators to manage the large amount of comments received and allowed the emergence of the mass comment phenomenon.On the other hand, the mechanism of e-notice and comment raised the participation of the better-organized firms, but not of citizens and micro firms, whose lack of inclusiveness hinder the quality of information available, thus the quality of rules enacted.
The digitization itself offered some important answers to the first problem, by providing application to analyze huge amounts of comments (such as Data Oriented Services-DORIS+ 102 or Compositional Data Analysis-CoDa used by the European Commission).Moreover, AI provides new tools to help decision-makers in reorganizing and analysing comments collected in consultations with extremely high participation rates 103 (e.g., text categorization of public comments 104, identification of duplicates, and summarization of overall comment sentiment).AI not only allows a significant time saving 105, but also prevents decision-makers being affected by information overload bias, which could impede an adequate the assessment of comments 106 .However, AI in consultation does not come without risks, since an inadequate design of the algorithm could compromise the guarantees of participation and the quality of information available 107 .For instance, these outcome can occur if comments provided in mass campaign are automatically de-quoted 108, excluded, 103 "Agencies can use advanced computational techniques to respond to the challenges of the era of mass commenting, specifically by identifying the most substantive comments that require more sustained attention and by aggregating and analyzing comments to identify emergent content that is only apparent when comments are understood in relationship to each other and not simply read as individual, atomized responses to a regulatory proposal" (Michael A. LIVERMORE, Vladimir EIDELMAN,  Brian GROM, "Computationally Assisted Regulatory Participation", in Notre Dame Law Review, vol.93, n. 3, 2018, pp.977-1034, p. 1034). 104This functionality has been identified by Cary COGLIANESE ("E-rulemaking Information Technology and Regulatory Policy", cit.) already in 2004.For instance, CitizenLab (a Belgian supporting governments around the world) uses NLP technique, with the capacity to automatically classify and analyse thousands of contributions collected on citizen participation platforms, to identify the main topics and group similar ideas together into clusters (European Commission, JRC, Selected AI cases in the public sector, cit., and https://www.citizenlab.co/platform-online-engagement-toolbox). 105David Freeman ENGSTROM, Daniel E. HO, Cathrine M. SHARKEY, Mariano-Florentino CUELLAR, Government by Algorithm: Artificial Intelligence in Federal Administrative Agencies, cit., p. 60. 106 Nicoletta RANGONE, "Improving consultation to ensure the European Union's democratic legitimacy: From traditional procedural requirements to behavioural insights", in European Law Journal, vol.28, n. 4-6, 2022, p. 154-171.  10"The act of reading comment grouped as "for" or "against" (or no position) may also impact the agency factfinder in the presentation of the information she is assimilating" (Melissa MORTAZAVI,  "Rulemaking Ex Machina", in Columbia Law Review, vol.117, n. 6, 2017).
108 Steven J. BALLA, Alexander R. BECK, Elisabeth MEEHAN, Arymala PRASAD, "Lost in the flood?: Agency responsiveness to mass comment campaigns in administrative rulemaking", in Regula-Revista de Derecho Público: Teoría y Método Vol. 8 | Año 2023 or considerated as a single one; 109 as well as if comments which "are not expressed using the standard narrative of policy making" are ignored or devaluated 110 .The robustness of the result depends also on the adequacy of the techniques deployed to assess data 111 .
The second problem of the limited participation of citizens and small firms is still an issue, due to the lack of digital literacy and motivation.Even when some overcome these barriers, their contributions lack the format (the narrative) to be taken seriously.There is no single answer to tackle the lack of inclusiveness, but one is definitively to use language and consultation techniques appropriate to the target audience 112 .Against the current reference to standard categories of stakeholders to be involved, AI could provide decision-makers with a precise identification of stakeholder groups interested in a consultation proceedings 113, which in turn would enable regulators to address different stakeholders by diverse and adequate means (e.g.seminars and community listening sessions during comment periods to facilitate citizens' participation).
New advancements in AI, such as LLM, can also help in overcoming the lack of inclusiveness by transforming the citizens' narrative into technical language that tion & Governance, 2020. 109To tackle this challenge, the European Commission (Better Regulation Toolbox, 2021, p. 472 ff.) and the European Court of Auditors ('Have your say!': Commission public consultations engage citizens, but fall short of outreach activities, special report n.14/2019, 39-40) suggest analyzing campaigns separately.In the United States, the discussion of the role to be attributed to mass comments is divisive, with most observers arguing the uselessness if not the harmfulness of these comments (Comment to ACUS from Senior Fellow R.J. Pierce on Mass Comments, Computer-Generated Comments and Fraudulent Comments, May 22, 2021), with notable exceptions emphasizing their value (Michael HERZ, "Malattributed comments in agency rule-making", in Cardozo Law Review, in vol.42, 2020, pp.1-67; Nina A. MENDELSON, "On the Value of Comments from Individual Members of the Public (ACUS Update)", in Notice and Comment.A Blog from Yale Journal of Regulation, July 14, 2021, https://www.yalejreg.com/nc/nina-a-mendelson-on-the-value-of-comments-from-individual-members-of-the-public/).Among the latter, it has been underlined that "the Executive Order [14094/2023, Modernizing the regulatory review] also includes a placeholder indicating the need for OIRA to develop "guidance or tools" to handle the large volumes of individual comments submitted through Regulations.govon certain high-visibility agency rules.As OIRA addresses this issue, OIRA should recognize, critically, that these comments, as with targeted community outreach, can represent important sources of both "data," including local information or situated knowledge, and "views," in the words of the APA.The vaguely pejorative term "mass comments" perhaps could also be upgraded to "large-volume individual comments" (Nina A. MENDELSON, "Public Engagement, Equity, and Executive Order 14094", Symposium on Modernizing Regulatory Review, June 7, 2023).
Revista de Derecho Público: Teoría y Método Vol. 8 | Año 2023 is more likely to be considered by the regulators114 .However, the same tools can make it extremely easy for a large quantity of comments by the private sector to be produced115, leading to mass campaigns being almost impossible to identify116, and challenging the ability of decision-makers to assess all documents received and "threaten to weaken the signal those words provide" 117 .
The examples and remarks in this paragraph show that AI is a valuable support to decision-makers and an empowerment tool to prevent information overload bias118, as well as in tackling the inclusiveness of "missed stakeholders"119 .However, AI couldn't supplant the sensitive public comment review task120 (the risk being a break to the right to participate in decision-making), nor is it a decisive answer to inclusiveness.

WHAT DIGITALISATION AND AI CAN DO FOR IMPACT ASSESSMENT?
Impact assessment (IA) is a systematic and comparative appraisal of how proposed rules will affect stakeholders, regulators, economic sectors, and the environment.It aims at identifying in advance all the intended and unintended consequences of feasible regulatory options, in order to allow evidence-based legislation and regulation.In this exercise, digitalisation121 and the interconnection of public datasets122 are crucial in improving the analytical basis for regulatory choices.Due to its predictive nature, a variant of this tool is currently being promoted by some scholars and institutions in order to identify the impact of AI applications in advance 123 .Besides IA of AI, what AI can do for IA?
In order to answer this question, two characteristics of IA are decisive.First: IA is not a mere technical exercise and it requires a broad approach and policy coherence, as well as a multidisciplinary view of the problem 124 and of the regulatory options to address it.
Second: IA is part of the motivation of the final law or regulation, whether or not legislators/regulators follow the IA outcome.In order to fulfill this supportive role, the data used in the IA should be transparent and the identified impacts need to be explainable and replicable; therefore, IA should provide causal connections rather than just identify correlation 125 .
Third: in the IA activity, one size does not fit all, and the depth of the assessment should be proportional to the issue at stake, its potential impact and resources available.For instance, is up to humans to identify the proportionate level of analysis which each case deserves (e.g.whether a cost-benefit or multicriteria analysis should be used, or the number of consultations to be carried out), or to establish what measure is preferable overall (e.g., in multicriteria analysis, whether a measure protects the environment or jobs, but could have a negative impact on competition).
Due to these characteristics, it is unlikely that AI can replace humans in IA.Nevertheless, AI could certainly play a supportive role in IA, while at the moment it is of very limited application, to the best of our knowledge 126 .
AI delivers some potential explored by studies devoted to AI in the administrative and the judiciary function.
Firstly, less staff and time is required in proceedings leveraging on AI127 .
Secondly, an increased access to a knowledge base that would not otherwise be attainable can address limited data availability constraints, which is a common issue for IA around the world128 .On the one hand, "language processing tools could analyze a proposed rule to determine its subject matter area, then crawl through related academic research to find and submit relevant scientific studies to the agency"129 .On the other hand, AI can help in analyzing public dataset 130 .For instance, the Italian national statistical institute-ISTAT delivered a platform (IstatData)131 enabling natural language-based searches on datasets contained in its archives and provides the most interesting and relevant answers from certified data132 .AI could also provide support specific to IA activities.
Firstly, AI could identify the relevant regulatory framework interested by the proposal and show if a regulatory option is redundant or incompatible with existing regulations 133 .
Secondly, when (if ever) rules are written as code, AI allows the automatic testing of the impact of new proposals or amendments, thus improving the ability to forecast whether a regulatory option actually can reach the expected outcomes134 .
Thirdly, AI can support the identification of administrative obligations introduced by the regulatory options, the administrative tasks per obligation and the estimation of their cost for end-users.In reality, these tasks do not require AI, being easily accomplished by humans (who identify the administrative burdens and related Revista de Derecho Público: Teoría y Método Vol. 8 | Año 2023 activities), supported by a standard cost model-SCM calculator (in order to quantify their total annual cost).
A precondition for the fulfillment of the above-mentioned potentials of AI for IA is data quality and availability.On the one hand, public databases on critical data for IA should be easily accessible to decision-makers (e.g., inventories of business acting in a given sector, or regulatory compliance cost derived from previous reduction programs).On the other hand, these data should be "contextualized", so that decision-makers can be aware of the purpose of their collection and thus interpret them for regulatory purposes 135 .
A last point to be considered when AI is used for IA is that the latter is forward looking, while the former leverages mainly on historical data, thus risks leading to an under-evaluation of new entrants and new risks 136 and supporting the wrong assumption that people's behaviour is always consistent 137 .

AI AND THE REGULATORY STOCK REVIEW
AI can dramatically improve the traditional labour-intensive ex post evaluations 138 .AI supports retrospective review of existing law and regulations by identifying outdated or redundant rules, overlapping among regulatory areas 139, "typographical errors or inaccurate cross-reference"; rules that "might benefit from elaboration or clarification" 140 .AI can also facilitate retrospective review aimed at identifying regulatory restrictions 141, or regulatory stock in need of adaptation to a changing context.Further potential application can also be envisioned, such as using case law data to identify rules whose compliance is resisted.
AI is therefore useful in signalling where there is potential to improve regulation and it avoids the classical problem of the regulators who have promoted a rule being in charge of its revision or suppression 142 (confirmation bias).
However, AI might also lead to false-positive output, if set out without taking into consideration the complex nature of the legal system.Take for instance an algorithm that counts obligations, without considering at the same time even lifting, limiting, or dispensing with obligations 143 .Moreover, a de-regulatory or pro-regulatory approach (of the developer or of the regulator commissioning the system) might deeply affect the functioning of the algorithm.This proves particularly dangerous because when an AI system performs reviews, the consultation that could counterbalance these results does not take place 144 .Therefore, it is crucial that AI plays a supportive role in regulatory review.Human intervention (lawyers in cooperation with computer scientists) is crucial in setting the of Transportation elaborated a dashboard (which incorporated an open-source platform developed by Mercatus Center) which employs machine learning to quantify regulatory load (count of restrictions, word count, regulatory complexity via Shannon entropy, conditional count, sentence length, last update).Cathrine M. SHARKEY, "Algorithmic tools in retrospective review of agency rules", cit., p. 13.
141 RegData qualify regulatory restrictions as words and phrases that indicate specific obligations or prohibitions, counting words and phrases such as shall, may not, must, required, and prohibited (Patrick A. McLAUGHLIN, "RegData Canada: A Data-Driven Approach to Regulatory Reform", cit., p. 2).In addition, machine-learning text-classification was used to predict industries primarily affected by each obligation (Omar AL-UBAYDLI and Patrick McLAUGHLIN, "RegData: A Numerical Database on IndustrySpecific Regulations for All United States Industries and Federal Regulations, 1997-2012",  in Regulation and Governance, vol.11, n. 1, 2017, pp.109-123).
142 Cathrine M. SHARKEY, "AI for retrospective review", in Belmont Law Review, vol.8, 2021,  footnote 73, pp.374-408 (p.390). 143Cary COGLIANESE, Gabriel SCHEFFLER and Daniel WALTERS have "replicated the methods underlying RegData and also adapted and expanded them to the task of measuring unrules based on a dictionary of five comparable obligation-alleviating terms: waive, exclude, except, exempt, and variance.(…) [They] used computerized computational techniques to search for both obligation imposing and obligation-alleviating terms throughout the Federal Register and the CFR, as well as in the United States Code" ("Unrules", in Stanford Law Review, 2021, pp.885-967, p. 921-922). 144In 2019, the US Department for Health and Human Services-HHS launched a pilot project called "AI for deregulation.In the Notice of Proposed Rulemaking, "Securing Updated and Necessary Statutory Evaluations Timely" (85 Fed.Reg.70096, 70111, Nov. 4, 2020) the agency "explicitly noted that AI augmented human insights to identify "potential reform opportunities."HHS's pilot project formed the basis, at least in part, for the new proposed rule.Here-and in its earlier rule-HHS disclosed that AI was used to help identify "outmoded" regulations, but there is nary a detail regarding how the AI worked or was used in the process.(…) But HHS's "Regulatory Clean Up Initiative" rule was not subject to the notice-and-comment process.The rule, moreover, offered only the most general description of the AI-driven NLP techniques used" (Cathrine M. SHARKEY, "AI for retrospective review", cit., p. 404 and 378; see also Cathrine M. SHARKEY, "Algorithmic tools in retrospective review of agency rules", cit.).algorithm with regard to what it is intended to look at (e.g., what counts as restriction or linguistic complexity), and what it means (e.g., unnecessary administrative burdens or justified provisions).Moreover, ensuring accuracy of rule interpretation in encoding rules is crucial both for decision-makers and regulated entities which increasingly embrace rules as a code in their compliance tasks145 .These decisions should be made transparent, along with "information about the training data, the process for classifying subtopics, how the clustering algorithm works and with what accuracy" 146 .Human intervention is also crucial in interpreting and monitoring AIbased output, since human-machine collaboration is based on ongoing fine-tuning.

THE NEED FOR A TAILORED AND AGILE FRAMEWORK FOR AI IN THE LIFE-CYCLE OF RULES
The analysis showed that AI has the power to play a crucial role in life-cycle of rules, by performing time-consuming tasks, increasing access to a knowledge base that would not otherwise be attainable, as well as enhancing the ability of institutions to draft effective rules and to declutter the regulatory stock.
However, the AI revolution is not without risks.It may hinder the guarantees of participation or discriminate stakeholders taking part in consultation and compromise the quality of information available to decision-makers; it may decrease human autonomy or make political choices, thus challenging the democratic representation; it might be biased for or against a de-regulatory or pro-regulatory approach, and so on.In order to contribute in achieving law effectiveness while limiting the risks, AI should play an enabling and supportive role to human intervention, which should remain pivotal.Otherwise, applications of AI that surreptitiously dictate the content of rules or de facto restrict the right to be heard challenge the separation of powers and the rule of law, thus questioning the very legitimacy of rules.However, it is not obvious how to set and police the line between human and the machine, due to possible over-reliance or aversion to AI 147, as well as to cognitive bias 148, thus leading to ineffectiveness of human intervention.It is therefore neces-sary to devise the complimentary and supportive role already at the level of algorithm setting, in addition to an ex post human control.In this purpose, the collaboration of computer scientists and lawyers is crucial not only "to ensure that computer architectures incorporate fundamental safeguards against bias, invasion of privacy", or unreliable assessments 149, but also to clearly identify what the AI tasks are, and what the role of humans is.For instance, if AI identifies overlapping rules, it is up to the regulator or lawmaker to suggest whether the previous rule should be repealed (since when a rule intervenes over an already regulated matter, complete overlap is unlikely, and repeal always requires substantive evaluation) 150 .In impact assessment, humans should instruct AI how to balance advantages with disadvantages, or how to value sensitive factors (such as human life, or air quality) 151 .Moreover, the system must allow complete human control of the analysis.For instance, a final step should allow humans to review the cost benefit-analysis of a proposed rule to update the standard cost of a particular administrative burden, or to minimize the negative impact of a prosed rule on SMEs, as well as to change its inadequate approach to gender equality.
As the use of AI in parliamentary and regulatory processes increase and the EU existing norms or those that are in the process of being approved at EU level do not tackle AI for legislation or regulation as such 152, it is necessary to establish a national power-conferring legislation framing the use of AI in regulation 153 .This legislation should set the guiding principles, not unlike those outlined for the administrative and judicial functions: complementary role of humans and AI (human in the loop), transparency 154, explainability 155, data governance, and security 156 .Each regulator should then adapt these principles to its own activity.These regulations should also set minimum procurement conditions which a third-party vendor should follow (when the preferable 157 in-house solution does not prove to be viable), in order to be in line to the above-mentioned principles 158, and to avoid a de facto delegation of legislative or regulatory power to a third party provider.
proposal does not set a discipline for AI in rule-making and law-making based on "narrow AI applications" (i.e., trained on specific data for a specific task and content).Nevertheless, it could be argued that AI in rule life-cycle might be classified as high-risk systems if it is likely to produce adverse impacts on fundamental rights, such as the right to non-discrimination or the right to be heard as a component of the right to a good administration (see the example of AI excluding comments characterized by informal narrative, or resulting from a mass campaign in Para.5).Moreover, recent amendments to the proposal take into account foundation models, specifying as they might fall under the high-risk category based on their use or purpose in development only.However, foundation models shall respect similar obligations.For instance, deployers who are public authorities shall comply with registration obligations, and with transparency requirements.Additionally, foundation models intended to work as "generative AI" (e.g.LLM supporting rules drafting, rule setting, and consultation) shall: i) comply with specific transparency obligations, ii) be trained, designed, and developed to ensure adequate safeguards and without prejudice to fundamental rights; and iii) be publicly available through a sufficiently detailed summary of the use of training data.On human oversight, the latter is added as a general principle applicable to all AI systems, but explicitly detailed for high-risk systems, while not mentioned in obligations of the providers of a foundation model. 153Stefano CIVITARESE MATTEUCCI, "Public Administration Algorithm Decision-Making and the Rule of Law", in European Public Law, vol.27, n. 1, 2021, pp.103-129 (p.104). 154Cary COGLIANESE and David LEHR, "Transparency and algorithmic governance", cit.
155 "The administrative state is about translation -from expert knowledge and legal authority discourses to a conversation that allows at least somewhat more public deliberation.A key question is what happens to that process when automated systems have an ever more prominent role in the administrative state, and their capacity to explain their decisions implicates at best a big principal agent problem and at worst is limited given their very architecture and ability to encourage decisions that humans would not have otherwise made" (Mariano-Florentino CUELLAR, "Cyberdelegation and the Administrative State", cit., p. 156-157).
156 On the accountability and security issues specific to Parliaments, see World e-Parliament Report 2020, cit., p. 56.Concerning regulation, see Mariano-Florentino CUELLAR, "Cyberdelegation and the Administrative State", cit., p. 153. 157The critical role of AI handling a key public function and leveraging of sensitive data suggests an in-house development.It would also allow a better tailoring of AI to the needs of legislators and regulators, as well as to make it easy to explain its functioning and output.Moreover, AI should be developed with open-source standards, so as to be easily shared with public authorities acting in the same phase of the rule life-cycle (e.g. the EC LEOS for legislation drafting and DORIS for consultation, as well as "GISA Self-assessment" developed by the Campania Italian Region for law enforcement).A more nuanced approached is suggested by the Administrative Conference of the United States, Using algorithmic tools in retrospective review of agency rules, cit., point 2 (see also Administrative Conference of the United States, Agency use of artificial intelligence, Recommendation, December 31, 2021, point 4). 158According to Cary COGLIANESE and Erik LAMPMANN ("Contracting for algorithmic accountability", in Public law and legal theory research paper series, Research paper n. 21-20, 2021), these minimum conditions should be identified by contract, with the advantage of a flexible framework that administration can adequate overtime, when necessary.On the contractual preconditions for acquiring As per the legislative function, parliaments should enact regulations (or soft regulation) for AI driven legislation, tailoring these principles to the peculiar features of their activities and needs, the legislative being characterized by an intense politicization and flexible nature of the procedure 159 .
The above mentioned power-conferring legislation should also incentivise experimentation.The analysis showed that not all applications reached the same maturity (e.g., AI in IA seems to be in its infancy), and others require important investment in terms of human resources and are not applicable to all types of rules (e.g., rule as a code).An incremental and experimental approach to AI in the life-cycle of rules is therefore suggested.In the short term, the potential of AI is particularly relevant for drafting, consultation, ex post evaluation.Other applications should be experimented in controlled fields, in order to test their real potential and tackle critical issues 160 .For instance, the regulatory framework of a given sector (e.g., taxation) or activity (e.g., public procurements) could be translated into codes, after having simplified and reorganized the regulatory stock, with the support of AI; then, the expected outcomes of alternative options for new proposals or amendment of this framework should tested through AI.This agile approach would allow the AI revolution to display its benefits while preventing potential harms or side effects 161 .
102 "Nowadays DORIS can process results of surveys coming from EUSurvey and Better Regulation Portal.It allows users to analyze data from open and closed questions, and offers a dashboard through which users can visualize the results of the analysis" (About DORIS+ | Joinup (europa.eu)).