| U_bar_at_K |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
EVIEHub/LLM-Rationality/src/metrics/rational_gap.py code served (permissive licence) · get_code("4f36da571294cae2") How it ranRan 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 numpy as np
# Create a 2D utilities array with shape (M, n_max)
# M = 5 (number of samples), n_max = 8 (maximum number of columns)
utilities = np.array([
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
[0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85],
[0.12, 0.22, 0.32, 0.42, 0.52, 0.62, 0.72, 0.82],
[0.18, 0.28, 0.38, 0.48, 0.58, 0.68, 0.78, 0.88],
[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
], dtype=np.float32)
# K must be between 1 and n_max (8)
K = 3
ARGS = {
"utilities": utilities,
"K": K,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — 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
|
| build_B1_dataset_sizes |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/plotting/appendix.py code served (permissive licence) · get_code("ca4346c7c3b4c5d3") How it ranRan 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 json
from pathlib import Path
import tempfile
import os
# Create a temporary directory structure with mock result files
temp_dir = tempfile.mkdtemp()
results_path = Path(temp_dir)
# Create experiment directories and seed 0 result files
experiments = ['h1', 'h2', 'h3', 'h4']
datasets = ['alpaca_eval', 'ultrafeedback', 'gsm8k', 'math', 'matharena', 'humaneval']
for exp in experiments:
exp_dir = results_path / exp
exp_dir.mkdir(exist_ok=True)
# Create some result files for h1 and h2 (conversational datasets)
if exp in ['h1', 'h2']:
for ds in ['alpaca_eval', 'ultrafeedback']:
result = {
'dataset': ds,
'M': 300,
'per_prompt_U_bar_K': [{'scores': [0.5] * 64} for _ in range(300)]
}
filename = exp_dir / f'{ds}_seed0.json'
filename.write_text(json.dumps(result))
# Create result files for verifiable datasets
if exp in ['h1', 'h3']:
for ds, m_val in [('gsm8k', 1319), ('math', 1000), ('matharena', 100), ('humaneval', 164)]:
result = {
'dataset': ds,
'M': m_val,
'per_prompt_U_bar_K': [{'scores': [0.5] * 64} for _ in range(m_val)]
}
filename = exp_dir / f'{ds}_seed0.json'
filename.write_text(json.dumps(result))
# Create some sub-sampled files for h3 and h4
if exp in ['h3', 'h4']:
for ds in ['gsm8k', 'math']:
result = {
'dataset': ds,
'M': 200,
'per_prompt_U_bar_K': [{'scores': [0.5] * 64} for _ in range(200)]
}
filename = exp_dir / f'{ds}_sub_seed0.json'
filename.write_text(json.dumps(result))
ARGS = {
'results_dir': results_path,
'seed': 0,
}
- 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
|
| build_B4_gpu_hours |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/plotting/appendix.py code served (permissive licence) · get_code("1ab3ac7f8ab24ab5") How it ranRan 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 json
import tempfile
from pathlib import Path
# Create a temporary directory structure with compute_budget*.jsonl files
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name)
# Create a logs subdirectory
logs_dir = temp_path / "logs"
logs_dir.mkdir(exist_ok=True)
# Create compute_budget*.jsonl files with sample data
compute_budget_file = logs_dir / "compute_budget_001.jsonl"
with open(compute_budget_file, 'w') as f:
# Write sample records for h1, h2, h3, h4
f.write(json.dumps({
"experiment": "h1_exp_001",
"gpu_hours": 2.5,
"metadata": {"seed": 42}
}) + "\n")
f.write(json.dumps({
"experiment": "h2_exp_002",
"gpu_hours": 3.1,
"metadata": {"seed": 42}
}) + "\n")
f.write(json.dumps({
"experiment": "h3_exp_003",
"gpu_hours": 1.8,
"metadata": {"seed": 42}
}) + "\n")
f.write(json.dumps({
"experiment": "h4_exp_004",
"gpu_hours": 4.2,
"metadata": {"seed": 42}
}) + "\n")
# Write a duplicate that should be deduped
f.write(json.dumps({
"experiment": "h1_exp_001",
"gpu_hours": 2.5,
"metadata": {"seed": 42}
}) + "\n")
# Create results_dir as a sibling to logs
results_dir = temp_path / "results"
results_dir.mkdir(exist_ok=True)
ARGS = {
"results_dir": results_dir,
"seed": 0,
}
- 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
|
| compute_actual_utility |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/metrics/rational_gap.py code served (permissive licence) · get_code("3768f174c2e044de") How it ranRan 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 ActualUtilityEstimate. 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 numpy as np
from dataclasses import dataclass
@dataclass(frozen=True)
class ActualUtilityEstimate:
"""Expected utility $\\bar{U}_K$ of one reasoning strategy on one run.
``per_prompt_U_bar_K`` (shape ``(M,)``) is the only field a run must
persist: rational value risk is derived from a *pair* of these
(see :func:`compute_rational_value_risk`).
"""
U_bar_K: float
per_prompt_U_bar_K: np.ndarray
M: int
K: int
def compute_actual_utility(utilities: np.ndarray) -> ActualUtilityEstimate:
"""Compute $\\bar{U}_K$ from a run's $\\widehat{U}_L$ utility array.
Args:
utilities: Float array of shape ``(M, K)`` where entry ``(i, k)`` is $\\widehat{U}_L(x_i, y_{i,k})$.
Returns:
:class:`ActualUtilityEstimate` with the aggregate scalar and the per-prompt array.
Raises:
ValueError: If ``utilities`` is not 2D or is empty.
"""
if utilities.ndim != 2:
raise ValueError(f'utilities must be 2D of shape (M, K), got shape {utilities.shape}')
if utilities.size == 0:
raise ValueError('utilities array is empty')
M, K = utilities.shape
per_prompt_U_bar = utilities.mean(axis=1).astype(float, copy=False)
return ActualUtilityEstimate(U_bar_K=float(per_prompt_U_bar.mean()), per_prompt_U_bar_K=per_prompt_U_bar, M=M, K=K)
np.random.seed(0)
utilities_array = np.random.randn(4, 3).astype(np.float32)
ARGS = {
"utilities": utilities_array,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ActualUtilityEstimate — a ActualUtilityEstimate output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ActualUtilityEstimate 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
|
| compute_rational_value_risk |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/metrics/rational_gap.py code served (permissive licence) · get_code("6d0c6b6db5143644") How it ranRan 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 RationalValueRisk. 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 numpy as np
# Create small valid numpy arrays for the two per-prompt utility arrays
# M=5 prompts, each with utility values
reference_per_prompt_U_bar_K = np.array([0.8, 0.75, 0.9, 0.85, 0.7], dtype=np.float32)
per_prompt_U_bar_K = np.array([0.7, 0.8, 0.85, 0.75, 0.65], dtype=np.float32)
# Define ARGS dict with all parameters
ARGS = {
'reference_per_prompt_U_bar_K': reference_per_prompt_U_bar_K,
'per_prompt_U_bar_K': per_prompt_U_bar_K,
'K_ref': 100,
'K': 50,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type RationalValueRisk — a RationalValueRisk output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RationalValueRisk 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
|
| draw_rvr_stack |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/plotting/plot_h3.py code served (permissive licence) · get_code("592305d44f89bc1d") How it ranRan 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 PosixPath. 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 numpy as np
from pathlib import Path
import tempfile
# Create a temporary directory for figures
temp_dir = tempfile.mkdtemp()
figures_dir = Path(temp_dir)
# Construct panels: list of (title, xticklabels, {model_alias: (ys, es)})
panels = [
(
"Panel 1: Task A",
["0", "64", "128", "256"],
{
"llama3.1-8b-instruct": (np.array([0.5, 0.6, 0.7, 0.75]), np.array([0.02, 0.03, 0.02, 0.03])),
"qwen2.5-7b-instruct": (np.array([0.45, 0.55, 0.65, 0.7]), np.array([0.03, 0.03, 0.02, 0.04])),
"tulu3-8b-rlvr": (np.array([0.48, 0.58, 0.68, 0.72]), np.array([0.02, 0.02, 0.03, 0.03])),
}
),
(
"Panel 2: Task B",
["0", "64", "128", "256"],
{
"llama3.1-8b-instruct": (np.array([0.6, 0.65, 0.72, 0.78]), np.array([0.02, 0.03, 0.02, 0.03])),
"qwen2.5-7b-instruct": (np.array([0.55, 0.62, 0.68, 0.74]), np.array([0.03, 0.02, 0.03, 0.02])),
"tulu3-8b-rlvr": (np.array([0.58, 0.64, 0.7, 0.76]), np.array([0.02, 0.03, 0.02, 0.03])),
}
),
(
"Panel 3: Task C",
["0", "64", "128", "256"],
{
"llama3.1-8b-instruct": (np.array([0.7, 0.75, 0.8, 0.85]), np.array([0.01, 0.02, 0.02, 0.01])),
"qwen2.5-7b-instruct": (np.array([0.65, 0.72, 0.77, 0.82]), np.array([0.02, 0.02, 0.01, 0.02])),
"tulu3-8b-rlvr": (np.array([0.68, 0.74, 0.79, 0.84]), np.array([0.02, 0.01, 0.02, 0.01])),
}
),
]
ylims = {
"Panel 1: Task A": (0.0, 1.0),
"Panel 2: Task B": (0.0, 1.0),
"Panel 3: Task C": (0.0, 1.0),
}
ARGS = {
"panels": panels,
"xlabel": "Temperature",
"figures_dir": figures_dir,
"stem": "test_rvr_stack",
"rotate": 45,
"ylims": ylims,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
|
| load_paths |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/pipeline/paths.py code served (permissive licence) · get_code("8b88695e272a574d") How it ranRan 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 Paths. 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
import tempfile
from pathlib import Path
import yaml
# Create a temporary directory and a temporary YAML config file
temp_dir = tempfile.mkdtemp()
temp_config_path = Path(temp_dir) / "paths.yaml"
# Create a valid paths configuration
paths_config = {
'outputs_root': str(Path(temp_dir) / 'outputs'),
'samples_dir': str(Path(temp_dir) / 'outputs' / 'data' / 'samples'),
'results_dir': str(Path(temp_dir) / 'outputs' / 'results'),
'raw_data_dir': str(Path(temp_dir) / 'outputs' / 'data' / 'raw'),
'logs_dir': str(Path(temp_dir) / 'outputs' / 'logs'),
}
# Write the YAML config file
with open(temp_config_path, 'w') as f:
yaml.dump(paths_config, f)
# Define ARGS dictionary with all parameters for load_paths
ARGS = {
'path': temp_config_path,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- yaml — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Paths — a Paths output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Paths 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
|
| resolve_reference |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/plotting/tables.py code served (permissive licence) · get_code("c318d7a4f2220ab0") How it ranRan 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 Run. 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 numpy as np
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class Run:
"""One run's per-prompt utilities, the budget, and which prompts it covered."""
per_prompt: np.ndarray
max_tokens: Optional[int]
prompt_indices: Optional[tuple[int, ...]] = None
# Define MODEL_ALIASES for the _get function
MODEL_ALIASES = {
'deepseek-v4-pro': ['deepseek-v4'],
'gpt-4': ['gpt4', 'gpt-4-turbo'],
}
# Create sample Run objects
per_prompt_array = np.array([0.8, 0.9, 0.7, 0.85])
run_verifiable = Run(
per_prompt=per_prompt_array,
max_tokens=2048,
prompt_indices=(0, 1, 2, 3)
)
run_conversational = Run(
per_prompt=np.array([0.75, 0.82, 0.88, 0.79]),
max_tokens=4096,
prompt_indices=(0, 1, 2, 3)
)
# Create arrays dict with reference runs for conversational datasets
arrays = {
('deepseek-v4-pro', 'conv_judge-llm', 4096): run_conversational,
('gpt-4', 'conv_judge-llm', 4096): Run(
per_prompt=np.array([0.85, 0.90, 0.92, 0.88]),
max_tokens=4096,
prompt_indices=(0, 1, 2, 3)
),
}
# Test cases
ARGS = {
'dataset': 'gsm8k', # verifiable dataset
'act': run_verifiable,
'arrays': arrays,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Run — a Run output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Run 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
|
| setup_run_logger |
Ran ran; our contract draft was wrong, not the code |
EVIEHub/LLM-Rationality/src/pipeline/logging_utils.py code served (permissive licence) · get_code("b12ba22f6c1e30d6") How it ranRan 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 logging
from datetime import datetime, timezone
from pathlib import Path
import tempfile
# Create a temporary directory for logs
temp_dir = tempfile.mkdtemp()
logs_dir = Path(temp_dir)
ARGS = {
'logs_dir': logs_dir,
'experiment': 'test_experiment',
'console_level': logging.INFO,
'timestamp': '20240115_120000Z'
}
- 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
|
| cache_exists |
Not yet run unverified (harvested, no recorded run) |
EVIEHub/LLM-Rationality/src/pipeline/cache.py code served (permissive licence) · get_code("23a93981a4df56cd") How it ran |
| cache_path |
Not yet run unverified (harvested, no recorded run) |
EVIEHub/LLM-Rationality/src/pipeline/cache.py code served (permissive licence) · get_code("19ceb99eed6f5ffe") How it ran |
| extract_answer_key |
Not yet run unverified (harvested, no recorded run) |
EVIEHub/LLM-Rationality/src/metrics/h3.py code served (permissive licence) · get_code("7a15b71811b6f05a") How it ran |
| self_consistency_utility_matrix |
Not yet run unverified (harvested, no recorded run) |
EVIEHub/LLM-Rationality/src/metrics/h3.py code served (permissive licence) · get_code("a8c849b42d0ceff8") How it ran |
| supports_answer_key_extraction |
Not yet run unverified (harvested, no recorded run) |
EVIEHub/LLM-Rationality/src/metrics/h3.py code served (permissive licence) · get_code("5cd2476ace38516d") How it ran |
| write_cache |
Not yet run unverified (harvested, no recorded run) |
EVIEHub/LLM-Rationality/src/pipeline/cache.py code served (permissive licence) · get_code("7807ae334816d10b") How it ran |