Paper deep dive
Test-Time Agent Evolution for Long-Horizon Legal Reasoning
Haotian Chen, Shuaicheng Niu, Haocong Rao, Kaisong Song, Jun Lin, Lizhen Cui, Zhiqi Shen, Yonghui Xu
Intelligence
Status: not_run | Model: - | Prompt: - | Confidence: 0%
Entities (0)
Relation Signals (0)
No relation signals yet.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Legal intelligence aims to support reliable decision-making across long-horizon legal processes involving evolving case states and multiple roles. However, real-world legal deployment exhibits substantial case heterogeneity in facts, evidence, and procedural contexts, exposing the limitations of static agent strategies. Moreover, legal reasoning is inherently interdependent across roles and procedural stages, making global reliability fundamentally different from isolated role competence. To address these challenges, we study training-free test-time agent adaptation, where agents continuously exploit deployment-time signals from preceding cases and ongoing interactions without updating model parameters. We propose \method, which introduces \emph{Test-Time Memory Evolution} to retrieve reusable experience from previous cases, adapt it to the current factual and procedural context, and consolidate accumulated experience for subsequent decision-making. Further, \emph{Rubric-Aligned Collaboration} verifies and revises role-specific actions according to behavioral and procedural requirements, enabling coordinated decision-making across roles and stages. Extensive experiments on J1-EVAL and LegalWorld across five backbone models demonstrate consistent improvements over representative reasoning and agent baselines with reasonable interaction and computational costs. Ablation and case studies further show that the two components provide complementary benefits in experience adaptation and cross-role coordination, improving the reliability and efficiency of long-horizon legal reasoning.
Tags
Links
- Source: https://arxiv.org/abs/2610.08138v1
- Canonical: https://arxiv.org/abs/2610.08138v1
Trouble viewing inline? Open PDF directly →
Full Text
51,830 characters extracted from source content.
Expand or collapse full text
Test-Time Agent Evolution for Long-Horizon Legal Reasoning Haotian Chen 1 , Shuaicheng Niu 2 , Haocong Rao 2 , Kaisong Song 3 , Jun Lin 3 , Lizhen Cui 1 , Zhiqi Shen 2 , Yonghui Xu 1,∗ 1 Joint SDU–NTU Centre for Artificial Intelligence Research, Shandong University 2 Nanyang Technological University 3 Alibaba Group haotian.chen@mail.sdu.edu.cn, xuyonghui@sdu.edu.cn ∗ Corresponding author Abstract Legal intelligence aims to support reliable decision-making across long-horizon legal processes involving evolving case states and multiple roles. However, real-world legal deployment exhibits sub- stantial case heterogeneity in facts, evidence, and procedural con- texts, exposing the limitations of static agent strategies. Moreover, legal reasoning is inherently interdependent across roles and proce- dural stages, making global reliability fundamentally different from isolated role competence. To address these challenges, we study training-free test-time agent adaptation, where agents continuously exploit deployment-time signals from preceding cases and ongo- ing interactions without updating model parameters. We propose TALA, which introduces Test-Time Memory Evolution to retrieve reusable experience from previous cases, adapt it to the current factual and procedural context, and consolidate accumulated ex- perience for subsequent decision-making. Further, Rubric-Aligned Collaboration verifies and revises role-specific actions according to behavioral and procedural requirements, enabling coordinated decision-making across roles and stages. Extensive experiments on J1-EVAL and LegalWorld across five backbone models demonstrate consistent improvements over representative reasoning and agent baselines with reasonable interaction and computational costs. Abla- tion and case studies further show that the two components provide complementary benefits in experience adaptation and cross-role co- ordination, improving the reliability and efficiency of long-horizon legal reasoning. Keywords Legal Agents, Test-Time Evolution, Long-Horizon Reasoning 1 Introduction Large language models (LLMs) are increasingly deployed as inter- active legal agents for legal question answering, document under- standing, and agent-based reasoning [5,8,9,16]. However, real- world legal practice rarely consists of isolated tasks or single-turn in- teractions. Legal consultation, document drafting, trial, and appeal are often sequentially connected, where facts, evidence, claims, and decisions produced at one stage constrain subsequent stages [34]. Legal agents must therefore maintain and update case states while reasoning coherently across extended interactions. The challenge of legal intelligence is thus shifting from merely knowing the law to acting reliably over time. Recent benchmarks have begun to capture such long-horizon characteristics through multi-turn interaction, and multi-role legal environments [15,33,34]. Nevertheless, a dynamic environ- ment does not necessarily imply an adaptive agent. Existing agent frameworks typically employ interaction strategies specified before deployment, such as predefined planning, reasoning, and tool-use procedures [23,24,30]. Although agents can react to obser- vations within a trajectory, their underlying interaction strategies often remain largely fixed as deployment conditions evolve across cases, roles, and procedural stages. As illustrated in Fig. 1(a), such static deployment strategies may struggle to adapt to newly emerg- ing information and changing procedural contexts, allowing local errors to propagate into inconsistent arguments and faulty claims. This reveals a fundamental gap between increasingly dynamic legal environments and largely predetermined agent strategies. In realistic deployment, legal cases arrive continuously, making it impractical to fine-tune or reinforce an agent for every newly encountered case [1]. A more practical alternative is to exploit signals naturally available during deployment without updating the underlying model. Recent studies have explored memory- and experience-based mechanisms for reusing information accumulated from previous interactions [21]. However, experience from one case is not directly transferable to another, as even cases involving the same offense may differ substantially in facts, evidence, and pro- cedural context. As illustrated in Fig. 1(b1), naively reusing prior experience can therefore introduce mismatched or misleading guid- ance. The first challenge is thus how to reconcile cross-case experience transfer with case-specific adaptation across heterogeneous legal cases. On the other hand, long-horizon legal reasoning is inherently coupled across roles and procedural stages. Existing methods often improve individual legal roles in isolation [26,29,32], yet stronger local decisions do not necessarily lead to reliable end-to-end execu- tion. As illustrated in Fig. 1(b2), decisions made by one role shape the context for subsequent roles, making cross-role misalignment particularly harmful as local inconsistencies can propagate across stages and compromise end-to-end reliability. The second challenge is therefore how to jointly coordinate decisions across coupled legal roles and procedural stages toward globally consistent execution. To address these challenges, we aim to enable LLM agents to adapt throughout long-horizon legal interactions using signals nat- urally available during deployment. We propose TALA, a training- free framework that improves agent behavior at test time without updating the underlying model parameters. To handle case het- erogeneity, TALA introduces Test-Time Memory Evolution (TME), which retrieves relevant experience from preceding cases, adapts it to the current factual and procedural context, and consolidates accu- mulated experience under a bounded memory budget. This allows arXiv:2610.08138v1 [cs.AI] 6 Oct 2026 Chen et al. Existing Agents Consultation •Personal facts •Legal questions Drafting •Fact statement •Legal analysis Trial •Legal debate •Role interaction Appeal •New claims •Procedural constraints Plan Tool use Reasoning Action Dynamic environment, but largely fixed agent strategy. (b) Key Challenges at Test Time 1. Experience Transfer under Case Heterogeneity Past case (Theft) •Stole a mobile phone •Eyewitness testimony Current case (Theft) •Shoplifting in supermarket •CCTV evidence Direct reuse × Mismatched guidance 2. Cross-Role Coupling under Procedural Constraints Client Provide facts Lawyer Legal Reasoning Judge Procedural ruling I only remember some details ... Based on the information, ... This claim lacks legal basis. ... Local decisions are coupled across roles and stages Dynamic environment, with continual agent evolution at test time. Test-Time Memory Evolution Rubric-Aligned Collaboration Error propagation Decision improvement Action TALA (Ours) (a) Dynamic Long-Horizon Legal Environment Figure 1: (a) Dynamic legal environments evolve across multiple stages, while agent strategies often remain largely fixed during deployment. (b) Case heterogeneity and cross-role misalignment jointly limit effective adaptation in long-horizon reasoning. prior interactions to provide reusable guidance without directly transferring case-specific facts or evidence. To mitigate cross-role misalignment, we further introduce Rubric-Aligned Collaboration (RAC), which verifies and revises each role’s actions according to role-specific behavioral and procedural requirements, preventing locally plausible decisions from introducing inconsistencies into subsequent roles and stages. Together, these mechanisms enable TALA to evolve both cross-case experience and cross-role decision- making throughout continual legal deployment, improving the global reliability of long-horizon interactions. Extensive experiments on J1-EVAL and LegalWorld demonstrate that TALA consistently improves performance across five back- bone models and diverse long-horizon legal scenarios, showing strong generalization across model families and scales. More impor- tantly, TALA substantially improves the robustness of multi-stage execution, sustaining reliable interaction across extended trajec- tories while maintaining moderate computational and interaction costs. Ablation and case studies further reveal that the two compo- nents are complementary and mutually reinforcing, with their joint use yielding more coherent long-horizon adaptation than either mechanism in isolation. Our contributions can be summarized as follows. (1) We formu- late long-horizon legal reasoning from a deployment-time evolution perspective, highlighting two fundamental challenges that arise under continual legal deployment: case heterogeneity, which com- plicates cross-case experience transfer, and cross-role misalignment, which makes local decisions consequential for subsequent roles and stages. (2) We propose TALA, a training-free framework for continual test-time agent evolution. It combines TME for context- aware cross-case experience adaptation with RAC for coordinated decision-making across coupled legal roles and procedural stages. (3) Extensive experiments on J1-EVAL and LegalWorld across five backbone models demonstrate consistent gains across model fami- lies and scales, improved robustness in long-horizon execution, and moderate test-time overhead. 2 Related Work LLM-based Legal Agents. Early studies on legal LLMs mainly fo- cus on static legal capabilities, such as legal knowledge acquisition, judgment prediction, and document understanding, through bench- mark construction and domain-specific adaptation [7,10,11,31]. More recently, research has shifted toward LLM-based legal agents that support interaction, tool use, and multi-role collaboration in complex legal environments [4,8]. Existing methods further en- hance legal agents through predefined reasoning workflows and legal-specific tools [29], or additional training such as supervised fine-tuning and reinforcement learning [1]. However, these im- provements are largely determined before deployment, while many case-specific facts, procedural states, role interactions, and tool feed- back only emerge during execution. How to exploit such deployment- time signals to continuously adapt subsequent agent behavior remains underexplored. In this paper, we aim to develop self-improving legal agents for more reliable reasoning. Test-Time Adaptation. Test-time adaptation aims to improve model performance during inference without accessing the original training data [6]. A prominent line of inference-time improvement is test-time scaling, which allocates additional computation through repeated sampling, majority voting, self-consistency, or iterative refinement [18,20,25]. While effective for short-form reasoning, such strategies become increasingly costly in long-horizon tasks, where a single trajectory may involve numerous interaction turns, role transitions, and tool calls [13,14]. More fundamentally, long- horizon agent interaction is inherently non-stationary: each action may alter subsequent states, available information, and behavioral constraints, making future decisions dependent on earlier interac- tions. Consequently, both useful experience and local errors can persist and compound over time. However, existing test-time methods have largely focused on isolated reasoning instances, leaving continual adaptation under interaction-induced non-stationarity relatively underexplored. This paper aims to bridge this gap through test-time agent evolution in long-horizon interactions. Test-Time Agent Evolution for Long-Horizon Legal Reasoning 3 Method As shown in Fig. 2, TALA operates under a continual test-time set- ting, where legal cases are processed sequentially without updating the underlying model parameters. It consists of two complemen- tary components: Test-Time Memory Evolution, which retrieves, adapts, and consolidates experience from preceding cases to han- dle case heterogeneity, and Rubric-Aligned Collaboration, which verifies and revises role-specific actions under behavioral and pro- cedural constraints. Together, the two components enable the agent to continuously exploit deployment-time signals for more reliable long-horizon legal reasoning. 3.1 Problem Formulation Test-Time Evolution. Let휋 Θ denote a pretrained language agent with parametersΘ, learned from training dataD train ∼ P train . At deployment, the agent sequentially encounters domain-specific le- gal tasks drawn fromP test , whereP test ≠ P train . As deployment progresses, newly encountered cases may differ in facts, evidence, procedural states, and role interactions, requiring the agent to con- tinually adapt its behavior to evolving test-time conditions. Long-Horizon Interaction. We formulate each legal case푖as a multi-turn interaction involving a set of rolesR=푟 1 , . . .,푟 퐾 , such as the lawyer, client, judge, and other legal participants. Within case 푖,푡indexes the interaction turn, and푇 푖 denotes the total number of turns in the corresponding trajectory. For clarity, we omit the case index푖when referring to variables within a single case. At turn푡, let H 푡 denote the accumulated interaction history, including previous utterances and tool observations, and let푠 푡 denote the current task state, such as the active scenario or litigation stage, procedural progress, and collected case information. Given the active role푟 푡 , the agent produces an action: 푎 푡 = 휋 Θ ( H 푡 ,푠 푡 ,푟 푡 ) ,(1) where푎 푡 ∈ AandAdenotes the action space. An action can be a natural-language response, such as questioning, answering, or doc- ument generation, or an executable action, such as legal retrieval or other tool invocation. After executing푎 푡 , the environment returns an observation표 푡+1 and updates the task state from푠 푡 to푠 푡+1 . The trajectory of case 푖 is therefore represented as: 휏 (푖) = (푠 푡 ,푟 푡 ,H 푡 ,푎 푡 ,표 푡+1 ) 푇 푖 푡=1 .(2) The agent sequentially processes푁legal cases휏 (푖) 푁 푖=1 drawn fromP test during test time. Our goal is to exploit information ac- cumulated from preceding cases and their interactions to improve performance on subsequent cases, while maintaining coherent be- havior with respect to the current role, task state, and procedure. 3.2 Test-Time Memory Evolution Real-world legal tasks involve complex, multi-stage decision-making [17], often requiring external legal knowledge and specialized tools. How- ever, existing LLM agents remain unreliable in tool use and long- horizon interactions [19]. To address this, we propose a Test-Time Memory Evolution (TME) mechanism that continuously accumu- lates and refines interaction experience during inference to support subsequent decision-making. The mechanism consists of three components: Memory Retrieval, Contextual Memory Adaptation, and Memory Consolidation. After completing each legal case, the agent preserves reusable expe- rience from its interaction trajectory, such as effective tool-use strategies and action guidance, to support subsequent cases. Let M 푖 =푚 푗 |M 푖 | 푗=1 denote the memory bank available before process- ing case푖, where each푚 푗 represents a textual experience entry with its associated metadata. Memory Retrieval. At turn푡of case푖, we retrieve relevant ex- perience fromM 푖 according to the current interaction context. Specifically, we construct a retrieval query푞 (푖) 푡 from the current task information and encode both the query and memory entries using a BGE encoder푓 BGE (·)[27]. The relevance between푞 (푖) 푡 and a memory entry푚 푗 is measured by cosine similarity: 휌 푗 = sim cos 푓 BGE (푞 (푖) 푡 ), 푓 BGE (푚 푗 ) ,(3) where푓 BGE (·)denotes the BGE embedding encoder and휌 푗 measures the semantic similarity between the current query and memory entry푚 푗 . We then rank all memory entries according to휌 푗 and retain at most the top-푘entries whose similarity scores exceed a threshold 훿 : R (푖) 푡 = TopK 푘 (푚 푗 ,휌 푗 ) | 푚 푗 ∈M 푖 , 휌 푗 ≥ 훿 ,(4) where훿=0.5 in our implementation.R (푖) 푡 contains the retrieved textual experience entries and their metadata, while the embeddings are used only for similarity computation. Contextual Memory Adaptation. Although retrieved memories may originate from the same legal scenario, their case-specific facts and evidentiary conditions can differ substantially. For example, cases involving the same offense may concern different objects, circumstances, or supporting evidence. Directly reusing such mem- ories may therefore introduce irrelevant or mismatched guidance. We use the same agent휋 Θ to adapt the retrieved experience to the current interaction context: ˆ 푚 (푖) 푡 = 휋 Θ R (푖) 푡 ,H (푖) 푡 ,푠 (푖) 푡 , ̃ 푎 (푖) 푡 = 휋 Θ H (푖) 푡 ,푠 (푖) 푡 ,푟 (푖) 푡 , ˆ 푚 (푖) 푡 , (5) where ˆ 푚 (푖) 푡 denotes the context-adapted memory incorporated into the current interaction context, and ̃ 푎 (푖) 푡 denotes the preliminary action generated before rubric-based verification. Memory Consolidation. Instead of directly storing raw interaction histories, we first distill each completed interaction into a concise and reusable memory entry that summarizes effective retrieval strategies and action guidance. The distilled entry is then encoded by 푓 BGE (·) and added to the persistent memory bank. As the memory bank grows, redundant or noisy experiences may reduce retrieval precision rather than further improve rea- soning [3]. We therefore maintain a bounded memory bank and trigger global pairwise consolidation once its size exceeds a pre- defined capacity퐶. Specifically, we select the most semantically similar pair(푝 ∗ ,푞 ∗ )= arg max 푝<푞 sim cos 푓 BGE (푚 푝 ), 푓 BGE (푚 푞 ) over the entire memory bank, rather than restricting the comparison to pairs that involve the newly added memory. The same agent 휋 Θ then merges the selected pair into a consolidated experience Chen et al. Completed Case � Key Action Feedback Next Case �+� Reliable Decisions Improved Reasoning Test-Time Memory Evolution Rubric-Aligned Collaboration Memory Bank Case 1: Contract Dispute Case 2: Property Crime Case �+� Case: Traffic Accident Issue: Liability...... Role: Lawyer Memory Retrieval 푠� � �, Contextual Memory Adaptation � � =� � �,푠,�, Memory Consolidation Distill and Store Exp Test-Time Memory Evolution Update Client Completeness Lawyer Grounding Judge Procedure � � =푅푢푏�.�ℎ푒 � � ,� Role-Specific Rubric Candidate Action Rubric Verification and Revision Final Action Guide Action Rubric-Aligned Collaboration Continual Test-Time Adaptation Figure 2: Overall framework of TALA. Under a continual test-time setting, the agent sequentially interacts with evolving legal cases and leverages deployment-time signals without updating model parameters. TALA consists of two components, Test-Time Memory Evolution and Rubric-Aligned Collaboration, which adapt prior experience to the current case and align role-specific behaviors to improve subsequent decisions. 푚 ∗ 푝,푞 = 휋 Θ (푚 푝 ∗ ,푚 푞 ∗ ), and updates the memory bank as: M ← M\푚 푝 ∗ ,푚 푞 ∗ ∪푚 ∗ 푝,푞 .(6) This consolidation removes redundant experiences while preserv- ing reusable knowledge within a fixed memory budget. If merging fails, the oldest memory is removed as a fallback. 3.3 Rubric-Aligned Collaboration We introduce Rubric-Aligned Collaboration (RAC) to coordinate mul- tiple roles under scenario-specific rubrics. Rather than optimizing each role independently [26,32], each role follows its own inter- action constraints, enabling complementary behaviors for reliable legal reasoning and task completion. For each scenario, we define a set of role-specific rubricsG= G lawyer ,G public ,G judge , . . . , where each rubric specifies behavioral and procedural requirements for the corresponding role. For the active role푟 (푖) 푡 , we denote its rubric asG 푟 (푖) 푡 =푔 1 , . . .,푔 퐽 . At turn 푡 , the candidate action ̃ 푎 (푖) 푡 is checked against the rubric: 푣 (푖) 푡 = 퐽 Ö 푗=1 푣 (푖) 푡,푗 , 푣 (푖) 푡,푗 = RubricCheck ̃ 푎 (푖) 푡 ,푔 푗 ∈ 0, 1.(7) Here,푣 (푖) 푡,푗 = 1 indicates that the candidate action satisfies rubric item푔 푗 . Thus,푣 (푖) 푡 =1 only when all rubric requirements are satis- fied; otherwise, the violated rubric items are used to provide revision guidance for the candidate action. The candidate action is directly accepted if it satisfies all rubric requirements; otherwise, the same agent revises it according to the corresponding rubric: 푎 (푖) 푡 = ̃ 푎 (푖) 푡 ,푣 (푖) 푡 = 1, 휋 Θ H (푖) 푡 ,푠 (푖) 푡 ,푟 (푖) 푡 , ˆ 푚 (푖) 푡 , ̃ 푎 (푖) 푡 ,G 푟 (푖) 푡 , 푣 (푖) 푡 = 0. (8) Here,푎 (푖) 푡 denotes the final action after rubric verification and pos- sible revision. This verification is applied to all participating roles throughout the interaction trajectory, preventing local violations from propagating across turns and thereby reducing error accumu- lation in long-horizon interactions. 4 Experiment Setup Datasets. To evaluate legal agents in long-horizon and multi-turn interaction settings, we consider two recent benchmarks, J1-EVAL [15] and LegalWorld [34], which cover diverse legal tasks ranging from interactive consultation to multi-stage litigation. J1-EVAL [15] contains six interactive legal scenarios covering different stages and roles in legal practice: Knowledge Questioning (KQ), Legal Consultation (LC), Complaint Drafting (CD), Defence Drafting (D), Civil Court (CI), and Criminal Court (CR). Beyond static legal question answering, these tasks require agents to inter- act with simulated users or legal participants over multiple turns, progressively collect case-relevant information, generate legal doc- uments, and follow scenario-specific procedures. The benchmark therefore evaluates both legal reasoning and the agent’s ability to maintain coherent behavior throughout multi-turn interactions. Test-Time Agent Evolution for Long-Horizon Legal Reasoning Table 1: Performance comparisons on J1-EVAL using Qwen3.5-4B, Qwen3-8B, and Qwen3-32B backbones. Best results are in bold and second-best results are underlined. Method Level-ILevel-IILevel-I KQ LCCDDDCICR Avg. Avg. FOR DOC FOR DOC PFS JUD REA LAW PFS CRI VER REA LAW Qwen3.5-4B44.526.24.328.21.417.327.86.39.18.716.453.636.618.825.4 • ReAct25.018.34.324.10.410.11.14.50.89.20.45.84.31.72.2 • Plan-and-Solve21.212.23.218.84.512.43.82.25.45.93.024.617.06.46.5 • Plan-and-Execute33.421.98.614.110.25.05.42.94.42.42.720.313.04.87.4 • LawThinker43.328.6 53.832.530.121.339.88.59.812.313.244.940.714.122.7 • Reflexion25.315.70.617.81.88.81.30.810.66.87.554.33.314.610.4 • TALA47.934.269.850.056.642.656.214.021.122.745.364.260.625.342.2 Qwen3-8B48.326.77.558.18.235.95.22.94.34.713.669.648.930.440.0 • ReAct59.534.424.153.818.628.71.20.62.21.66.765.248.131.034.5 • Plan-and-Solve57.034.620.038.66.58.11.82.55.85.00.866.746.125.925.6 • Plan-and-Execute57.734.6 8.622.30.73.37.35.26.75.97.356.531.919.921.2 • LawThinker57.930.389.252.2 78.933.417.08.010.38.911.360.955.925.834.4 • Reflexion57.633.732.756.416.825.91.10.51.60.57.865.239.129.630.1 • TALA57.536.598.075.558.755.440.023.529.033.680.097.167.146.765.3 Qwen3-32B54.339.16.555.32.939.521.05.88.310.39.184.164.339.340.9 • ReAct58.933.834.040.510.418.426.29.012.58.87.772.555.934.827.0 • Plan-and-Solve56.339.717.419.25.79.613.67.310.55.93.849.337.618.017.0 • Plan-and-Execute58.931.913.112.69.77.52.21.82.82.03.047.833.421.914.4 • LawThinker56.8 42.383.953.5 86.742.019.49.719.617.579.862.345.329.731.0 • Reflexion59.431.443.738.225.429.030.410.816.612.36.658.043.930.119.9 • TALA62.639.4100.070.358.753.585.023.332.731.485.498.669.545.757.5 Table 2: Performance comparisons on J1-EVAL using InternLM3-8B and GLM-4-9B backbones. Best results are in bold, second- best results are underlined, and “-” denotes failure to complete the task. Method Level-ILevel-IILevel-I KQ LCCDDDCICR Avg. Avg. FOR DOC FOR DOC PFS JUD REA LAW PFS CRI VER REA LAW InternLM3-8B39.833.049.061.61.427.35.71.52.31.48.647.836.316.113.4 • ReAct44.126.726.930.0-------2.91.00.70.4 • Plan-and-Solve41.429.716.141.8-5.83.83.18.54.72.037.725.212.39.9 • Plan-and-Execute47.633.44.51.8-0.44.53.88.73.90.05.85.21.31.5 • LawThinker42.8 37.178.560.149.133.76.02.73.92.146.226.148.56.28.1 • Reflexion17.812.51.15.6-0.3--------- • TALA50.934.9100.067.556.350.788.917.521.918.878.264.261.737.720.4 GLM-4-9B47.619.059.831.13.213.51.5-0.2-15.040.626.212.68.4 • ReAct48.316.85.419.31.86.00.1---2.211.64.43.20.8 • Plan-and-Solve19.16.70.60.50.73.30.60.40.3-0.54.34.21.70.5 • Plan-and-Execute35.612.1------------- • LawThinker53.924.663.228.26.88.272.0---3.615.99.14.63.8 • Reflexion50.922.30.68.10.44.4----0.94.32.10.70.5 • TALA55.634.095.553.857.844.680.08.712.09.572.594.251.632.822.0 LegalWorld [34] simulates a long-horizon civil litigation process through seven interconnected stages: Legal Consultation (LC), Com- plaint Drafting (CD), Defence Drafting (D), First-Instance Trial (FIT), Appeal Drafting (AD), Appeal Response (AR), and Second- Instance Trial (SIT). In contrast to independently evaluated sce- narios, the outputs and case states produced in earlier stages are carried forward to subsequent stages, forming a continuous liti- gation trajectory. This setting evaluates whether legal agents can preserve and utilize long-term case information, adapt to evolv- ing procedural states, and maintain consistent reasoning across different stages of litigation. Baselines. We compare our method with several representa- tive reasoning and agent baselines. SourceOnly directly uses the Chen et al. J1-EVALLegalWorld 30 20 10 0 Performance Drop (a) Qwen3.5-4B 21.4 14.3 12.0 18.2 11.4 3.8 Ours 44.6Ours 65.7 J1-EVALLegalWorld (b) Qwen3-8B 29.3 19.0 15.8 11.2 7.4 4.3 Ours 58.4Ours 61.3 J1-EVALLegalWorld (c) Qwen3-32B 26.8 19.5 10.3 15.5 9.6 9.0 Ours 61.0Ours 69.9 J1-EVALLegalWorld (d) InternLM3-8B 23.7 16.7 18.3 22.7 24.2 12.7 Ours 52.0Ours 63.7 J1-EVALLegalWorld (e) GLM-4-9B 25.3 17.8 20.0 18.9 12.4 17.3 Ours 48.9Ours 44.5 SourceOnlyw/o Test-Time Memory Evolutionw/o Rubric-Aligned Collaboration Figure 3: Ablation study of TALA across five backbone models on J1-EVAL and LegalWorld. Performance drops are reported after removing TME or RAC, showing that both components consistently contribute across models and benchmarks. Table 3: Performance comparisons on LegalWorld using Qwen3.5-4B, Qwen3-8B, and Qwen3-32B backbones. Best re- sults are in bold and second-best results are underlined. Method LCDDCA IS PI C FM EM PC EA LR Qwen3.5-4B46.456.853.549.733.451.842.645.9 • ReAct43.757.455.450.540.254.144.148.6 • Plan-and-Solve41.855.746.441.827.145.236.441.3 • Plan-and-Execute43.250.942.538.019.244.236.042.0 • LawThinker43.451.954.850.944.440.131.738.3 • Reflexion45.158.855.850.228.953.044.047.5 • TALA53.594.968.461.965.866.555.858.4 Qwen3-8B33.980.162.949.643.152.039.439.9 • ReAct28.982.563.852.445.552.140.542.0 • Plan-and-Solve6.051.323.019.77.731.721.925.0 • Plan-and-Execute4.649.924.819.88.229.621.725.4 • LawThinker25.788.570.155.053.937.825.630.5 • Reflexion31.283.962.551.846.953.840.942.2 • TALA39.994.170.158.064.863.449.650.2 Qwen3-32B43.271.058.353.649.559.347.752.5 • ReAct40.972.066.159.258.460.349.252.8 • Plan-and-Solve42.559.241.434.722.641.732.237.7 • Plan-and-Execute40.160.836.230.717.436.127.532.5 • LawThinker47.576.163.356.151.434.826.932.7 • Reflexion43.375.064.956.649.958.447.351.5 • TALA54.995.575.269.577.269.457.260.0 original backbone model without additional design. We consider five representative open-source LLMs from three model families: GLM-4-9B [12], InternLM3-8B [2], Qwen3-8B, Qwen3-32B, and Qwen3.5-4B [22]. These models cover different model scales and serve as the base models for evaluating the effectiveness and gen- eralizability of different agent frameworks. ReAct [30] interleaves reasoning and action generation, allowing the agent to iteratively interact with external tools and update its reasoning based on en- vironmental observations. Plan-and-Solve [24] first decomposes a complex task into a sequence of manageable subtasks and then solves them sequentially according to the generated plan. Plan- and-Execute [23] further separates high-level planning from step- wise execution, where a planner generates a global task plan and an executor carries out individual steps with available tools. Law- Thinker [29] is a legal-specific agent based on an Explore–Verify– Memorize workflow, which retrieves legal knowledge, explicitly Table 4: Performance comparisons on LegalWorld using InternLM3-8B and GLM-4-9B backbones. Best results are in bold and second-best results are underlined. Method LCDDCA IS PI C FM EM PC EA LR InternLM3-8B41.167.562.450.841.023.618.323.2 • ReAct33.678.069.956.659.622.917.021.3 • Plan-and-Solve34.958.943.235.938.522.216.220.2 • Plan-and-Execute29.350.135.330.719.726.719.723.7 • LawThinker42.367.664.553.860.022.616.520.6 • Reflexion34.772.768.456.756.023.418.321.9 • TALA51.192.374.761.269.063.748.848.9 GLM-4-9B29.449.942.117.64.724.517.718.6 • ReAct25.754.344.215.47.618.013.113.7 • Plan-and-Solve5.229.232.69.82.39.86.76.7 • Plan-and-Execute1.024.222.69.85.09.45.75.5 • LawThinker16.957.445.820.815.220.313.416.7 • Reflexion25.556.344.214.16.420.914.916.2 • TALA34.084.651.728.436.049.936.135.1 verifies intermediate evidence and reasoning, and stores validated information for reuse in subsequent interactions. For a fair compar- ison, all methods are instantiated with the same backbone models and evaluation settings, and agent-based baselines are provided with the same set of external tools. Implementation Details. Each backbone model is used to in- stantiate all agent roles. To avoid unbounded interaction loops, we follow the interaction settings of the original benchmarks [15,34]. For LLM-based metric evaluation, we use DeepSeek-Flash [28]. All experiments are conducted on NVIDIA L20 GPUs. 5 Results and Analysis 5.1 Main Results As shown in Tables 1 and 2, TALA consistently improves perfor- mance on J1-EVAL across different backbone models and task levels. The gains are particularly pronounced on document drafting and courtroom-oriented metrics. Improvements on FOR and DOC indi- cate stronger preservation of task-specific information and more reliable generation of structurally complete legal documents. Mean- while, the gains on PFS, REA, and LAW suggest better procedural compliance, legal reasoning, and use of appropriate legal provisions. Test-Time Agent Evolution for Long-Horizon Legal Reasoning SOReActPSPEREFLTOurs 0 2 4 6 8 Time / case (min, median) 0.96 2.45 7.13 4.68 2.61 7.50 4.27 (a) Consultation time (LegalWorld, 4B) KQLCCDDDCICR 0 10 20 30 40 50 Turns / case (median) 15 10 2020 50 35 (b) Turns per case (J1-EVAL, 4B) 9 644 19 13 05101520 Tool calls / case (median) 200 400 600 800 1000 Tokens / case (k, median) SO ReAct PS PE Ours (c) Tool calls (LegalWorld, 4B) 025%50%75%100% Completion rate SO ReAct PS PE REF LT Ours 46% 60% 26% 72% 48% 36% 100% (d) Completion (LegalWorld, GLM) SourceOnly (SO)ReActPlanAndSolve (PS)PlanAndExecute (PE)Reflexion (REF)LawThinker (LT)Ours Figure 4: Efficiency analysis of TALA. (a) Median execution time per case. (b) Median interaction turns across different task scenarios. (c) Tool-call and token usage per case. (d) End-to-end task completion rate. Tables 3 and 4 further show that TALA achieves consistent improvements on LegalWorld across legal consultation, document drafting, and courtroom advocacy. The improvements are especially evident in drafting and advocacy tasks, where successful comple- tion requires agents to preserve case facts across stages, adapt to changing role objectives, and reuse previously established evidence. Across Tables 1, 2, 3, and 4, the improvements are consistently observed on Qwen3.5-4B, Qwen3-8B, Qwen3-32B, InternLM3-8B, and GLM-4-9B. This indicates that TALA is not tied to a particular model family or parameter scale, but provides a generally effective test-time adaptation mechanism for improving long-horizon legal agents without updating the underlying model parameters. 5.2 Ablation Study As shown in Fig. 3, removing either component consistently de- grades the performance of TALA across all five backbone models and both benchmarks. On J1-EVAL, removing Test-Time Memory Evolution leads to an average performance drop of 17.5 points, while removing Rubric-Aligned Collaboration results in a 15.3-point drop. Similar trends are observed on LegalWorld, with average decreases of 13.0 and 9.4 points after removing TME and RAC, respectively. Av- eraged over all model–benchmark combinations, the performance drops are 15.2 points for w/o TME and 12.4 points for w/o RAC. In comparison, SourceOnly exhibits an average degradation of 21.3 points relative to the full model. These results demonstrate that both components make substantial and complementary contribu- tions: TME provides persistent task- and case-specific knowledge adaptation, whereas RAC regulates role-specific behavior and in- teraction progression; combining them yields the strongest overall performance. 5.3 Efficiency of TALA We further evaluate the interaction and computational efficiency of TALA. As shown in Fig. 4, TALA maintains reasonable test-time overhead while supporting reliable long-horizon execution. 1) Execution Time. On LegalWorld, TALA requires a median of 4.27 minutes per consultation case, remaining below several planning-intensive baselines. This suggests that the additional adap- tation steps introduce manageable computational overhead. 2) In- teraction Turns. Across J1-EVAL scenarios, TALA remains within Table 5: Audit results for the self-judgment mechanisms in TME and RAC. All values are reported on a 0–100 scale. Audit MetricTME RAC Judgment Agreement66.871.7 Judge-Verified Local Error32.639.6 Jev Coverage at Matched Error84.391.6 Potential Local LLM Calls Saved–89.5 the interaction range of existing methods. Its performance gains therefore do not simply result from extending the conversation with additional turns. 3) Tool and Token Usage. TALA main- tains moderate tool-call and token usage by selectively invoking retrieval when additional legal knowledge or prior experience is needed. This avoids repeatedly expanding intermediate reasoning or invoking tools throughout the trajectory. 4) Completion Rate. On LegalWorld with GLM-4-9B, TALA achieves a 100% completion rate, compared with 26%–72% for the evaluated baselines. This in- dicates improved robustness in sustaining long-horizon execution across multiple stages. 5.4 Case Study Analysis Fig. 5 further illustrates how the two components of TALA affect agent behavior through representative cases. In the J1-EVAL con- sultation case, the user raises multiple legal issues concerning the validity of prior civil acts, applicable provisions, liquidation, and company termination. SourceOnly provides only a partial response and terminates the conversation before the remaining issues are addressed. TME retrieves relevant legal provisions and improves the grounding of the lawyer’s response, but does not prevent pre- mature termination. In contrast, RAC explicitly tracks unresolved issues and encourages the involved roles to continue clarification and inquiry, resulting in more complete issue coverage, although the available legal grounding remains limited. Combining both mechanisms, TALA maintains the interaction until the required issues are covered while grounding the lawyer’s responses with relevant legal knowledge. Chen et al. (b) Test-Time Memory Evolution(a) SourceOnly(c) Rubric-Aligned Collaboration(d) TALA (Ours) Public: “After the company’s registration is revoked, are its prior civil acts still valid? Which laws apply? Is liquidation required? Does revocation immediately terminate the company?...” Lawyer: “The prior acts may remain valid under certain circumstances ...” Public: “End conversation.” Public: “After the company’s registration is revoked, are its prior civil acts still valid? Which laws apply? Is liquidation required? ...” Lawyer: [Adaptive Memory: retrieve relevant statutes] “According to the Company Law and the Civil Code, ...” Public: “End conversation.” Public: [Role-Specific Rubric: unresolved issues → continue inquiry] “Which provision supports this conclusion?” Lawyer: [Role-Specific Rubric: missing facts → clarify first] “Has the company entered liquidation and have creditors been notified?” Public: [Role-Specific Rubric: unresolved issues → continue inquiry] “Is liquidation required after revocation?” Lawyer: [Adaptive Memory: retrieve relevant statutes] “According to the applicable provisions of the Company Law, ...” · Legal support · Incomplete coverage· Complete issue coverage · Limited legal grounding Respondent Lawyer: “The first-instance court correctly rejected the claimed shipping loss ... The appeal should therefore be dismissed and the original judgment upheld.” Respondent Lawyer: [Adaptive Memory: retrieve prior judgment + evidence] “The RMB 80,000 payment ... the receipt issued by Zhonggang ... the notation concerning Dai Zhongliang ... Yet, the first- instance court correctly rejected our claimed shipping loss, and the original judgment should be upheld.” Plaintiff Lawyer: [Role-Specific Rubric: missing facts → clarify before drafting] “Please confirm the legal representative, claimed amount, defendant’s address, and supporting evidence ...” Client: “Shao Yawei ... RMB 157,300 ...” Client: [Role-Specific Rubric: missing evidence → supply supporting material] “We retained the bank transfer record for the RMB 80,000 payment.” Respondent Lawyer: [Adaptive Memory: retrieve prior evidence] “Fengye paid RMB 80,000 after the vessel was detained; the receipt does not establish voluntary repayment ...” · Advocacy drift · Key facts ignored· Evidence recovered · Advocacy drift remains · Advocacy aligned · Limited grounding· Aligned advocacy · Grounded evidence · Incomplete issue coverage · No legal grounding· Full coverage · Strong legal grounding Figure 5: Case studies on J1-EVAL and LegalWorld. The upper case presents a legal consultation scenario in J1-EVAL, while the lower case illustrates a multi-stage legal workflow in LegalWorld. We compare SourceOnly with Test-Time Memory Evolution, Rubric-Aligned Collaboration, and the full TALA framework to show their complementary effects on legal grounding, interaction coverage, role alignment, and cross-stage evidence use. The takeaway beneath each case summarizes the observed behavior, where underlinedterms indicate remaining limitations. The LegalWorld case demonstrates a different failure mode in a long-horizon, multi-stage legal workflow. The same dispute evolves from consultation and complaint drafting to first-instance and ap- pellate proceedings, requiring the agent to preserve case evidence while adapting to changing role objectives. SourceOnly exhibits advocacy drift: although acting as the respondent’s lawyer, it fo- cuses on defending the rejection of its own claimed shipping loss rather than protecting the favorable RMB 80,000 judgment. Test- Time Memory Evolution successfully recovers prior-stage evidence, including the payment and receipt information, but the advocacy objective can still remain misaligned. Rubric-Aligned Collaboration instead regulates stage- and role-specific behavior, such as requir- ing missing facts to be clarified before drafting, but cannot recover evidence that is unavailable in the current interaction. With both components, TALA preserves relevant evidence across stages while maintaining role-aligned advocacy. Together, the two cases highlight the complementary roles of the proposed components. Test-Time Memory Evolution primarily de- termines what information should be recovered and reused, whereas Rubric-Aligned Collaboration regulates how each role should act and how the interaction should progress. Their combination therefore addresses both knowledge continuity and behavioral alignment, which are jointly required for reliable long-horizon agent execution. 5.5 Auditing Self-Judgment with Jev We further audit the self-judgment mechanisms in TALA using Jev 1 , an independent lightweight structured judge. As shown in Table 5, we conduct the analysis on the J1-EVAL KQ scenario across all five backbone models, covering the internal judgments used by both Test-Time Memory Evolution (TME) and Rubric-Aligned Collaboration (RAC). We report four metrics: Judgment Agreement 1 https://typesafe.ai/ measures the consistency between Jev and the original local self- judgment; Judge-Verified Local Error estimates the error rate of the original judgment through independent verification; Jev Coverage at Matched Error measures the proportion of decisions that Jev can handle without exceeding the original judgment error; and Potential Local LLM Calls Saved estimates the corresponding reduction in local LLM-based judgment calls. Overall, the results support the effectiveness of our internal judgment design, while lightweight judges such as Jev provide a promising direction for further im- proving verification efficiency and reducing local LLM calls. 6 Conclusion In this paper, we investigate test-time evolution for long-horizon legal agents and identify two key challenges in realistic deploy- ment: case heterogeneity, which complicates experience transfer across continuously arriving cases, and cross-role coupling, where local decisions can influence subsequent roles and propagate across procedural stages. To address these challenges, we propose TALA, which enables agents to continually adapt throughout deployment by evolving cross-case experience and coordinating decisions across coupled legal roles and stages. Specifically, Test-Time Memory Evolu- tion retrieves, adapts, and consolidates prior interaction experience to support heterogeneous cases, while Rubric-Aligned Collaboration aligns role decisions with behavioral and procedural requirements to improve global consistency across long-horizon interactions. Ex- tensive experiments on J1-EVAL and LegalWorld across five back- bone models demonstrate consistent improvements across model families and scales, together with stronger robustness in multi-stage execution. Further ablation, efficiency, and case studies show that the two components are complementary and mutually reinforcing, jointly improving cross-case adaptation, cross-role coordination, and the overall reliability of long-horizon legal reasoning. Test-Time Agent Evolution for Long-Horizon Legal Reasoning Limitations. Our current study focuses on autonomous test- time evolution, while real-world legal decision-making is inher- ently interactive and often requires sustained collaboration between agents and human professionals. Future work may extend TALA toward human-in-the-loop and recursively interactive legal agents that continuously incorporate expert feedback, user corrections, and procedural changes during deployment. Evaluating such sys- tems in more specialized legal settings, with stronger requirements on accountability, professional expertise, and human-agent coordi- nation, remains an important direction. References [1]Hua Cai, Shuang Zhao, Liang Zhang, Xuli Shen, Qing Xu, Weilin Shen, Zihao Wen, and Tianke Ban. 2025. Unilaw-r1: A large language model for legal reasoning with reinforcement learning and iterative inference. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing. 18128–18142. [2]Zheng Cai, Maosong Cao, Haojiong Chen, Kai Chen, Keyu Chen, Xin Chen, Xun Chen, Zehui Chen, Zhi Chen, Pei Chu, et al.2024. Internlm2 technical report. arXiv preprint arXiv:2403.17297 (2024). [3] Shuqi Cao, Jingyi He, and Fei Tan. 2026. HiGMem: A Hierarchical and LLM- Guided Memory System for Long-Term Conversational Agents. In Findings of the Association for Computational Linguistics: ACL 2026. 33853–33862. [4]Guhong Chen, Liyang Fan, Zihan Gong, Nan Xie, Zixuan Li, Ziqiang Liu, Cheng- ming Li, Qiang Qu, Hamid Alinejad-Rokny, Shiwen Ni, et al.2025. Agentcourt: Simulating court with adversarial evolvable lawyer agents. In Findings of the Association for Computational Linguistics: ACL 2025. 5850–5865. [5]Haotian Chen, Yanyu Xu, Boyan Wang, Chaoyue Zhao, Xiaoyu Han, Fang Wang, Lizhen Cui, and Yonghui Xu. 2025. LexPro-1.0 technical report. arXiv preprint arXiv:2503.06949 (2025). [6]Haotian Chen, Yanyu Xu, Yonghui Xu, Boyan Wang, Fang Wang, and Lizhen Cui. 2026. Test-Time Thinking: Reinforcement Adaptation for Multimodal LLM Reasoning. Expert Systems with Applications (2026), 132524. [7] Pierre Colombo, Telmo Pessoa Pires, Malik Boudiaf, Dominic Culver, Rui Melo, Caio Corro, Andre FT Martins, Fabrizio Esposito, Vera Lúcia Raposo, Sofia Mor- gado, et al.2024. Saullm-7b: A pioneering large language model for law. arXiv preprint arXiv:2403.03883 (2024). [8]Jiaxi Cui, Munan Ning, Zongjian Li, Hao Li, Yang Ya, Bohua Chen, Bin Ling, Yonghong Tian, and Li Yuan. 2026. Chatlaw: A multi-agent legal assistant based on a role-aligned mixture-of-experts architecture. Fundamental Research (2026). [9]Joseph Enguehard, Morgane Van Ermengem, Kate Atkinson, Sujeong Cha, Ari- jit Ghosh Chowdhury, Prashanth Kallur Ramaswamy, Jeremy Roghair, Hannah R Marlowe, Carina Suzana Negreanu, Kitty Boxall, et al.2025. Lemaj (legal llm- as-a-judge): Bridging legal reasoning and llm evaluation. In Proceedings of the natural legal language processing workshop 2025. 318–337. [10] Zhiwei Fei, Xiaoyu Shen, Dawei Zhu, Fengzhe Zhou, Zhuo Han, Alan Huang, Songyang Zhang, Kai Chen, Zhixin Yin, Zongwen Shen, et al.2024. Lawbench: Benchmarking legal knowledge of large language models. In Proceedings of the 2024 conference on empirical methods in natural language processing. 7933–7962. [11]Zhiwei Fei, Songyang Zhang, Xiaoyu Shen, Dawei Zhu, Xiao Wang, Jidong Ge, and Vincent Ng. 2025. Internlm-law: An open-sourced chinese legal large lan- guage model. In Proceedings of the 31st International Conference on Computational Linguistics. 9376–9392. [12]Team Glm, Aohan Zeng, Bin Xu, Bowen Wang, Chenhui Zhang, Da Yin, Dan Zhang, Diego Rojas, Guanyu Feng, Hanlin Zhao, et al.2024. Chatglm: A fam- ily of large language models from glm-130b to glm-4 all tools. arXiv preprint arXiv:2406.12793 (2024). [13]Audrey Huang, Adam Block, Qinghua Liu, Nan Jiang, Akshay Krishnamurthy, and Dylan J Foster. 2025. Is best-of-n the best of them? coverage, scaling, and optimality in inference-time alignment. arXiv preprint arXiv:2503.21878 (2025). [14]Baihe Huang, Shanda Li, Tianhao Wu, Yiming Yang, Ameet Talwalkar, Kannan Ramchandran, Michael Jordan, and Jiantao Jiao. 2026. Sample complexity and representation ability of test-time scaling paradigms. In International Conference on Learning Representations, Vol. 2026. 54262–54298. [15] Zheng Jia, Shengbin Yue, Wei Chen, Siyuan Wang, Yidong Liu, Zejun Li, Yun Song, and Zhongyu Wei. 2026. Ready jurist one: Benchmarking language agents for legal intelligence in dynamic environments. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 10351–10376. [16]Haitao Li, Junjie Chen, Jingli Yang, Qingyao Ai, Wei Jia, Youfeng Liu, Kai Lin, Yueyue Wu, Guozhi Yuan, Yiran Hu, et al.2025. Legalagentbench: Evaluating llm agents in legal domain. In Proceedings of the 63rd annual meeting of the association for computational linguistics (volume 1: long papers). 2322–2344. [17]Shuang Liu, Ruijia Zhang, Ruoyun Ma, Yujia Deng, Lanyi Zhu, Jiayu Li, Zelong Li, Zhibin Shen, and Mengnan Du. 2026. LLM agents in law: Taxonomy, applications, and challenges. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 15768–15792. [18]Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, et al. 2023. Self-refine: Iterative refinement with self-feedback. Advances in neural information processing systems 36 (2023), 46534–46594. [19] Shishir G Patil, Huanzhi Mao, Fanjia Yan, Charlie Cheng-Jie Ji, Vishnu Suresh, Ion Stoica, and Joseph E Gonzalez. 2025. The berkeley function calling leaderboard (bfcl): From tool use to agentic evaluation of large language models. In Forty- second International Conference on Machine Learning. [20] Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. 2025. Scaling LLM test-time compute optimally can be more effective than scaling parameters for reasoning. In International Conference on Learning Representations, Vol. 2025. 10131–10165. [21]Mirac Suzgun, Mert Yuksekgonul, Federico Bianchi, Dan Jurafsky, and James Zou. 2026. Dynamic cheatsheet: Test-time learning with adaptive memory. In Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers). 7080–7106. [22]Qwen Team. 2025. Qwen3 Technical Report. arXiv:2505.09388 [cs.CL] https: //arxiv.org/abs/2505.09388 [23]Oguzhan Topsakal and Tahir Cetin Akinci. 2023. Creating large language model applications utilizing langchain: A primer on developing llm apps fast. In Interna- tional conference on applied engineering and natural sciences, Vol. 1. 1050–1056. [24]Lei Wang, Wanyu Xu, Yihuai Lan, Zhiqiang Hu, Yunshi Lan, Roy Ka-Wei Lee, and Ee-Peng Lim. 2023. Plan-and-solve prompting: Improving zero-shot chain- of-thought reasoning by large language models. In Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1: Long papers). 2609–2634. [25]Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2022. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171 (2022). [26]Yang Wu, Chenghao Wang, Ece Gumusel, and Xiaozhong Liu. 2024. Knowledge- infused legal wisdom: Navigating llm consultation through the lens of diagnostics and positive-unlabeled reinforcement learning. In Findings of the Association for Computational Linguistics: ACL 2024. 15542–15555. [27]Shitao Xiao, Zheng Liu, Peitian Zhang, and Niklas Muennighoff. 2023. C-Pack: Packaged Resources To Advance General Chinese Embedding. arXiv:2309.07597 [cs.CL] [28] Anyi Xu, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, Chenchen Ling, et al.2026. Deepseek- v4: Towards highly efficient million-token context intelligence. arXiv preprint arXiv:2606.19348 (2026). [29]Xinyu Yang, Chenlong Deng, Tongyu Wen, Binyu Xie, and Zhicheng Dou. 2026. Lawthinker: A deep research legal agent in dynamic environments. arXiv preprint arXiv:2602.12056 (2026). [30]Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. 2022. React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629 (2022). [31] Shengbin Yue, Wei Chen, Siyuan Wang, Bingxuan Li, Chenchen Shen, Shujun Liu, Yuxuan Zhou, Yao Xiao, Song Yun, Xuanjing Huang, et al.2023. Disc-lawllm: Fine-tuning large language models for intelligent legal services. arXiv preprint arXiv:2309.11325 (2023). [32]Shengbin Yue, Ting Huang, Zheng Jia, Siyuan Wang, Shujun Liu, Yun Song, Xuan-Jing Huang, and Zhongyu Wei. 2025. Multi-agent simulator drives lan- guage models for legal intensive interaction. In Findings of the Association for Computational Linguistics: NAACL 2025. 6552–6585. [33]Senbo Zhang, Qiqi Wang, Fanghao Lou, Guanyu Chen, Yihong Pan, Huijia Li, and Qian Liu. 2026. DefGen-Bench: A Benchmark for Chinese Criminal Defence Opinion Generation in LegalAI. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 35378–35392. [34]Songhan Zuo, Shengbin Yue, Tao Chiang, Guanying Li, Yun Song, Xuanjing Huang, and Zhongyu Wei. 2026. LegalWorld: A Life-Cycle Interactive Environ- ment for Legal Agents. arXiv preprint arXiv:2606.18728 (2026).