LegalAgentBench: Evaluating LLM Agents in Legal Domain

Haitao Li, Junjie Chen, Jingli Yang, Qingyao Ai, Wei Jia, Youfeng Liu, Kai Lin, Yueyue Wu, Guozhi Yuan, Yiran Hu, Wuyue Wang, Yiqun Liu, Minlie Huang · DOI

Abstract

LegalAgentBench is a comprehensive benchmark designed to evaluate Large Language Model (LLM) agents in the Chinese legal domain. It integrates 17 real-world corpora and 37 specialized tools to test "judicial cognition"—the ability to perform multi-step reasoning, navigate specialized databases, and draft precise legal documents. Using a novel Planning Tree construction method, the benchmark generates 300 tasks ranging from simple 1-hop lookups to complex 5-hop reasoning. Evaluation of top-tier models reveals that while GPT-4o leads with a 79.08% success rate, significant challenges remain in long-chain reasoning and specialized legal document generation. This benchmark provides a fine-grained evaluation framework for agents operating in highly specialized vertical domains.

Introduction

While Large Language Models (LLMs) have demonstrated impressive general-purpose capabilities, the legal field presents a unique challenge. Legal work is not merely about answering questions; it requires the ability to perform multi-step reasoning and navigate a vast body of laws and precedents. This "judicial cognition" is essential for tasks like searching law firm databases, calculating penalties, or retrieving specific legislative articles.

Existing benchmarks often focus on general knowledge or basic legal tasks like case retrieval, failing to evaluate LLM-as-Agent systems. In these systems, the model must autonomously decide which tools to use to solve a complex problem. LegalAgentBench addresses this gap by providing a standardized, fine-grained evaluation environment for agents in the specialized Chinese legal domain.

Methodology

The researchers developed a three-part framework for LegalAgentBench:

  1. The Environment: A text-based setup consisting of 17 distinct corpora, including 14 tabular databases for structured lookups (e.g., CompanyInfo, CourtInfo) and 3 document repositories for unstructured retrieval (e.g., LegalArticle, LegalCases).
  2. The Tools: 37 specialized APIs categorized into Text Retrievers, Mathematical Tools (for calculating fines or dates), Database Tools, and System Tools to finalize tasks.
  3. The Tasks: 300 manually annotated tasks created using a novel Planning Tree construction method. This method maps out potential solution paths from a starting entity to a final requirement, allowing for the generation of tasks with varying complexity levels.
The workflow for task generation using the Planning Tree method, illustrating the transition from tree construction to final verification.

Performance is evaluated using three metrics: Success Rate (final answer accuracy), Process Rate (accuracy of intermediate reasoning steps), and BERT-Score (semantic similarity to reference answers).

Experimental Results

The study evaluated eight prominent models, including GPT-4o, Claude-3.5-Sonnet, and GLM-4, across different reasoning strategies such as ReAct (Reason + Act) and Plan-and-Execute.

The Complexity Wall

A key finding is the "Complexity Wall": performance is inversely proportional to task depth. As shown in the results table, even the best models see a significant drop in success rates as the number of reasoning "hops" increases. For instance, top models achieve approximately 93% success on 1-hop tasks but drop to roughly 61% on 5-hop tasks, indicating that long-chain reasoning remains a major weakness for current AI agents.

Performance comparison of various LLMs across different task complexities (1-hop to 5-hop) and reasoning strategies (P-S, P-E, ReAct).

Reasoning Strategies

For multi-hop reasoning, the ReAct strategy generally outperformed "Plan-and-Execute" (P-E) methods. ReAct’s ability to update its internal state based on immediate tool feedback allows it to self-correct during the process. However, ReAct struggled with Writing tasks, where a holistic "Plan-and-Solve" (P-S) approach proved more effective for managing parallel information needs and maintaining document structure.

Model Performance

  • Top Performer: GPT-4o using the ReAct method achieved the highest overall success rate of 79.08% and was among the most token-efficient models.
  • Domestic Leaders: GLM-4-Plus and Qwen-max showed strong competitive performance, particularly in understanding the nuances of the Chinese legal system.
  • The Entry Barrier: Smaller or older models like LLaMA-3.1-8B and GPT-3.5 struggled significantly, often falling below a 30% success rate, highlighting the high difficulty of the legal domain.

Discussion and Limitations

The benchmark reveals a "Specialized Knowledge Bottleneck." Models often fail because they lack "legal common sense," such as failing to distinguish between "filing time" and "trial time" or not knowing which specific database to consult for case number verification. Furthermore, models frequently suffer from hallucinated tool arguments or get stuck in infinite loops during long interactions.

Currently, LegalAgentBench is focused exclusively on the Chinese language and statutory law system. Future work aims to expand the benchmark to support multiple languages and diverse legal systems, including case law systems like those in the US or UK, to foster a global standard for legal AI agents.

Conclusion

LegalAgentBench provides a rigorous testing ground for LLM agents in the legal sector. By highlighting the gap between simple retrieval and complex judicial reasoning, it sets a clear path for the development of more capable and reliable AI legal assistants.

Summary updated

BibTeX
@inproceedings{li2025legalagentbench,
  author = {Haitao Li and Junjie Chen and Jingli Yang and Qingyao Ai and Wei Jia and Youfeng Liu and Kai Lin and Yueyue Wu and Guozhi Yuan and Yiran Hu and Wuyue Wang and Yiqun Liu and Minlie Huang},
  title = {{LegalAgentBench: Evaluating LLM Agents in Legal Domain}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure