Papers
Topics
Authors
Recent
Search
2000 character limit reached

LegalMidm: Use-Case-Driven Legal Domain Specialization for Korean Large Language Model

Published 28 Apr 2026 in cs.CL and cs.AI | (2604.25297v1)

Abstract: In recent years, the rapid proliferation of open-source LLMs has spurred efforts to turn general-purpose models into domain specialists. However, many domain-specialized LLMs are developed using datasets and training protocols that are not aligned with the nuanced requirements of real-world applications. In the legal domain, where precision and reliability are essential, this lack of consideration limits practical utility. In this study, we propose a systematic training framework grounded in the practical needs of the legal domain, with a focus on Korean law. We introduce LegalMidm, a Korean legal-domain LLM, and present a methodology for constructing high-quality, use-case-driven legal datasets and optimized training pipelines. Our approach emphasizes collaboration with legal professionals and rigorous data curation to ensure relevance and factual accuracy, and demonstrates effectiveness in key legal tasks.

Summary

  • The paper's main contribution is developing a use-case-driven specialization pipeline that fuses legal and general-domain data to prevent catastrophic forgetting.
  • It employs systematic legal workflow analysis and integrates human-curated and synthetic data to enhance tasks like document drafting and QA.
  • Empirical results demonstrate significant improvements over larger models, validating the pipeline's effectiveness in both legal and general benchmarks.

Motivation and Framing

The proliferation of open-source LLMs has accelerated interest in their application to vertical domains. The legal field, especially for non-English languages such as Korean, remains underexplored with existing domain adaptation approaches often misaligned with the operational constraints and nuanced requirements of legal AI workflows. This work presents LegalMidm, a Korean legal-domain LLM developed via a use-case-driven end-to-end specialization pipeline. The approach emphasizes demand-driven task selection, deep collaboration with practitioners during data curation, and methodical ablation of domain adaptation strategies, with a focus on practical performance and generalizability across both legal and generic domains.

Domain Requirement Analysis and Task Design

A critical first step involves systematic analysis of Korean and U.S. legal tech products to identify high-value tasks. The authors prioritize document-centric operations such as drafting complaints and petitions (DD), document-based QA (DQA), document summarization (DS), and conventional open QA and MCQ tasks, reflecting consensus among practicing attorneys regarding immediate AI utility in legal services. Anecdotal tasks with vague or low practical importance are explicitly excluded, underscoring a shift from generic data scraping toward actual service-delivery optimization.

Subsequent dataset construction leverages contributions from law graduates, legal practitioners, and attorneys to ensure annotation quality, factual accuracy, and robust task coverage. The dataset creation pipeline is cost-sensitive, integrating selective automation (statute-grounded synthetic data via GPT-4o) but imposing explicit factual verification of legal reference integrity during automatic QA pair generation.

Training Pipeline Design

Continual Pre-Training and Instruction Tuning

LegalMidm's adaptation leverages the proprietary Mi:dm-2.0-Base (11.5B) as a starting point. The pipeline consists of sequential continual pre-training (CPT) and instruction tuning (IT), where both phases are subjected to rigorous ablation regarding the integration of domain-specific and general-domain data.

A key finding is that inclusion of general-domain data during both CPT and IT stages—rather than pure legal-focused training—consistently improves legal task performance and prevents catastrophic forgetting of general capabilities. This empirically undermines a commonly held assumption that domain-only specialization maximizes legal accuracy. The domain composition's impact is visualized in (Figure 1). Figure 1

Figure 1: Performance variation with respect to the domain composition of training data. PLM represents the proprietary Mi:dm-2.0-Base model, and SFT represents the K-intelligence/Midm-2.0-Base-Instruct model.

Automated data generation from statutory sources enables scaling, but the optimal integration of legal references is nontrivial. Three data formats are systematically compared: absence of references, references as part of the input, and references as output. Incorporating legal references in either input or output yields improved performance on document-based tasks, but output-based reference generation sharply degrades MCQ performance. The final pipeline thus integrates references as part of the input context—a compromise balancing document-intensive and open-domain legal tasks.

System Prompt Strategies

The reflection of identity/persona in LLM outputs is handled via system prompts. Experiments reveal that system prompts increase the model's ability to describe its "Mi:dm" identity when applied during inference, but inclusion during training is unnecessary and can degrade core task performance. The optimal setting applies legal advisor persona prompts only during inference.

Empirical Results

On six human-curated Korean legal benchmarks spanning summarization, petition/complaint drafting, open QA, DQA, and MCQ, LegalMidm demonstrates superior performance compared to SOTA open-base Korean LLMs of substantially larger parameter count (e.g., Qwen2.5-32B, Llama3.3-70B, Gemma-2-27B), with improvements up to ~16 ROUGE-L points over the closest competitor in document drafting and summary tasks.

Simultaneously, LegalMidm maintains competitive performance on general domain benchmarks KMMLU and HAERAE, validating the continual inclusion of general domain data as an anti-forgetting and robustness mechanism. All performance metrics reflect averaged, repeated experiments, and legal task generations are further evaluated by GPT-4o LLM-judges to validate qualitative gains.

The analysis provides fine-grained insight into the trade-off space regarding data composition and domain mix, synthetic data formatting, and persona reflection. The results robustly support the claim that use-case-driven, ablation-validated pipelines outperform naïve specialty fine-tuning approaches both in-domain and cross-domain.

Theoretical and Practical Implications

The study formalizes domain adaptation for LLMs as a use-case-driven process with practical feedback loops anchored in real-world tasks and practitioner judgment. The systematic pipeline unifies human curation, statistical analysis of real user logs (to preserve generalist capabilities), careful synthetic augmentation, and ablations of each major training design choice—yielding a replicable recipe for other low-resource or vertical legal domains.

Practically, this methodology enables deployable, robust Korean legal LLMs for high-stakes workflows, supporting document generation, legal QA, and knowledge verification at a standard competitive with much larger generalist models. The prevention of catastrophic forgetting and preservation of utility for common user queries is directly operationalized.

Theoretically, the findings challenge untested assumptions regarding the sufficiency of domain-pure adaptation and demonstrate the nuanced interplay between data variety, synthetic knowledge injection, and prompt-based instruction. Future AI developments can build upon these multi-stage procedural insights to instantiate specialized LLMs for other regulated or high-precision domains.

Conclusion

LegalMidm embodies a rigorously validated, collaborative framework for vertical-domain LLM specialization, specifically tailored for Korean legal services. The work demonstrates that integrating general- and domain-specific data during both CPT and IT is critical for robust task performance and resistance to catastrophic forgetting. Synthetic legal data should integrate references in the input, not output, to prevent instability on heterogeneous legal tasks. System prompts are best utilized at inference to provide persona reflection without compromising performance. The pipeline is directly extensible to other languages and verticals requiring practical, high-fidelity domain adaptation for LLMs (2604.25297).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.