SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.12553 · 2022

Understanding Domain Learning in Language Models Through Subpopulation Analysis

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 2 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2210.12553.json · badge: /api/ran/2210.12553.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
zsquaredz/subpopulation_analysis canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_ccas Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zsquaredz/subpopulation_analysis/code/cca_core.py
code served (permissive licence) · get_code("01472465bed8b268")
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

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

# Create small positive definite symmetric matrices for X
num_neurons_x = 4
num_neurons_y = 3

# Create positive definite matrices by constructing them as A @ A.T
A_x = np.random.randn(num_neurons_x, num_neurons_x)
sigma_xx = A_x @ A_x.T

A_y = np.random.randn(num_neurons_y, num_neurons_y)
sigma_yy = A_y @ A_y.T

# Create cross-covariance matrices
sigma_xy = np.random.randn(num_neurons_x, num_neurons_y)
sigma_yx = sigma_xy.T

# Small epsilon for numerical stability
epsilon = 1e-6

# Construct ARGS dictionary
ARGS = {
    "sigma_xx": sigma_xx,
    "sigma_xy": sigma_xy,
    "sigma_yx": sigma_yx,
    "sigma_yy": sigma_yy,
    "epsilon": epsilon,
    "verbose": 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 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_existing_dataset Ran
ran on a synthesized input
zsquaredz/subpopulation_analysis/code/preprocess/utils.py
code served (permissive licence) · get_code("a9dd2376c565d8de")
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, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import os
import tempfile

# Create a temporary directory for pickle files
temp_dir = tempfile.mkdtemp()

# Create sample data
reviews = [
    "This product is great!",
    "This product is terrible!",
    "I love it!",
    "I hate it!",
    "Amazing quality",
    "Poor quality",
    "Highly recommend",
    "Do not buy",
]

labels = [1, 0, 1, 0, 1, 0, 1, 0]

# Save pickle files for 'test' category
category = 'test'
reviews_file = os.path.join(temp_dir, f'X_{category}_5.pkl')
labels_file = os.path.join(temp_dir, f'y_{category}_5.pkl')

with open(reviews_file, 'wb') as f:
    pickle.dump(reviews, f)

with open(labels_file, 'wb') as f:
    pickle.dump(labels, f)

ARGS = {
    'data_dir': temp_dir,
    'category': category,
}
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 2, 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
load_existing_dataset_and_create_splits Ran
ran on a synthesized input
zsquaredz/subpopulation_analysis/code/preprocess/utils.py
code served (permissive licence) · get_code("908a92be65ade86a")
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 pickle
import os
import tempfile

# Create a temporary directory for the test data
temp_dir = tempfile.mkdtemp()

# Create sample data
reviews = ["This is a great product!"] * 50 + ["This is terrible."] * 50
labels = [1] * 50 + [0] * 50

# Save the pickle files
category = "electronics"
reviews_file = os.path.join(temp_dir, f'X_{category}_5.pkl')
labels_file = os.path.join(temp_dir, f'y_{category}_5.pkl')

with open(reviews_file, 'wb') as f:
    pickle.dump(reviews, f)

with open(labels_file, 'wb') as f:
    pickle.dump(labels, f)

ARGS = {
    'data_dir': temp_dir,
    'category': category,
    'train_size': 40,
    'val_size': 30,
    'test_size': 20,
    'shuffle': True
}
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 — 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
positivedef_matrix_sqrt Ran
ran, honoured the contract we drafted
zsquaredz/subpopulation_analysis/code/cca_core.py
code served (permissive licence) · get_code("ea98389a1755bb3f")
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

# Create a small positive definite symmetric matrix
# Using a simple construction: A @ A.T is always positive definite
np.random.seed(0)
base_matrix = np.random.randn(4, 4)
positive_def_matrix = base_matrix @ base_matrix.T

# Verify it's positive definite by checking eigenvalues
eigenvalues = np.linalg.eigvalsh(positive_def_matrix)
assert np.all(eigenvalues > 1e-10), "Matrix must be positive definite"

ARGS = {
    "array": positive_def_matrix
}
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, 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
remove_small Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zsquaredz/subpopulation_analysis/code/cca_core.py
code served (permissive licence) · get_code("ffcbd13c7094948e")
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

# Create small covariance matrices for testing
# sigma_xx: variance matrix for x (4x4)
sigma_xx = np.array([
    [1.5, 0.2, 0.1, 0.0],
    [0.2, 2.0, 0.3, 0.1],
    [0.1, 0.3, 0.8, 0.0],
    [0.0, 0.1, 0.0, 0.05]
], dtype=np.float32)

# sigma_yy: variance matrix for y (3x3)
sigma_yy = np.array([
    [1.2, 0.1, 0.0],
    [0.1, 1.8, 0.2],
    [0.0, 0.2, 0.06]
], dtype=np.float32)

# sigma_xy: crossvariance matrix (4x3)
sigma_xy = np.array([
    [0.5, 0.2, 0.1],
    [0.3, 0.6, 0.2],
    [0.1, 0.1, 0.3],
    [0.02, 0.01, 0.01]
], dtype=np.float32)

# sigma_yx: conjugate transpose of sigma_xy (3x4)
sigma_yx = sigma_xy.T

# epsilon: cutoff threshold
epsilon = 0.1

ARGS = {
    "sigma_xx": sigma_xx,
    "sigma_xy": sigma_xy,
    "sigma_yx": sigma_yx,
    "sigma_yy": sigma_yy,
    "epsilon": epsilon
}
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 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_file Not yet run
unverified (harvested, no recorded run)
zsquaredz/subpopulation_analysis/code/preprocess/utils.py
code served (permissive licence) · get_code("41bedd34dd92f3bb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 3 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
compute_ccas 6 other papers
3 dated earlier, 3 later
1706.05806 (2017-06)
SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability
1806.05759 (2018-06)
Insights on representational similarity in neural networks with canonical correlation
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
and 3 more not named here
positivedef_matrix_sqrt 6 other papers
3 dated earlier, 3 later
1706.05806 (2017-06)
SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability
1806.05759 (2018-06)
Insights on representational similarity in neural networks with canonical correlation
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
and 3 more not named here
remove_small 6 other papers
3 dated earlier, 3 later
1706.05806 (2017-06)
SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability
1806.05759 (2018-06)
Insights on representational similarity in neural networks with canonical correlation
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
and 3 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

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

Abstract

We investigate how different domains are encoded in modern neural network architectures. We analyze the relationship between natural language domains, model size, and the amount of training data used. The primary analysis tool we develop is based on subpopulation analysis with Singular Vector Canonical Correlation Analysis (SVCCA), which we apply to Transformer-based language models (LMs). We compare the latent representations of such a language model at its different layers from a pair of models: a model trained on multiple domains (an experimental model) and a model trained on a single domain (a control model). Through our method, we find that increasing the model capacity impacts how domain information is stored in upper and lower layers differently. In addition, we show that larger experimental models simultaneously embed domain-specific information as if they were conjoined control models. These findings are confirmed qualitatively, demonstrating the validity of our method.

For agents

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

get_harvested_code_for_paper("2210.12553")
get_code_for_paper("2210.12553")
have("2210.12553")

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

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

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

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

Connect an agent — have() is free.