SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.02950 · 2026

Kernel Affine Hull Machines as Compute-Efficient Encoders for Frozen Semantic Spaces

Bernhard Moser, Mohit Kumar, Somayeh Kargaran, Manuela Geiß

arXiv · PDF

Code that ran

7 of 8 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; 0 honoured the contract we drafted, 3 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2605.02950.json · badge: /api/ran/2605.02950.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
MohitKumarRostock/Austrian_law_assistant community
Papers with Code archive
7 ran · 1 no recorded run
FunctionStatusWhere it lives
_as_float_ndarray Ran
ran, violated the contract we drafted
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("7e3c6d94b5ffd28d")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

ARGS = {
    'x': np.array([1, 2, 3, 4]),
    'min_dtype': np.float32,
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
_fit_cluster_autoencoder Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("25e66112e224e14a")
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 numpy as np

# Mock the imported functions that autoencoder depends on
class MockDimReduce:
    @staticmethod
    def dim_reduce(y_data, subspace_dim):
        """Mock dim_reduce: returns reduced data and principal components"""
        D, N = y_data.shape
        # Return dummy reduced data and PC matrix
        y_reduced = y_data[:subspace_dim, :]
        PC = np.random.randn(D, subspace_dim).astype(np.float32)
        return y_reduced, PC

class MockKxxMatrix:
    @staticmethod
    def kxx_matrix(y_data_n_subspace, weights_matrix, kerneltype):
        """Mock kxx_matrix: returns a kernel matrix"""
        N = y_data_n_subspace.shape[1]
        # Return a dummy positive semi-definite kernel matrix
        Kxx = np.eye(N, dtype=np.float32) + 0.1 * np.random.randn(N, N).astype(np.float32)
        Kxx = (Kxx + Kxx.T) / 2  # Make symmetric
        return Kxx

class MockKRLS:
    @staticmethod
    def kernel_regularized_least_squares(Kxx, y_data):
        """Mock kernel_regularized_least_squares: returns coefficient matrix"""
        D = y_data.shape[0]
        N = Kxx.shape[0]
        # Return dummy coefficients
        B = np.random.randn(N, D).astype(np.float32)
        return B

# Inject mocks into modules
import sys
from types import ModuleType

dim_reduce_module = ModuleType('dim_reduce')
dim_reduce_module.dim_reduce = MockDimReduce.dim_reduce
sys.modules['dim_reduce'] = dim_reduce_module

kxx_matrix_module = ModuleType('kxx_matrix')
kxx_matrix_module.kxx_matrix = MockKxxMatrix.kxx_matrix
sys.modules['kxx_matrix'] = kxx_matrix_module

krls_module = ModuleType('kernel_regularized_least_squares')
krls_module.kernel_regularized_least_squares = MockKRLS.kernel_regularized_least_squares
sys.modules['kernel_regularized_least_squares'] = krls_module

# Create test data
np.random.seed(0)
# y_data: 5 features, 10 samples
y_data = np.random.randn(5, 10).astype(np.float32)

# indices: select a subset of columns (e.g., columns 0,1,2,3)
indices = np.array([0, 1, 2, 3], dtype=int)

# subspace_dim: reduce to 2 dimensions
subspace_dim = 2

ARGS = {
    'y_data': y_data,
    'indices': indices,
    'subspace_dim': subspace_dim
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
dim_reduce, kernel_regularized_least_squares, kxx_matrix, 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
_scale_like Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("ea5ed9dd9d1f31b5")
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 ndarray, 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 numpy as np

# Test case 1: float32 array with scale
X_float32 = np.array([[1.0, 2.0, 3.0, 4.0],
                       [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)

# Test case 2: integer array (will be converted to float32)
X_int = np.array([[1, 2, 3, 4],
                   [5, 6, 7, 8]], dtype=np.int32)

# Test case 3: float64 array
X_float64 = np.array([[1.5, 2.5, 3.5, 4.5],
                       [5.5, 6.5, 7.5, 8.5]], dtype=np.float64)

# Test case 4: complex array (dtype.kind == 'c')
X_complex = np.array([[1+2j, 3+4j, 5+6j, 7+8j],
                       [9+10j, 11+12j, 13+14j, 15+16j]], dtype=np.complex64)

# Scale values
scale_value = 2.5
scale_one = 1.0

ARGS = {
    "X": X_float32,
    "scale": scale_value,
    "inplace": False
}
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 ndarray, 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
_should_auto_l2_normalize_targets Ran
ran, violated the contract we drafted
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("0cf22478784b78b9")
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 numpy as np

# Setup for _should_auto_l2_normalize_targets
# The function expects Y to be a numpy array (or convertible to one)
# It checks if Y is 2D and has columns with approximately unit norms

# Create a test case where columns have norms approximately equal to 1.0
# This should return True
Y_test = np.array([
    [0.95, 0.05, -0.1],
    [0.3, 0.98, 0.05],
    [-0.05, 0.2, 1.0],
    [0.1, -0.05, 0.05]
], dtype=np.float32)

# Verify the norms are in the expected range (approximately 1.0)
norms = np.linalg.norm(Y_test, axis=0)
# This creates norms roughly around [1.0, 1.0, 1.0] which should trigger the heuristic

ARGS = {
    "Y": Y_test
}
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 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
autoencoder Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("93f94638253e3c02")
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 numpy as np

# We need to mock the imported functions that don't exist
class MockDimReduce:
    @staticmethod
    def dim_reduce(y_data, subspace_dim):
        # Return reduced data and principal components
        D, N = y_data.shape
        # Create mock PC matrix (D x subspace_dim)
        PC = np.random.randn(D, subspace_dim).astype(np.float32)
        # Create mock reduced data (subspace_dim x N)
        y_data_reduced = np.random.randn(subspace_dim, N).astype(np.float32)
        return y_data_reduced, PC

class MockKxxMatrix:
    @staticmethod
    def kxx_matrix(y_data_n_subspace, weights_matrix, kerneltype):
        # Return a kernel matrix (N x N)
        N = y_data_n_subspace.shape[1]
        return np.eye(N).astype(np.float32)

class MockKernelRegularizedLeastSquares:
    @staticmethod
    def kernel_regularized_least_squares(Kxx, y_data):
        # Return coefficients matrix (N x D)
        N = Kxx.shape[0]
        D = y_data.shape[0]
        return np.random.randn(N, D).astype(np.float32)

# Mock the imports
import sys
mock_dim_reduce_module = type(sys)('dim_reduce')
mock_dim_reduce_module.dim_reduce = MockDimReduce.dim_reduce
sys.modules['dim_reduce'] = mock_dim_reduce_module

mock_kxx_matrix_module = type(sys)('kxx_matrix')
mock_kxx_matrix_module.kxx_matrix = MockKxxMatrix.kxx_matrix
sys.modules['kxx_matrix'] = mock_kxx_matrix_module

mock_krls_module = type(sys)('kernel_regularized_least_squares')
mock_krls_module.kernel_regularized_least_squares = MockKernelRegularizedLeastSquares.kernel_regularized_least_squares
sys.modules['kernel_regularized_least_squares'] = mock_krls_module

# Construct arguments for the autoencoder function
np.random.seed(0)

# Create sample data: D=4 features, N=10 samples
y_data = np.random.randn(4, 10).astype(np.float32)
subspace_dim = 3
min_range = 0.001

ARGS = {
    'y_data': y_data,
    'subspace_dim': subspace_dim,
    'min_range': min_range
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
dim_reduce, kernel_regularized_least_squares, kxx_matrix, 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
l2_normalize_columns Ran
ran, violated the contract we drafted
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("a127bf013e84a17b")
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 ndarray, ndim 2, dtype family float, shape (4, 3) 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 small 2D matrix with distinct dimensions for testing
# Shape: (D=4, N=3) - 4 features, 3 samples
M = np.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
], dtype=np.float32)

# Define arguments dictionary
ARGS = {
    'M': M,
    'eps': 1e-12
}
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 ndarray, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) 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
parallel_autoencoders Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("dfdb7c353a6cf1a6")
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 numpy as np

# Mock the required imported modules that are called within autoencoder()
class MockDimReduce:
    """Mock dim_reduce function"""
    def __call__(self, y_data, subspace_dim):
        # Return reduced data and principal components
        D, N = y_data.shape
        # y_data_n_subspace: (subspace_dim, N)
        y_data_n_subspace = np.random.randn(subspace_dim, N).astype(np.float32)
        # PC: principal components (D, subspace_dim)
        PC = np.random.randn(D, subspace_dim).astype(np.float32)
        return y_data_n_subspace, PC

class MockKxxMatrix:
    """Mock kxx_matrix function"""
    def __call__(self, y_data_n_subspace, weights_matrix, kerneltype):
        # Return kernel matrix (N, N)
        subspace_dim, N = y_data_n_subspace.shape
        Kxx = np.eye(N, dtype=np.float32) + 0.1 * np.random.randn(N, N).astype(np.float32)
        return Kxx

class MockKernelRegularizedLeastSquares:
    """Mock kernel_regularized_least_squares function"""
    def __call__(self, Kxx, y_data):
        # Return B matrix (N, D)
        N = Kxx.shape[0]
        D = y_data.shape[0]
        B = np.random.randn(N, D).astype(np.float32)
        return B

# Inject mocks into modules
import sys
from types import ModuleType

dim_reduce_module = ModuleType('dim_reduce')
dim_reduce_module.dim_reduce = MockDimReduce()
sys.modules['dim_reduce'] = dim_reduce_module

kxx_matrix_module = ModuleType('kxx_matrix')
kxx_matrix_module.kxx_matrix = MockKxxMatrix()
sys.modules['kxx_matrix'] = kxx_matrix_module

kernel_regularized_least_squares_module = ModuleType('kernel_regularized_least_squares')
kernel_regularized_least_squares_module.kernel_regularized_least_squares = MockKernelRegularizedLeastSquares()
sys.modules['kernel_regularized_least_squares'] = kernel_regularized_least_squares_module

# Now construct ARGS for parallel_autoencoders
np.random.seed(42)

# Create y_data: (D=5, N=12) - 5 features, 12 samples
y_data = np.random.randn(5, 12).astype(np.float32)

# subspace_dim: reduce to 2 dimensions
subspace_dim = 2

# Nb: block size - with N=12 and Nb=4, we get ~3 clusters
Nb = 4

# n_jobs: use serial execution (1 job)
n_jobs = 1

# verbose: set to False for cleaner output
verbose = False

ARGS = {
    'y_data': y_data,
    'subspace_dim': subspace_dim,
    'Nb': Nb,
    'n_jobs': n_jobs,
    'verbose': verbose,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
dim_reduce, joblib, kernel_regularized_least_squares, kxx_matrix, numpy — 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
train_kahm_regressor Not yet run
unverified (harvested, no recorded run)
MohitKumarRostock/Austrian_law_assistant/kahm_regression.py
code served (permissive licence) · get_code("e2610edb8ee86daa")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Background: Transformer-based semantic encoders are effective, but when the teacher representation space and corpus index are fixed, online query encoding can become the recurring deployment bottleneck. This raises the methodological question whether repeated neural inference can be replaced by a lighter estimator with analytically explicit approximation behavior. Objectives: We study Kernel Affine Hull Machines (KAHMs) as mathematically explicit, computeefficient encoders for frozen teacher representation spaces. Retrieval is used only as a proof-ofprinciple instance of the broader fixed-space encoding problem. Methods: We formulate semantic encoding as conditional-mean estimation. The teacher representation is modeled as a noisy prototype mixture with posterior cluster-probability weights. KAHM geometry estimates these weights from lexical features in an explicitly identified RKHS hypothesis space, giving non-asymptotic posterior-approximation control. Semantic prototypes are then refined by normalized least-mean-squares updates on noisy teacher embeddings, yielding an error decomposition into posterior-approximation, finite-sample/generalization, and teacher-noise terms. Results: On a controlled Austrian-law benchmark in a frozen Mixedbread semantic corpus space, KAHM achieves the strongest teacher-space reconstruction and principal rank-sensitive retrieval performance among five evaluation-matched learned adapters. Relative to direct transformer encoding on the same frozen index, it reduces online per-query time from 800.663 ms to 93.834 ms, an 8.53× CPU speedup. Conclusions: KAHM provides an analytically explicit, lightweight estimator for fixed-teacher lexical-to-semantic adaptation with interpretable error terms. The retrieval experiment supports this methodological claim as a controlled proof of principle.

For agents

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

get_harvested_code_for_paper("2605.02950")
get_code_for_paper("2605.02950")
have("2605.02950")

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

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

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

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

Connect an agent — have() is free.