SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.04400 · 2021

HydraSum: Disentangling Stylistic Features in Text Summarization using Multi-Decoder Models

arXiv · PDF · Open in the Atlas

Code that ran

3 of 9 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 3 have no contract verdict; 0 failures of our instrument; 6 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/2110.04400.json · badge: /api/ran/2110.04400.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
salesforce/hydra-sum canonical (classifier label)
classifier basis not recorded on the link
3 ran · 6 no recorded run
FunctionStatusWhere it lives
compute_accuracy_score Ran
ran on a synthesized input
salesforce/hydra-sum/modelling/train_seq2seq.py
code served (permissive licence) · get_code("609763ac0cecc7ee")
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 numpy as np

# Construct valid arguments for compute_accuracy_score
# The function expects:
# - y_true: list of gold label IDs
# - y_pred: list of prediction arrays (logits/probabilities)
# - ignore_ids: ID to ignore during computation

# Create sample predictions (batch of 2, with 4 classes each)
y_pred = [
    np.array([0.1, 0.8, 0.05, 0.05]),  # predicts class 1
    np.array([0.9, 0.05, 0.03, 0.02])  # predicts class 0
]

# Create corresponding gold labels
y_true = [1, 0]  # correct predictions

# Alternative with ignore_ids
y_pred_with_ignore = [
    np.array([0.1, 0.8, 0.05, 0.05]),
    np.array([0.9, 0.05, 0.03, 0.02]),
    np.array([0.2, 0.3, 0.4, 0.1])
]

y_true_with_ignore = [1, 0, -1]  # last one should be ignored

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
    "ignore_ids": -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
convert_examples_to_features_pegasus Ran
ran on a synthesized input
salesforce/hydra-sum/modelling/train_seq2seq_utils.py
code served (permissive licence) · get_code("397bbbe7fee1493e")
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 logging
from transformers import AutoTokenizer

logging.basicConfig(level=logging.INFO)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.pad_token = "[PAD]"
        self._token_to_id = {
            "[PAD]": 0,
            "the": 1,
            "quick": 2,
            "brown": 3,
            "fox": 4,
            "jumps": 5,
            "over": 6,
            "lazy": 7,
            "dog": 8,
            "summarize": 9,
            "article": 10,
        }
    
    def convert_tokens_to_ids(self, tokens):
        return [self._token_to_id.get(token, 0) for token in tokens]
    
    def encode(self, text):
        # Simple tokenization: split by spaces and convert to IDs
        tokens = text.lower().split()
        ids = []
        for token in tokens:
            # Map token or character to ID
            token_id = self._token_to_id.get(token, len(self._token_to_id))
            ids.append(token_id)
        return ids if ids else [0]

# Create sample examples
examples = [
    {
        'article': 'the quick brown fox jumps over the lazy dog',
        'summary': 'fox jumps',
        'id': 'example_1'
    },
    {
        'article': 'this is a test article with some content',
        'summary': 'test article',
        'id': 'example_2'
    }
]

tokenizer = MinimalTokenizer()

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'max_length': 512,
    'max_decoder_length': 128
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
transformers — 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_examples Ran
ran on a synthesized input
salesforce/hydra-sum/modelling/train_seq2seq_utils.py
code served (permissive licence) · get_code("1b2cef5d2e4a09bb")
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 os
import csv
import tempfile
import torch

# Create a temporary TSV file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.tsv")

# Write a simple TSV file with headers and data
with open(temp_file, 'w', newline='', encoding='utf-8') as f:
    writer = csv.DictWriter(f, fieldnames=['col1', 'col2', 'col3'], delimiter='\t')
    writer.writeheader()
    writer.writerow({'col1': 'value1', 'col2': 'value2', 'col3': 'value3'})
    writer.writerow({'col1': 'value4', 'col2': 'value5', 'col3': 'value6'})

ARGS = {
    'filename': temp_file
}
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 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
convert_examples_to_features Not yet run
unverified (harvested, no recorded run)
salesforce/hydra-sum/modelling/train_seq2seq_utils.py
code served (permissive licence) · get_code("1b019761ed7a2bd0")
How it ran

no invocation recorded.

get_extractive_coverage Not yet run
unverified (harvested, no recorded run)
salesforce/hydra-sum/postprocessing/extractive_fragments_utils.py
code served (permissive licence) · get_code("b61cdc748ec6ff41")
How it ran

no invocation recorded.

get_extractive_fragments Not yet run
unverified (harvested, no recorded run)
salesforce/hydra-sum/postprocessing/extractive_fragments_utils.py
code served (permissive licence) · get_code("94735fc7331c68ce")
How it ran

no invocation recorded.

get_fragment_density Not yet run
unverified (harvested, no recorded run)
salesforce/hydra-sum/postprocessing/extractive_fragments_utils.py
code served (permissive licence) · get_code("0c36571d6b1304c6")
How it ran

no invocation recorded.

get_overlap Not yet run
unverified (harvested, no recorded run)
salesforce/hydra-sum/postprocessing/lexical_overlap.py
code served (permissive licence) · get_code("be2b77546711701c")
How it ran

no invocation recorded.

get_overlap_file Not yet run
unverified (harvested, no recorded run)
salesforce/hydra-sum/postprocessing/lexical_overlap.py
code served (permissive licence) · get_code("6ff04903ffe27357")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Summarization systems make numerous "decisions" about summary properties during inference, e.g. degree of copying, specificity and length of outputs, etc. However, these are implicitly encoded within model parameters and specific styles cannot be enforced. To address this, we introduce HydraSum, a new summarization architecture that extends the single decoder framework of current models to a mixture-of-experts version with multiple decoders. We show that HydraSum's multiple decoders automatically learn contrasting summary styles when trained under the standard training objective without any extra supervision. Through experiments on three summarization datasets (CNN, Newsroom and XSum), we show that HydraSum provides a simple mechanism to obtain stylistically-diverse summaries by sampling from either individual decoders or their mixtures, outperforming baseline models. Finally, we demonstrate that a small modification to the gating strategy during training can enforce an even stricter style partitioning, e.g. high- vs low-abstractiveness or high- vs low-specificity, allowing users to sample from a larger area in the generation space and vary summary styles along multiple dimensions.

For agents

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

get_harvested_code_for_paper("2110.04400")
get_code_for_paper("2110.04400")
have("2110.04400")

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

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

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

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

Connect an agent — have() is free.