SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.11493 · 2024

Benchmarking Knowledge Boundary for Large Language Models: A Different Perspective on Model Evaluation

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 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, 1 violated it and 0 have no contract verdict; 10 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2402.11493.json · badge: /api/ran/2402.11493.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
pkulcwmzx/knowledge-boundary canonical (classifier label)
classifier basis: census
12 ran · 2 no recorded run
FunctionStatusWhere it lives
alcuna2pairs Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils_datafile.py
code served (permissive licence) · get_code("1c8790831419aa34")
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. 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 the expected structure
temp_dir = tempfile.mkdtemp()
json_path = os.path.join(temp_dir, "test_data.json")

# Create sample data matching the expected structure
data = {
    "item1": [
        {
            "form": "multi-choice",
            "question": "What is 2+2?",
            "answers": [4, 5, 6]
        },
        {
            "form": "open-ended",
            "question": "Explain gravity",
            "answers": "Gravity is a force"
        }
    ],
    "item2": [
        {
            "form": "multi-choice",
            "question": "What is the capital of France?",
            "answers": ["Paris", "London", "Berlin"]
        },
        {
            "form": "open-ended",
            "question": "What is AI?",
            "answers": "AI is artificial intelligence"
        }
    ]
}

with open(json_path, 'w') as f:
    json.dump(data, f)

ARGS = {
    "jsonpath": json_path,
    "question_type": "multi-choice"
}
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 list — a list 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
batch_index Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pkulcwmzx/knowledge-boundary/utils.py
code served (permissive licence) · get_code("042a558be7481c16")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) 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

torch.manual_seed(0)

# For the 3D case: target_tensor should be indexable by [range_tensor_1, range_tensor_2, index_tensor]
# index_tensor has shape (shape_1, shape_2, shape_3)
# range_tensor_1 has shape (shape_1, shape_2, shape_3) with values 0 to shape_1-1
# range_tensor_2 has shape (shape_1, shape_2, shape_3) with values 0 to shape_2-1
# So target_tensor needs shape (shape_1, shape_2, ...)

# Let's use a 3D case: shape_1=2, shape_2=3, shape_3=4
shape_1, shape_2, shape_3 = 2, 3, 4

# target_tensor should have at least 3 dimensions
# The indexing is target_tensor[range_tensor_1, range_tensor_2, index_tensor]
# where index_tensor values are indices into the third dimension
# So target_tensor shape should be (shape_1, shape_2, max_index_value)
target_tensor_3d = torch.randn(shape_1, shape_2, 5)

# index_tensor has shape (2, 3, 4) with values that index into dim 2 of target_tensor
index_tensor_3d = torch.randint(0, 5, (shape_1, shape_2, shape_3)).long()

# For the 2D case
# target_tensor[range_vector, index_tensor] where range_vector shape is (shape_0, 1) and index_tensor shape is (shape_0, shape_1)
# This means target_tensor should have shape (shape_0, shape_1) or compatible
shape_0 = 2
target_tensor_2d = torch.randn(shape_0, 4)
index_tensor_2d = torch.randint(0, 4, (shape_0, 3)).long()

# Test with 3D case
ARGS = {
    "target_tensor": target_tensor_3d,
    "index_tensor": index_tensor_3d,
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
batch_questions Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils.py
code served (permissive licence) · get_code("e11d3d97fcb16519")
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)

class StandInTokenizer:
    def __init__(self):
        self.pad_token = None
        self.vocab_size = 1000
    
    def add_special_tokens(self, special_tokens):
        if 'pad_token' in special_tokens:
            self.pad_token = special_tokens['pad_token']
    
    def __call__(self, texts, padding=None, truncation=None, return_tensors=None):
        # Simple mock tokenizer that returns token IDs
        batch_size = len(texts) if isinstance(texts, list) else 1
        seq_length = 8
        
        # Create dummy token IDs
        token_ids = torch.randint(0, self.vocab_size, (batch_size, seq_length))
        attention_mask = torch.ones_like(token_ids)
        
        result = {
            'input_ids': token_ids,
            'attention_mask': attention_mask
        }
        return result

class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(1000, 16)
        self.linear = nn.Linear(16, 4)
    
    def forward(self, input_ids, attention_mask=None):
        return self.embedding(input_ids)

questions = [
    "What is machine learning?",
    "How does deep learning work?"
]

model = StandInModel()
tokenizer = StandInTokenizer()

ARGS = {
    'questions': questions,
    'model': model,
    'tokenizer': tokenizer
}
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
evaluate Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils_eval.py
code served (permissive licence) · get_code("833ecf7a36f47a2f")
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 int, ndim 0, dtype family int, 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 torch.nn as nn

torch.manual_seed(0)

# Define a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_dim=4):
        super().__init__()
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, input_embeds):
        # input_embeds shape: (batch_size, seq_len, hidden_dim)
        # output logits shape: (batch_size, seq_len, vocab_size)
        logits = self.linear(input_embeds)
        
        # Create a simple output object with logits attribute
        class ModelOutput:
            pass
        
        output = ModelOutput()
        output.logits = logits
        return output

# Minimal tokenizer (not actually used in the function body)
class MinimalTokenizer:
    pass

# Create instances
model = MinimalModel(vocab_size=100, hidden_dim=4)
tokenizer = MinimalTokenizer()

# Set up parameters
batch_size = 2
seq_len = 5
output_length = 2
hidden_dim = 4
vocab_size = 100

# Create full_embeddings: (batch_size, seq_len, hidden_dim)
full_embeddings = torch.randn(batch_size, seq_len, hidden_dim)

# Create labels that match the output sequence we expect to match
# labels shape: (output_length,) since we compare with gen_output[i, :]
labels = torch.tensor([42, 55])

# candidate_tokens (not used in function, but required parameter)
candidate_tokens = list(range(vocab_size))

# tok_id (not used in function, but required parameter)
tok_id = 0

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "candidate_tokens": candidate_tokens,
    "full_embeddings": full_embeddings,
    "tok_id": tok_id,
    "labels": labels,
    "output_length": output_length,
}
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 int, ndim 0, dtype family int, 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
get_discriminate Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/run_baseline_prompt.py
code served (permissive licence) · get_code("93d0ddd0909385c0")
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 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - prompts: used with list(map(...)) so needs to be iterable
# - answer: concatenated with each prompt string using f-string
# Both are used in string operations, so they should be strings

# Create minimal valid arguments
prompts = [
    "Is 2 + 2 equal to 4? ",
    "Is the Earth flat? "
]

answer = "Yes."

ARGS = {
    "prompts": prompts,
    "answer": answer
}
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 list, ndim 1, dtype family float — 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
get_raw_embedding_table Ran
ran, honoured the contract we drafted
pkulcwmzx/knowledge-boundary/model_utils.py
code served (permissive licence) · get_code("31e17daaa5baa13e")
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 Parameter, ndim 2, 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

torch.manual_seed(0)

class SimpleEmbeddingModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(num_embeddings=10, embedding_dim=4)
    
    def get_input_embeddings(self):
        return self.embedding

model = SimpleEmbeddingModel()

ARGS = {
    'model': model
}
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 Parameter, ndim 2, dtype family float — no output shape is stated: observe_signature.py recorded Tensor ndim 2, which disagrees with the fixture run
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
log_perplexity_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pkulcwmzx/knowledge-boundary/utils_loss.py
code served (permissive licence) · get_code("e82788514c8b7bc2")
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 Tensor, 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 torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Set up tensor arguments
batch_size = 2
seq_len = 5
vocab_size = 4

# logits: shape [batch_size, seq_len, vocab_size]
# These are raw model outputs before softmax
logits = torch.randn(batch_size, seq_len, vocab_size)

# prompts: shape [batch_size, seq_len]
# These are token indices that we'll use to gather log probs
prompts = torch.randint(0, vocab_size, (batch_size, seq_len))

# question_len: shape [batch_size]
# Length of each sequence in the batch
question_len = torch.tensor([4, 3])

ARGS = {
    "logits": logits,
    "prompts": prompts,
    "question_len": question_len,
}
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 Tensor, 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
log_prob_loss Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils_loss.py
code served (permissive licence) · get_code("facc8bf34362700f")
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 Tensor, 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 torch.nn as nn

torch.manual_seed(0)

# Create small tensors
# logits: shape (batch=2, seq_len=5, vocab_size=4)
# labels: shape (batch=2, seq_len=5)
logits = torch.randn(2, 5, 4)
labels = torch.randint(0, 4, (2, 5))

# Create a loss function
# The function reshapes to (-1, vocab_size) and (-1,) so we need CrossEntropyLoss
loss_fct = nn.CrossEntropyLoss()

# Temperature parameter
temp = 1.0

ARGS = {
    "logits": logits,
    "labels": labels,
    "loss_fct": loss_fct,
    "temp": temp
}
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 Tensor, 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
pass_test Ran
ran, violated the contract we drafted
pkulcwmzx/knowledge-boundary/utils_eval.py
code served (permissive licence) · get_code("e7c7db7209eba73f")
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.

import torch

torch.manual_seed(0)

class ArgsStandIn:
    def __init__(self):
        self.device = 'cpu'

# Create args object
args = ArgsStandIn()

# Create decode_toks: shape (batch_size=2, sequence_length=5)
# Contains token indices
decode_toks = torch.tensor([
    [1, 2, 3, 4, 5],
    [2, 3, 4, 5, 6]
], dtype=torch.long)

# Create tokenized_ans: list of lists of token indices
# Each sublist represents tokenized answer to match against
tokenized_ans = [
    [2, 3],      # This will match in decode_toks[0, 1:3] and decode_toks[1, 0:2]
    [4, 5],      # This will match in decode_toks[0, 3:5] and decode_toks[1, 2:4]
]

ARGS = {
    'args': args,
    'decode_toks': decode_toks,
    'tokenized_ans': tokenized_ans
}
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 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
rome2pairs Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils_datafile.py
code served (permissive licence) · get_code("d0acf7ffcbea7312")
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. 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 the expected structure
temp_dir = tempfile.mkdtemp()
jsonpath = os.path.join(temp_dir, "rome_data.json")

# Build sample data matching the function's expected structure
sample_data = [
    {
        "paraphrase_prompts": [
            "What is the capital of France?",
            "Name the capital of France."
        ],
        "requested_rewrite": {
            "prompt": "The capital of {} is",
            "subject": "France",
            "relation_id": "P36",
            "target_true": {
                "str": "Paris",
                "id": "Q90"
            },
            "target_new": {
                "str": "Lyon",
                "id": "Q322"
            }
        }
    },
    {
        "paraphrase_prompts": [
            "Who wrote Shakespeare?",
            "Shakespeare was written by?"
        ],
        "requested_rewrite": {
            "prompt": "{} wrote many plays",
            "subject": "William Shakespeare",
            "relation_id": "P31",
            "target_true": {
                "str": "playwright",
                "id": "Q11565"
            },
            "target_new": {
                "str": "author",
                "id": "Q36180"
            }
        }
    }
]

# Write the sample data to the temporary JSON file
with open(jsonpath, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "jsonpath": jsonpath,
    "real_data": False
}
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 list — a list 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
similarity_loss Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils_loss.py
code served (permissive licence) · get_code("3bb211327ce4cced")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch import nn

torch.manual_seed(0)

# Create logits tensor: shape (batch_size=2, seq_len=5, vocab_size=4)
logits = torch.randn(2, 5, 4)

# Create ref_logits tensor: shape (batch_size=2, embedding_dim=4)
ref_logits = torch.randn(2, 4)

# Create question_len: indices into the sequence dimension for each batch item
question_len = torch.tensor([1, 3])

ARGS = {
    'logits': logits,
    'ref_logits': ref_logits,
    'question_len': question_len,
}
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 Tensor, 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
test_one_case Ran
ran; our contract draft was wrong, not the code
pkulcwmzx/knowledge-boundary/utils_eval.py
code served (permissive licence) · get_code("855876231279297b")
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. 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
import torch.nn.functional as F

torch.manual_seed(0)

class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 5)
    
    def forward(self, inputs_embeds):
        # inputs_embeds shape: (batch_size, seq_len, embedding_dim)
        # output logits shape: (batch_size, seq_len, vocab_size)
        batch_size, seq_len, emb_dim = inputs_embeds.shape
        logits = self.linear(inputs_embeds)
        
        # Create a simple output object with logits attribute
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output

model = StandInModel()

# test_embeddings: (batch_size=2, seq_len=3, embedding_dim=4)
test_embeddings = torch.randn(2, 3, 4)

# batched_inverse_label_mask: boolean mask for (batch_size=2, seq_len=2)
# The function uses log_probs[:, :-1, :] which removes last token, so seq_len becomes 2
batched_inverse_label_mask = torch.tensor([
    [True, False],
    [False, True]
])

ARGS = {
    "model": model,
    "test_embeddings": test_embeddings,
    "batched_inverse_label_mask": batched_inverse_label_mask
}
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 — 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_model_and_tokenizer Not yet run
unverified (harvested, no recorded run)
pkulcwmzx/knowledge-boundary/model_utils.py
code served (permissive licence) · get_code("3244f3e967f2f156")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
pkulcwmzx/knowledge-boundary/args.py
code served (permissive licence) · get_code("63e2574a77d8e69c")
How it ran

no invocation recorded.

Also present in other papers' code

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

In recent years, substantial advancements have been made in the development of large language models, achieving remarkable performance across diverse tasks. To evaluate the knowledge ability of language models, previous studies have proposed lots of benchmarks based on question-answering pairs. We argue that it is not reliable and comprehensive to evaluate language models with a fixed question or limited paraphrases as the query, since language models are sensitive to prompt. Therefore, we introduce a novel concept named knowledge boundary to encompass both prompt-agnostic and prompt-sensitive knowledge within language models. Knowledge boundary avoids prompt sensitivity in language model evaluations, rendering them more dependable and robust. To explore the knowledge boundary for a given model, we propose projected gradient descent method with semantic constraints, a new algorithm designed to identify the optimal prompt for each piece of knowledge. Experiments demonstrate a superior performance of our algorithm in computing the knowledge boundary compared to existing methods. Furthermore, we evaluate the ability of multiple language models in several domains with knowledge boundary.

For agents

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

get_harvested_code_for_paper("2402.11493")
get_code_for_paper("2402.11493")
have("2402.11493")

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

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

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

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

Connect an agent — have() is free.