K o LEG : On-the-Fly K orean Legal Knowledge Editing with Continuous Retrieval (2025)

Abstract: Korean legal knowledge is subject to frequent temporal updates driven by societal needs and government policies. Even minor modifications to legal provisions can have significant consequences, yet continuously retraining large language models (LLMs) to incorporate such updates is resource-intensive and impractical. To address this, we propose KoLEG, an on-the-fly Korean Legal knowledge editing framework enhanced with continuous retrieval. KoLEG employs an Editing-Aware Learning Strategy and a LawEdit Retriever, which together adaptively integrate subtle linguistic nuances and continuous legislative amendments. To support this task, we construct the Korean Legislative Amendment Dataset, explicitly designed for continuous legal knowledge updates with attention to both temporal dynamics and linguistic subtleties. KoLEG outperforms existing locate-then-edit and retrieval-based editing methods, demonstrating superior effectiveness in legal knowledge editing while preserving linguistic capabilities. Furthermore, KoLEG maintains robust performance in sequential editing, improves performance on precedent application tasks, and is qualitatively validated by legal experts.

## introduction korean legal knowledge undergoes frequent temporal updates in response to societal demands and government policies, with statutes being enacted, amended, or repealed an average of 12.2 times each @xcite . for example, between 2020 and 2022 alone, over 14,000 legislative amendments were proposed, and some statutes have been revised more than 100 times 1 . such frequent revisions present significant challenges for large language models (llms), which struggle † corresponding author 1 https://klri.re.kr/lawdata/html/index.html?@xmath0. continuously retraining llms to maintain upto-date legal knowledge is both cost-prohibitive and impractical, especially given the frequency and scale of legislative changes. as legal knowledge evolves gradually and cumulatively, ongoing retraining is not a sustainable solution. to overcome these limitations, knowledge editing has been proposed as an efficient way to selectively update or correct specific knowledge in pre-trained models without full retraining @xcite . traditional knowledge editing methods, such as rome @xcite and memit @xcite , are not well suited for continuous updates, as their performance tends to degrade after repeated edits. more recent approaches that combine continuous learning or retrieval augmentation, including lte @xcite and recipe @xcite , have improved flexibility but still struggle to capture the fine-grained and subtle distinctions characteristic of legal revisions. these challenges highlight the need for a more robust and adaptive framework for legal knowledge editing. to address these challenges, we propose ko-leg, a knowledge editing framework explicitly designed for the legal domain that enables onthe-fly updates to korean legal knowledge. ko-leg integrates two core components: an editing-aware learning strategy and a lawedit retriever. the editing-aware learning strategy allows the model to autonomously determine when and how to perform knowledge editing, ensuring contextual adaptability and minimizing unintended performance degradation. lawedit retriever leverages contrastive learning to accurately retrieve relevant legal knowledge, effectively capturing subtle updates and temporal attributes. by working together, these components enable koleg to reference and incorporate the latest legislative amend-ments as needed, preserving both legal accuracy and linguistic fluency. to further support continuous legal knowledge updates, we construct the korean legislative amendments dataset, covering 65 korean legal categories directly collected from the ministry of government legislation 2 and lbox open @xcite . this dataset is the first to comprehensively account for real, inherently unstructured korean legislative amendment histories, including multi-stage cumulative revisions and mappings to legal precedents based on specific timestamps. the key contributions of this paper are: knowledge editing knowledge editing offers an efficient way to update llms without full retraining @xcite . rome @xcite locates and updates specific parametric knowledge using causal tracing and rank-one updates, while r-rome @xcite ) improves rome's stability for sequential editing. memit @xcite enables simultaneous, large-scale knowledge edits by modifying multiple key-value pairs across layers. grace @xcite introduces a codebook network for continual model adaptation, and alphaedit @xcite uses null-space constraints to better preserve unrelated knowledge during editing. recent retrieval-augmented methods such as lte @xcite and recipe @xcite support continuous updates, but struggle to capture the nuanced and cumulative nature of legal amendments. koleg addresses this by using a custom retriever and learning strategy specialized for legal edits, achieving state-of-theart performance in the korean legal domain. ## preliminary knowledge editing aims to update the knowledge stored in llms f through query-answer edit pairs {(q i , a * i )} @xmath1. given an edit pair (q i , a * i ), the post-edit model f * is expected to map the input query q i to the target answer a * i , such that in this study, we design the input queries q as questions and prompts that require the llm to memorize and update legal knowledge @xcite . these queries focus on titles of laws, specific articles, and how provisions have been amended in the context of legal question answer-ing and completion. for instance, an input query q i includes "what is the content of article 29 of the criminal act?" or "article 29 of the criminal act states". the target answer a * i corresponds to the legal knowledge intended for updating, serving as the accurate response to the given query q i . to evaluate the effectiveness of legal knowledge editing, we consider the following four dimensions: ## korean legislative amendments since no existing dataset incorporates korean legislative amendment histories for knowledge editing, we construct a new dataset that allows for tracking legal revisions and applying knowledge editing methods. we collect legislative histories based on implementation periods using the open api foot_0 pro-vided by the national law open data under the ministry of government legislation of south korea. the collected legal history is structured into three subsets: knowledge book, test, and editing-aware learning dataset. to construct the test and editing-aware learning dataset, we utilize gpt-4 omni @xcite . for further details on the construction process, refer to appendix a and c. ## koleg we propose koleg, a framework for on-the-fly updates of korean legal knowledge that leverages continuous retrieval. koleg enables fine-grained knowledge editing by incorporating retrieval augmentations that account for implementation periods and subtle legal revisions. by integrating retrieved knowledge with the model's internal representations, koleg remains robust to continuous legislative amendments. as illustrated in figure 1 , koleg consists of an editing-aware learning strategy ( §5.1), a lawedit retriever ( §5.2), and an on-the-fly editing ( §5.3). ## experimental setup we design experiments to demonstrate koleg's effectiveness in legal knowledge editing. experimental details are provided in appendix a. ## conclusion in this study, we present koleg, an on-the-fly korean legal knowledge editing framework with continuous retrieval. koleg combines an editing-aware learning strategy and a custom lawedit retriever to enable precise, real-time updates of legal knowledge, even in the presence of frequent and subtle legislative amendments. by leveraging retrieval mechanisms that account for implementation periods and fine-grained legal revisions, koleg achieves state-of-the-art performance in the korean legal domain while preserving linguistic capabilities. extensive experiments demonstrate koleg's robustness, efficiency, and adaptability across a range of tasks. in future work, we aim to extend koleg to multilingual and crossjurisdictional legal knowledge editing.