SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.findings-acl.583 · ACL Findings · 2025

CitaLaw: Enhancing LLM with Citations in Legal Domain

Jun Xu, Sunhao Dai, Kepu Zhang, Weijie Yu

Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2025.findings-acl.583.json · badge: /api/ran/2025.findings-acl.583.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
CSHaitao/LexiLaw canonical (classifier label)
classifier basis: census
3 ran · 1 no recorded run
FunctionStatusWhere it lives
gelu Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
CSHaitao/LexiLaw/src/modeling_chatglm.py
code served (permissive licence) · get_code("43c9688838aff8b2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function gelu takes a single parameter: x
# Looking at the body, x is used in arithmetic operations (multiplication, addition, tanh)
# so it needs to be a tensor

# Create a small tensor for testing
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gelu_impl Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
CSHaitao/LexiLaw/src/modeling_chatglm.py
code served (permissive licence) · get_code("c8f235d13277facd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

def gelu_impl(x):
    """OpenAI's gelu implementation."""
    return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * x * (1.0 + 0.044715 * x * x)))

# Create a small tensor for input
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate Ran
ran on a synthesized input
CSHaitao/LexiLaw/inference_finetune.py
code served (permissive licence) · get_code("b708930c3633638c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class StandInTokenizer:
    def encode(self, text):
        # Return a list of token ids
        return [1, 2, 3, 4, 5]
    
    def decode(self, token_ids):
        # Convert token ids back to text
        return "generated output text"

class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 16)
        self.linear = nn.Linear(16, 100)
    
    def generate(self, input_ids, min_length, max_length, do_sample, temperature, num_return_sequences):
        # Return a tensor of shape (num_return_sequences, sequence_length)
        # The function expects to index with [0] and then decode
        batch_size = input_ids.shape[0]
        seq_len = min(max_length, 10)
        output_ids = torch.randint(0, 100, (batch_size, seq_len))
        return output_ids

model = StandInModel()
tokenizer = StandInTokenizer()
text = "hello world"

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "text": text
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_tf_weights_in_chatglm_6b Not yet run
unverified (harvested, no recorded run)
CSHaitao/LexiLaw/src/modeling_chatglm.py
code served (permissive licence) · get_code("25fd6233234767aa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
gelu_impl 4 other papers
4 dated earlier
2210.02414 (2022-10)
GLM-130B: An Open Bilingual Pre-trained Model
2307.13528 (2023-07)
FacTool: Factuality Detection in Generative AI -- A Tool Augmented Framework for Multi-Task and Multi-Domain Scenarios
2310.18339 (2023-10)
When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications
and 1 more not named here
gelu 3 other papers
3 dated earlier
2210.02414 (2022-10)
GLM-130B: An Open Bilingual Pre-trained Model
2307.13528 (2023-07)
FacTool: Factuality Detection in Generative AI -- A Tool Augmented Framework for Multi-Task and Multi-Domain Scenarios
2310.18339 (2023-10)
When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications
load_tf_weights_in_chatglm_6b 3 other papers
3 dated earlier
2210.02414 (2022-10)
GLM-130B: An Open Bilingual Pre-trained Model
2307.13528 (2023-07)
FacTool: Factuality Detection in Generative AI -- A Tool Augmented Framework for Multi-Task and Multi-Domain Scenarios
2310.18339 (2023-10)
When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In this paper, we propose CitaLaw, the first benchmark designed to evaluate LLMs' ability to produce legally sound responses with appropriate citations. CitaLaw features a diverse set of legal questions for both laypersons and practitioners, paired with a comprehensive corpus of law articles and precedent cases as a reference pool. This framework enables LLMbased systems to retrieve supporting citations from the reference corpus and align these citations with the corresponding sentences in their responses. Moreover, we introduce syllogisminspired evaluation methods to assess the legal alignment between retrieved references and LLM-generated responses, as well as their consistency with user questions. Extensive experiments on 2 open-domain and 7 legal-specific LLMs demonstrate that integrating legal references substantially enhances response quality. Furthermore, our proposed syllogism-based evaluation method exhibits strong agreement with human judgments.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2025.findings-acl.583")
get_code_for_paper("2025.findings-acl.583")
have("2025.findings-acl.583")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2025.findings-acl.583.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2025.findings-acl.583.svg)](https://syntology.ai/paper/2025.findings-acl.583)

Connect an agent — have() is free.