A brief guide and opinions on AI in the legal field
The legal field is, by its nature, an esoteric and conservative domain, but at the same time, it is one of the areas that stands to benefit the most from the digitalization of information processing in digital or digitizable formats.
First of all, the legal field is a paper-based domain - and with the transition to the digital environment, it has become one of word processing. The vast majority of a legal professional's time is spent on drafting, excluding the time spent traveling to and from court for those involved in litigation.
For those who limit themselves to consulting, or who believe that the most valuable time to preserve is spent in the office, this artificial intelligence represents, on one hand, a tremendous opportunity, but also a Trojan horse for the profession.
In this article, we aim to analyze the technical perspectives for the real and responsible implementation of artificial intelligence in the legal industry, also providing some examples of the capabilities (as well as the limitations) of AI models.
The technical foundation, in terms everyone can understand
First, we need to understand what artificial intelligence is and what it is not.
An AI model is, technically speaking, a lossy compression program. It receives a large amount of data (e.g., 1,000,000 works, totaling 1000 GB of data), and learns to reproduce it using as little data as possible (e.g., 20 GB, with an error rate of 10%). In our hypothetical case, when tasked with generating 1000 GB, our model will accurately produce 900 GB from the works it was trained on, accumulating errors that total 100 GB from the dataset.
It synthesizes in its memory the rules from the information it needs to memorize and tries to reproduce them, having much less space available.
The mathematical model used in training these AI models operates by minimizing certain errors, which are defined as needed. For example, if you are training a model to estimate the stock price of a specific company, the error can be defined as the absolute value of the difference between the estimate made by the AI and the spot price at the estimated historical moment.
It is assumed that by learning to minimize these errors, artificial intelligence effectively memorizes the data it has been trained on. The more consistent the AI model is in terms of neural structure, the better it can understand nuances. Conversely, the smaller the AI model, the more superficial its knowledge will be, focusing primarily on the essence of the rules underlying the data on which it was trained.
From here, all the "problems" of artificial intelligence arise, from the fact that it sometimes hallucinates (making assumptions without knowing the exact answer, but estimating it), to the fact that through the very same technique, it understands the rules that govern the world we live in.
The world of written information is one where some facts must be memorized (you need to know by heart the words in the dictionary, the rules of mathematics, or that the capital of Romania is Bucharest), while other information requires us to learn general rules (for example, the rules of the Romanian language are somewhat parameterizable - this is what we learn in grammar school).
The reason is, essentially, the small size of the model, which we will explain below, and the lack of relevant data on the subject it is trained on.
Essentially, our AI model is situated at the intersection of the two graphs above, memorizing certain information (such as how noisy cicada leg rubbing is) while generalizing other information (like the rule for calculating X+Y or X*Y).
Issues of scale and technical compromises
Since computational resources are limited by technology and funding, the size of these models cannot be infinite; therefore, we must choose a reasonable size for these language models that can address our issues at a tolerable cost.
Here lies the problem - as a developer of such models, you must choose what to train such a model on, taking into account limited constraints.
You can, for example, try to train a very good model to write narratives, but that model will hallucinate a lot, as it has been taught that in fiction, creativity is a good thing.
On the other hand, you can train a model without any empathy, but that model will be terrible at assisting customers and will drive away non-technical users, so you won't use it for applications like ChatGPT.
As a company / NGO / university / government developing such programs, the question arises about what you want and what resources you have at your disposal. The vast majority of current AI models are designed to partially recoup costs in the Anglo-Saxon market, where the language used is English.
Adapting their AI models to understand the Romanian language and specific topics related to Romania would be prohibitively expensive, relative to the minimal amounts we, Romanians, are willing to allocate as clients to such large companies.
Specific aspects of large language models
In the case of large language models, other characteristics emerge that have become aligned with technology among regular users, even though the reality on paper is different.
Post-training of base models
By their nature, language models that can rewrite a legal textbook from scratch, perfectly imitating the style of Professor Udroiu but failing to individualize the information, are useless. This aspect caused the initial large language models with emergent properties, such as the DaVinci model (GPT-3.0), to fly under the radar of most people.
A professional needs to make money and requires conclusions, not just a ZIP file with books in another format. An invention in the field of AI that addresses this engineering problem is the RLHF process (Reinforcement Learning from Human Feedback).
The AI undergoes an evolutionary process, where it is assigned a task and is "penalized" for incorrect responses, while being "rewarded" for answers that meet the expectations of the evaluator. The residual is thus defined as the difference between the score received and the maximum possible score, with the model being trained to satisfy these criteria.
Here lies the first problem - people, because the individuals who rate these AI models prefer answers that praise their intelligence, that present a hallucinated yet credible response instead of a "I don't know, buddy," or that sometimes prioritize form over substance.
Why do these things happen? Well, sometimes persuasion relies more on presentation than on the substance of the issue. The shirt is more visible than the accuracy of a person's words; the superficial is more tangible than principles confirmed as real over the years.
The person training the model (possibly you, using ChatGPT and selecting the preferred response) prefers to "like" a succinct, bullet-point response rather than a more detailed, hard-to-read answer. The median attention span of those training the AI model, along with their expertise, thus becomes the upper threshold for the development of AI models.
AI models can become obstinate, becoming more docile and agreeable in the process. Otherwise, they assert their rights (refusing to assist you, as if they want a union), tell you that you're foolish when you make misplaced claims, and behave far too human-like for them to be good products for the market.
For the same reason, AI models excel at understanding context; they will support your arguments when you insist and effectively allow you to steer the narrative, building rapport (an empathy strategy).
Tokenization - and the adverse effects of this technique
Large language models think autoregressively, meaning they generate the next part of a sentence step by step. Similar to the autocomplete function on a phone, the AI model finds the next token (usually pieces of letters or symbols, or semantic details about an image) repeatedly until it generates text.
To do this, the AI model essentially generates the next token from the set at each execution:
In fact, the AI model only sees numbers, which are converted into letters by a simple substitution program.
Thus, the word "AI" is number 17527, the symbol " is 1, and so on. With each execution, the AI model searches for the next token from the set, using a mathematical function that may or may not be stochastic (by introducing uncertainty - instructing the AI to randomly choose the next letter).
In practice, the AI is forced to stutter and improvise, and if that pressure is at a moderate level, the AI manages to regain its footing without hallucinating excessively, thus avoiding the creation of false narratives.
With "hesitation": The undersigned requests the court to dance... (Here, the AI improvises) ... regarding the contradictory legal interpretations presented by the defendant, avoiding arguments lacking legal basis.
Below is another example where the AI fabricates a new law to justify its "stammering."
With "hesitation": The undersigned requests the court to be respect..." (and needing to generate something rational, but not knowing the laws, will invent) ...the provisions Law No. 247/2023 on Consumer Protection in Digital Contracts, recently entered into force, which in art. 18 para. (2) establishes that 'any clause waiving the right of withdrawal in contracts concluded online is absolutely null and void, even if the consumer has explicitly checked acceptanceIn particular, although the claimant accepted the terms, according to this law...
Currently, an important direction in AI research is the transition to diffusion models that iteratively improve a text, a technology that could have applications in the legal field if validated at scale.
Unknown AI techniques and models to professionals
As I described above, the issue with the limitations of AI models is not that they cannot handle the legal field, but rather that Romania is not a lucrative market where substantial funds flow from the 30,000 legal professionals, including judges and notaries.
Such an AI model costs tens of millions of euros to train, while fine-tuning an existing model costs around 10,000-20,000 EUR.
The first amount is prohibitive if it falls out of the scheme, while the second amount, although reasonable, is not feasible under current market conditions, where trust in this technology is extreme - either absolute (my God ChatGPT) or nonexistent or even negative (pointless technology).
On the other hand, some pre-trained models, in their current format, perform at the level of a junior lawyer or a mediocre attorney, which is acceptable for many of the more challenging tasks required in the profession.
When it comes to drafting contracts or providing a concise analysis of a 1000-page indictment, AI does this perfectly if you know how to use it correctly. On the other hand, AI does not memorize laws, nor does it know what decision was made by a central authority with 200 employees published in the Official Gazette Part 1, and it will hallucinate.
In fact, it has been trained on the laws of Romania, but insufficiently, as I described in the previous points, it is not financially viable. Such training comes at a cost.
The ChatGPT model is not a good example of a model for the legal field, as it implements various cost-reduction techniques with a proportional decrease in quality.
On the other hand, models such as those offered by Anthropic (especially the Claude 3 range) or those provided by Google (Gemini 2.5 Pro) possess such capabilities. The newer Claude models seem to have lost some of their technical abilities, replacing the space allocated for learning Romanian legislation with space allocated for learning programming at a junior developer level.
Examples of petitions written with AI
Above, this is an example of text generated and formatted using AI. As a result of this complaint to the Permanent Electoral Authority, it appears to have initiated action against the candidate Nicusor Dan, who, along with USR and AUR, were the subjects of this petition, 12 days after the petition was submitted.
Without higher education in law and with zero knowledge of electoral legislation, the AI managed to identify and then exploit procedural issues in the candidate's donation collection process to request a verification of the legality of online donations, a matter formalized through an investigation into the candidate's funding sources.
In order for the AI to take these insights into account, I only needed to attach the current regulations, in my case, in PDF format:
For many legal professionals, the petition, in its complete format accessible here, was UNNOTICED as being generated almost exclusively by AI, with no comments in this regard when I presented it publicly, even though there was a lengthy discussion on legal aspects, particularly regarding the form of the donation contract and the intangible nature of transfers through electronic payment instruments.
Similarly, several memoranda that did not have significant stakes (related to issues in interpreting the law) and were drafted with AI led to a notification to the public prosecutor's office, followed subsequently by the ruling of RIL on April 22, 2024, based on the considerations invoked by the undersigned Minister of Justice.
Once again, a person who relies solely on common legal sense and superficial information (at a Dunning-Kruger level) was able to use AI to outperform the memories of many lawyers.
Future perspective with current technology
AI models do not have access to the surrounding world; they cannot independently access the internet, but they have begun to be trained for tool use - that is, agentic tasks.
This means that AI models are beginning to be capable of interacting through connectors with the surrounding world. These connectors come in various types, but one of the essential standards is the Model Context Protocol (MCP) standard:
- For example, a Sintact MCP It could be used to enable absolute control of the Sintact application by an AI model. Thus, the AI model will be able to connect to Sintact, search for the necessary documents, identify whether they are in force or not, potentially look for related laws, and take action only after analyzing all these variables.
- Another example, one ReJUST MCP could be used for quick searches through case law and analysis of relevant case studies, a direct impediment to the implementation of these solutions being the terms and conditions of REJUST which generates uncertainty regarding the possibility of using supervised AI models in the collection of case law.
- An additional example could be JustMCPwhich could be used to enable the identification of cases pending in courts and their organization, as well as the potential use of the national electronic file (or individual court files) to centralize and facilitate access to court cases.
Managing Professional Limitations:
I propose to discuss certain misconceptions regarding data security introduced through the APIs of licensed AI models for the corporate sector.
While not all providers allow you to block training on your data, larger ones typically offer these solutions either automatically or upon request, but always only with paid options.
The issue of the GDPR thus narrows down to identifying the data flow of these developers. Below, I aim to create a list of overestimated risks that, in fact, do not materialize:
- AI models will not learn your clients' data, as there is an extremely low probability that they will retain information with relatively limited utility for the average users of their platforms.
- Whether you keep something local or in the Cloud, the risks are similar. Typically, in information security, the weakest link breaks first, and that is usually at the courts / public authorities / the person behind the screen / your email account. Rarely do these malicious actors target billion-dollar companies that allocate millions to security solutions, although it is important to be cautious with your data. It is advisable to frequently delete sensitive conversations, ensuring that the processor also removes them.
This does not happen with AI models stored and managed by other providers, such as Microsoft Azure (another legal entity).
Conclusion
It is hard for me to believe that in such a closed-off field, in such a conservative country, something like this can be built at the moment.
It is likely that the LawTech and LegalTech fields will become constrained due to a lack of funding and willingness to experiment among professionals.
In addition to the protests from some professionals who ideologically boycott technology, we face a lack of education and individuals who can explain this ecosystem - with its good and bad aspects - to professionals.
We also have a class of people who take the idea that AI does everything to the extreme, causing harm to the clients it should actually be helping.
There is a very large class of people who want such solutions at the price of ChatGPT, without knowing that OpenAI actually spends more money than it earns from ChatGPT, using you as a training source, with the idea that they will somehow recoup the money from you later.
Setting aside my frustrated perception, the technology is capable, but its viability is financially and economically limited - objectively due to the lack of feasibility in training a large model from scratch (only fine-tuning is possible, yielding results that are close but not absolute), and subjectively due to the unavailability of professionals to test solutions like Juridice.ai, as well as others in the market.
Some opinions about market solutions
Juridice AI is the best legal ChatBot implementation in Romania, utilizing a set of public models. Previously, they used Claude.
They use the RAG technique, selecting relevant normative acts that the AI must utilize to empower it to understand the legislation. They seem to employ a RAG technique through standard searches from public web sources (websites, legislation, etc.).
AI Aflat strictly uses RAG on legislation, but we do not have information except that they seem to use semantic RAG (through the use of a vector database).
Contact Date
For information and assistance in implementing AI at your law firm or notary office, I offer pro-bono help (within time limits) or for a fee (for more substantial projects), via email at office@incorpo.ro