Legal AI for All: Reducing Perplexity and Boosting Accuracy in Normative Texts With Fine-Tuned LLMs and RAG


Abstract:

This study investigates the potential of open-source Large Language Models (LLMs) to enhance the accessibility and understanding of complex legal information. Legal texts often present linguistic and structural barriers for non-experts, highlighting the need for tools that can support natural language interaction with normative content. We propose a framework that integrates Fine-Tuning and Retrieval-Augmented Generation (RAG) techniques to adapt LLMs for domain-specific legal applications. Using synthetic, validated question-answer datasets, we train and evaluate multiple open-source models and introduce novel benchmarks to assess performance across different difficulty levels. Results show that the fine-tuned models significantly reduce perplexity (up to 10×) and, when combined with RAG, achieve accuracy levels exceeding 90%. To demonstrate adaptability, an additional use case involving travel-related legal norms in an environmentally protected insular region is included. This confirms the scalability of the approach to diverse legal scenarios, supporting its potential for broader adoption in legal information systems.

Año de publicación:

2025

Keywords:

  • Ecuadorian law
  • generative AI
  • Large Language Models (LLM)
  • Legal
  • RAG
  • Fine-Tuning

Fuente:

scopusscopus

Tipo de documento:

Article

Estado:

Acceso restringido

Áreas de conocimiento:

  • Inteligencia artificial
  • Ley
  • Ciencias de la computación

Áreas temáticas de Dewey:

  • Derecho
  • Métodos informáticos especiales
  • Funcionamiento de bibliotecas y archivos
Procesado con IAProcesado con IA

Objetivos de Desarrollo Sostenible:

  • ODS 4: Educación de calidad
  • ODS 15: Vida de ecosistemas terrestres
  • ODS 16: Paz, justicia e instituciones sólidas
Procesado con IAProcesado con IA