Introduction
While Large Language Models (LLMs) have demonstrated significant potential in the legal domain, evaluation efforts have been predominantly focused on the United States' "Common Law" system and the English language. Legal systems are inherently jurisdiction-specific; the "Civil Law" framework of Portugal differs fundamentally from the legal structures of the US or UK. Consequently, existing multilingual datasets often fall short, covering only basic tasks like document classification rather than the deep legal reasoning required for professional practice.
LegalBench.PT addresses this gap as the first comprehensive benchmark designed to evaluate LLMs on the specific nuances of Portuguese law. By transforming real-world academic assessments into a structured dataset, this research provides a standardized metric for measuring AI proficiency in European Portuguese legal contexts.
Methodology
The researchers developed a multi-stage pipeline to convert academic materials into a rigorous evaluation framework. The process began with the collection of 341 real law exams from the University of Lisbon, spanning the years 2021 to 2024 and covering 31 distinct legal disciplines.
Because traditional law exams typically consist of long-form essay questions that are difficult to grade automatically, the authors utilized GPT-4o to rewrite these complex scenarios into structured formats, including Multiple-Choice, True/False, and Matching questions. To ensure the quality of this synthetic transformation, the team employed lexical (ROUGE-L) and semantic (sentence embeddings) filtering to prune duplicates. A critical step in this process was the removal of questions that relied solely on memorizing article numbers, ensuring the benchmark tests substantive legal reasoning rather than rote memorization.
Dataset Composition
The resulting benchmark, LegalBench.PT, comprises 4,723 questions. These are categorized into four primary domains:
- Public Law: Including Constitutional, Administrative, and Criminal Law.
- Private Law: Including Civil, Commercial, and Labor Law.
- Public-Private Law: Specifically focusing on Competition Law.
- International & EU Law: Covering broader European and global legal frameworks.
To establish a performance ceiling, the researchers recruited 22 Portuguese lawyers to answer a subset of these questions. While the synthetic data proved to be high-quality, human validation identified a noise level of approximately 12% in the "gold" answers—a common challenge in synthetic dataset generation that the authors acknowledge as a baseline for future refinement.
Evaluation and Results
The benchmark was used to test a variety of state-of-the-art models, ranging from proprietary frontier models to large-scale open-weights models. The results indicate that top-tier LLMs are highly capable of navigating the complexities of the Portuguese legal system.
As shown in the evaluation data, GPT-4o and Claude 3.5 Sonnet lead the field with accuracies of 85.4% and 85.1%, respectively. Notably, the open-weights model Llama-3.1-405B performed competitively at 83.8%, suggesting that open-source alternatives are becoming viable for specialized legal applications. In contrast, the human baseline for practicing lawyers ranged between 60% and 80%. While the models outperformed humans on these standardized tasks, the authors attribute this partly to the models' optimization for structured test-taking and the relative fatigue humans experience when answering large volumes of questions.
Discussion and Insights
A significant concern in synthetic benchmarking is "self-generation bias," where a model might perform better on data it helped create. To investigate this, the authors re-generated a portion of the benchmark using Claude 3.5 Sonnet and found no significant performance advantage for GPT-4o, suggesting the benchmark is robust across different model architectures.
The human evaluation also highlighted the inherent ambiguity of legal practice. Approximately 15% of the questions were flagged as ambiguous, where multiple interpretations could be valid. This reflects the reality of the legal profession, where "it depends" is often the most accurate answer, and suggests that future iterations of the benchmark could benefit from more nuanced grading schemes.
Conclusion
LegalBench.PT represents a major step forward in the evaluation of AI for non-English, Civil Law jurisdictions. While the current benchmark focuses on structured questions, future work will aim to include more generative tasks, such as contract analysis and legal drafting, to more closely mirror the day-to-day responsibilities of legal professionals. The dataset is currently available on Hugging Face to encourage further research in the Portuguese legal AI space.
Summary updated