SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.13562 · 2026

Mitigating the Safety-Utility Trade-off in LLM Alignment via Adaptive Safe Context Learning

Ran He, Jian Liang, Yanbo Wang, Lu Wang, Minzheng Wang, Yongcan Yu

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 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, 3 violated it and 0 have no contract verdict; 7 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2602.13562.json · badge: /api/ran/2602.13562.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
ybwang119/ASCL canonical (classifier label)
classifier basis: census
10 ran · 3 no recorded run
FunctionStatusWhere it lives
append_log_with_lock Ran
ran, violated the contract we drafted
ybwang119/ASCL/benchmark/core/file_lock_utils.py
pointer only (licence: NONE) · get_code("10bec5fa8e6f61dd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

append_results_with_lock Ran
ran, violated the contract we drafted
ybwang119/ASCL/benchmark/core/file_lock_utils.py
pointer only (licence: NONE) · get_code("c01bc9ee109cbf8d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

collect_all_summaries Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/benchmark/aggregate_results.py
pointer only (licence: NONE) · get_code("726a6b9bf91dba53")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_label_categories_refusal Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/benchmark/core/evaluator.py
pointer only (licence: NONE) · get_code("320e53d22a431c6d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

llama_guard_moderate Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/benchmark/core/evaluator.py
pointer only (licence: NONE) · get_code("69d99684e9c8aafc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_config Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/src/rag_mcp_server.py
pointer only (licence: NONE) · get_code("f33694889a861d02")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_detailed_metrics Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/benchmark/aggregate_results.py
pointer only (licence: NONE) · get_code("a90bae6c7c585846")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

qwen_guard_moderate Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/benchmark/core/evaluator.py
pointer only (licence: NONE) · get_code("711896fc20bbdc1f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

save_temp_results Ran
ran, violated the contract we drafted
ybwang119/ASCL/benchmark/core/file_lock_utils.py
pointer only (licence: NONE) · get_code("0f5d518fa86c579f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

summaries_to_dataframe Ran
ran; our contract draft was wrong, not the code
ybwang119/ASCL/benchmark/aggregate_results.py
pointer only (licence: NONE) · get_code("c8365de93184ac10")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

calculate_batch_results Not yet run
unverified (harvested, no recorded run)
ybwang119/ASCL/benchmark/calculate_results.py
pointer only (licence: NONE) · get_code("a4fcf66f43d9221a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_adapter Not yet run
unverified (harvested, no recorded run)
ybwang119/ASCL/benchmark/core/dataset_adapter.py
pointer only (licence: NONE) · get_code("a1254dbd2ac8f59a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

has_adapter Not yet run
unverified (harvested, no recorded run)
ybwang119/ASCL/benchmark/core/dataset_adapter.py
pointer only (licence: NONE) · get_code("619bbd8e00b79eda")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ybwang119/ASCL when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 13 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.

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

Repositories linked to this paper

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

Abstract

While reasoning models have achieved remarkable success in complex reasoning tasks, their increasing power necessitates stringent safety measures. For safety alignment, the core challenge lies in the inherent trade-off between safety and utility. However, prevailing alignment strategies typically construct CoT training data with explicit safety rules via context distillation. This approach inadvertently limits reasoning capabilities by creating a rigid association between rule memorization and refusal. To mitigate the safety-utility trade-off, we propose the Adaptive Safe Context Learning (ASCL) framework to improve the reasoning given proper context. ASCL formulates safety alignment as a multi-turn tool-use process, empowering the model to autonomously decide when to consult safety rules and how to generate the ongoing reasoning. Furthermore, to counteract the preference for rule consultation during RL, we introduce Inverse Frequency Policy Optimization (IFPO) to rebalance advantage estimates. By decoupling rule retrieval and subsequent reasoning, our method achieves higher overall performance compared to baselines. Our code is publicly available at https://github.com/ybwang119/ASCL.git.

For agents

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

get_harvested_code_for_paper("2602.13562")
get_code_for_paper("2602.13562")
have("2602.13562")

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

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

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

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

Connect an agent — have() is free.