SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.12382 · NeurIPS · 2024

From Instance Training to Instruction Learning: Task Adapters Generation from Instructions

Yao Xu, Shizhu He, Kang Liu, Jun Zhao, Huanxuan Liao, Yuanzhe Zhang, Yanchao Hao, Shengping Liu

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 5 failures of our instrument; 2 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/2406.12382.json · badge: /api/ran/2406.12382.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
Xnhyacinth/TAGI canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
trae1oung/dyprag community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
MLPHypernet Ran
ran on a synthesized input · constructed an object; no result was computed
trae1oung/dyprag/src/projector.py
code served (permissive licence) · get_code("1581aa2261d895a7")
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, MLPHypernet: 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)

# The forward method calls:
# - self.linear1(features) -> expects features to be a tensor
# - F.relu(...) -> element-wise operation
# - self.linear2(...) -> takes output of relu
# - .reshape(self.input_dim, self.output_dim) -> reshapes to (input_dim, output_dim)

# Working backwards:
# - input_dim and output_dim are used for reshape, so they should be integers
# - linear2 output should have input_dim * output_dim elements
# - linear1 takes features and outputs something
# - linear2 takes that output

# Let's say:
# - input_dim = 3
# - output_dim = 4
# - features shape: (batch, feature_size) = (2, 5)
# - linear1: 5 -> hidden_size
# - linear2: hidden_size -> 3*4=12

input_dim = 3
output_dim = 4
feature_size = 5
hidden_size = 12

linear1 = nn.Linear(feature_size, hidden_size)
linear2 = nn.Linear(hidden_size, input_dim * output_dim)

features = torch.randn(2, feature_size)

ARGS = {
    "linear1": linear1,
    "linear2": linear2,
    "input_dim": input_dim,
    "output_dim": output_dim
}
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 MLPHypernet — 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 MLPHypernet 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
ProjectorLoRA Ran
ran on a synthesized input · constructed an object; no result was computed
trae1oung/dyprag/src/projector.py
code served (permissive licence) · get_code("7e25c66296d764a0")
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, ProjectorLoRA: 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)

ARGS = {
    'module_name': 'down_proj',
    'layer_idx': 0,
    'input_dim': 4,
    'lora_rank': 2,
    'output_dim': 3,
    'hidden_dim': 16
}
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 ProjectorLoRA — 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 ProjectorLoRA 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
att_mse_loss Ran
ran; our contract draft was wrong, not the code
Xnhyacinth/TAGI/src/losses.py
code served (permissive licence) · get_code("eb1bd9941fe77289")
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. 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.functional as F

torch.manual_seed(0)

# Create attention tensors with shape (batch_size, num_heads, length, length)
batch_size = 2
num_heads = 3
length = 4

attention_S = torch.randn(batch_size, num_heads, length, length)
attention_T = torch.randn(batch_size, num_heads, length, length)

# Create a mask tensor with shape (batch_size, length)
mask = torch.ones(batch_size, length)
mask[0, 2:] = 0  # mask some positions in first batch
mask[1, 3:] = 0  # mask some positions in second batch

ARGS = {
    "attention_S": attention_S,
    "attention_T": attention_T,
    "mask": mask,
}
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 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
exact_match_score Ran
ran, violated the contract we drafted
Xnhyacinth/TAGI/src/compute_metrics.py
code served (permissive licence) · get_code("e168ce39d04b76f1")
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 bool, 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 string

ARGS = {
    "prediction": "Hello, World!",
    "ground_truth": "hello world",
    "xlingual": False,
}
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 bool, 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
kd_ce_loss Ran
ran; our contract draft was wrong, not the code
Xnhyacinth/TAGI/src/losses.py
code served (permissive licence) · get_code("40443594fb77d42a")
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. 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.functional as F

torch.manual_seed(0)

# Create student logits tensor
# Shape: (batch_size=2, num_labels=4) for 2D case
logits_S = torch.randn(2, 4)

# Create teacher logits tensor with same shape
logits_T = torch.randn(2, 4)

# Temperature as a scalar float
temperature = 3.0

ARGS = {
    "logits_S": logits_S,
    "logits_T": logits_T,
    "temperature": temperature,
}
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 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
kd_mse_loss Ran
ran; our contract draft was wrong, not the code
Xnhyacinth/TAGI/src/losses.py
code served (permissive licence) · get_code("a6de986aee092cb5")
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. 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.functional as F

torch.manual_seed(0)

# Create small tensors for logits_S and logits_T
# Shape: (batch_size=2, length=3, num_labels=4)
logits_S = torch.randn(2, 3, 4)
logits_T = torch.randn(2, 3, 4)

# Temperature as a scalar float
temperature = 1.0

ARGS = {
    "logits_S": logits_S,
    "logits_T": logits_T,
    "temperature": temperature,
}
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 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
Xnhyacinth/TAGI/src/compute_metrics.py
code served (permissive licence) · get_code("52a9f448d8cbd82a")
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 string

def normalize_answer(s):
    """Lower text and remove punctuation, and extra whitespace."""

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation)
        return ''.join((ch for ch in text if ch not in exclude))

    def lower(text):
        return text.lower()
    return white_space_fix(remove_punc(lower(s)))

ARGS = {
    "s": "Hello, World!  This is a TEST."
}
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 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
set_argument_value Ran
ran; our contract draft was wrong, not the code
Xnhyacinth/TAGI/src/create_exps.py
code served (permissive licence) · get_code("d98382bbc755ff32")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# The function set_argument_value operates on a list of arguments
# It looks for a name parameter in the list, and sets the value at the next index
# It checks that the element after the name is not a string starting with '-'
# This appears to be parsing command-line style arguments

# Construct a valid arguments list (like command-line arguments)
arguments = ['--learning_rate', '0.001', '--batch_size', '32', '--model', 'resnet']

# The name to look up
name = '--batch_size'

# The new value to set
value = '64'

ARGS = {
    'arguments': arguments,
    'name': name,
    'value': value
}
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
load_tf_weights_in_gpt2 Not yet run
unverified (harvested, no recorded run)
Xnhyacinth/TAGI/src/modeling_gpt2.py
code served (permissive licence) · get_code("bc9fb74e483fb901")
How it ran

no invocation recorded.

load_tf_weights_in_t5 Not yet run
unverified (harvested, no recorded run)
Xnhyacinth/TAGI/src/modeling_t5.py
code served (permissive licence) · get_code("bfbc7746415f3426")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 3 the same month, 2 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.

FunctionAlso present inEarliest-datedOthers named
load_tf_weights_in_t5 20 other papers
17 dated earlier, 1 the same month, 1 later, 1 same year, order not determinable
2201.05966 (2022-01)
UNIFIEDSKG: Unifying and Multi-Tasking Structured Knowledge Grounding with Text-to-Text Language Models
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
2205.06983 (2022-05)
RASAT: Integrating Relational Structures into Pretrained Seq2Seq Model for Text-to-SQL
and 17 more not named here
normalize_answer 12 other papers
9 dated earlier, 2 the same month, 1 same year, order not determinable
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
2212.03813 (2022-12)
Robustness of Learning from Task Instructions
2023.findings-emnlp.836 (2023 (year only))
Ensemble-Instruct: Generating Instruction-Tuning Data with a Heterogeneous Mixture of LMs
and 9 more not named here
load_tf_weights_in_gpt2 11 other papers
9 dated earlier, 2 later
2206.11871 (2022-06)
Offline RL for Natural Language Generation with Implicit Language Q Learning
2211.09817 (2022-11)
On the Effect of Pre-training for Transformer in Different Modality on Offline Reinforcement Learning
2211.11694 (2022-11)
Exploring Discrete Diffusion Models for Image Captioning
and 8 more not named here
exact_match_score 8 other papers
6 dated earlier, 1 the same month, 1 same year, order not determinable
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
2212.03813 (2022-12)
Robustness of Learning from Task Instructions
2302.14691 (2023-02)
Investigating the Effectiveness of Task-Agnostic Prefix Prompt for Instruction Following
and 5 more not named here
set_argument_value 2 other papers
2 dated earlier
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
2212.03813 (2022-12)
Robustness of Learning from Task Instructions
att_mse_loss 1 other paper
1 dated earlier
2403.15268 (2024-03)
Awakening Augmented Generation: Learning to Awaken Internal Knowledge of Large Language Models for Question Answering
kd_ce_loss 1 other paper
1 dated earlier
2403.15268 (2024-03)
Awakening Augmented Generation: Learning to Awaken Internal Knowledge of Large Language Models for Question Answering
kd_mse_loss 1 other paper
1 dated earlier
2403.15268 (2024-03)
Awakening Augmented Generation: Learning to Awaken Internal Knowledge of Large Language Models for Question Answering

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

Large language models (LLMs) have acquired the ability to solve general tasks by utilizing instruction finetuning (IFT). However, IFT still relies heavily on instance training of extensive task data, which greatly limits the adaptability of LLMs to real-world scenarios where labeled task instances are scarce and broader task generalization becomes paramount. Contrary to LLMs, humans acquire skills and complete tasks not merely through repeated practice but also by understanding and following instructional guidelines. This paper is dedicated to simulating human learning to address the shortcomings of instance training, focusing on instruction learning to enhance cross-task generalization. Within this context, we introduce Task Adapters Generation from Instructions (TAGI), which automatically constructs the task-specific model in a parameter generation manner based on the given task instructions without retraining for unseen tasks. Specifically, we utilize knowledge distillation to enhance the consistency between TAGI developed through Learning with Instruction and task-specific models developed through Training with Instance, by aligning the labels, output logits, and adapter parameters between them. TAGI is endowed with cross-task generalization capabilities through a two-stage training process that includes hypernetwork pretraining and finetuning. We evaluate TAGI on the Super-Natural Instructions and P3 datasets. The experimental results demonstrate that TAGI can match or even outperform traditional meta-trained models and other hypernetwork models, while significantly reducing computational requirements. Our code will be available at https://github.com/Xnhyacinth/TAGI.

For agents

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

get_harvested_code_for_paper("2406.12382")
get_code_for_paper("2406.12382")
have("2406.12382")

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

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

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

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

Connect an agent — have() is free.