SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_29781 · AAAI · 2024

ShareBERT: Embeddings Are Capable of Learning Hidden Layers

Jia Hu, Roberto Cavicchioli, Giulia Berardinelli, Alessandro Capotondi

Open in the Atlas

Code that ran

4 of 12 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, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 8 no recorded run), measured 2026-11-23; 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/aaai_29781.json · badge: /api/ran/aaai_29781.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
jchenghu/sharebert canonical (classifier label)
classifier basis: census
4 ran · 8 no recorded run
FunctionStatusWhere it lives
add_run_id_per_command Ran
ran on a synthesized input
jchenghu/sharebert/generate_training_commands.py
code served (permissive licence) · get_code("83017ca49f860ecd")
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 datetime
import random

def get_run_id():
    t = datetime.datetime.now()
    time_str = t.strftime('%Y%m%d%H%M%S')
    random_num = random.randint(10000, 100000)
    return f'{time_str}-{random_num}'

def add_run_id_per_command(params_combinations_named):
    for comb in params_combinations_named:
        comb['current_run_id'] = get_run_id()
    return params_combinations_named

# Construct valid arguments for add_run_id_per_command
# The function expects a list of dictionaries representing parameter combinations
# It iterates through each dict and adds a 'current_run_id' key to it

params_combinations_named = [
    {'learning_rate': 0.001, 'batch_size': 32},
    {'learning_rate': 0.01, 'batch_size': 64},
    {'learning_rate': 0.0001, 'batch_size': 16}
]

ARGS = {
    'params_combinations_named': params_combinations_named
}
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
get_adafactor Ran
ran on a synthesized input
jchenghu/sharebert/pretraining/optimizers.py
code served (permissive licence) · get_code("dcaec8b1a4eafa8b")
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 Adafactor. 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
from transformers.optimization import Adafactor

torch.manual_seed(0)

# Create a small model with parameters
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

# Instantiate the model
model = TinyModel()

# Extract model parameters
params = model.parameters()

# Define learning rate
lr = 0.001

# Define args as an empty dict or minimal dict (not used in function body)
args = {}

ARGS = {
    "args": args,
    "lr": lr,
    "params": params
}
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 Adafactor — a Adafactor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adafactor 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_valid_dataloader Ran
ran on a synthesized input
jchenghu/sharebert/run_pretraining.py
code served (permissive licence) · get_code("76a475fa13f37cec")
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 generator. 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 numpy as np
from torch.utils.data import Dataset

torch.manual_seed(0)

class SimpleDataset(Dataset):
    def __init__(self, num_samples=8, feature_dim=4):
        self.num_samples = num_samples
        self.feature_dim = feature_dim
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        x = torch.randn(self.feature_dim)
        y = torch.tensor(idx % 2, dtype=torch.long)
        return x, y

class Args:
    def __init__(self):
        self.local_rank = -1
        self.validation_micro_batch = 2

dataset = SimpleDataset(num_samples=8, feature_dim=4)
args = Args()

ARGS = {
    "args": args,
    "dataset": dataset,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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_yaml Ran
ran on a synthesized input
jchenghu/sharebert/generate_training_commands.py
code served (permissive licence) · get_code("33af7059190bcdc2")
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 tempfile
import os
import yaml

# Create a temporary YAML file for testing
temp_dir = tempfile.mkdtemp()
yaml_file = os.path.join(temp_dir, "test.yaml")

# Write a valid YAML file
yaml_content = {
    "key1": "value1",
    "key2": 42,
    "nested": {
        "inner_key": "inner_value"
    }
}

with open(yaml_file, 'w') as f:
    yaml.dump(yaml_content, f)

# Define ARGS
ARGS = {
    "file_name": yaml_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
bias_gelu Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/pretraining/modeling.py
code served (permissive licence) · get_code("f114723b758d8789")
How it ran

no invocation recorded.

f_gelu Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/pretraining/modeling.py
code served (permissive licence) · get_code("2fd4f78b58e81a10")
How it ran

no invocation recorded.

get_adam Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/pretraining/optimizers.py
code served (permissive licence) · get_code("359de01bfd27f11e")
How it ran

no invocation recorded.

get_deepspeed_config Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/pretraining/modeling.py
code served (permissive licence) · get_code("87b054b1860fbd9e")
How it ran

no invocation recorded.

get_hyper_param_combinations_grid Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/generate_training_commands.py
code served (permissive licence) · get_code("b3320dffb841701b")
How it ran

no invocation recorded.

get_lamb Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/pretraining/optimizers.py
code served (permissive licence) · get_code("ae00927d87a00b5d")
How it ran

no invocation recorded.

list_files_in_dir Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/dataset/generate_samples.py
code served (permissive licence) · get_code("5d4e3f4f111dd4f0")
How it ran

no invocation recorded.

list_files_in_dir Not yet run
unverified (harvested, no recorded run)
jchenghu/sharebert/dataset/merge_shards.py
code served (permissive licence) · get_code("ece94a2d9b3487f1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 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.

FunctionAlso present inEarliest-datedOthers named
get_valid_dataloader 2 other papers
2 dated earlier
2211.17201 (2022-11)
ExtremeBERT: A Toolkit for Accelerating Pretraining of Customized BERT
2305.15032 (2023-05)
How to Distill your BERT: An Empirical Study on the Impact of Weight Initialisation and Distillation Objectives
bias_gelu 1 other paper
1 dated earlier
2305.15032 (2023-05)
How to Distill your BERT: An Empirical Study on the Impact of Weight Initialisation and Distillation Objectives
f_gelu 1 other paper
1 dated earlier
2305.15032 (2023-05)
How to Distill your BERT: An Empirical Study on the Impact of Weight Initialisation and Distillation Objectives
get_deepspeed_config 1 other paper
1 dated earlier
2305.15032 (2023-05)
How to Distill your BERT: An Empirical Study on the Impact of Weight Initialisation and Distillation Objectives

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

The deployment of Pre-trained Language Models in memorylimited devices is hindered by their massive number of parameters, which motivated the interest in developing smaller architectures. Established works in the model compression literature showcased that small models often present a noticeable performance degradation and need to be paired with transfer learning methods, such as Knowledge Distillation. In this work, we propose a parameter-sharing method that consists of sharing parameters between embeddings and the hidden layers, enabling the design of near-zero parameter encoders. To demonstrate its effectiveness, we present an architecture design called ShareBERT, which can preserve up to 95.5% of BERT Base performances, using only 5M parameters (21.9× fewer parameters) without the help of Knowledge Distillation. We demonstrate empirically that our proposal does not negatively affect the model learning capabilities and that it is even beneficial for representation learning. Code will be available at https://github.com/jchenghu/sharebert.

For agents

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

get_harvested_code_for_paper("aaai_29781")
get_code_for_paper("aaai_29781")
have("aaai_29781")

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

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

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

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

Connect an agent — have() is free.