arXiv:2610.13722cs.CLOct 2026

Manuscript Offprint

arXiv:2610.13722

Enhancing Legal Reasoning in Pre-trained Language Models via Knowledge Graph-Guided Multi-Task Pre-training

Ibrahim Siddig, Munir Georges

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Legal language understanding requires reasoning over semi-structured regulatory documents, yet standard pre-training objectives do not explicitly target this structural capability. Because current legal language models rely solely on masked language modeling, they treat statutory text as flat token sequences and ignore the underlying hierarchical constraints. To bridge this gap, we present a multi-task pre-training approach for German traffic law (StVO). Our approach combines three complementary objectives: Next Sentence Prediction (NSP), Knowledge Graph (KG) Guided Clustering (CLU), and Knowledge Graph (KG) Aware Paragraph Classification (CLS). This approach explicitly encodes structured legal knowledge directly into the model weights. This encoding enables zero-shot legal reasoning at inference time and removes the need for discrete graph traversal. We evaluate our approach across nine Transformer-based encoders and 324 experimental runs. On synthetic StVO question answering, our models demonstrate consistent relative improvements between 10.3% and 155.0% over baselines. Furthermore, relative to the established LexGLUE baselines (Chalkidis et al., 2022a), our models improve over prior results on four of seven legal benchmarks. It also achieves consistent zero-shot transfer gains between 3.4% and 15.8% on Austrian driving regulations. These experimental results indicate that our training approach generalizes successfully beyond the initial training legal domain.

1 Introduction

Legal Natural Language Processing (NLP) models are considered a base component for Reliable Artificial Intelligence (rAI) within semi-structured resources such as statutory books and contractual texts (Yao et al., 2024). A persistent challenge involves the trade-off between predictive accuracy and interpretability; as SOTA Pre-trained Language Models (PLMs) achieve high performance, they remain largely unexplainable; conversely, rule-based methods offer transparency but suffer from flexibility (Zhong et al., 2020). Despite recent proposals targeting this balance (An and Zhang, 2024; Wang et al., 2024), the gap between empirical performance and verifiable legal reasoning persists as a critical bottleneck (Zhong et al., 2020).

Existing legal domain-adaptive pre-training approaches—including Lawformer (Xiao et al., 2021), SAILER (Li et al., 2023), and LegalBERT (Chalkidis et al., 2020)—rely on implicit structural modeling through long-range attention, structural headers, or domain-specific MLM, respectively. None explicitly incorporates the formal semantic relationships and hierarchical constraints of the semi-structured legal texts during pre-training. To resolve this limitation, we introduce a training approach that explicitly injects knowledge graphs into the embedding space of PLMs.

In this work, we propose a multi-task domain-adaptive pre-training approach validated in the German Road Traffic Regulations (StVO) as representative for the semi-structured legal texts, encoding legal structure via three complementary objectives: Next Sentence Prediction (NSP) for document coherence, Knowledge Graph-guided Clustering (CLU) for relational structure, and KG-aware paragraph Classification (CLS) for task-aligned reasoning.

Our main contributions in this work are:

• We introduce a unified multi-task pre-training approach for semi-structured regulatory text that explicitly integrates KG structures into latent representations, unlike existing text-concatenation approaches.

• We employ TransE-derived legal paragraph embeddings as soft pre-training targets, enabling the transfer of relational legal knowledge without hard classification constraints and allowing the model to learn a continuous range of legal concepts.

  • A differentiable gated KG-aware attention training mechanism that performs real-time latent-space retrieval from a KG paragraph embeddings library, dynamically weighting external legal context against internal model representations. Unlike traditional retrieval-augmented approaches, which require discrete external database lookups during inference.

  • A synthetic German traffic law QA dataset (N=12,554N = 12,554) with paragraph-level citation grounding and strict paragraph-level splits to prevent data leakage, providing a new benchmark for citation-accurate legal reasoning.