SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.07893 · 2022

Gold Doesn't Always Glitter: Spectral Removal of Linear and Nonlinear Guarded Attribute Information

arXiv · PDF · Open in the Atlas

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; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-22; 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/2203.07893.json · badge: /api/ran/2203.07893.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
jasonshaoshun/SAL canonical (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
debias_by_specific_directions Ran
ran on a synthesized input
jasonshaoshun/SAL/src/old_debias.py
code served (permissive licence) · get_code("06f4800d560a810f")
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, 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
import scipy

# Create test data for the function
# directions: List[np.ndarray] - a list of direction vectors (each a 2D array)
# input_dim: int - the dimension of the input space

# For debias_by_specific_directions, we need:
# 1. A list of direction vectors (numpy arrays that will be passed to get_nullspace_projection)
# 2. An input dimension

# Create some small direction vectors
# These should be 2D arrays (matrices) since get_nullspace_projection expects them
# and applies scipy.linalg.null_space to them

# Example: create a few small direction matrices
direction_1 = np.array([[1.0, 2.0, 3.0, 4.0],
                        [2.0, 4.0, 6.0, 8.0]])  # 2x4 matrix (rank 1)

direction_2 = np.array([[1.0, 0.0, 1.0, 0.0],
                        [0.0, 1.0, 0.0, 1.0],
                        [1.0, 1.0, 1.0, 1.0]])  # 3x4 matrix

directions = [direction_1, direction_2]
input_dim = 4

ARGS = {
    "directions": directions,
    "input_dim": input_dim
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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, 4) — shape (4, 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_nullspace_projection Ran
ran on a synthesized input
jasonshaoshun/SAL/src/old_debias.py
code served (permissive licence) · get_code("b2e1ce12869f94c1")
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, 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
import scipy

# Create a simple matrix W with a non-trivial nullspace
# We'll create a 3x4 matrix (more columns than rows) to ensure a nullspace exists
# Rank 2 matrix so nullspace dimension is 2
W = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 4.0, 6.0, 8.0],
    [1.0, 0.0, 1.0, 0.0]
], dtype=np.float64)

ARGS = {
    "W": W
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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, 4) — shape (4, 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_projection_to_intersection_of_nullspaces Ran
ran; our contract draft was wrong, not the code
jasonshaoshun/SAL/src/debias.py
code served (permissive licence) · get_code("6603d34965799b5d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (4, 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
import scipy

# Create small test matrices for rowspace projections
# These will be projection matrices (symmetric, idempotent)

# Create a simple matrix and compute its rowspace projection
def create_test_rowspace_projection(rows, cols):
    """Create a small test matrix and return its rowspace projection"""
    W = np.random.randn(rows, cols)
    if np.allclose(W, 0):
        w_basis = np.zeros_like(W.T)
    else:
        w_basis = scipy.linalg.orth(W.T)
    P_W = w_basis.dot(w_basis.T)
    return P_W

# Set seed for reproducibility
np.random.seed(0)

# Create test rowspace projection matrices
# Using input_dim = 4 as specified
input_dim = 4

# Create 3 different rowspace projection matrices
P1 = create_test_rowspace_projection(2, input_dim)
P2 = create_test_rowspace_projection(2, input_dim)
P3 = create_test_rowspace_projection(1, input_dim)

rowspace_projection_matrices = [P1, P2, P3]

ARGS = {
    "rowspace_projection_matrices": rowspace_projection_matrices,
    "input_dim": input_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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, 4) — shape (4, 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_rowspace_projection Ran
ran, honoured the contract we drafted
jasonshaoshun/SAL/src/debias.py
code served (permissive licence) · get_code("109a64c49d7364c5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (4, 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
import scipy

# Create a small test matrix W
# Using shape (3, 4) to have distinct dimensions
W = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 4.0, 6.0, 8.0],
    [1.0, 1.0, 1.0, 1.0]
], dtype=np.float64)

ARGS = {
    "W": W
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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, 4) — shape (4, 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
load_data Ran
ran on a synthesized input
jasonshaoshun/SAL/src/deepmoji/deepmoji_debias.py
code served (permissive licence) · get_code("a604bbf3e7962f40")
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 numpy as np
import tempfile
import os

# Create a temporary directory with the required .npy files
temp_dir = tempfile.mkdtemp()

# Create small dummy numpy arrays for each file
neg_neg = np.random.randn(2, 4).astype(np.float32)  # 2 samples, 4 features
neg_pos = np.random.randn(3, 4).astype(np.float32)  # 3 samples, 4 features
pos_neg = np.random.randn(2, 4).astype(np.float32)  # 2 samples, 4 features
pos_pos = np.random.randn(3, 4).astype(np.float32)  # 3 samples, 4 features

# Save the arrays to the temporary directory
np.save(os.path.join(temp_dir, 'neg_neg.npy'), neg_neg)
np.save(os.path.join(temp_dir, 'neg_pos.npy'), neg_pos)
np.save(os.path.join(temp_dir, 'pos_neg.npy'), pos_neg)
np.save(os.path.join(temp_dir, 'pos_pos.npy'), pos_pos)

ARGS = {
    'path': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
read_data_file Ran
ran on a synthesized input
jasonshaoshun/SAL/src/deepmoji/last_layer_extraction.py
code served (permissive licence) · get_code("1299f5fff0c8311f")
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
import tempfile
import os

# Create a temporary numpy file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.npy")

# Create sample data and save it
sample_data = np.random.randn(4, 3).astype(np.float32)
np.save(temp_file, sample_data)

ARGS = {
    "input_file": temp_file
}
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
transform_vec Ran
ran on a synthesized input
jasonshaoshun/SAL/src/deepmoji/last_layer_extraction.py
code served (permissive licence) · get_code("6c65e2e967eea2d2")
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 1, dtype family float, shape (2,) 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)

class ScorerModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.layer3 = nn.Linear(2, 2)
    
    def forward(self, x):
        return x

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.scorer = nn.Sequential(
            nn.Linear(4, 3),
            nn.Linear(3, 2),
            nn.Linear(2, 2)
        )
    
    def extract_module(self, name):
        if name == 'scorer':
            return self.scorer
        raise ValueError(f"Module {name} not found")

model = MockModel()
in_vec = [1.0, 2.0, 3.0, 4.0]

ARGS = {
    'in_vec': in_vec,
    '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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
debias_by_specific_directions Not yet run
unverified (harvested, no recorded run)
jasonshaoshun/SAL/src/debias.py
code served (permissive licence) · get_code("3b1da49bcea7e00a")
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, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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.

FunctionAlso present inEarliest-datedOthers named
get_projection_to_intersection_of_nullspaces 6 other papers
2 dated earlier, 4 later
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
2210.14011 (2022-10)
Are All Spurious Features in Natural Language Alike? An Analysis through a Causal Lens
and 3 more not named here
debias_by_specific_directions 5 other papers
2 dated earlier, 3 later
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
2210.14011 (2022-10)
Are All Spurious Features in Natural Language Alike? An Analysis through a Causal Lens
and 2 more not named here
get_rowspace_projection 4 other papers
2 dated earlier, 2 later
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
2210.14011 (2022-10)
Are All Spurious Features in Natural Language Alike? An Analysis through a Causal Lens
and 1 more not named here
debias_by_specific_directions 2 other papers
2 dated earlier
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
get_nullspace_projection 2 other papers
2 dated earlier
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
load_data 2 other papers
2 dated earlier
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
read_data_file 2 other papers
2 dated earlier
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings
transform_vec 2 other papers
2 dated earlier
1901.09451 (2019-01)
Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting
2007.00049 (2020-07)
OSCaR: Orthogonal Subspace Correction and Rectification of Biases in Word Embeddings

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-22.

Repositories linked to this paper

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

Abstract

We describe a simple and effective method (Spectral Attribute removaL; SAL) to remove private or guarded information from neural representations. Our method uses matrix decomposition to project the input representations into directions with reduced covariance with the guarded information rather than maximal covariance as factorization methods normally use. We begin with linear information removal and proceed to generalize our algorithm to the case of nonlinear information removal using kernels. Our experiments demonstrate that our algorithm retains better main task performance after removing the guarded information compared to previous work. In addition, our experiments demonstrate that we need a relatively small amount of guarded attribute data to remove information about these attributes, which lowers the exposure to sensitive data and is more suitable for low-resource scenarios. Code is available at https://github.com/jasonshaoshun/SAL.

For agents

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

get_harvested_code_for_paper("2203.07893")
get_code_for_paper("2203.07893")
have("2203.07893")

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

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

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

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

Connect an agent — have() is free.