SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.18887 · ICML · 2023

How Does Information Bottleneck Help Deep Learning?

Xu Ji, Kenji Kawaguchi, Zhun Deng, Jiaoyang Huang, Spearman Pearson

arXiv · PDF · Open in the Atlas

Code that ran

8 of 13 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 6 have no contract verdict; 2 failures of our instrument; 5 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/2305.18887.json · badge: /api/ran/2305.18887.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
xu-ji/information-bottleneck canonical (classifier label)
classifier basis: census
8 ran · 5 no recorded run
FunctionStatusWhere it lives
adversarial_cross_entropy Ran
ran; our contract draft was wrong, not the code
xu-ji/information-bottleneck/dnn/swag_repo/swag/losses.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("e11996f54eea8253")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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. A run is recorded.

compute_MI_theta_D_single_seed_jensen Ran
ran on a synthesized input
xu-ji/information-bottleneck/toy/util/swag.py
code served (permissive licence) · get_code("962fc1c520aa6c6a")
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 MockSWAGModel(nn.Module):
    """Mock SWAG model with required methods for the function."""
    
    def __init__(self, num_params=12):
        super().__init__()
        self.num_params = num_params
        # Register a parameter so the model has learnable parameters
        self.param = nn.Parameter(torch.randn(num_params))
        self._sampled_params = None
        
    def sample(self, scale=1.0, cov=True, block=True):
        """Sample parameters from the SWAG distribution."""
        # Store sampled parameters for later retrieval
        self._sampled_params = self.param + scale * torch.randn_like(self.param)
    
    def compute_logprob_cumu(self, layer_idx, vec=None, block=True):
        """Compute log probability for a cumulative layer."""
        if vec is None:
            # Use internal sampled params
            return torch.tensor(-2.5, dtype=torch.float32)
        else:
            # Use provided vector
            return torch.tensor(-2.7, dtype=torch.float32)
    
    def get_cumu_param_list(self, layer_idx):
        """Get parameter list for a layer."""
        return self._sampled_params if self._sampled_params is not None else self.param.clone()


# Create multiple SWAG models (one per data instance)
num_data_instances = 2
swag_models = [MockSWAGModel(num_params=12) for _ in range(num_data_instances)]

# Define layers to compute MI for
layers = [0, 1]

# Number of samples per data instance
num_samples = 3

ARGS = {
    'swag_models': swag_models,
    'num_samples': num_samples,
    'layers': 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 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
cross_entropy Ran
ran; our contract draft was wrong, not the code
xu-ji/information-bottleneck/dnn/swag_repo/swag/losses.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("fc2aaf6fd20bc53f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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. A run is recorded.

dataset_name Ran
ran on a synthesized input
xu-ji/information-bottleneck/dnn/swag_repo/MI/util.py
code served (permissive licence) · get_code("5e26fa10c5a96c83")
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 str. 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

torch.manual_seed(0)

ARGS = {
    'data': 'mnist',
    'seed': 42,
    'i': 0
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
est_MI Ran
ran on a synthesized input
xu-ji/information-bottleneck/toy/util/general.py
code served (permissive licence) · get_code("43703d6b3f57375b")
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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x, repr=False):
        z = self.linear(x)
        log_prob = torch.sum(z, dim=1, keepdim=True)
        if repr:
            return z, log_prob
        return log_prob
    
    def log_marg_prob(self, z, x, jensen=False):
        marg_prob = torch.sum(z, dim=1, keepdim=True) * 0.5
        return marg_prob

model = SimpleModel()

dataset = [
    (torch.randn(4), torch.tensor(0)),
    (torch.randn(4), torch.tensor(1)),
    (torch.randn(4), torch.tensor(0)),
    (torch.randn(4), torch.tensor(1)),
    (torch.randn(4), torch.tensor(0)),
]

ARGS = {
    'model': model,
    'dataset': dataset,
    'sz': 2,
    'jensen': False,
    'requires_grad': True,
}
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 Tensor, 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
est_MI_cond Ran
ran on a synthesized input
xu-ji/information-bottleneck/toy/util/general.py
code served (permissive licence) · get_code("dfa889418df10f6f")
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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np

torch.manual_seed(0)

# Define a minimal model that satisfies the function's requirements
class MinimalVAE(nn.Module):
    def __init__(self, input_dim=4, latent_dim=3):
        super().__init__()
        self.input_dim = input_dim
        self.latent_dim = latent_dim
        self.encoder = nn.Linear(input_dim, latent_dim * 2)
        self.decoder = nn.Linear(latent_dim, input_dim)
        
    def forward(self, x, repr=False):
        # Encode to get mean and logvar
        encoded = self.encoder(x)
        mu, logvar = encoded.chunk(2, dim=1)
        
        # Reparameterization trick
        std = torch.exp(0.5 * logvar)
        eps = torch.randn_like(std)
        z = mu + eps * std
        
        if repr:
            # Return z and log_prob (log probability under N(mu, std^2))
            log_prob = -0.5 * (logvar + ((z - mu) ** 2) / torch.exp(logvar)).sum(dim=1)
            return z, log_prob
        
        return z
    
    def log_marg_prob(self, z, x, jensen=False):
        # Compute marginal log probability
        # Simple approximation: log p(z) - reconstruction error
        log_pz = -0.5 * (z ** 2).sum(dim=1)
        
        if jensen:
            # Jensen variant: add some penalty
            log_marg = log_pz - 0.1 * ((self.decoder(z) - x) ** 2).sum(dim=1)
        else:
            log_marg = log_pz - 0.05 * ((self.decoder(z) - x) ** 2).sum(dim=1)
        
        return log_marg

# Create model
model = MinimalVAE(input_dim=4, latent_dim=3)

# Create a small data loader
num_classes = 2
batch_size = 2
num_batches = 2

# Create synthetic data: list of (xs, ys) tuples
dl = []
for _ in range(num_batches):
    xs = torch.randn(batch_size, 4)  # batch_size x input_dim
    ys = torch.randint(0, num_classes, (batch_size,))  # batch_size
    dl.append((xs, ys))

# Set up arguments
ARGS = {
    'model': model,
    'num_classes': num_classes,
    'dl': dl,
    'sz': -1,  # Use all samples
    'jensen': False
}
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 Tensor, 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
exp_name Ran
ran on a synthesized input
xu-ji/information-bottleneck/dnn/swag_repo/MI/util.py
code served (permissive licence) · get_code("9f5a910348a7492a")
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 str. 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

class Args:
    def __init__(self):
        self.batch_size = 32
        self.wd = 0.0001
        self.model = "resnet18"
        self.dataset = "cifar10"
        self.seed = 42

ARGS = {
    'args': Args()
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
exp_name_flat Ran
ran on a synthesized input
xu-ji/information-bottleneck/dnn/swag_repo/MI/util.py
code served (permissive licence) · get_code("36461b9533fa5d2f")
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 str. 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)

# The function exp_name_flat uses its parameters only for string formatting.
# It converts them to strings and concatenates them.
# So we just need valid values for each parameter that can be string-formatted.

dataset = "cifar10"
seed = 42
batch_size = 32
wd = 0.0001
model = "resnet18"

ARGS = {
    "dataset": dataset,
    "seed": seed,
    "batch_size": batch_size,
    "wd": wd,
    "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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
basic_data Not yet run
unverified (harvested, no recorded run)
xu-ji/information-bottleneck/toy/util/data.py
code served (permissive licence) · get_code("661a8c2abca9d4d4")
How it ran

no invocation recorded.

basic_data_instance Not yet run
unverified (harvested, no recorded run)
xu-ji/information-bottleneck/toy/util/data.py
code served (permissive licence) · get_code("a0d8e4386d7c5fbd")
How it ran

no invocation recorded.

loaders Not yet run
unverified (harvested, no recorded run)
xu-ji/information-bottleneck/dnn/swag_repo/experiments/imagenet/data.py
code served (permissive licence) · get_code("99e3815602045644")
How it ran

no invocation recorded.

masked_loss Not yet run
unverified (harvested, no recorded run)
xu-ji/information-bottleneck/dnn/swag_repo/swag/losses.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from ravidziv/SimplifyingImbalancedTraining, is pointer only (licence: NONE) · get_code("8bbca7799326d580")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from ravidziv/SimplifyingImbalancedTraining, 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.

train_model Not yet run
unverified (harvested, no recorded run)
xu-ji/information-bottleneck/toy/util/general.py
code served (permissive licence) · get_code("802ae9c8c6458aaf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 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, 3 later) and 9 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
adversarial_cross_entropy 2 other papers
1 dated earlier, 1 later
1902.02476 (2019-02)
A Simple Baseline for Bayesian Uncertainty in Deep Learning
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
cross_entropy 2 other papers
1 dated earlier, 1 later
1902.02476 (2019-02)
A Simple Baseline for Bayesian Uncertainty in Deep Learning
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
masked_loss 2 other papers
1 dated earlier, 1 later
1902.02476 (2019-02)
A Simple Baseline for Bayesian Uncertainty in Deep Learning
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
loaders 1 other paper
1 dated earlier
1902.02476 (2019-02)
A Simple Baseline for Bayesian Uncertainty in Deep Learning

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

Numerous deep learning algorithms have been inspired by and understood via the notion of information bottleneck, where unnecessary information is (often implicitly) minimized while taskrelevant information is maximized. However, a rigorous argument for justifying why it is desirable to control information bottlenecks has been elusive. In this paper, we provide the first rigorous learning theory for justifying the benefit of information bottleneck in deep learning by mathematically relating information bottleneck to generalization errors. Our theory proves that controlling information bottleneck is one way to control generalization errors in deep learning, although it is not the only or necessary way. We investigate the merit of our new mathematical findings with experiments across a range of architectures and learning settings. In many cases, generalization errors are shown to correlate with the degree of information bottleneck: i.e., the amount of the unnecessary information at hidden layers. This paper provides a theoretical foundation for current and future methods through the lens of information bottleneck. Our new generalization bounds scale with the degree of information bottleneck, unlike the previous bounds that scale with the number of parameters, VC dimension, Rademacher complexity, stability or robustness. Our code is publicly available at: https://github.com/xu-ji/information-bottleneck

For agents

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

get_harvested_code_for_paper("2305.18887")
get_code_for_paper("2305.18887")
have("2305.18887")

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

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

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

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

Connect an agent — have() is free.