SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.acl-long.631 · ACL · 2023

HINT: Hypernetwork Instruction Tuning for Efficient Zero-& Few-Shot Generalisation

Matthew Peters, Hannaneh Hajishirzi, Yizhong Wang, Hamish Ivison, Akshita Bhagia

Open in the Atlas

Code that ran

7 of 7 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; 1 failure of our instrument; 0 no recorded run), measured 2026-11-24; 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/2023.acl-long.631.json · badge: /api/ran/2023.acl-long.631.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
allenai/hyper-task-descriptions canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
cosine_similarity Ran
ran on a synthesized input
allenai/hyper-task-descriptions/hyper_task_descriptions/modeling/losses.py
code served (permissive licence) · get_code("b3531e17616694ee")
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 ArrayImpl, 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 jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test tensors
batch_size = 2
feature_dim = 4

# predictions: shape (batch_size, feature_dim)
predictions = jnp.array(np.random.randn(batch_size, feature_dim), dtype=jnp.float32)

# targets: shape (batch_size, feature_dim)
targets = jnp.array(np.random.randn(batch_size, feature_dim), dtype=jnp.float32)

# epsilon: small float for numerical stability
epsilon = 1e-08

ARGS = {
    "predictions": predictions,
    "targets": targets,
    "epsilon": epsilon,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
cosine_similarity_loss Ran
ran on a synthesized input
allenai/hyper-task-descriptions/hyper_task_descriptions/modeling/losses.py
code served (permissive licence) · get_code("4a9e6a156b8302c2")
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 ArrayImpl, 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 jax
import jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test tensors
batch_size = 2
embedding_dim = 4
num_target_vectors = 3

# pred_vectors: shape (batch_size, embedding_dim)
pred_vectors = jnp.array(np.random.randn(batch_size, embedding_dim).astype(np.float32))

# target_vectors: shape (num_target_vectors, embedding_dim)
target_vectors = jnp.array(np.random.randn(num_target_vectors, embedding_dim).astype(np.float32))

# ground_truth_similarity: shape (batch_size, num_target_vectors)
# This should match the output shape of cosine_similarity when called with pred_vectors and target_vectors
ground_truth_similarity = jnp.array(np.random.randn(batch_size, num_target_vectors).astype(np.float32))

ARGS = {
    "pred_vectors": pred_vectors,
    "target_vectors": target_vectors,
    "ground_truth_similarity": ground_truth_similarity,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
cosine_similarity_one_to_many Ran
ran on a synthesized input
allenai/hyper-task-descriptions/hyper_task_descriptions/modeling/losses.py
code served (permissive licence) · get_code("90ce40d219f59148")
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 ArrayImpl, 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 jax.numpy as jnp

# Set up small test arrays for the function
# pred_vector should be 1-D array of dimension 4
pred_vector = jnp.array([1.0, 2.0, 3.0, 4.0])

# target_vectors should be 2-D array with shape (batch_size, dimension)
# Using batch_size=2, dimension=4 to keep it tiny
target_vectors = jnp.array([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0]
])

ARGS = {
    "pred_vector": pred_vector,
    "target_vectors": target_vectors
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
flattened_traversal Ran
ran on a synthesized input
allenai/hyper-task-descriptions/hyper_task_descriptions/utils.py
code served (permissive licence) · get_code("5b9af9aa2ef57960")
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 function. 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 flax
from flax.core import frozen_dict


def flattened_traversal(fn):
    """Returns function that is called with `(path, param)` instead of pytree."""

    def mask(tree):
        flat = flax.traverse_util.flatten_dict(tree, sep='/')
        masked_tree = flax.traverse_util.unflatten_dict({k: fn(k, v) for k, v in flat.items()}, sep='/')
        return frozen_dict.freeze(masked_tree)
    return mask


def example_fn(path, param):
    """Example function that takes path and param."""
    if isinstance(param, (int, float)):
        return param * 2
    return param


ARGS = {
    "fn": example_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
inverse_match_any Ran
ran on a synthesized input
allenai/hyper-task-descriptions/hyper_task_descriptions/utils.py
code served (permissive licence) · get_code("984735d85e28e0f7")
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 function. 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 re
from typing import Sequence

def inverse_match_any(regexes: Sequence[str]) -> callable:
    """Inverse of the above"""
    regexes = tuple((re.compile(regex) for regex in regexes))

    def _match_any(path, _):
        """False if path matches any regex in regexs, true otherwise."""
        return not any((regex.fullmatch(path) for regex in regexes))
    return _match_any


ARGS = {
    "regexes": [r"layer\.\d+", r"head\.\w+", r".*\.bias"]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
match_any Ran
ran; our contract draft was wrong, not the code
allenai/hyper-task-descriptions/hyper_task_descriptions/utils.py
code served (permissive licence) · get_code("5a7134ad1da3f957")
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 function. 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 re
from typing import Any, Callable, Optional, Sequence, Tuple

torch_imported = False
try:
    import torch
    torch_imported = True
except ImportError:
    pass

# Setup for match_any function
# The function takes regexes: Sequence[str] as input
# It returns a closure that checks if parameter names match any of the regex patterns

# Create test regex patterns that would match parameter names
regexes = [
    r"layer\.0\.weight",
    r"layer\.1\..*",
    r"bias.*"
]

ARGS = {
    "regexes": regexes
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
trim_and_pad Ran
ran on a synthesized input
allenai/hyper-task-descriptions/hyper_task_descriptions/modeling/hyper_transformer.py
code served (permissive licence) · get_code("340572aed6b56d15")
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 EagerTensor, ndim 2, dtype family float, shape (8, 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 tensorflow as tf

# Create a simple tensor with shape (10, 4) - 10 timesteps, 4 features
tensor = tf.constant([[1.0, 2.0, 3.0, 4.0],
                      [5.0, 6.0, 7.0, 8.0],
                      [9.0, 10.0, 11.0, 12.0],
                      [13.0, 14.0, 15.0, 16.0],
                      [17.0, 18.0, 19.0, 20.0],
                      [21.0, 22.0, 23.0, 24.0],
                      [25.0, 26.0, 27.0, 28.0],
                      [29.0, 30.0, 31.0, 32.0],
                      [33.0, 34.0, 35.0, 36.0],
                      [37.0, 38.0, 39.0, 40.0]])

# Define task feature lengths mapping
task_feature_lengths = {
    'input': 8,
    'output': 6
}

# Define task feature paddings mapping (pad value for each feature)
task_feature_paddings = {
    'input': 0,
    'output': -1
}

ARGS = {
    'k': 'input',
    't': tensor,
    'task_feature_lengths': task_feature_lengths,
    'task_feature_paddings': task_feature_paddings,
    'left_pad': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 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 6 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
match_any 1 other paper
1 same year, order not determinable
2309.05444 (2023-09)
Pushing Mixture of Experts to the Limit: Extremely Parameter Efficient MoE for Instruction Tuning

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

Recent NLP models have shown the remarkable ability to effectively generalise 'zero-shot' to new tasks using only natural language instructions as guidance. However, many of these approaches suffer from high computational costs due to their reliance on concatenating lengthy instructions with every input example, resulting in costly reprocessing of the instruction. To avoid this, we introduce Hypernetworks for INstruction Tuning (HINT), which convert task instructions and examples into parameter-efficient modules inserted into an underlying model using a pretrained text encoder, eliminating the need to include instructions in the model input. The hypernetwork in HINT also produces an encoded instruction, which we concatenate with encoded inputs during decoding to further improve performance. HINT models outperform strong state-of-theart baselines by over 10% when controlling for compute (measured in FLOPs). By converting instructions into modules, HINT models can effectively disregard the length of instructions and few-shot example inputs in terms of compute usage. As a result, HINT can enhance its performance by up to 25% by incorporating additional few-shot data, while utilizing only up to 5% more compute. This combines the strengths of parameter-efficient fine-tuning and in-context learning. We release our code publicly 1 .

For agents

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

get_harvested_code_for_paper("2023.acl-long.631")
get_code_for_paper("2023.acl-long.631")
have("2023.acl-long.631")

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

curl https://syntology.ai/api/ran/2023.acl-long.631.json

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

[![Syntology run record](https://syntology.ai/api/ran/2023.acl-long.631.svg)](https://syntology.ai/paper/2023.acl-long.631)

Connect an agent — have() is free.