DOI: https://doi.org/10.66104/4zsfgz56
تاريخ النشر: 2026-02-27
المؤلف: Ruan Dias Santana وآخرون
الموضوع الرئيسي: الذكاء الاصطناعي في القانون
نظرة عامة
يواجه النظام القضائي البرازيلي تحديات كبيرة بسبب تراكم الدعاوى الرقمية، مما يجعل فرز القضايا يدويًا غير فعال ومكلف. تبحث هذه الدراسة في تطبيق الذكاء الاصطناعي التوليدي، تحديدًا من خلال نماذج اللغة الكبيرة (LLMs)، لتعزيز تصنيف الالتماسات القانونية. تم هيكلة الدراسة في ثلاث مراحل، بدءًا من نموذج التعلم القليل الذي حقق دقة أولية بلغت 56%.
تظهر النتائج التكامل الناجح لنموذج جمنّي مع بنية توليد معززة بالاسترجاع (RAG)، مما حسّن دقة التصنيف إلى 84%. تؤكد هذه التقدمات على أهمية السياق الديناميكي في تحقيق أتمتة قانونية عالية الدقة. ساهمت المنهجيات الرئيسية، بما في ذلك زيادة البيانات وN-grams، في هذا التقدم، لكن القدرة على الاستشارة في الوقت الحقيقي لـ RAG مع قاعدة المعرفة أثبتت أنها حاسمة للتعامل مع تعقيدات القانون البرازيلي. بالإضافة إلى ذلك، توفر بنية RAG قابلية تفسير محسّنة، مما يسمح بتدقيق السوابق المستخدمة في التصنيفات، وبالتالي تعزيز الثقة في التكنولوجيا. تشمل اتجاهات البحث المستقبلية استكشاف نماذج التضمين المصممة خصيصًا للنصوص القانونية البرازيلية، مثل LegalBERT-PT، والتحقق من أداء النظام في بيئة الإنتاج لتقييم التحسينات في الكفاءة الإجرائية.
مقدمة
تناقش مقدمة ورقة البحث التحديات والتقدمات في القطاع القانوني بسبب الانتقال إلى العمليات الرقمية، التي تُسمى “العدالة 4.0.” في البرازيل، أدى تنفيذ نظام العملية القضائية الإلكترونية (PJe/E-Proc) إلى تحسين الوصول إلى العدالة ولكنه أدى أيضًا إلى اختناق تشغيلي. على وجه التحديد، أصبح التصنيف اليدوي للالتماسات الأولية – وهي خطوة حاسمة لتحديد القواعد الإجرائية واختصاص المحكمة – مهمة متكررة ومعرضة للأخطاء، مما أدى إلى تأخيرات وعدم كفاءة في نظام العدالة.
تواجه طرق الأتمتة التقليدية، بما في ذلك تقنيات معالجة اللغة الطبيعية الكلاسيكية (NLP) مثل آلات الدعم الشعاعي (SVM) والنماذج الحديثة المعتمدة على المحولات مثل BERT، قيودًا كبيرة بسبب اعتمادها على مجموعات بيانات كبيرة وموسومة. في السياق القانوني، يعتبر إنشاء هذه المجموعات مكلفًا ويتطلب معرفة متخصصة. ومع ذلك، فإن ظهور الذكاء الاصطناعي التوليدي ونماذج اللغة الكبيرة (LLMs)، مثل عائلتي GPT وجمنّي، يقدم فرصة تحويلية. تظهر هذه النماذج، التي تم تدريبها مسبقًا على مجموعات نصية واسعة، قدرات تعميم محسّنة، مما يمكنها من أداء مهام معقدة مع أمثلة قليلة (تعلم قليل) وتقليل الحاجة إلى تدريب متخصص واسع.
الطرق
تم تطوير المنهجية الموضحة في هذه الدراسة من خلال نهج تكراري وتدريجي، وهيكلت في ثلاث مراحل تجريبية متميزة. تم تصميم كل مرحلة خصيصًا لمعالجة والتغلب على قيود التعميم المحددة في المرحلة السابقة. سمح هذا التقدم المنهجي بتنقيح التقنيات والاستراتيجيات، مما يضمن أن تكون النتائج قوية وقابلة للتطبيق عبر سياقات مختلفة. يبرز التصميم الدقيق لهذه المراحل أهمية التكيف في منهجيات البحث، خاصة عند مواجهة تحديات في التعميم.
النتائج
في قسم النتائج، يوضح المؤلفون تقييمهم التجريبي، الذي تم إجراؤه بطريقة متسلسلة وتدريجية. مكنت هذه المنهجية الباحثين من عزل مساهمات تقنيات مختلفة، تتراوح من التحفيز الأساسي إلى استرجاع المعلومات السياقية، وبالتالي تقييم فعاليتها في مهام التصنيف القانوني.
تسلط النتائج الضوء على كل من مقاييس الأداء الكمية والتداعيات النوعية المستمدة من كل مرحلة من التجارب. لا يوضح هذا النهج المنظم تأثير التقنيات الفردية على فعالية التصنيف العامة فحسب، بل يوفر أيضًا رؤى حول التداعيات الأوسع لأنظمة استرجاع المعلومات القانونية.
المناقشة
تسلط قسم المناقشة في ورقة البحث الضوء على التحديات التي يواجهها النظام القضائي البرازيلي بسبب تراكم هائل من القضايا الرقمية، مما يعقد تصنيف القضايا يدويًا. تبحث الدراسة في تطبيق الذكاء الاصطناعي التوليدي، تحديدًا من خلال نماذج اللغة الكبيرة (LLMs)، لتعزيز تصنيف الالتماسات القانونية. توضح البحث تقدمًا تقنيًا من ثلاث مراحل: اختبار نموذج التعلم القليل بدقة متواضعة تبلغ 56%، تليها تحسينات باستخدام تقنيات هندسة التحفيز وزيادة البيانات لمعالجة تحيزات مجموعة البيانات، وت culminate في تنفيذ إطار توليد معزز بالاسترجاع (RAG). زاد هذا النهج النهائي بشكل كبير من الدقة إلى 84% عبر أحد عشر فئة قانونية معقدة، مما يظهر قدرة النموذج على تقليل الهلوسات الناتجة عن الذكاء الاصطناعي وتوضيح عدم اليقين الدلالي في النصوص القانونية.
تشير النتائج إلى أن بنية RAG لا تحسن فقط الكفاءة التشغيلية في معالجة الوثائق القانونية، ولكنها تعزز أيضًا موثوقية وقابلية تفسير نظام التصنيف. من خلال دمج الوصول في الوقت الحقيقي إلى قاعدة المعرفة، يضمن النموذج أن تصنيفاته مستندة إلى سوابق قانونية حالية، مما يعزز الثقة في التكنولوجيا. تختتم الدراسة بأن هذه المنهجية المبتكرة تقدم حلاً قابلاً للتوسع لتكنولوجيا القانون، مما قد يفيد الولايات القضائية الأخرى التي تواجه تحديات رقمية مماثلة. تشمل اتجاهات البحث المستقبلية استكشاف نماذج التضمين المتخصصة المصممة خصيصًا للسياقات القانونية البرازيلية لتحسين قدرات الاسترجاع للنظام والتحقق من فعاليتها في التطبيقات الواقعية.
القيود
في المرحلة الأولى من الدراسة، تم تقييم قيود نموذج GPT-4o-mini باستخدام تحفيزات ثابتة قليلة بدون معرفة خارجية. كانت أداء النموذج دون المستوى، حيث حقق دقة بلغت 56% فقط، ويرجع ذلك أساسًا إلى تحيز قوي تجاه الفئة الغالبة (THEMA 864) وفشل في معالجة تعقيدات القضايا المتعلقة بالضرائب. كشفت التحليلات أن الاعتماد على N-grams أدى إلى غموض دلالي، خاصة في التمييز بين المواضيع ذات الصلة الوثيقة، كما يتضح من الارتباك بين مواضيع مثل THEME 796 وTHEME 1199. أشار تحليل منحنى ROC إلى أنه بينما تم الحفاظ على الدقة العامة، تضاءلت قدرة النموذج التمييزية للفئات المحددة، مما يبرز ضرورة وجود نهج سياقي أكثر تطورًا، مثل توليد معزز بالاسترجاع (RAG).
أشار تحليل نوعي إضافي لمصفوفة الالتباس إلى أخطاء مستمرة، خاصة داخل فئة NONE، حيث تم تصنيف الالتماسات العامة بشكل خاطئ كمواضيع محددة بسبب تداخل المفردات. على سبيل المثال، تم الخلط بين الالتماسات المتعلقة بـ “غرامة فرض ضريبة ملكية المركبات” (فئة NONE) و”الإجراء التقريري لعدم وجود دين ضريبة ملكية المركبات بسبب البيع” (THEME 1118) بسبب قربها في الفضاء الكامن. يشير ذلك إلى أن آلية البحث الدلالي الحالية غير كافية، وقد تتطلب التطبيقات المستقبلية خطوة إعادة ترتيب إضافية أو تحقق منطقي بعد عملية الاسترجاع لتعزيز دقة التصنيف.
DOI: https://doi.org/10.66104/4zsfgz56
Publication Date: 2026-02-27
Author(s): Ruan Dias Santana et al.
Primary Topic: Artificial Intelligence in Law
Overview
The Brazilian judicial system faces significant challenges due to a backlog of digital lawsuits, rendering manual case sorting inefficient and costly. This research investigates the application of Generative Artificial Intelligence, specifically through Large Language Models (LLMs), to enhance the categorization of legal petitions. The study is structured into three phases, beginning with a few-shot learning model that achieved an initial accuracy of 56%.
The findings demonstrate the successful integration of the Gemini model with a Retrieval Augmented Generation (RAG) architecture, which improved classification accuracy to 84%. This progression underscores the importance of dynamic context in achieving high-precision legal automation. Key methodologies, including Data Augmentation and N-grams, contributed to this advancement, but the real-time consultation capability of RAG with a knowledge base proved critical for handling the complexities of Brazilian law. Additionally, the RAG architecture offers enhanced explainability, allowing for the auditing of precedents used in classifications, thereby fostering trust in the technology. Future research directions include the exploration of embedding models tailored to Brazilian legal texts, such as LegalBERT-PT, and validating the system’s performance in a production setting to assess improvements in procedural efficiency.
Introduction
The introduction of the research paper discusses the challenges and advancements in the legal sector due to the transition to digital processes, termed “Justice 4.0.” In Brazil, the implementation of the Electronic Judicial Process system (PJe/E-Proc) has improved access to justice but has also led to an operational bottleneck. Specifically, the manual classification of initial petitions—a crucial step for determining procedural rules and court jurisdiction—has become a repetitive and error-prone task, resulting in delays and inefficiencies in the justice system.
Traditional automation methods, including classical Natural Language Processing (NLP) techniques like Support Vector Machines (SVM) and modern Transformer-based models such as BERT, face significant limitations due to their reliance on large, labeled datasets. In the legal context, creating these datasets is costly and requires specialized knowledge. However, the advent of Generative Artificial Intelligence and Large-Scale Language Models (LLMs), such as the GPT and Gemini families, presents a transformative opportunity. These models, which are pre-trained on extensive text corpora, demonstrate enhanced generalization capabilities, enabling them to perform complex tasks with minimal examples (few-shot learning) and significantly reducing the need for extensive, specialized training.
Methods
The methodology outlined in this research was developed through an iterative and incremental approach, structured into three distinct experimental phases. Each phase was specifically designed to address and overcome the generalization limitations identified in the preceding stage. This systematic progression allowed for the refinement of techniques and strategies, ensuring that the findings were robust and applicable across various contexts. The careful design of these phases underscores the importance of adaptability in research methodologies, particularly when faced with challenges in generalization.
Results
In the Results section, the authors detail their experimental evaluation, which was conducted in a sequential and incremental manner. This methodology enabled the researchers to isolate the contributions of various techniques, ranging from basic prompting to the retrieval of contextual information, thereby assessing their effectiveness in legal classification tasks.
The findings highlight both the quantitative performance metrics and the qualitative implications derived from each phase of the experiments. This structured approach not only elucidates the impact of individual techniques on the overall classification effectiveness but also provides insights into the broader implications for legal information retrieval systems.
Discussion
The discussion section of the research paper highlights the challenges faced by the Brazilian judicial system due to an overwhelming backlog of digital cases, which complicates manual case classification. The study investigates the application of Generative Artificial Intelligence, specifically through Large Language Models (LLMs), to enhance the categorization of legal petitions. The research outlines a three-phase technical progression: initially testing a few-shot learning model with a modest accuracy of 56%, followed by improvements using prompt engineering and data augmentation techniques to address dataset biases, and culminating in the implementation of a Retrieval-Augmented Generation (RAG) framework. This final approach significantly increased accuracy to 84% across eleven complex legal categories, demonstrating the model’s ability to reduce AI hallucinations and clarify semantic uncertainties in legal texts.
The findings suggest that the RAG architecture not only improves operational efficiency in legal document processing but also enhances the reliability and explainability of the classification system. By integrating real-time access to a knowledge base, the model ensures that its classifications are grounded in current legal precedents, thereby fostering greater trust in the technology. The study concludes that this innovative methodology presents a scalable solution for LegalTech, potentially benefiting other jurisdictions facing similar digital challenges. Future research directions include exploring specialized embedding models tailored to Brazilian legal contexts to further refine the system’s retrieval capabilities and validating its effectiveness in real-world applications.
Limitations
In the first phase of the study, the limitations of the GPT-4o-mini model were assessed using static Few-Shot prompts without external knowledge. The model’s performance was suboptimal, achieving only 56% accuracy, primarily due to a strong bias towards the majority class (THEMA 864) and a failure to address the complexities of tax-related issues. The analysis revealed that the reliance on N-grams led to semantic ambiguities, particularly in distinguishing between closely related themes, as illustrated by the confusion between themes such as THEME 796 and THEME 1199. The ROC curve analysis indicated that while overall accuracy was maintained, the model’s discriminative ability for specific classes diminished, highlighting the necessity for a more sophisticated contextual approach, such as Retrieval-Augmented Generation (RAG).
Further qualitative analysis of the Confusion Matrix indicated persistent errors, particularly within the NONE class, where generic petitions were misclassified as specific themes due to overlapping vocabulary. For instance, petitions related to “Vehicle Property Tax Fine Enforcement” (class NONE) were confused with “Declaratory Action of Non-Existence of Vehicle Property Tax Debt by Sale” (THEME 1118) due to their proximity in latent space. This suggests that the current semantic search mechanism is insufficient, and future implementations may require an additional re-ranking step or logical verification following the retrieval process to enhance classification accuracy.
