Performing Automated Employment Law Case Analysis Using Large Language Models
Bibliographic record
Abstract
In pursuing agentic AI for complex legal workflows, systems must deliver accurate, cited, and nuanced outputs—boiling down to accurate legal question answering (QA). This project focuses on performing QA in Canadian employment law, focusing on worker classification (e.g., employee vs. contractor tests from Sagaz Industries precedents), using the Sagaz dataset: over 300 case analyses from David Liang and Samuel Dahan's Conflict Analytics Lab. One of the limitations of Large Language Models (LLMs) is that in analyzing large 30-page or longer documents to answer questions, even though all the text is in the context window, key pieces of information may still be missed in answering questions. To address this limitation, we explore various Retrieval-Augmented Generation (RAG) techniques to provide Large Language Models (LLMs) with the relevant context for 20+ case-specific questions that make up the case analysis. RAG techniques include no-processing (full case as context), chunking with vector embeddings for efficient retrieval, knowledge graph construction for Graph RAG to capture relational elements, and combinations of different methods. Additionally, methods for performing the analysis of multiple questions in a single prompt are also being explored to balance token usage efficiency and accuracy. Preliminary evaluations have with the no-processing technique has shown some signs of limited success of 50% accuracy on a 20-case subset of cases in the dataset. Work is currently still ongoing: to improve the prompts used to specify the case analysis questions as mis-interpretation and overly strict evaluations were a leading cause of incorrect answers in these initial tests; to scale up the processing pipeline (as some of the processing techniques take up many millions of LLM tokens); and to analyze the resulting outputs across 20+ questions asked in each case analysis for the hundreds of cases.
Fetched live from OpenAlex and de-inverted. Abstracts are not stored in this database: the inverted indexes are 8.6 GB of the frame’s 9.3 GB of text, and the host has 13 GB free.
How this classification was reachedexpand
Full frame distilled prediction
Teacher imitationNot calibrated prevalence, not ground truth. Human validation pending. Learned from the 10,348 direct Codex labels and 10,348 direct Gemma labels. Candidate is the union of thresholded teacher heads; consensus is their intersection. These outputs are machine_predicted_unvalidated and are not human labels or direct frontier model labels.
Codex and Gemma teacher scores by category
| Category | Codex | Gemma |
|---|---|---|
| Metaresearch | 0.006 | 0.001 |
| Meta-epidemiology (narrow) | 0.000 | 0.000 |
| Meta-epidemiology (broad) | 0.001 | 0.000 |
| Bibliometrics | 0.001 | 0.005 |
| Science and technology studies | 0.004 | 0.002 |
| Scholarly communication | 0.001 | 0.002 |
| Open science | 0.001 | 0.001 |
| Research integrity | 0.000 | 0.001 |
| Insufficient payload (model declined to judge) | 0.000 | 0.000 |
Machine scores (provisional)
The two teacher heads of the student model, read on this work. A score orders the frame for review; it never asserts a category, and the validation status ships verbatim with every row.
Baseline scores from an immature model (maturity gate not passed, 7 training rounds). Scores rank; they never assert a category.
score_only:v0-immature-baseline · verbatim from the scoring run: score_only means the number may rank works, and no category label ships from itClassification
machine, unvalidatedMachine predicted; a candidate call from one teacher head, not a consensus.
How this classification was reached, model by model and score by score, is at the end of the page under "How this classification was reached".