Papers › RAIN-Merging: A Gradient-Free Method to Enhance Instruction Following in Large...

RAIN-Merging: A Gradient-Free Method to Enhance Instruction Following in Large Reasoning Models with Preserved Thinking Format

26 Feb 2026arXiv:2602.22538added by Syntology

Zhehao Huang, Yuhang Liu, Baijiong Lin, Yixin Lou, Zhengbao He, Hanling Tian, Tao Li, Xiaolin Huang

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

Large reasoning models (LRMs) excel at a long chain of reasoning but often fail to faithfully follow instructions regarding output format, constraints, or specific requirements. We investigate whether this gap can be closed by integrating an instruction-tuned model (ITM) into an LRM. Analyzing their differences in parameter space, namely task vectors, we find that their principal subspaces are nearly orthogonal across key modules, suggesting a lightweight merging with minimal interference. However, we also demonstrate that naive merges are fragile because they overlook the output format mismatch between LRMs (with explicit thinking and response segments) and ITMs (answers-only). We introduce RAIN-Merging (Reasoning-Aware Instruction-attention guided Null-space projection Merging), a gradient-free method that integrates instruction following while preserving thinking format and reasoning performance. First, with a small reasoning calibration set, we project the ITM task vector onto the null space of forward features at thinking special tokens, which preserves the LRM's structured reasoning mechanisms. Second, using a small instruction calibration set, we estimate instruction attention to derive module-specific scaling that amplifies instruction-relevant components and suppresses leakage. Across four instruction-following benchmarks and nine reasoning & general capability benchmarks, RAIN-Merging substantially improves instruction adherence while maintaining reasoning quality. The gains are consistent across model scales and architectures, translating to improved performance in agent settings.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2602.22538")

Code

Syntology Ran 14 of 26 code samples harvested from 1 repository linked to this paper; 12 have no recorded run. Of those that ran: 4 ran · fixture could not drive it; 10 ran with no contract checked.

By repository: found in paper text by Syntology: 26 samples from 1 repository, 14 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

K1nght/RAIN-Merging found in paper text by Syntology report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

26 samples harvested; 14 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · fixture could not drive it
10ran
12unverified

Licence: 0 of the 26 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from K1nght/RAIN-Merging. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AT_times_y_o K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 00c9c6977a701ff1 · report
AT_times_y_qk_batched K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · f155dbbce57758d3 · report
cg_ffn_down K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · d5691f582cfd141a · report
cg_o K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 42f44084ce891789 · report
cg_single_head_batched K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · c5accd50884f21fc · report
cg_v K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 7ac48ccbf2c80177 · report
ffn_down_dense_project K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 14e5c6e4549a8303 · report
k_dense_project K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · 9d56cb9c14aa40c3 · report
locate_segments K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 0dbdd515cbf42f3e · report
o_dense_project K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · e21d060263e1cf25 · report
prepare_samples_unified K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 5a360716a871f952 · report
q_dense_project K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · 2170244af18f0455 · report
task_vectors_single_layer_unified K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran MIT (permissive) · 850f45dfa3a08cf8 · report
v_dense_project K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · d47c35c41d796139 · report
AT_times_y_ffn_down K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 386325217560019b · report
AT_times_y_v K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 132be6fed0784839 · report
A_times_delta_ffn_down K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · b59409e59cc75ff5 · report
A_times_delta_o K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 0bef599c3d266dd0 · report
A_times_delta_qk_batched K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · ec239cd5afa0e9ab · report
A_times_delta_v K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 6a80e7e297cc2dfd · report
PreparedSample K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · e68cff037c0b5994 · report
build_constraints_single_layer_unified K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 18483f343db694e9 · report
cleanup_memory K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 0e35eabd03de87a8 · report
collect_layer_features_with_hooks K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · cc07a611c75febcf · report
optimized_layerwise_headwise_nullspace_projection K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 88609c4f9a469bab · report
set_strict_runtime K1nght/RAIN-Merging/nullspace_merge_qkvo_ffn.py found in paper text by Syntology unverified MIT (permissive) · 64c33317028b2a64 · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2602.22538, was issued in February 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections