SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.02211 · NeurIPS · 2022

Variable-rate hierarchical CPC leads to acoustic unit discovery in speech

Santiago Cuervo, Adrian Ła Ńcucki, Ricard Marxer, Paweł Rychlikowski, Jan Chorowski

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-24; 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/2206.02211.json · badge: /api/ran/2206.02211.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
chorowski-lab/hcpc canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
FunctionStatusWhere it lives
MultiLevelModel Ran
ran on a synthesized input · constructed an object; no result was computed
chorowski-lab/hcpc/cpc/model.py
code served (permissive licence) · get_code("08f3980ddf80abec")
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 an instance of its own class, MultiLevelModel: the run constructed the object and did not call it, so no result was computed. 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)

# Define Globals class
class Globals(object):
    """Global configuration objects."""
    epoch = -1
    currentIteration = -1
    writer = None
    debugging = False
    supervisedRL = False
    uniformDownsampling = False

# Build a minimal frameLevelModel
class MinimalFrameLevelModel(nn.Module):
    def __init__(self):
        super(MinimalFrameLevelModel, self).__init__()
        self.gEncoder = nn.Linear(5, 6)
        self.gEncoder.dimEncoded = 6
        self.gAR = nn.LSTM(6, 7, batch_first=True)
        self.gAR.getDimOutput = lambda: 7
        self.numUpdates = 0
    
    def forward(self, batchData, label):
        # Returns: cFeature, encodedData, label, extraLosses
        batch_size = batchData.size(0) if isinstance(batchData, torch.Tensor) else 2
        seq_len = 8
        cFeature = torch.randn(batch_size, seq_len, 5)
        encodedData = torch.randn(batch_size, seq_len, 6)
        extraLosses = {}
        return cFeature, encodedData, label, extraLosses
    
    def updateCounter(self):
        self.numUpdates += 1

# Build a minimal segmenter
class MinimalSegmenter(nn.Module):
    def __init__(self):
        super(MinimalSegmenter, self).__init__()
        self.segmentOnContext = False
        self.boundaryPredictor = None
        self.numUpdates = 0
    
    def forward(self, cFeature, encodedData, label):
        # Returns: compressedSegments, compressMatrices, boundaryLogProbs
        batch_size = cFeature.size(0)
        seq_len = cFeature.size(1)
        
        # Create a simple compressed representation
        compressed_data = cFeature[:, ::2, :]  # downsample by 2
        compressed_len = compressed_data.size(1)
        
        batch_sizes = torch.tensor([compressed_len] * batch_size, dtype=torch.long)
        sorted_indices = torch.arange(batch_size)
        unsorted_indices = torch.arange(batch_size)
        
        compressedSegments = torch.nn.utils.rnn.PackedSequence(
            compressed_data.reshape(-1, compressed_data.size(-1)),
            batch_sizes,
            sorted_indices,
            unsorted_indices
        )
        
        compressMatrices = torch.ones(batch_size, seq_len, 1)
        boundaryLogProbs = torch.nn.utils.rnn.PackedSequence(
            torch.randn(batch_size * compressed_len, 2),
            batch_sizes,
            sorted_indices,
            unsorted_indices
        )
        
        return compressedSegments, compressMatrices, boundaryLogProbs
    
    def computeExtraLosses(self, label):
        return {}

# Create instances
frame_level_model = MinimalFrameLevelModel()
segmenter = MinimalSegmenter()

# Create batch data and label
batch_data = torch.randn(2, 8, 5)
label = torch.randint(0, 2, (2, 8))

ARGS = {
    "frameLevelModel": frame_level_model,
    "segmenter": segmenter,
    "keepHidden": False
}
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 MultiLevelModel — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiLevelModel 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
deltas Ran
ran, honoured the contract we drafted
chorowski-lab/hcpc/cpc/eval/phone_segmentation.py
code served (permissive licence) · get_code("0ea246c53b8065e5")
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 list, ndim 1, dtype family int; 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 random

random.seed(0)

ARGS = {
    "D": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 int — 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
parse_args Ran
ran; our contract draft was wrong, not the code
chorowski-lab/hcpc/cpc/eval/phone_segmentation.py
code served (permissive licence) · get_code("c77fa1d3a867cb87")
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 Namespace. 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 argparse
from pathlib import Path
import tempfile
import os

# Create temporary directories for testing
temp_dir = tempfile.mkdtemp()
db_dir = os.path.join(temp_dir, "audio_data")
val_file = os.path.join(temp_dir, "validation.txt")
phone_file = os.path.join(temp_dir, "phones.txt")
checkpoint_dir = os.path.join(temp_dir, "checkpoints")

os.makedirs(db_dir, exist_ok=True)
os.makedirs(checkpoint_dir, exist_ok=True)

# Create dummy validation file
with open(val_file, 'w') as f:
    f.write("seq1\nseq2\n")

# Create dummy phone labels file
with open(phone_file, 'w') as f:
    f.write("a b c d\n")

# Create dummy checkpoint file
checkpoint_path = os.path.join(checkpoint_dir, "model.pt")
with open(checkpoint_path, 'w') as f:
    f.write("dummy checkpoint")

# Build argv list with all arguments
argv = [
    '--pathDB', db_dir,
    '--pathVal', val_file,
    '--load', checkpoint_path,
    '--pathPhone', phone_file,
    '--pathCheckpoint', checkpoint_dir,
    '--batchSizeGPU', '8',
    '--file_extension', '.flac',
    '--size_window', '20480',
    '--nProcessLoader', '8',
    '--max_size_loaded', '4000000000',
    '--tolerance', '2',
    '--segmentationMode', 'cosineDissimilarity',
]

ARGS = {
    'argv': argv,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
Globals Not yet run
unverified (harvested, no recorded run)
chorowski-lab/hcpc/cpc/model.py
code served (permissive licence) · get_code("c158e898af4e20d1")
How it ran

no invocation recorded.

Also present in other papers' code

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

The success of deep learning comes from its ability to capture the hierarchical structure of data by learning high-level representations defined in terms of low-level ones. In this paper we explore self-supervised learning of hierarchical representations of speech by applying multiple levels of Contrastive Predictive Coding (CPC). We observe that simply stacking two CPC models does not yield significant improvements over single-level architectures. Inspired by the fact that speech is often described as a sequence of discrete units unevenly distributed in time, we propose a model in which the output of a low-level CPC module is non-uniformly downsampled to directly minimize the loss of a high-level CPC module. The latter is designed to also enforce a prior of separability and discreteness in its representations by enforcing dissimilarity of successive high-level representations through focused negative sampling, and by quantization of the prediction targets. Accounting for the structure of the speech signal improves upon single-level CPC features and enhances the disentanglement of the learned representations, as measured by downstream speech recognition tasks, while resulting in a meaningful segmentation of the signal that closely resembles phone boundaries.

For agents

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

get_harvested_code_for_paper("2206.02211")
get_code_for_paper("2206.02211")
have("2206.02211")

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

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

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

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

Connect an agent — have() is free.