| alpha_curve |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/analyze_sigma_diag.py code served (permissive licence) · get_code("af3818432452a307") 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 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 numpy as np
# Construct rows_ml: a list of dictionaries with 'alpha' and 'worst_mahal' keys
rows_ml = [
{'alpha': 0.1, 'worst_mahal': 1.5},
{'alpha': 0.1, 'worst_mahal': 2.3},
{'alpha': 0.1, 'worst_mahal': 1.8},
{'alpha': 0.5, 'worst_mahal': 3.2},
{'alpha': 0.5, 'worst_mahal': 2.9},
{'alpha': 1.0, 'worst_mahal': 4.1},
{'alpha': 1.0, 'worst_mahal': 3.9},
{'alpha': 1.0, 'worst_mahal': 4.5},
]
ARGS = {
'rows_ml': rows_ml,
'by': 'worst_mahal'
}
- 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 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
|
| by_modellayer |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/analyze_sigma_diag.py code served (permissive licence) · get_code("49139a918e0add33") 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 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)
# Analyzing the function:
# - It takes 'rows' as a parameter
# - rows is iterable
# - Each element r in rows must be dict-like with keys 'model' and 'layer'
# - The function groups rows by (model, layer) tuple
# Create sample rows with 'model' and 'layer' keys
rows = [
{'model': 'bert', 'layer': 0, 'value': 1.5},
{'model': 'bert', 'layer': 1, 'value': 2.3},
{'model': 'bert', 'layer': 0, 'value': 1.8},
{'model': 'gpt2', 'layer': 0, 'value': 3.1},
{'model': 'gpt2', 'layer': 2, 'value': 2.9},
]
ARGS = {
'rows': rows
}
- 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
|
| compute_baseline_stats |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/eval_utility.py code served (permissive licence) · get_code("73375b11ddfd65e7") 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. 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)
# Define a minimal model that has a .logits attribute
class MockModel(nn.Module):
def __init__(self, vocab_size=256, hidden_dim=4):
super().__init__()
self.embedding = nn.Embedding(vocab_size, hidden_dim)
self.linear = nn.Linear(hidden_dim, vocab_size)
def forward(self, x):
# x shape: (batch, seq_len)
embedded = self.embedding(x) # (batch, seq_len, hidden_dim)
logits = self.linear(embedded) # (batch, seq_len, vocab_size)
# Return an object with .logits attribute
class Output:
pass
out = Output()
out.logits = logits
return out
# Create model
model = MockModel(vocab_size=256, hidden_dim=4)
# Create a minimal dataset - list of token tensors
# Each token tensor should have at least prefix_len + 1 tokens
dataset = [
torch.randint(0, 256, (100,)), # First sample with 100 tokens
torch.randint(0, 256, (100,)), # Second sample with 100 tokens
]
device = 'cpu'
prefix_len = 32
ARGS = {
'model': model,
'dataset': dataset,
'device': device,
'prefix_len': prefix_len,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, tqdm — 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
|
| compute_gradient_covariance |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
okezue/tcc-research/two_channel/compute_subspace.py code served (permissive licence) · get_code("2f5d8bf2db8aad63") 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 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)
# Build a minimal model that satisfies the function's needs
class MiniTransformer(nn.Module):
def __init__(self, hidden_size=4, vocab_size=100, n_layers=2):
super().__init__()
self.config = type('Config', (), {'hidden_size': hidden_size})()
self.transformer = type('Transformer', (), {})()
# Create minimal transformer blocks
self.transformer.h = nn.ModuleList([
nn.Linear(hidden_size, hidden_size) for _ in range(n_layers)
])
self.embedding = nn.Embedding(vocab_size, hidden_size)
self.lm_head = nn.Linear(hidden_size, vocab_size)
def forward(self, x):
# x shape: (batch, seq_len)
h = self.embedding(x) # (batch, seq_len, hidden_size)
# Pass through transformer blocks
for block in self.transformer.h:
h = block(h)
logits = self.lm_head(h) # (batch, seq_len, vocab_size)
return type('Output', (), {'logits': logits})()
# Build minimal tokenizer
class MiniTokenizer:
def encode(self, text):
return torch.tensor([1, 2, 3])
# Create model and tokenizer
model = MiniTransformer(hidden_size=4, vocab_size=100, n_layers=2)
tokenizer = MiniTokenizer()
# Create dataset: list of token tensors
# Each element should have at least prefix_len + 1 tokens
dataset = [
torch.randint(0, 100, (40,), dtype=torch.long),
torch.randint(0, 100, (40,), dtype=torch.long),
torch.randint(0, 100, (40,), dtype=torch.long),
]
ARGS = {
'model': model,
'tokenizer': tokenizer,
'layer_idx': 0,
'dataset': dataset,
'prefix_len': 32,
'device': 'cpu',
'max_samples': 2,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, tqdm — 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
|
| embed_pool |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
okezue/tcc-research/two_channel/exp_attack_defense.py code served (permissive licence) · get_code("c0789119cb1c3b0b") 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 Tensor, ndim 2, dtype family float, shape (2, 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
import torch.nn as nn
from unittest.mock import Mock, MagicMock
torch.manual_seed(0)
# Build a minimal model with a layer that can be hooked
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.layer1 = nn.Linear(4, 4)
self.layer2 = nn.Linear(4, 4)
def forward(self, x):
x = self.layer1(x)
x = self.layer2(x)
return x
model = SimpleModel()
# Create a small pool of sequences (list of tensors)
# Each sequence should be at least ctx=32 long, but we'll make them shorter
# and the function uses seq[:ctx], so we need at least ctx tokens
# Let's create sequences of length 32 with embedding dim 4
pool = [
torch.randn(32, 4),
torch.randn(32, 4),
]
# Layer specification - use 'layer2' as the target layer
layer = 'layer2'
# Device - CPU only
dev = 'cpu'
# U_B - optional projection matrix for subspace
# Should be shape (hidden_dim, subspace_dim) for projection
U_B = torch.randn(4, 2)
# Mode - one of 'full', 'behavior', 'identity'
mode = 'full'
# Context length
ctx = 32
# Mock get_layer_block to return the layer, layer index, and something else
def mock_get_layer_block(model, layer_name):
if layer_name == 'layer2':
return model.layer2, 1, None
return None, -1, None
# Patch the function in the module
import sys
import types
two_channel_mock = types.ModuleType('two_channel')
compute_subspace_mock = types.ModuleType('compute_subspace')
compute_subspace_mock.get_layer_block = mock_get_layer_block
two_channel_mock.compute_subspace = compute_subspace_mock
sys.modules['two_channel'] = two_channel_mock
sys.modules['two_channel.compute_subspace'] = compute_subspace_mock
ARGS = {
'model': model,
'pool': pool,
'layer': layer,
'dev': dev,
'U_B': U_B,
'mode': mode,
'ctx': ctx,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, tqdm, two_channel — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
|
| get_layer_block |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/adjacency_builder_v2.py code served (permissive licence) · get_code("6e8b81f3837f0c7b") 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 Linear. 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)
# Create a simple model with transformer.h structure
class SimpleTransformer(nn.Module):
def __init__(self, num_layers=3):
super().__init__()
self.transformer = nn.Module()
self.transformer.h = nn.ModuleList([
nn.Linear(4, 4) for _ in range(num_layers)
])
model = SimpleTransformer(num_layers=3)
layer = 1
ARGS = {
'model': model,
'layer': layer
}
- 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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
|
| get_layer_block |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/compute_subspace.py code served (permissive licence) · get_code("141f652e9aaad06f") 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 torch
import torch.nn as nn
torch.manual_seed(0)
# Build a model with transformer.h architecture
class TransformerBlock(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.linear = nn.Linear(hidden_size, hidden_size)
def forward(self, x):
return self.linear(x)
class TransformerModel(nn.Module):
def __init__(self, num_blocks=5, hidden_size=4):
super().__init__()
self.transformer = nn.Module()
self.transformer.h = nn.ModuleList([
TransformerBlock(hidden_size) for _ in range(num_blocks)
])
def forward(self, x):
for block in self.transformer.h:
x = block(x)
return x
model = TransformerModel(num_blocks=5, hidden_size=4)
layer_idx = 2
ARGS = {
'model': model,
'layer_idx': layer_idx
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_subspace |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
okezue/tcc-research/two_channel/exp_attack_defense.py code served (permissive licence) · get_code("358c50879ad84ef7") 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. 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)
# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
def __init__(self):
super().__init__()
self.config = type('Config', (), {
'hidden_size': 4,
'vocab_size': 8
})()
self.transformer = nn.Module()
self.transformer.ln_f = nn.LayerNorm(4)
self.model = nn.Module()
self.model.norm = nn.LayerNorm(4)
self.lm_head = nn.Linear(4, 8)
self.embedding = nn.Embedding(8, 4)
self.blocks = nn.ModuleList([
nn.Linear(4, 4),
nn.Linear(4, 4)
])
def forward(self, x):
# x shape: (batch, seq_len)
batch_size, seq_len = x.shape
# Embedding lookup
h = self.embedding(x) # (batch, seq_len, hidden_size)
# Pass through first block
for block in self.blocks:
h = block(h)
return h
# Create a tokenizer stub (not really used in function)
class MinimalTokenizer:
def encode(self, text):
return torch.tensor([1, 2, 3, 4, 5])
# Create minimal dataset - list of token sequences
ds = [
torch.randint(0, 8, (5,)),
torch.randint(0, 8, (5,)),
]
# Mock get_layer_block function
import sys
from unittest.mock import MagicMock
class MockModule:
def register_forward_hook(self, fn):
class Hook:
def remove(self):
pass
return Hook()
def mock_get_layer_block(model, layer):
blk = model.blocks[0]
li = 0
nl = len(model.blocks)
return blk, li, nl
# Inject the mock into a fake module
import types
mock_module = types.ModuleType('two_channel.compute_subspace')
mock_module.get_layer_block = mock_get_layer_block
sys.modules['two_channel.compute_subspace'] = mock_module
sys.modules['two_channel'] = types.ModuleType('two_channel')
model = MinimalModel()
tok = MinimalTokenizer()
dev = 'cpu'
layer = 0
ARGS = {
'model': model,
'tok': tok,
'ds': ds,
'layer': layer,
'dev': dev,
'k': 2,
'n_cal': 2
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, tqdm, two_channel — 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
|
| hidden_at_layer |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/adjacency_builder_v2.py code served (permissive licence) · get_code("6263d79619c3195f") 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 Tensor, ndim 2, dtype family float, shape (2, 5) 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 a simple model with a block that we can hook into
class SimpleBlock(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 5)
def forward(self, x):
return self.linear(x)
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.embedding = nn.Embedding(10, 4)
self.blk = SimpleBlock()
def forward(self, ids):
x = self.embedding(ids)
x = self.blk(x)
return x
model = SimpleModel()
blk = model.blk
# Create small input tensor: batch size 2, sequence length 3, token indices 0-9
ids = torch.randint(0, 10, (2, 3))
ARGS = {
"model": model,
"blk": blk,
"ids": ids,
}
- 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 2, dtype family float, shape (2, 5) — shape (2, 5) 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
|
| hidden_with_logits |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/adjacency_builder_v2.py code served (permissive licence) · get_code("372287728c9df8ab") 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. 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)
# Build a minimal model that:
# 1. Accepts ids as input
# 2. Returns an object with .logits attribute
# 3. Works with forward hooks that capture intermediate outputs
class MinimalBlock(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 5)
def forward(self, x):
return self.linear(x)
class MinimalModel(nn.Module):
def __init__(self):
super().__init__()
self.embedding = nn.Embedding(10, 4)
self.blk = MinimalBlock()
self.head = nn.Linear(5, 6)
def forward(self, ids):
x = self.embedding(ids) # (batch, seq, 4)
x = self.blk(x) # (batch, seq, 5)
logits = self.head(x) # (batch, seq, 6)
class Output:
pass
out = Output()
out.logits = logits
return out
model = MinimalModel()
model.eval()
# Create a block reference - should be the same as model.blk
blk = model.blk
# Create input ids: shape (batch_size=2, seq_len=3)
ids = torch.randint(0, 10, (2, 3), dtype=torch.long)
ARGS = {
'model': model,
'blk': blk,
'ids': ids
}
- 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
|
| load_all |
Ran ran; our contract draft was wrong, not the code |
okezue/tcc-research/two_channel/analyze_sigma_diag.py code served (permissive licence) · get_code("9aafed64160f8319") 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 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 json
import os
import tempfile
import shutil
# Create a temporary directory for test data
temp_dir = tempfile.mkdtemp()
# Create sample JSON files matching the expected format
sigma_data_1 = {
'model': 'model_v1',
'layer': 'layer_0',
'd': 128,
'F_diag_sum': 42.5,
'rows': [
{'sigma': 0.1, 'value': 1.0},
{'sigma': 0.2, 'value': 2.0}
]
}
sigma_data_2 = {
'model': 'model_v2',
'layer': 'layer_1',
'd': 256,
'F_diag_sum': 85.3,
'rows': [
{'sigma': 0.15, 'value': 1.5}
]
}
# Write test JSON files
with open(os.path.join(temp_dir, 'sigma_diag_0.json'), 'w') as f:
json.dump(sigma_data_1, f)
with open(os.path.join(temp_dir, 'sigma_diag_1.json'), 'w') as f:
json.dump(sigma_data_2, f)
ARGS = {
'out_dir': temp_dir
}
- 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, 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
|
| load_model |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
okezue/tcc-research/two_channel/compute_subspace.py code served (permissive licence) · get_code("5148fb5c61d1921e") 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 torch
import torch.nn as nn
from transformers import PreTrainedModel, PretrainedConfig
from transformers.modeling_outputs import CausalLMOutputWithPast
torch.manual_seed(0)
# Create a minimal stand-in tokenizer
class MinimalTokenizer:
def __init__(self):
self.pad_token = "<pad>"
self.eos_token = "<eos>"
self.vocab_size = 100
def __call__(self, text, **kwargs):
return {"input_ids": torch.tensor([[1, 2, 3]]), "attention_mask": torch.tensor([[1, 1, 1]])}
@classmethod
def from_pretrained(cls, model_id):
return cls()
# Create a minimal stand-in causal LM model
class MinimalCausalLM(PreTrainedModel):
def __init__(self, config=None):
if config is None:
config = PretrainedConfig()
super().__init__(config)
self.hidden_size = 64
self.embedding = nn.Embedding(100, 64)
self.linear = nn.Linear(64, 100)
self.output_hidden_states = True
def forward(self, input_ids, attention_mask=None, **kwargs):
hidden = self.embedding(input_ids)
logits = self.linear(hidden)
return CausalLMOutputWithPast(
loss=None,
logits=logits,
hidden_states=(hidden,)
)
def eval(self):
return super().eval()
def to(self, device):
return super().to(device)
@classmethod
def from_pretrained(cls, model_id, **kwargs):
model = cls()
model.output_hidden_states = kwargs.get('output_hidden_states', False)
return model
# Monkey patch AutoModelForCausalLM and AutoTokenizer
import transformers
transformers.AutoModelForCausalLM.from_pretrained = MinimalCausalLM.from_pretrained
transformers.AutoTokenizer.from_pretrained = MinimalTokenizer.from_pretrained
ARGS = {
"model_id": "gpt2",
"device": "cpu"
}
- 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 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
|
| make_ds |
Ran ran, honoured the contract we drafted |
okezue/tcc-research/two_channel/eval_quotient_batch.py code served (permissive licence) · get_code("c36ccd0250aec47f") 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 list, ndim 2, 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
from unittest.mock import MagicMock
torch.manual_seed(0)
class MockTokenizer:
def __call__(self, text, add_special_tokens=False, truncation=True, max_length=512):
# Return a dict with 'input_ids' key containing token IDs
# Make it long enough to satisfy the sequence length requirement
token_ids = [101, 2054, 2003, 1037, 3231, 1029, 102] * 100
return {'input_ids': token_ids[:max_length]}
class MockDataset:
def __init__(self):
self.data = [
{'text': 'This is a sample text with enough content to pass the length check. ' * 3},
{'text': 'Another example of text that is long enough for processing. ' * 3},
{'text': 'Yet another text sample with sufficient length requirements. ' * 3},
]
def __iter__(self):
return iter(self.data)
def mock_load_dataset(name, config, split):
return MockDataset()
# Patch the load_dataset function
import datasets
original_load_dataset = datasets.load_dataset
datasets.load_dataset = mock_load_dataset
tok = MockTokenizer()
n = 2
sl = 64
ARGS = {
'tok': tok,
'n': n,
'sl': sl,
'seed': 42
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- datasets, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, 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
|
| make_ds |
Ran ran on a synthesized input |
okezue/tcc-research/two_channel/exp_attack_defense.py code served (permissive licence) · get_code("7157763e28dc845c") 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 list, ndim 2, 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
class MockTokenizer:
"""Stand-in tokenizer that mimics HuggingFace tokenizer behavior"""
def __call__(self, text, add_special_tokens=False, truncation=True, max_length=512):
# Simulate tokenization by returning a dict with 'input_ids' key
# Split text into words and convert to token IDs
words = text.split()
token_ids = [hash(word) % 1000 for word in words[:max_length]]
return {'input_ids': token_ids}
# Create a mock tokenizer
tok = MockTokenizer()
ARGS = {
'tok': tok,
'n': 10,
'sl': 5,
'seed': 42
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- datasets, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, 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
|
| random_neighbors |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
okezue/tcc-research/two_channel/adjacency_builder.py code served (permissive licence) · get_code("62c2bb4f1efb997d") 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 Tensor, ndim 2, dtype family float, shape (1024, 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)
# H is used as:
# - H.shape[0] to get n (number of rows)
# - H[i:i + 1] to slice a single row and repeat it
# - H[j] to index multiple rows
# So H needs to be a 2D tensor where we can index and slice
H = torch.randn(2, 4)
ARGS = {
"H": H,
"k": 512,
"seed": 0,
}
- 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 2, dtype family float, shape (1024, 4) — shape (1024, 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
|
| calibrate_quant_stats |
Not yet run unverified (harvested, no recorded run) |
okezue/tcc-research/two_channel/eval_utility.py code served (permissive licence) · get_code("1d8e979edfb64149") How it ran |
| make_test |
Not yet run unverified (harvested, no recorded run) |
okezue/tcc-research/two_channel/eval_inv_direct.py code served (permissive licence) · get_code("edec64212e4621cf") How it ran |
| nearest_neighbors |
Not yet run unverified (harvested, no recorded run) |
okezue/tcc-research/two_channel/adjacency_builder.py code served (permissive licence) · get_code("7383c4c2299cfe66") How it ran |
| top_prob_neighbors |
Not yet run unverified (harvested, no recorded run) |
okezue/tcc-research/two_channel/adjacency_builder.py code served (permissive licence) · get_code("9e3d1668d28583e5") How it ran |