SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.15716 · 2025

DianJin-R1: Evaluating and Enhancing Financial Reasoning in Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

1 of 3 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 0 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2504.15716.json · badge: /api/ran/2504.15716.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
aliyun/qwen-dianjin canonical (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
FunctionStatusWhere it lives
get_rope_index Ran
ran; our contract draft was wrong, not the code
aliyun/qwen-dianjin/DianJin-OCR-R1/src/rl/verl/models/transformers/qwen2_vl.py
code served (permissive licence) · get_code("e81f53ee64a9fcbe")
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) and returned Tensor, ndim 2, dtype family int, shape (3, 9) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create a minimal Qwen2VLProcessor stand-in
class MinimalImageProcessor:
    def __init__(self):
        self.merge_size = 2

class MinimalTokenizer:
    def __init__(self):
        self.token_map = {
            '<|image_pad|>': 100,
            '<|video_pad|>': 101,
            '<|vision_start|>': 102,
        }
    
    def convert_tokens_to_ids(self, token):
        return self.token_map.get(token, 0)

class MinimalProcessor:
    def __init__(self):
        self.image_processor = MinimalImageProcessor()
        self.tokenizer = MinimalTokenizer()

# Create processor
processor = MinimalProcessor()

# Create input_ids: 1D tensor with some vision tokens
# Include vision_start (102), image_pad (100), and some text tokens
input_ids = torch.tensor([5, 6, 102, 100, 100, 100, 100, 7, 8], dtype=torch.long)

# Create image_grid_thw: (num_images, 3) where each row is [t, h, w]
image_grid_thw = torch.tensor([[1, 4, 4]], dtype=torch.long)

# Create video_grid_thw: (num_videos, 3) where each row is [t, h, w]
video_grid_thw = torch.tensor([[2, 6, 6]], dtype=torch.long)

# Create second_per_grid_ts: temporal scaling for videos
second_per_grid_ts = torch.tensor([1.0], dtype=torch.float32)

# Create attention_mask: same shape as input_ids, all ones
attention_mask = torch.ones_like(input_ids)

ARGS = {
    'processor': processor,
    'input_ids': input_ids,
    'image_grid_thw': image_grid_thw,
    'video_grid_thw': video_grid_thw,
    'second_per_grid_ts': second_per_grid_ts,
    'attention_mask': attention_mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 int, shape (3, 9) — shape (3, 9) as a later run recorded it
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
qwen2_vl_attn_forward Not yet run
unverified (harvested, no recorded run)
aliyun/qwen-dianjin/DianJin-OCR-R1/src/rl/verl/models/transformers/qwen2_vl.py
code served (permissive licence) · get_code("94cb835f47dcfc92")
How it ran

no invocation recorded.

qwen2_vl_forward_old Not yet run
unverified (harvested, no recorded run)
aliyun/qwen-dianjin/DianJin-OCR-R1/src/rl/verl/models/transformers/qwen2_vl.py
code served (permissive licence) · get_code("1a0b75b2de257457")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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
get_rope_index 7 other papers
6 later, 1 undated
2505.16282 (2025-05)
ARPO:End-to-End Policy Optimization for GUI Agents with Experience Replay
2506.01908 (2025-06)
Reinforcement Learning Tuning for VideoLLMs: Reward Design and Data Efficiency
2506.05154 (2025-06)
Resisting Contextual Interference in RAG via Parametric-Knowledge Reinforcement
and 4 more not named here
qwen2_vl_attn_forward 1 other paper
1 later
2601.05167 (2026-01)
RelayLLM: Efficient Reasoning via Collaborative Decoding
qwen2_vl_forward_old 1 other paper
1 later
2601.05167 (2026-01)
RelayLLM: Efficient Reasoning via Collaborative Decoding

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-23.

Repositories linked to this paper

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

Abstract

Effective reasoning remains a core challenge for large language models (LLMs) in the financial domain, where tasks often require domain-specific knowledge, precise numerical calculations, and strict adherence to compliance rules. We propose DianJin-R1, a reasoning-enhanced framework designed to address these challenges through reasoning-augmented supervision and reinforcement learning. Central to our approach is DianJin-R1-Data, a high-quality dataset constructed from CFLUE, FinQA, and a proprietary compliance corpus (Chinese Compliance Check, CCC), combining diverse financial reasoning scenarios with verified annotations. Our models, DianJin-R1-7B and DianJin-R1-32B, are fine-tuned from Qwen2.5-7B-Instruct and Qwen2.5-32B-Instruct using a structured format that generates both reasoning steps and final answers. To further refine reasoning quality, we apply Group Relative Policy Optimization (GRPO), a reinforcement learning method that incorporates dual reward signals: one encouraging structured outputs and another rewarding answer correctness. We evaluate our models on five benchmarks: three financial datasets (CFLUE, FinQA, and CCC) and two general reasoning benchmarks (MATH-500 and GPQA-Diamond). Experimental results show that DianJin-R1 models consistently outperform their non-reasoning counterparts, especially on complex financial tasks. Moreover, on the real-world CCC dataset, our single-call reasoning models match or even surpass the performance of multi-agent systems that require significantly more computational cost. These findings demonstrate the effectiveness of DianJin-R1 in enhancing financial reasoning through structured supervision and reward-aligned learning, offering a scalable and practical solution for real-world applications.

For agents

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

get_harvested_code_for_paper("2504.15716")
get_code_for_paper("2504.15716")
have("2504.15716")

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

curl https://syntology.ai/api/ran/2504.15716.json

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

[![Syntology run record](https://syntology.ai/api/ran/2504.15716.svg)](https://syntology.ai/paper/2504.15716)

Connect an agent — have() is free.