SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.13179 · EMNLP · 2024

EH-MAM: Easy-to-Hard Masked Acoustic Modeling for Self-Supervised Speech Representation Learning

Sreyan Ghosh, Ashish Seth, Sonal Kumar, Dinesh Manocha, S Sakshi, Ramaneswaran Selvakumar

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 4 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/2410.13179.json · badge: /api/ran/2410.13179.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
cs20s030/ehmam canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
collate_tokens Ran
ran, honoured the contract we drafted
cs20s030/ehmam/data_utils.py
code served (permissive licence) · get_code("d0c01822a7592080")
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 2, dtype family int, shape (3, 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)

# Create a list of 1d tensors with varying lengths
values = [
    torch.tensor([1, 2, 3, 4]),
    torch.tensor([5, 6, 7]),
    torch.tensor([8, 9])
]

# Define parameters
pad_idx = 0
eos_idx = 2
left_pad = False
move_eos_to_beginning = False
pad_to_length = None
pad_to_multiple = 1
pad_to_bsz = None

ARGS = {
    "values": values,
    "pad_idx": pad_idx,
    "eos_idx": eos_idx,
    "left_pad": left_pad,
    "move_eos_to_beginning": move_eos_to_beginning,
    "pad_to_length": pad_to_length,
    "pad_to_multiple": pad_to_multiple,
    "pad_to_bsz": pad_to_bsz,
}
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 int, shape (3, 4) — shape (3, 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_alibi Ran
ran, honoured the contract we drafted
cs20s030/ehmam/models/utils.py
code served (permissive licence) · get_code("64a73f82ea703bf0")
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 3, dtype family float, shape (4, 8, 8) 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 math

torch.manual_seed(0)

ARGS = {
    "max_positions": 8,
    "attention_heads": 4,
}
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 3, dtype family float, shape (4, 8, 8) — shape (4, 8, 8) 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_annealed_rate Ran
ran, honoured the contract we drafted
cs20s030/ehmam/models/data2vec_audio.py
code served (permissive licence) · get_code("27e813fec3cb4b6f")
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 float, 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 torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "start": 0.001,
    "end": 0.1,
    "curr_step": 500,
    "total_steps": 1000
}
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 float, 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
get_layer_id_for_vit Ran
ran, honoured the contract we drafted
cs20s030/ehmam/models/mae_image_classification.py
code served (permissive licence) · get_code("3f903f847b8f7f28")
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 int, ndim 0, dtype family int, 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 torch

torch.manual_seed(0)

# The function get_layer_id_for_vit takes two parameters:
# 1. name: a string representing a parameter name
# 2. num_layers: an integer representing the number of layers

# Let's construct valid test cases
name = "blocks.5.attn.qkv.weight"
num_layers = 12

ARGS = {
    "name": name,
    "num_layers": num_layers,
}
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 int, ndim 0, dtype family int, 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
masked_alibi Ran
ran; our contract draft was wrong, not the code
cs20s030/ehmam/models/utils.py
code served (permissive licence) · get_code("beba926588613ced")
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 3, dtype family float, shape (6, 3, 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 torch

torch.manual_seed(0)

# Analyze the function:
# - alibi_bias: tensor that gets reshaped to (orig_B, H, orig_T, orig_T)
# - mask_indices: tensor used with unsqueeze and masked_select
# - orig_B: int, batch size
# - orig_T: int, sequence length

# The function does:
# 1. alibi_bias.view(orig_B, -1, orig_T, orig_T) -> H is inferred
# 2. mask_indices.unsqueeze(1) and .unsqueeze(-1), .unsqueeze(-2)
# 3. masked_select operations that reduce dimensions
# 4. Final reshape to (-1, M, M)

# mask_indices must be a boolean tensor that can be broadcast properly
# It's used as alibi_mask = mask_indices.unsqueeze(1)
# Then alibi_mask.unsqueeze(-1) for first masked_select
# Then alibi_mask.unsqueeze(-2) for second masked_select

orig_B = 2
orig_T = 4
H = 3

# Create alibi_bias: shape should allow view to (orig_B, H, orig_T, orig_T)
# So total elements = 2 * 3 * 4 * 4 = 96
alibi_bias = torch.randn(96)

# Create mask_indices as a boolean tensor
# Based on usage: mask_indices.unsqueeze(1) then unsqueeze(-1) and unsqueeze(-2)
# It needs to broadcast with (orig_B, orig_T, orig_T)
# Starting shape should be (orig_B, orig_T) for this to work
mask_indices = torch.tensor([[True, True, False, True],
                              [True, False, True, True]], dtype=torch.bool)

ARGS = {
    "alibi_bias": alibi_bias,
    "mask_indices": mask_indices,
    "orig_B": orig_B,
    "orig_T": orig_T,
}
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 3, dtype family float, shape (6, 3, 3) — shape (6, 3, 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
update_checkpoint Ran
ran; our contract draft was wrong, not the code
cs20s030/ehmam/fb_convert_beit_cp.py
code served (permissive licence) · get_code("cf82e11f14a349c2")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Construct a minimal model_dict with checkpoint state
model_dict = {
    'cls_token': torch.randn(1, 1, 4),
    'patch_embed.proj.weight': torch.randn(4, 3),
    'patch_embed.proj.bias': torch.randn(4),
    'mask_token': torch.randn(1, 1, 4),
    'mlp.fc1.weight': torch.randn(8, 4),
    'mlp.fc1.bias': torch.randn(8),
    'mlp.fc2.weight': torch.randn(4, 8),
    'mlp.fc2.bias': torch.randn(4),
    'lm_head.weight': torch.randn(10, 4),
    'lm_head.bias': torch.randn(10),
    'fc_norm.weight': torch.randn(4),
    'fc_norm.bias': torch.randn(4),
    'head.weight': torch.randn(5, 4),
    'head.bias': torch.randn(5),
    'other_layer.weight': torch.randn(3, 4),
}

prefix = 'model.'
is_nested = True

ARGS = {
    'model_dict': model_dict,
    'prefix': prefix,
    'is_nested': is_nested,
}
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
get_2d_sincos_pos_embed Not yet run
unverified (harvested, no recorded run)
cs20s030/ehmam/models/mae.py
pointer only (licence: MIT); the stored copy get_code serves, from yunongLiu1/IKEA-Manuals-at-Work, is pointer only (licence: NONE) · get_code("3185afc3e87293ed")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yunongLiu1/IKEA-Manuals-at-Work, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_2d_sincos_pos_embed_from_grid Not yet run
unverified (harvested, no recorded run)
cs20s030/ehmam/models/mae.py
pointer only (licence: MIT); the stored copy get_code serves, from zhangyifei01/LMIM, is pointer only (licence: NONE) · get_code("f10004e059714d42")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zhangyifei01/LMIM, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

load_indexed_dataset Not yet run
unverified (harvested, no recorded run)
cs20s030/ehmam/data_utils.py
code served (permissive licence) · get_code("320ee357dd9d70f1")
How it ran

no invocation recorded.

modify_relative_position_bias Not yet run
unverified (harvested, no recorded run)
cs20s030/ehmam/models/mae.py
code served (permissive licence) · get_code("915281feeb90ee5a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 2 the same month, 4 later) and 2 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_2d_sincos_pos_embed_from_grid 190 other papers
120 dated earlier, 6 the same month, 63 later, 1 same year, order not determinable · 65 only as an assembly brick
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
and 187 more not named here
get_2d_sincos_pos_embed 95 other papers
69 dated earlier, 2 the same month, 23 later, 1 same year, order not determinable · 33 only as an assembly brick
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
and 92 more not named here
get_layer_id_for_vit 3 other papers
2 dated earlier, 1 later
2212.07525 (2022-12)
Efficient Self-supervised Learning with Contextualized Target Representations for Vision, Speech and Language
2401.03497 (2024-01)
EAT: Self-Supervised Pre-Training with Efficient Audio Transformer
2506.12222 (2025-06)
SSLAM: Enhancing Self-Supervised Models with Audio Mixtures for Polyphonic Soundscapes
modify_relative_position_bias 3 other papers
2 dated earlier, 1 later
2212.07525 (2022-12)
Efficient Self-supervised Learning with Contextualized Target Representations for Vision, Speech and Language
2401.03497 (2024-01)
EAT: Self-Supervised Pre-Training with Efficient Audio Transformer
2506.12222 (2025-06)
SSLAM: Enhancing Self-Supervised Models with Audio Mixtures for Polyphonic Soundscapes
get_alibi 1 other paper
1 dated earlier
2212.07525 (2022-12)
Efficient Self-supervised Learning with Contextualized Target Representations for Vision, Speech and Language
get_annealed_rate 1 other paper
1 dated earlier
2212.07525 (2022-12)
Efficient Self-supervised Learning with Contextualized Target Representations for Vision, Speech and Language
masked_alibi 1 other paper
1 dated earlier
2212.07525 (2022-12)
Efficient Self-supervised Learning with Contextualized Target Representations for Vision, Speech and Language
update_checkpoint 1 other paper
1 dated earlier
2212.07525 (2022-12)
Efficient Self-supervised Learning with Contextualized Target Representations for Vision, Speech and Language

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

In this paper, we present EH-MAM (Easyto-Hard adaptive Masked Acoustic Modeling), a novel self-supervised learning approach for speech representation learning. In contrast to the prior methods that use random masking schemes for Masked Acoustic Modeling (MAM), we introduce a novel selective and adaptive masking strategy. Specifically, during SSL training, we progressively introduce harder regions to the model for reconstruction. Our approach automatically selects hard regions and is built on the observation that the reconstruction loss of individual frames in MAM can provide natural signals to judge the difficulty of solving the MAM pre-text task for that frame. To identify these hard regions, we employ a teacher model that first predicts the frame-wise losses and then decides which frames to mask. By learning to create challenging problems, such as identifying harder frames and solving them simultaneously, the model is able to learn more effective representations and thereby acquire a more comprehensive understanding of the speech. Quantitatively, EH-MAM outperforms several state-ofthe-art baselines across various low-resource speech recognition and SUPERB benchmarks by 5%-10%. Additionally, we conduct a thorough analysis to show that the regions masked by EH-MAM effectively capture useful context across speech frames 1 . * Equal contribution, † Equal Ideation 1 Code: https://github.com/cs20s030/ehmam.git Random Masking Masked Frame Reconstruction Model Pre-defined masking strategy Model (Teacher) Masked Frame Reconstruction Model (Student) Selective Masking with Teacher (b) EH-MAM Pre-training (a) Traditional MAM Pre-training

For agents

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

get_harvested_code_for_paper("2410.13179")
get_code_for_paper("2410.13179")
have("2410.13179")

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

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

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

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

Connect an agent — have() is free.