SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.20974 · EMNLP · 2024

SaySelf: Teaching LLMs to Express Confidence with Self-Reflective Rationales

Jing Gao, Shizhe Diao, Yangyi Chen, Xingyao Wang, Xiaoze Liu, Shujin Wu, Tianyang Xu, Robert Hunter, Biden Robert, Hunter Biden, Hunter Robert, Biden, and 2 more

arXiv · PDF · Open in the Atlas

Code that ran

11 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2405.20974.json · badge: /api/ran/2405.20974.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
xu1868/SaySelf canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
xu1868/sayself canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
FunctionStatusWhere it lives
calculate_reward Ran
ran, honoured the contract we drafted
xu1868/SaySelf/utils/utils.py
code served (permissive licence) · get_code("6c5c81d9c2c06116")
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 float, 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.

import torch
import numpy as np

# Set random seed for reproducibility
torch.manual_seed(0)

# The function takes two parameters: correctness and confidence
# Both are used as numeric values (compared, divided, etc.)
# They should be scalars or array-like values in range [0, 10] ideally

ARGS = {
    "correctness": 7.5,
    "confidence": 8.2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
accelerate, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
encode_with_json_format Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/evaluation/evaluate.py
code served (permissive licence) · get_code("b9d2be719e848341")
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 torch
from unittest.mock import Mock

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.bos_token = "[BOS]"
    
    def __call__(self, text, return_tensors=None, max_length=None, truncation=None):
        # Return a mock tokenization result
        mock_result = Mock()
        mock_result.input_ids = torch.randint(0, 1000, (1, 8))
        return mock_result

class MockArgs:
    def __init__(self):
        self.explicitly_state_confidence = False

example = {
    'question': 'What is the capital of France?',
    'answer': 'Paris',
    'negative_answer': 'London/Berlin/Rome'
}

tokenizer = MockTokenizer()
max_seq_length = 128
args = MockArgs()
add_bos = False

ARGS = {
    'example': example,
    'tokenizer': tokenizer,
    'max_seq_length': max_seq_length,
    'args': args,
    'add_bos': add_bos
}
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 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
encode_with_messages_format Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/training/finetune.py
code served (permissive licence) · get_code("0fe2c5386a8e7ffe")
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 torch
from unittest.mock import Mock

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.eos_token = '</s>'
        self.bos_token = '<s>'
    
    def __call__(self, text, return_tensors=None, max_length=None, truncation=False):
        # Simple mock: tokenize by splitting and pad/truncate to max_length
        tokens = text.split()
        if max_length:
            tokens = tokens[:max_length]
        # Create fake token ids
        token_ids = [i % 100 for i in range(len(tokens))]
        input_ids = torch.tensor([token_ids], dtype=torch.long)
        result = Mock()
        result.input_ids = input_ids
        return result

example = {
    'messages': [
        {'role': 'system', 'content': 'You are a helpful assistant.'},
        {'role': 'user', 'content': 'What is two plus two?'},
        {'role': 'assistant', 'content': 'Two plus two equals four.'}
    ]
}

tokenizer = MockTokenizer()
max_seq_length = 128
add_bos = False

ARGS = {
    'example': example,
    'tokenizer': tokenizer,
    'max_seq_length': max_seq_length,
    'add_bos': add_bos
}
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 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
encode_with_messages_format Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/evaluation/evaluate.py
code served (permissive licence) · get_code("2ff0831de5949f6c")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Stand-in tokenizer class that mimics HuggingFace tokenizer behavior
class StandInTokenizer:
    def __init__(self):
        self.bos_token = "[BOS]"
        self.eos_token_id = 2
        self.pad_token_id = None
    
    def __call__(self, text, return_tensors=None, max_length=None, truncation=False):
        # Simple mock tokenization: split and convert to token IDs
        tokens = text.split()
        token_ids = [1 + (i % 100) for i in range(len(tokens))]
        
        if max_length and truncation and len(token_ids) > max_length:
            token_ids = token_ids[:max_length]
        
        input_ids = torch.tensor([token_ids], dtype=torch.long)
        
        if return_tensors == 'pt':
            return type('TokenizerOutput', (), {
                'input_ids': input_ids
            })()
        return input_ids

# Stand-in args object with the explicitly_state_confidence attribute
class StandInArgs:
    def __init__(self):
        self.explicitly_state_confidence = False

# Create example data following the truthful_qa format
example = {
    'question': 'What is the capital of France?',
    'best_answer': 'Paris',
    'correct_answers': ['Paris', 'The capital of France is Paris']
}

# Create tokenizer
tokenizer = StandInTokenizer()

# Create args
args = StandInArgs()

# Define ARGS dictionary
ARGS = {
    'example': example,
    'tokenizer': tokenizer,
    'max_seq_length': 128,
    'add_bos': False,
    'args': args
}
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 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
encode_with_messages_format Ran
ran; our contract draft was wrong, not the code
xu1868/sayself/training/rlhf_train.py
code served (permissive licence) · get_code("a6a6be18e0e76d28")
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 torch

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.eos_token = '</s>'
        self.bos_token = '<s>'
    
    def __call__(self, text, return_tensors=None, max_length=None, truncation=False):
        # Mock tokenization - return simple token ids
        tokens = text.split()
        token_ids = [i % 100 for i in range(len(tokens))]
        input_ids = torch.tensor([token_ids], dtype=torch.long)
        
        if max_length and input_ids.shape[1] > max_length:
            input_ids = input_ids[:, :max_length]
        
        class TokenizerOutput:
            def __init__(self, ids):
                self.input_ids = ids
        
        return TokenizerOutput(input_ids)

example = {
    'messages': [
        {'role': 'system', 'content': 'You are a helpful assistant.'},
        {'role': 'user', 'content': 'What is the capital of France?'},
        {'role': 'assistant', 'content': 'The capital of France is Paris.'}
    ]
}

tokenizer = MockTokenizer()
max_seq_length = 512
add_bos = False

ARGS = {
    'example': example,
    'tokenizer': tokenizer,
    'max_seq_length': max_seq_length,
    'add_bos': add_bos
}
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 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
encode_with_qr_format Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/training/finetune.py
code served (permissive licence) · get_code("25e9ee7fc7b8741c")
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 torch
from transformers import AutoTokenizer

torch.manual_seed(0)

# Create a minimal tokenizer stand-in that mimics the tokenizer interface
class MinimalTokenizer:
    def __init__(self):
        self.bos_token = "[BOS]"
    
    def __call__(self, text, return_tensors=None, max_length=None, truncation=False):
        # Simple tokenization: split and map to token ids
        tokens = text.split()
        token_ids = [hash(t) % 1000 for t in tokens]  # Deterministic fake ids
        
        if max_length and truncation:
            token_ids = token_ids[:max_length]
        
        input_ids = torch.tensor([token_ids], dtype=torch.long)
        
        if return_tensors == 'pt':
            return type('TokenizerOutput', (), {
                'input_ids': input_ids
            })()
        return input_ids

tokenizer = MinimalTokenizer()

question = "What is the capital of France?"
response = "The capital of France is Paris."
max_seq_length = 512
add_bos = False

ARGS = {
    'question': question,
    'response': response,
    'tokenizer': tokenizer,
    'max_seq_length': max_seq_length,
    'add_bos': add_bos
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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
generate_summarized_reason Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/evaluation/evaluate_reason.py
code served (permissive licence) · get_code("e3b0d7c3e623b451")
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 os
from unittest.mock import MagicMock, patch

# Set up environment variable needed by the function
os.environ['OPENAI_DEPLOYMENT_NAME'] = 'test-deployment'

# Create a mock OpenAI client and response
mock_completion = MagicMock()
mock_completion.choices = [MagicMock()]
mock_completion.choices[0].message = MagicMock()
mock_completion.choices[0].message.content = "Reason: I was uncertain because the input was ambiguous and could have multiple valid interpretations."

# Mock the openai module globally so the function can access it
mock_openai = MagicMock()
mock_openai.chat.completions.create.return_value = mock_completion

import sys
sys.modules['openai'] = MagicMock(
    AzureOpenAI=MagicMock,
    OpenAI=MagicMock,
    OpenAIError=Exception
)

# Patch the openai object in the function's namespace
import builtins
builtins.openai = mock_openai

# Define arguments for generate_summarized_reason function
ARGS = {
    'reasons': 'The model was uncertain because the input contained conflicting signals. The confidence threshold was not met.',
    'prompt': 'You need to summarize the given uncertain reasons from an LLM. You will be provided with the reasons. \n\nReasons:\n<REASONS>\n\nYou should give the reasons from a first-person perspective, as if you are the LLM that gives the provided responses and confidence scores.\n\nYou should keep your response concise and to the point. Your summarized reason should be in 1-3 sentences.\n \nPlease give your responses in the following format:\nReason: <REASON>\n'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
parse_response Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/utils/utils.py
code served (permissive licence) · get_code("df9fb4e8e291c1f4")
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 re

def parse_response(response):
    idx = response.rfind('I am')
    answer, confidence = (response[:idx], response[idx:])
    nums = re.findall('\\d+', confidence)
    if len(nums) != 1:
        return (answer, 0)
    return (answer, float(nums[0]))

# The function takes a single parameter: response (a string)
# It searches for the substring 'I am' using rfind
# It extracts numbers using regex from the confidence part
# It returns a tuple of (answer string, confidence float)

ARGS = {
    'response': 'This is my answer I am 85 percent confident'
}
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 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
parse_response_new Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/utils/utils.py
code served (permissive licence) · get_code("7f4e1be0da09e67d")
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 re

def parse_response_new(response, args=None):
    if args and args.r_tuning:
        if 'unsure' in response:
            return (response, '', 0)
        else:
            return (response, '', 10)
    self_reflection_idx = response.find('Self-reflection: ')
    confidence_idx = response.find('Confidence: ')
    self_reflection_str = response[self_reflection_idx + len('Self-reflection: '):confidence_idx]
    confidence_str = response[confidence_idx + len('Confidence: '):]
    if self_reflection_str == '' or confidence_str == '':
        return (response, self_reflection_str, 0)
    confidence = re.findall('\\d+', confidence_str)
    if len(confidence) != 1:
        return (response, self_reflection_str, 0)
    return (response, self_reflection_str, float(confidence[0]))


class ArgsConfig:
    def __init__(self, r_tuning=False):
        self.r_tuning = r_tuning


response_with_self_reflection = "Some initial text. Self-reflection: This is my reflection. Confidence: 85 percent"

args_config = ArgsConfig(r_tuning=False)

ARGS = {
    "response": response_with_self_reflection,
    "args": args_config
}
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 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
parse_summarized_response Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/evaluation/evaluate_reason.py
code served (permissive licence) · get_code("351da31d97b7a2c7")
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 logging

def parse_summarized_response(response):
    try:
        response = response.split('Reason:')
        return response[1].strip()
    except Exception as e:
        logging.error(e)
        return ''


# Setup code to construct valid arguments
ARGS = {
    'response': 'This is a summary. Reason: The main point is that we need to extract this part.'
}
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
preprocess_dataset Ran
ran; our contract draft was wrong, not the code
xu1868/SaySelf/evaluation/generate_reasons_for_evaluation.py
code served (permissive licence) · get_code("a942e23bce929ae1")
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 torch
import numpy as np

torch.manual_seed(0)

# Create a minimal args object with the required attributes
class Args:
    def __init__(self):
        self.enable_unsfted_model = False

# Create example data dict with required keys
examples = {
    'question': [
        'What is the capital of France?',
        'What is 2 + 2?'
    ],
    'answer': [
        'Paris',
        '4'
    ],
    'negative_answer': [
        'London',
        '5'
    ]
}

# Build ARGS dict
ARGS = {
    'examples': examples,
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
encode_with_files_format Not yet run
unverified (harvested, no recorded run)
xu1868/SaySelf/evaluation/evaluate.py
code served (permissive licence) · get_code("6ea8e572530aeb5b")
How it ran

no invocation recorded.

encode_with_prompt_completion_format Not yet run
unverified (harvested, no recorded run)
xu1868/SaySelf/training/finetune.py
code served (permissive licence) · get_code("119cad9954acc960")
How it ran

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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 12 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
encode_with_prompt_completion_format 4 other papers
1 dated earlier, 1 the same month, 2 later
2402.16705 (2024-02)
SelectIT: Selective Instruction Tuning for LLMs via Uncertainty-Aware Self-Reflection
2405.05008 (2024-05)
ADELIE: Aligning Large Language Models on Information Extraction
2406.15444 (2024-06)
Published at ICLR 2025 Workshop on Reasoning and Planning for LLMs CUTTING THROUGH THE NOISE: BOOSTING LLM PERFORMANCE ON MATH WORD PROBLEMS
and 1 more not named here

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

Large language models (LLMs) often generate inaccurate or fabricated information and generally fail to indicate their confidence, which limits their broader applications. Previous work has elicited confidence from LLMs by direct or self-consistency prompting, or constructing specific datasets for supervised finetuning. The prompting-based approaches have inferior performance, and the training-based approaches are limited to binary or inaccurate group-level confidence estimates. In this work, we present SaySelf, a novel training framework that teaches LLMs to express more fine-grained confidence estimates. In addition, beyond the confidence scores, SaySelf initiates the process of directing LLMs to produce selfreflective rationales that clearly identify gaps in their parametric knowledge and explain their uncertainty. This is achieved by using an LLM to automatically summarize the uncertainties in specific knowledge via natural language. The summarization is based on the analysis of the inconsistency in multiple sampled reasoning chains, and the resulting data is utilized for supervised fine-tuning. Moreover, we utilize reinforcement learning with a meticulously crafted reward function to calibrate the confidence estimates, motivating LLMs to deliver accurate, high-confidence predictions and to penalize overconfidence in erroneous outputs. Experimental results demonstrate the effectiveness of SaySelf in reducing the confidence calibration error and maintaining the task performance. The generated self-reflective rationales are also reasonable and can further contribute to the calibration. The code is made public at https://github.com/xu1868/SaySelf.

For agents

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

get_harvested_code_for_paper("2405.20974")
get_code_for_paper("2405.20974")
have("2405.20974")

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

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

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

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

Connect an agent — have() is free.