A maritime legal reasoning system

By constructing a high-quality maritime law dataset and using LoRA technology to fine-tune a large language model, high-quality answers and reasoning paths are generated, solving the problem of maritime case adjudication relying on manual operation, realizing the efficiency and accuracy of the maritime law reasoning system, and improving arbitration efficiency.

CN122491469APending Publication Date: 2026-07-31SHANGHAI MARITIME UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI MARITIME UNIVERSITY
Filing Date
2026-03-30
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The handling process of maritime cases relies heavily on manual operation, which consumes a lot of human and material resources. Therefore, it is urgent for technical personnel to develop an agency system that can achieve efficient information retrieval and accurately assist arbitration decision-making.

Method used

We construct a high-quality maritime law dataset, employ a large language model, and use LoRA technology for efficient fine-tuning to generate high-quality answers and thought chain reasoning paths. We then combine customized system prompts and decision ternary structures to optimize the output answers.

Benefits of technology

The system improves the efficiency and accuracy of maritime arbitration, effectively supports maritime legal reasoning tasks, and has high practical value and potential for widespread adoption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491469A_ABST
    Figure CN122491469A_ABST
Patent Text Reader

Abstract

This invention proposes a maritime legal reasoning system. The system uses a large language model as the baseline model and employs LoRA technology to efficiently fine-tune the baseline model. By constructing a high-quality maritime legal dataset, the system guides the large language model to output high-quality answers and reasoning paths. Based on multi-source data collection and high-quality dataset construction, this invention ensures the professionalism and diversity of maritime legal data and improves the reliability of model training. Furthermore, it fills the gap in existing technologies for AI-assisted maritime arbitration and representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a maritime legal reasoning system. Background Technology

[0002] Since the Age of Exploration, maritime arbitration has always been a strategic high ground in the competition for international shipping rules. With 85% of global trade relying on maritime transport, disputes have expanded from traditional areas like collisions and charter party breaches to emerging fields such as shipping finance and carbon trading. The number and complexity of cases have seen explosive growth. Typically, the handling of maritime cases involves multiple complex stages, including acceptance, service of process and defense, exchange of evidence, hearings, mediation or award, and the effective date and enforcement of judgments. These stages collectively ensure the fairness and efficiency of maritime dispute resolution, as illustrated in the structured process diagram. Each stage relies heavily on manual operation, consuming significant human and material resources. Against this backdrop, achieving efficient information retrieval and developing an agency system that accurately supports arbitration decision-making has become a pressing issue for those skilled in the art. Summary of the Invention

[0003] The purpose of this invention is to propose a maritime legal reasoning system that possesses domain expertise and enables precise reasoning, thereby helping to improve the efficiency of maritime case arbitration.

[0004] To achieve the above objectives, this invention proposes a maritime legal reasoning system, which uses a large language model as the baseline model and employs LoRA technology to efficiently fine-tune the baseline model. By constructing a high-quality maritime law dataset, the large language model is guided to output high-quality answers and reasoning paths, including the following steps: S1: Collect maritime legal data samples from different sources; S2: Use the large language model tool to divide the original dataset file into chunks; S3: Combine the processed text block with customized system prompts, input it into the large language model, and automatically generate questions; S4: Based on the generated questions, use specific prompt words to guide the large language model to output high-quality answers; S5: Perform deduplication, language polishing, and format standardization on all generated question-and-answer pairs.

[0005] Furthermore, in S2, the text block length is set to a minimum of 1400 characters and a maximum of 2400 characters; after the blocks are divided, the text blocks are manually proofread to ensure that the language is complete and the semantics are clear.

[0006] Furthermore, in S3, the system prompts are set to generate a question every 50 characters to control the question density and ensure relevance to the text content.

[0007] Furthermore, in S5, the output answer is optimized by introducing a "decision ternary structure" to ensure that the conclusion is based on legal provisions, relevant facts, and logic.

[0008] Furthermore, the following techniques are used to efficiently fine-tune the baseline model using LoRA technology: LoRA achieves efficient parameter fine-tuning through a low-rank decomposition strategy. Its core assumption is that the incremental update ΔW of the pre-trained model weight matrix W∈Rd×k during the downstream task adaptation process has low-rank properties; The update amount is decomposed into the product of two trainable low-rank matrices ΔW=BA, where B∈Rd×r, A∈Rr×k, r≪min(d,k), and the original weights W are frozen during training to optimize only {A,B}. The forward propagation is corrected to h = Wx + BAx, and the computational overhead is eliminated during the inference phase by merging weights W′ = W + BA.

[0009] Furthermore, large language models include Qwen2.5-7B, DeepSeek-R1-Distill-Qwen-7B, or LawLLM-7B.

[0010] Furthermore, it also includes the evaluation of the fine-tuned large language model; The general competence assessment compared four core indicators: BLEU-4, ROUGE-1, ROUGE-2, and ROUGE-L. A rigorous objective evaluation dataset was specifically designed and constructed to test the model's ability to analyze complex legal scenarios and filter out irrelevant information. We adopted a question-and-answer research paradigm to simulate the professional review process. Referring to the construction method of objective evaluation datasets, we developed a corresponding subjective evaluation dataset and introduced a general large language model as an evaluation tool to more accurately evaluate the quality of the system's subjective responses.

[0011] Compared with the prior art, the advantages of the present invention are: 1. This invention ensures the professionalism and diversity of maritime legal data and improves the reliability of model training by collecting data from multiple sources and constructing high-quality datasets.

[0012] 2. The designed maritime legal assessment framework takes into account both general and professional capabilities. The system can effectively support maritime legal reasoning tasks, such as case analysis and regulatory inquiries, and has high practical value and potential for promotion. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of the construction-processing-evaluation process of the maritime legal reasoning system in this embodiment of the invention; Figure 2 This is a schematic diagram illustrating the construction of a high-quality maritime dataset in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating efficient fine-tuning of a LoRA-based model in one embodiment; Figure 4 This is a schematic diagram of a maritime legal assessment framework in one embodiment; Figure 5 This is a schematic diagram illustrating the evaluation results of a maritime legal reasoning system in one embodiment. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be further described below.

[0015] This invention proposes a maritime law reasoning system. The system uses a general large language model as the benchmark model and employs LoRA technology to efficiently fine-tune the benchmark model. By constructing a high-quality maritime law dataset, the system guides the large language model to output high-quality answers and thought chain reasoning paths.

[0016] like Figure 1 As shown, the specific construction, processing, and evaluation of the maritime legal reasoning system include the following steps: A1: Collect maritime legal data samples from different sources manually; construct a high-quality maritime legal dataset based on the collected data samples using a large language model and manual annotation.

[0017] Understandably, the maritime law natural language processing task dataset provided by the Maritime Law Research Center of Shanghai Maritime University was obtained. This dataset includes multiple task types such as legal information extraction, legal question answering, legal reading comprehension, similar case matching, and judgment prediction, totaling more than 6,000 entries. Maritime legal text data was collected, including the full text of laws and regulations such as the "Maritime Law of the People's Republic of China," the "Special Procedure Law for Maritime Litigation of the People's Republic of China," and the "Maritime Traffic Safety Law of the People's Republic of China," as well as typical maritime cases involving enterprises in free trade zones published by the China Maritime Arbitration Commission. Data related to the field of maritime law was also screened from the latest open-source datasets and manually collected.

[0018] Meanwhile, based on the aforementioned collected raw data samples, a high-quality fine-tuning dataset of maritime legal instructions was constructed using a general large language model combined with manual annotation, such as... Figure 2 As shown, the specific steps include: A11: The original dataset file was segmented using a general-purpose large language model tool. To ensure the semantic integrity of the text segments and to fit the model context window, the text segment length was set to a minimum of 1400 characters and a maximum of 2400 characters. After segmentation, the text segments were manually proofread to ensure linguistic integrity and semantic clarity.

[0019] A12: Combine the processed text block with customized system prompts and input it into a general large language model to automatically generate questions. The system prompts are set to generate one question every 50 characters to control the question density and ensure its relevance to the text content.

[0020] A13: Based on the generated questions, use specific prompts to guide the general-purpose large language model to output high-quality answers. Simultaneously, the model is required to generate corresponding thought chain reasoning paths to improve the robustness of the answers and the accuracy of the facts.

[0021] A14: All generated question-and-answer pairs are deduplicated, language-polished, and formatted. The output answers are optimized by introducing a "decision ternary structure" to ensure conclusions are based on legal provisions, relevant facts, and logic. This process constructs a maritime law dataset containing 23,960 high-quality entries, covering more than ten task types, including maritime document summarization, legal Q&A, and judicial examinations. In this embodiment, the "decision ternary structure" defines the core elements of systematic decision-making: guiding principles, objective basis, and final ruling. This represents a rational deductive path from basis to result. Each decision problem can be analyzed using this ternary structure, which consists of the following: Guiding principles: criteria, standards, constraints; Objective basis: data, evidence, conditions; Final ruling: judgment, solution, output.

[0022] Step A2: Select three general-purpose large language models as the baseline models for fine-tuning.

[0023] It is understandable that three general-purpose large language models were chosen as the baseline models for fine-tuning: Qwen2.5-7B, DeepSeek-R1-Distill-Qwen-7B, and LawLLM-7B.

[0024] Step A3 involves using LoRA technology to efficiently fine-tune the three benchmark models, such as... Figure 3 As shown.

[0025] It is understandable that the incremental update ΔW of the pre-trained model weight matrix W∈Rd×k during the downstream task adaptation process has low-rank characteristics. The update is decomposed into the product of two trainable low-rank matrices ΔW=BA, where B∈Rd×r, A∈Rr×k, and rank r≪min(d,k). During training, the original weights W are frozen, and only the low-rank matrices {A,B} are optimized. The forward propagation is corrected to h=Wx+BAx, and during the inference phase, the additional computational overhead is eliminated by weight merging W′=W+BA.

[0026] Simultaneously, LlamaFactory was used as the fine-tuning framework, with a training batch size of 16, a learning rate of 5×10⁻⁵ to 5×10⁻⁵, and a maximum word length of 4,096. Training was performed on a single GPU with 32GB of memory using Bfloat16 floating-point precision. This method reduces the number of fine-tuning parameters to 0.1%–1% of the total fine-tuning, significantly reducing GPU memory requirements, maintaining zero inference latency, and effectively avoiding catastrophic forgetting of pre-trained knowledge.

[0027] Step A4, as follows Figure 4 As shown, a comprehensive maritime legal assessment framework was constructed based on the characteristics of the maritime legal reasoning system.

[0028] Understandably, to verify the performance of the fine-tuned maritime legal reasoning system, a comprehensive evaluation framework was constructed, and the system was evaluated from two aspects: general capabilities and professional capabilities. Specifically, this included: Quantitative analysis was used to calculate four core indicators—BLEU-4, ROUGE-1, ROUGE-2, and ROUGE-L—on a standardized benchmark to evaluate the model’s performance in commonsense reasoning, logical operations, and interdisciplinary knowledge domains, and to diagnose its domain adaptability. A rigorous objective assessment dataset was specifically designed and constructed, with its core consisting of 165 maritime law exam questions (100 single-choice and 65 multiple-choice). The questions were sourced from the Maritime Law Research Center of Shanghai Maritime University and integrated with the latest maritime legal materials, cases, and regulations from 2022 to 2024. The overall accuracy of the model across all questions was calculated to quantitatively assess the candidate's mastery of professional knowledge and ability to analyze complex legal scenarios. We adopted a question-and-answer research paradigm and constructed an evaluation dataset containing 20 subjective questions. We introduced a generalized large language model as the judging model. Based on the preset scoring criteria, we scored the model's answers on three dimensions (accuracy (ACC), completeness (CPL), and relevance (RLV) (each item is scored from 1 to 5 points). Finally, we took the average score as a measure of the system's subjective professional competence.

[0029] Step A5 involves a comprehensive evaluation of the three fine-tuned models, analyzing them from both general and professional perspectives. The final score for each model's overall performance provides a basis for model selection and application. Figure 5 As shown.

[0030] It is understandable that the above evaluation is performed on the three finely tuned models and their corresponding baseline models: General capability assessment results show that the fine-tuned model significantly outperforms the untuned model in all text generation quality metrics (BLEU-4, ROUGE-1 / 2 / L), and inference time and processing speed are greatly improved, with some metrics showing an improvement rate of over 200%. The fine-tuned model achieved a higher overall accuracy rate on objective questions than its baseline model. The maritime law reasoning system based on LawLLM-7B achieved an accuracy rate of 74% on single-choice questions and 54% on more challenging multiple-choice questions, with an overall accuracy rate of 64%. The scoring of the judge models shows that the average score of the models improved by 11%-21% after fine-tuning. Among them, the maritime law reasoning system based on LawLLM-7B fine-tuning performed the best, with an average score of 3.47 (out of 5), especially achieving a high score of 4.4 in relevance (RLV).

[0031] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0032] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.

Claims

1. A maritime legal reasoning system, characterized in that, By constructing a high-quality maritime law dataset, the large language model is guided to output high-quality answers and reasoning paths, including the following steps: S1: Collect maritime legal data samples from different sources; S2: Use the large language model tool to divide the original dataset file into chunks; S3: Combine the processed text block with customized system prompts, input it into the large language model, and automatically generate questions; S4: Based on the generated questions, use specific prompt words to guide the large language model to output high-quality answers; S5: Perform deduplication, language polishing, and format standardization on all generated question-and-answer pairs.

2. The maritime legal reasoning system according to claim 1, characterized in that, In S1, maritime legal data samples are collected from different sources, specifically including: This dataset, compiled by the Maritime Law Research Center of Shanghai Maritime University, covers Natural Language Processing (NLP) tasks in the field of maritime law. It includes manually annotated data for generating high-quality instructions, encompassing tasks such as legal information extraction, legal question answering, legal reading comprehension, similar case matching, and judgment prediction, totaling over 6000 entries. Legal text data. This includes the full text of laws and regulations such as the "Maritime Law of the People's Republic of China," the "Special Procedure Law for Maritime Litigation of the People's Republic of China," and the "Maritime Traffic Safety Law of the People's Republic of China," as well as typical maritime cases involving enterprises in free trade zones published by the China Maritime Arbitration Commission; Open-source datasets. Samples were selected from the latest open datasets and manually filtered according to requirements to obtain maritime-related data.

3. The maritime legal reasoning system according to claim 1, characterized in that, In step S2, the length of the text block is set to a minimum of 1400 characters and a maximum of 2400 characters. After the blocks are divided, the text blocks are manually proofread to ensure that the language is complete and the semantics are clear.

4. The maritime legal reasoning system according to claim 1, characterized in that, In step S3, the system prompt is set to generate a question every 50 characters to control the question density and ensure relevance to the text content.

5. The maritime legal reasoning system according to claim 1, characterized in that, In S4, based on the generated question, specific prompt words are used to guide the large language model to output a high-quality answer, specifically including: For the legal questions generated, please extract or summarize accurate and concise answers from the original text. Answers should include a brief theoretical reasoning process, directly address the question, and, where possible, cite relevant legal provisions or interpretations to ensure authoritativeness.

6. The maritime legal reasoning system according to claim 1, characterized in that, In S5, a "decision-making ternary structure" is introduced, which defines the core elements of systematic decision-making: guiding principles, objective evidence, and final ruling. This represents a rational deductive path from evidence to result. Every decision problem can be analyzed through this ternary structure, which consists of the following: guiding principles: criteria, standards, constraints; objective evidence: data, evidence, conditions; final ruling: judgment, solution, output. The "decision-making ternary structure" optimizes the output answer, ensuring that the conclusion is based on legal provisions, relevant facts, and logic.

7. The maritime legal reasoning system according to claim 1, characterized in that, The large language model includes Qwen2.5-7B, DeepSeek-R1-Distill-Qwen-7B, or LawLLM-7B.