SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.01478 · ICLR · 2025

SePer: MEASURE RETRIEVAL UTILITY THROUGH THE LENS OF SEMANTIC PERPLEXITY REDUCTION

Hao Liu, Hui Xiong, Jinhui Ye, Yijie Xu, Lu Dai

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 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; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; 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/2503.01478.json · badge: /api/ran/2503.01478.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
sepermetric/seper canonical (classifier label)
classifier basis: classifier_2025
2 ran · 2 no recorded run
FunctionStatusWhere it lives
check_entail Ran
ran; our contract draft was wrong, not the code
sepermetric/seper/seper/calculate.py
code served (permissive licence) · get_code("a773ca8bb8d56c52")
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 tuple. 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)

class MockEntailmentModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def check_implication(self, text1, text2):
        # Returns (implication_tensor, logits_tensor)
        # implication should be tensor with values in [0, 1, 2]
        implication = torch.tensor([[2]], dtype=torch.long)
        logits = torch.randn(1, 3)
        return implication, logits

model = MockEntailmentModel()

ARGS = {
    'text1': 'The cat is on the mat',
    'text2': 'A feline is resting on a rug',
    'model': model,
    'entailment_option': 'bi'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
get_semantic_ids Ran
ran, honoured the contract we drafted
sepermetric/seper/seper/uncertainty_measures/semantic_entropy.py
code served (permissive licence) · get_code("332481886769d3cb")
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 list, ndim 1, dtype family int; 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

# Define a mock model that implements check_implication method
class MockEntailmentModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def check_implication(self, text1, text2, example=None):
        """
        Returns a tuple of (implication_score, confidence).
        implication_score can be 0, 1, or 2.
        - 0: no implication
        - 1: partial implication
        - 2: full entailment
        """
        # Simple mock logic based on string length for determinism
        len_diff = abs(len(text1) - len(text2))
        if len_diff < 2:
            implication = 2  # semantically equivalent
        elif len_diff < 5:
            implication = 1  # partial implication
        else:
            implication = 0  # no implication
        
        confidence = 0.95
        return implication, confidence

# Create mock model
torch.manual_seed(0)
model = MockEntailmentModel()

# Create a list of strings to group by semantic meaning
strings_list = [
    "The cat is sleeping",
    "A cat is sleeping",
    "The dog is running",
    "Dogs are running"
]

# Define ARGS dictionary with all required parameters
ARGS = {
    "strings_list": strings_list,
    "model": model,
    "strict_entailment": False,
    "example": None
}
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 list, ndim 1, dtype family int — a list 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
calculate_uncertainty_hard_batch Not yet run
unverified (harvested, no recorded run)
sepermetric/seper/seper/calculate.py
code served (permissive licence) · get_code("53249f8daa38bc56")
How it ran

no invocation recorded.

calculate_uncertainty_soft_batch Not yet run
unverified (harvested, no recorded run)
sepermetric/seper/seper/calculate.py
code served (permissive licence) · get_code("9a65641b658a37eb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 4 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-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

Large Language Models (LLMs) have demonstrated improved generation performance by incorporating externally retrieved knowledge, a process known as retrieval-augmented generation (RAG). Despite the potential of this approach, existing studies evaluate RAG effectiveness by 1) assessing retrieval and generation components jointly, which obscures retrieval's distinct contribution, or 2) examining retrievers using traditional metrics such as NDCG, which creates a gap in understanding retrieval's true utility in the overall generation process. To address the above limitations, in this work, we introduce an automatic evaluation method that measures retrieval utility through the lens of information gain within the RAG framework. Specifically, we propose Semantic Perplexity (SePer), a metric that captures the LLM's internal belief about the correctness of the generated answer. We then quantify the utility of retrieval by the extent to which it reduces semantic perplexity post retrieval. Extensive experiments demonstrate that SePer not only aligns closely with human preferences but also offers a more precise and efficient evaluation of retrieval utility across diverse RAG scenarios.

For agents

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

get_harvested_code_for_paper("2503.01478")
get_code_for_paper("2503.01478")
have("2503.01478")

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

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

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

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

Connect an agent — have() is free.