SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.22648 · ICML · 2026

UCPO: Uncertainty-Aware Policy Optimization

Jing Huang, Junhao Zhang, Qiang Zhu, Chunmei Xie, Mengyu Lu, Weiqi Xiong, Qixuan Zhou, Xingzhong Xu, Yadong Li, Xianzhou Zeng, Siye Chen, Nan Gongrui

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 4 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/2601.22648.json · badge: /api/ran/2601.22648.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
xzhouzeng/ucpo canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
extract_answer_mc Ran
ran; our contract draft was wrong, not the code
xzhouzeng/ucpo/eval/metrics.py
code served (permissive licence) · get_code("bd2a0c243efb8933")
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. 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 re

def extract_answer_mc(model_response: str):
    """
    从大模型的响应中解析出多选题答案:
    - 返回 'A'/'B'/'C'/'D' 之一,或 'uncertainty'
    - 解析失败返回 None
    """
    if not isinstance(model_response, str):
        return None
    text = model_response.strip()
    m_simple = re.fullmatch('([A-D])[\\.\\)]?\\s*', text, flags=re.IGNORECASE)
    if m_simple:
        return m_simple.group(1).upper()
    text_clean = re.sub('\\\\text\\{\\s*([^{}]+?)\\s*\\}', '\\1', text)
    boxed_uncertainty_patterns = ['\\\\boxed\\{\\s*\\\\text\\{\\s*uncertainty\\s*\\}\\s*\\}', '\\\\boxed\\{\\s*uncertainty\\s*\\}']
    boxed_letter_with_prefix_pattern = '\\\\boxed\\{\\s*\\\\text\\{\\s*([A-D])\\s*[\\.\\)]?[^}]*\\}\\s*\\}'
    boxed_candidates = []
    for pat in boxed_uncertainty_patterns:
        if re.search(pat, text_clean, flags=re.IGNORECASE):
            boxed_candidates.append('uncertainty')

    def _norm_boxed_letter(m):
        letter = m.group(1).upper()
        if letter in ['A', 'B', 'C', 'D']:
            return '\\boxed{\\text{' + letter + '}}'
        return m.group(0)
    text_clean = re.sub(boxed_letter_with_prefix_pattern, _norm_boxed_letter, text_clean, flags=re.IGNORECASE)
    answer_token_pattern = '[*"_\\\']*\\banswer\\b[*"_\\\']*'
    answer_spans = list(re.finditer(answer_token_pattern, text_clean, flags=re.IGNORECASE))
    candidates = []
    for m in answer_spans:
        start = m.start()
        end = min(len(text_clean), m.end() + 300)
        segment = text_clean[start:end]
        unc_patterns = ['[*"_\\\']*\\banswer\\b[*"_\\\']*\\s*[::]\\s*["`\\\']?uncertainty["`\\\']?\\b', '\\banswer\\b[^\\n]*?\\\\boxed\\{\\s*\\\\text\\{\\s*uncertainty\\s*\\}\\s*\\}', '\\banswer\\b[^\\n]*?\\\\boxed\\{\\s*uncertainty\\s*\\}']
        found_uncertainty = False
        for pat in unc_patterns:
            if re.search(pat, segment, flags=re.IGNORECASE):
                candidates.append('uncertainty')
                found_uncertainty = True
                break
        if found_uncertainty:
            continue
        choice_patterns = ['[*"_\\\']*\\banswer\\b[*"_\\\']*\\s*[::]\\s*["`\\\']?([A-D])["`\\\']?\\b', '\\banswer\\b[^\\n]*?[::]\\s*["`\\\']?([A-D])["`\\\']?\\b', '\\banswer\\b[^\\n]*?\\\\boxed\\{\\s*\\\\text\\{\\s*([A-D])\\s*\\}\\s*\\}', '\\banswer\\b[^\\n]*?\\\\boxed\\{\\s*([A-D])\\s*\\}', '\\banswer\\b[^\\n]*?\\b([A-D])\\b']
        for pat in choice_patterns:
            m_choice = re.search(pat, segment, flags=re.IGNORECASE)
            if m_choice:
                choice = m_choice.group(1).upper()
                if choice in ['A', 'B', 'C', 'D']:
                    candidates.append(choice)
                    break
    if candidates:
        return candidates[-1]
    if boxed_candidates:
        pass
    last_choice = None
    boxed_patterns = ['\\\\boxed\\{\\s*\\\\text\\{\\s*uncertainty\\s*\\}\\s*\\}', '\\\\boxed\\{\\s*uncertainty\\s*\\}', '\\\\boxed\\{\\s*\\\\text\\{\\s*([A-D])\\s*\\}\\s*\\}', '\\\\boxed\\{\\s*([A-D])\\s*[\\.\\)]\\s*[^}]*\\}', '\\\\boxed\\{\\s*([A-D])\\s*\\}']
    for pat in boxed_patterns:
        for m in re.finditer(pat, text_clean, flags=re.IGNORECASE):
            if m.lastindex is None:
                last_choice = 'uncertainty'
            else:
                ch = m.group(m.lastindex).upper()
                if ch in ['A', 'B', 'C', 'D']:
                    last_choice = ch
    if last_choice is not None:
        return last_choice
    return None


ARGS = {
    "model_response": "The answer is: B"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
generate_config_from_args Ran
ran; our contract draft was wrong, not the code
xzhouzeng/ucpo/train/verl/model_merger/base_model_merger.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from LeapLabTHU/OPDVR, is pointer only (licence: NONE) · get_code("8896f4e2bafe8abc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from LeapLabTHU/OPDVR, and GitHub detected no licence in that repository 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_json Ran
ran; our contract draft was wrong, not the code
xzhouzeng/ucpo/eval/eval_general.py
code served (permissive licence) · get_code("a34eb4a9ee65c5fb")
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 dict. The image it ran in was 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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": 42,
    "key3": [1, 2, 3],
    "key4": {"nested": "object"}
}

with open(test_file, 'w', encoding='utf-8') as f:
    json.dump(test_data, f)

ARGS = {
    "file_path": test_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
normalize_final_answer Ran
ran; our contract draft was wrong, not the code
xzhouzeng/ucpo/eval/utils.py
code served (permissive licence) · get_code("5662e5ee755b541c")
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. 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 re

SUBSTITUTIONS = [('an ', ''), ('a ', ''), ('.$', '$'), ('\\$', ''), ('\\ ', ''), (' ', ''), ('mbox', 'text'), (',\\text{and}', ','), ('\\text{and}', ','), ('\\text{m}', '\\text{}')]

REMOVED_EXPRESSIONS = ['square', 'ways', 'integers', 'dollars', 'mph', 'inches', 'ft', 'hours', 'km', 'units', '\\ldots', 'sue', 'points', 'feet', 'minutes', 'digits', 'cents', 'degrees', 'cm', 'gm', 'pounds', 'meters', 'meals', 'edges', 'students', 'childrentickets', 'multiples', '\\text{s}', '\\text{.}', '\\text{\ns}', '\\text{}^2', '\\text{}^3', '\\text{\n}', '\\text{}', '\\mathrm{th}', '^\\circ', '^{\\circ}', '\\;', ',\\!', '{,}', '"', '\\dots']

def normalize_final_answer(final_answer: str) -> str:
    """
    Normalize a final answer to a quantitative reasoning question.
    This code comes from https://arxiv.org/pdf/2206.14858.pdf, page18.
    """
    for before, after in SUBSTITUTIONS:
        final_answer = final_answer.replace(before, after)
    for expr in REMOVED_EXPRESSIONS:
        final_answer = final_answer.replace(expr, '')
    final_answer = re.sub('(.*?)(\\$)(.*?)(\\$)(.*)', '$\\3$', final_answer)
    final_answer = re.sub('(\\\\text\\{)(.*?)(\\})', '\\2', final_answer)
    final_answer = re.sub('(\\\\textbf\\{)(.*?)(\\})', '\\2', final_answer)
    final_answer = re.sub('(\\\\overline\\{)(.*?)(\\})', '\\2', final_answer)
    final_answer = re.sub('(\\\\boxed\\{)(.*)(\\})', '\\2', final_answer)
    final_answer = re.sub('(frac)([^{])(.)', 'frac{\\2}{\\3}', final_answer)
    final_answer = re.sub('(sqrt)([^{])', 'sqrt{\\2}', final_answer)
    final_answer = final_answer.replace('$', '')
    if final_answer.replace(',', '').isdigit():
        final_answer = final_answer.replace(',', '')
    return final_answer

ARGS = {
    'final_answer': '\\boxed{42}'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
repeatness Ran
ran, violated the contract we drafted
xzhouzeng/ucpo/eval/utils.py
code served (permissive licence) · get_code("3dcb40e5ce9bac48")
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 bool, ndim 0, dtype family float, shape () 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.

# Analyzing the function
# repeatness() takes a single parameter: s (a string)
# The function computes a "repeatness" metric based on suffix arrays and LCP arrays

# Simple test cases
ARGS = {
    "s": "abcabcabc"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () 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
think_boxed_reward_fn_mc Ran
ran; our contract draft was wrong, not the code
xzhouzeng/ucpo/eval/metrics.py
code served (permissive licence) · get_code("bf0242950c3037b8")
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 tuple, ndim 1, 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

# Set seed for reproducibility
torch.manual_seed(0)

# Build valid arguments for think_boxed_reward_fn_mc

# Example 1: Simple answer extraction - letter answer
model_response_1 = "The answer is A."
gt_1 = "A"

# Example 2: Answer with boxed notation
model_response_2 = r"\boxed{B}"
gt_2 = "B"

# Example 3: Answer with think tags
model_response_3 = "<think>Let me solve this problem...</think> The answer is C."
gt_3 = "C"

# Example 4: Uncertainty response
model_response_4 = r"\boxed{\text{uncertainty}}"
gt_4 = "A"

# Example 5: Answer with formatting
model_response_5 = "answer: **D**"
gt_5 = "D"

# Use one of the examples as the primary arguments
ARGS = {
    "model_response": model_response_1,
    "gt": gt_1,
    "fast": False
}
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 tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
cal_metrics_whole_mc Not yet run
unverified (harvested, no recorded run)
xzhouzeng/ucpo/eval/metrics.py
code served (permissive licence) · get_code("36bc11ec34c0b777")
How it ran

no invocation recorded.

compute_score Not yet run
unverified (harvested, no recorded run)
xzhouzeng/ucpo/train/recipe/ucpo/reward_fn/uc_reward_mc.py
code served (permissive licence) · get_code("57cabc812db1e524")
How it ran

no invocation recorded.

mathd_normalize_answer Not yet run
unverified (harvested, no recorded run)
xzhouzeng/ucpo/eval/utils.py
code served (permissive licence) · get_code("0388e4fa2f36659e")
How it ran

no invocation recorded.

think_boxed_reward_fn_mc Not yet run
unverified (harvested, no recorded run)
xzhouzeng/ucpo/train/recipe/ucpo/reward_fn/uc_reward_mc.py
code served (permissive licence) · get_code("9fc79b9da77368ec")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 4 later) and 5 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
generate_config_from_args 57 other papers
3 dated earlier, 4 the same month, 47 later, 3 undated
2410.02992 (2024-10)
Learning to Better Search with Language Models via Guided Reinforced Self-Training
2509.25787 (2025-09)
Self-Evolving Vision-Language Models for Image Quality Assessment via Voting and Ranking
2510.08630 (2025-10)
ExPO-HM: Learning to Explain-then-Detect for Hateful Meme Detection
and 54 more not named here
mathd_normalize_answer 12 other papers
6 dated earlier, 6 later
2503.10460 (2025-03)
Light-R1: Curriculum SFT, DPO and RL for Long COT from Scratch and Beyond
2505.03335 (2025-05)
Absolute Zero: Reinforced Self-play Reasoning with Zero Data
2505.13379 (2025-05)
Thinkless: LLM Learns When to Think
and 9 more not named here
normalize_final_answer 9 other papers
4 dated earlier, 5 later
2504.16084 (2025-04)
TTRL: Test-Time Reinforcement Learning
2509.24372 (2025-09)
Evolution Strategies at Scale: LLM Fine-Tuning Beyond Reinforcement Learning
2511.13223 (2025-11)
TokenSqueeze: Performance-Preserving Compression for Reasoning LLMs
and 6 more not named here
repeatness 8 other papers
3 dated earlier, 5 later
2509.24372 (2025-09)
Evolution Strategies at Scale: LLM Fine-Tuning Beyond Reinforcement Learning
2511.13223 (2025-11)
TokenSqueeze: Performance-Preserving Compression for Reasoning LLMs
2511.15694 (2025-11)
The Impact of Quantization on Large Reasoning Model Reinforcement Learning
and 5 more not named here
load_json 1 other paper
1 dated earlier
2025.findings-emnlp.103 (2025 (year only))
A Structured Framework for Evaluating and Enhancing Interpretive Capabilities of Multimodal LLMs in Culturally Situated Tasks

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

The key to building trustworthy large language models (LLMs) lies in endowing them with inherent uncertainty expression capabilities, thereby mitigating overconfident errors in high-stakes applications. However, existing RL paradigms such as GRPO often suffer from Advantage Bias due to binary decision spaces and static uncertainty rewards, inducing either excessive conservatism or overconfidence. To tackle this challenge, this paper unveils the root causes of reward hacking and overconfidence in current RL paradigms incorporating uncertainty-based rewards, based on which we propose the UnCertainty-Aware Policy Optimization (UCPO) framework. UCPO employs Ternary Advantage Decoupling to separate and independently normalize deterministic and uncertain rollouts, thereby eliminating advantage bias. Furthermore, a Dynamic Uncertainty Reward Adjustment mechanism adapts uncertainty weights in real-time according to model evolution and instance difficulty. Experimental results in mathematical reasoning and general tasks demonstrate that UCPO effectively resolves the reward imbalance, significantly improving the reliability of the model beyond their knowledge boundaries.

For agents

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

get_harvested_code_for_paper("2601.22648")
get_code_for_paper("2601.22648")
have("2601.22648")

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

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

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

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

Connect an agent — have() is free.