SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.03348 · 2024

Learning to Maximize Mutual Information for Chain-of-Thought Distillation

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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 0 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2403.03348.json · badge: /api/ran/2403.03348.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
xinchen9/cot_distillation_acl2024 canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
eval_t5 Ran
ran; our contract draft was wrong, not the code
xinchen9/cot_distillation_acl2024/uncertainty.py
code served (permissive licence) · get_code("9693d493cc8bcf8b")
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 tuple. 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 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)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.vocab_size = 100
    
    def __call__(self, texts, max_length=512, truncation=True, return_tensors=None):
        # Return a dict with input_ids
        input_ids = torch.tensor([[1, 2, 3, 4]], dtype=torch.long)
        attention_mask = torch.tensor([[1, 1, 1, 1]], dtype=torch.long)
        result = {'input_ids': input_ids, 'attention_mask': attention_mask}
        return result
    
    def encode(self, text, return_tensors=None):
        # Return token ids for a label
        tokens = torch.tensor([[5, 6]], dtype=torch.long)
        return tokens
    
    def decode(self, token_ids):
        # Return a string
        return "predicted label"
    
    def pad_token_id(self):
        return 0

# Create a minimal T5-like model
class MinimalT5Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.encoder = nn.Linear(4, 8)
        self.decoder = nn.Linear(8, 100)
        self.pad_token_id = 0
    
    def forward(self, input_ids, decoder_input_ids):
        # Simulate encoder output
        batch_size = input_ids.size(0)
        seq_len = input_ids.size(1)
        
        # Create logits output
        logits = torch.randn(batch_size, seq_len, 100)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output
    
    def generate(self, input_ids, decoder_input_ids):
        # Return generated token ids
        return torch.tensor([[5, 6, 7]], dtype=torch.long)

# Create a minimal test dataset
class MinimalTestSet:
    def __init__(self):
        self.data = [
            {'input': 'test input one', 'label': 'label one'},
            {'input': 'test input two', 'label': 'label two'},
        ]
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]

# Construct arguments
test_set = MinimalTestSet()
model = MinimalT5Model()
tokenizer = MinimalTokenizer()

ARGS = {
    'test_set': test_set,
    'model': model,
    'tokenizer': tokenizer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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
eval_t5_explain Ran
ran; our contract draft was wrong, not the code
xinchen9/cot_distillation_acl2024/explain_test.py
code served (permissive licence) · get_code("d1fab58449e6b191")
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 tuple. 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 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)

# Stand-in tokenizer
class StandInTokenizer:
    def __init__(self):
        self.pad_token_id = 0
    
    def __call__(self, texts, max_length=512, truncation=True, return_tensors='pt'):
        # Return mock tokenized output
        batch_size = len(texts)
        input_ids = torch.randint(1, 100, (batch_size, 10))
        attention_mask = torch.ones((batch_size, 10))
        return {
            'input_ids': input_ids,
            'attention_mask': attention_mask
        }
    
    def decode(self, token_ids, skip_special_tokens=True):
        return "the model predicted explanation"

# Stand-in T5 model
class StandInT5Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(10, 10)
    
    def generate(self, input_ids, decoder_input_ids, max_length=128):
        # Return mock generated token ids
        batch_size = input_ids.size(0)
        return torch.randint(1, 100, (batch_size, 20))

# Stand-in dataset loader
class StandInDatasetLoader:
    def _parse_llm_output(self, cot_example):
        return "the gold rationale text", "label_value"

# Create test_set - list of examples
test_set = [
    {'input': 'input text one'},
    {'input': 'input text two'}
]

# Create cot_set - list of chain-of-thought examples
cot_set = [
    {'cot': 'reasoning one'},
    {'cot': 'reasoning two'}
]

# Create dataset_loader
dataset_loader = StandInDatasetLoader()

# Create model
model = StandInT5Model()

# Create tokenizer
tokenizer = StandInTokenizer()

# Mock functions that are called but not defined in the function signature
def calculate_bleu_score(predictions, references):
    return {'bleu': 0.75}

def roberta_cosine_similarity(text1, text2):
    return 0.85

# Inject mocks into globals so they're available when eval_t5_explain runs
import builtins
builtins.calculate_bleu_score = calculate_bleu_score
builtins.roberta_cosine_similarity = roberta_cosine_similarity

ARGS = {
    'test_set': test_set,
    'cot_set': cot_set,
    'dataset_loader': dataset_loader,
    'model': model,
    'tokenizer': tokenizer,
    'metrics': ['BLEU', 'Cosine']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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

Also present in other papers' code

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

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-22.

Repositories linked to this paper

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

Abstract

Knowledge distillation, the technique of transferring knowledge from large, complex models to smaller ones, marks a pivotal step towards efficient AI deployment. Distilling Step-by-Step~(DSS), a novel method utilizing chain-of-thought~(CoT) distillation, has demonstrated promise by imbuing smaller models with the superior reasoning capabilities of their larger counterparts. In DSS, the distilled model acquires the ability to generate rationales and predict labels concurrently through a multi-task learning framework. However, DSS overlooks the intrinsic relationship between the two training tasks, leading to ineffective integration of CoT knowledge with the task of label prediction. To this end, we investigate the mutual relationship of the two tasks from Information Bottleneck perspective and formulate it as maximizing the mutual information of the representation features of the two tasks. We propose a variational approach to solve this optimization problem using a learning-based method. Our experimental results across four datasets demonstrate that our method outperforms the state-of-the-art DSS. Our findings offer insightful guidance for future research on language model distillation as well as applications involving CoT. Codes are available at \url{https://github.com/xinchen9/cot_distillation_ACL2024}.

For agents

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

get_harvested_code_for_paper("2403.03348")
get_code_for_paper("2403.03348")
have("2403.03348")

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

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

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

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

Connect an agent — have() is free.