Legal Aligner: Transforming Generic LLMs into Domain Experts for Enhanced Accuracy

preprint OA: closed
Full text JSON View at publisher

Abstract

Abstract Large Language Models (LLMs) demonstrate strong general-purpose capabilities but often underperform in specialized domains such as law, where jurisdiction-specific and long-tail knowledge is critical. Existing domain adaptation methods, particularly supervised fine-tuning, are computationally expensive, vulnerable to catastrophic forgetting, and infeasible for proprietary black-box models. We propose \textbf{Legal Aligner}, a lightweight, parameter-agnostic post-hoc refinement framework that enhances legal factuality without modifying upstream model weights. Acting as a plug-and-play correction layer, Legal Aligner identifies and rectifies unsupported doctrinal claims, jurisdictional inconsistencies, and citation errors in generated legal responses. We evaluate Legal Aligner on a curated Hong Kong legal consultation dataset across eight upstream LLMs, including both open-source and proprietary models. Results show consistent improvements in factual reliability, with gains of up to 14.9 percentage points in Factuality Coverage Score and a 58.9 Our findings demonstrate that output-level alignment offers a scalable and maintainable alternative to parameter-level adaptation for high-stakes legal AI systems, particularly in jurisdictions underrepresented in large-scale pretraining corpora.
Full text 10,480 characters · extracted from preprint-html · click to expand
Legal Aligner: Transforming Generic LLMs into Domain Experts for Enhanced Accuracy | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Legal Aligner: Transforming Generic LLMs into Domain Experts for Enhanced Accuracy Pengcheng Wen, Guoying LU, Sirui Han, Yike GUO This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8868100/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Large Language Models (LLMs) demonstrate strong general-purpose capabilities but often underperform in specialized domains such as law, where jurisdiction-specific and long-tail knowledge is critical. Existing domain adaptation methods, particularly supervised fine-tuning, are computationally expensive, vulnerable to catastrophic forgetting, and infeasible for proprietary black-box models. We propose \textbf{Legal Aligner}, a lightweight, parameter-agnostic post-hoc refinement framework that enhances legal factuality without modifying upstream model weights. Acting as a plug-and-play correction layer, Legal Aligner identifies and rectifies unsupported doctrinal claims, jurisdictional inconsistencies, and citation errors in generated legal responses. We evaluate Legal Aligner on a curated Hong Kong legal consultation dataset across eight upstream LLMs, including both open-source and proprietary models. Results show consistent improvements in factual reliability, with gains of up to 14.9 percentage points in Factuality Coverage Score and a 58.9 Our findings demonstrate that output-level alignment offers a scalable and maintainable alternative to parameter-level adaptation for high-stakes legal AI systems, particularly in jurisdictions underrepresented in large-scale pretraining corpora. Legal Aligner Domain Adaptation Legal AI Factual Accuracy Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8868100","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":592400733,"identity":"1c90b3ba-fa6b-47a1-8027-f939ba81cd27","order_by":0,"name":"Pengcheng Wen","email":"","orcid":"","institution":"The Hong Kong University of Science and Technology","correspondingAuthor":false,"prefix":"","firstName":"Pengcheng","middleName":"","lastName":"Wen","suffix":""},{"id":592400734,"identity":"85487c86-959f-4550-87fc-bf2507116fba","order_by":1,"name":"Guoying LU","email":"","orcid":"","institution":"The Hong Kong University of Science and Technology","correspondingAuthor":false,"prefix":"","firstName":"Guoying","middleName":"","lastName":"LU","suffix":""},{"id":592400735,"identity":"67e8063c-d49c-46cf-b392-fa7fed5baa6e","order_by":2,"name":"Sirui Han","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAuElEQVRIiWNgGAWjYDACZiBObGBg4AdxGBsSSNAi2QDUQJwWiOEMDAYHiNUi3877TOLhDrs84xvpzx8w7kgjrMXgMLuZROKZ5GKzGzmGDYxncojQwszGJpHYxpy47UYO0GFtFUQ4rBmspT5x84z0h8RpYTgM1nI4cYNEAtBhbcQ47DAbs0Vi2/HEGWfeGM5IbCPC+/L9xxhv/myrTuxvT3/w4WNbMhEOQwEJpGoYBaNgFIyCUYAdAABWMznWHzfn/wAAAABJRU5ErkJggg==","orcid":"","institution":"The Hong Kong University of Science and Technology","correspondingAuthor":true,"prefix":"","firstName":"Sirui","middleName":"","lastName":"Han","suffix":""},{"id":592400737,"identity":"8fe8ab11-3507-42fb-ab12-2deba8e8d48b","order_by":3,"name":"Yike GUO","email":"","orcid":"","institution":"The Hong Kong University of Science and Technology","correspondingAuthor":false,"prefix":"","firstName":"Yike","middleName":"","lastName":"GUO","suffix":""}],"badges":[],"createdAt":"2026-02-13 06:24:44","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-8868100/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8868100/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":104782492,"identity":"6ae1a494-8049-4c14-8119-cae02e56c7c6","added_by":"auto","created_at":"2026-03-17 07:57:24","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":2561715,"visible":true,"origin":"","legend":"","description":"","filename":"LegalAlignerTransformingGenericLLMsintoDomainExpertsforEnhancedAccuracy2.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8868100/v1_covered_6ae7c277-93af-4e09-a794-d5b2e1364b9f.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Legal Aligner: Transforming Generic LLMs into Domain Experts for Enhanced Accuracy","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Legal Aligner, Domain Adaptation, Legal AI, Factual Accuracy","lastPublishedDoi":"10.21203/rs.3.rs-8868100/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8868100/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"Large Language Models (LLMs) demonstrate strong general-purpose capabilities but often underperform in specialized domains such as law, where jurisdiction-specific and long-tail knowledge is critical. Existing domain adaptation methods, particularly supervised fine-tuning, are computationally expensive, vulnerable to catastrophic forgetting, and infeasible for proprietary black-box models.\nWe propose \\textbf{Legal Aligner}, a lightweight, parameter-agnostic post-hoc refinement framework that enhances legal factuality without modifying upstream model weights. Acting as a plug-and-play correction layer, Legal Aligner identifies and rectifies unsupported doctrinal claims, jurisdictional inconsistencies, and citation errors in generated legal responses.\nWe evaluate Legal Aligner on a curated Hong Kong legal consultation dataset across eight upstream LLMs, including both open-source and proprietary models. Results show consistent improvements in factual reliability, with gains of up to 14.9 percentage points in Factuality Coverage Score and a 58.9\nOur findings demonstrate that output-level alignment offers a scalable and maintainable alternative to parameter-level adaptation for high-stakes legal AI systems, particularly in jurisdictions underrepresented in large-scale pretraining corpora.","manuscriptTitle":"Legal Aligner: Transforming Generic LLMs into Domain Experts for Enhanced Accuracy","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-03-16 22:36:32","doi":"10.21203/rs.3.rs-8868100/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"27017382-1908-429c-8216-8b2dd3c845e8","owner":[],"postedDate":"March 16th, 2026","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-03-16T22:36:32+00:00","versionOfRecord":[],"versionCreatedAt":"2026-03-16 22:36:32","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8868100","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8868100","identity":"rs-8868100","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2026) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00