SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.20730 · 2026

Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning

Jy-Yong Sohn, Jihoon Kwon, Jiwon Choi

arXiv · PDF

Code that ran

6 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 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/2605.20730.json · badge: /api/ran/2605.20730.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
HITsz-TMG/ICL-State-Vector canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
LzVv123456/I2CL community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
get_data_layers Ran
ran; our contract draft was wrong, not the code
HITsz-TMG/ICL-State-Vector/selected_layers.py
pointer only (licence: NONE) · get_code("7fa4c0d4e9cee1af")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HITsz-TMG/ICL-State-Vector 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.

metric_average Ran
ran, honoured the contract we drafted
HITsz-TMG/ICL-State-Vector/utils.py
pointer only (licence: NONE) · get_code("dc25dfef6f90b386")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HITsz-TMG/ICL-State-Vector 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.

sea_born Ran
ran; our contract draft was wrong, not the code
HITsz-TMG/ICL-State-Vector/utils.py
pointer only (licence: NONE) · get_code("85ac527a9dce9de6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HITsz-TMG/ICL-State-Vector 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.

shuffle_train Ran
ran; our contract draft was wrong, not the code
HITsz-TMG/ICL-State-Vector/utils.py
pointer only (licence: NONE) · get_code("f4d8b3796ddaccdf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HITsz-TMG/ICL-State-Vector 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.

str2list Ran
ran; our contract draft was wrong, not the code
HITsz-TMG/ICL-State-Vector/state_vector_optimize.py
pointer only (licence: NONE) · get_code("3b34facc51914c48")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HITsz-TMG/ICL-State-Vector 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.

target_layer_selection Ran
ran, honoured the contract we drafted
LzVv123456/I2CL/run_task_vector.py
code served (permissive licence) · get_code("405289a97499d9cc")
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 int, ndim 0, dtype family int, 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 as nn

torch.manual_seed(0)

class MockTokenizer:
    def __call__(self, text):
        return {"input_ids": torch.tensor([[1, 2, 3, 4]])}

class MockEvaluator:
    def evaluate(self, model, tokenizer, demonstration='', use_cache=False):
        return {
            'accuracy': 0.75,
            'loss': 0.25,
            'f1': 0.70
        }

class MockModelWrapper(nn.Module):
    def __init__(self, num_layers=4):
        super().__init__()
        self.num_layers = num_layers
        self.layers = nn.ModuleList([nn.Linear(4, 4) for _ in range(num_layers)])
    
    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x
    
    class ContextManager:
        def __init__(self, model):
            self.model = model
        
        def __enter__(self):
            return self
        
        def __exit__(self, exc_type, exc_val, exc_tb):
            pass
    
    def replace_latent(self, context_vector_dict, layers, config):
        return self.ContextManager(self)

class MockArgs:
    def __init__(self):
        self.metric = 'accuracy'
        self.config = {
            'use_cache': False,
            'hidden_size': 4
        }

model_wrapper = MockModelWrapper(num_layers=4)
tokenizer = MockTokenizer()
evaluator = MockEvaluator()
args = MockArgs()

context_vector_dict = {
    0: torch.randn(2, 4),
    1: torch.randn(2, 4),
    2: torch.randn(2, 4),
    3: torch.randn(2, 4)
}

ARGS = {
    'args': args,
    'model_wrapper': model_wrapper,
    'tokenizer': tokenizer,
    'evaluator': evaluator,
    'context_vector_dict': context_vector_dict
}
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 int, ndim 0, dtype family int, 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
get_optimizers Not yet run
unverified (harvested, no recorded run)
HITsz-TMG/ICL-State-Vector/optimizer.py
pointer only (licence: NONE) · get_code("f5d8f58d3af60f15")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HITsz-TMG/ICL-State-Vector 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.

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, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 0 later) and 0 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
get_data_layers 1 other paper
1 dated earlier
2404.11225 (2024-04)
In-Context Learning State Vector with Inner and Momentum Optimization
get_optimizers 1 other paper
1 dated earlier
2404.11225 (2024-04)
In-Context Learning State Vector with Inner and Momentum Optimization
metric_average 1 other paper
1 dated earlier
2404.11225 (2024-04)
In-Context Learning State Vector with Inner and Momentum Optimization
sea_born 1 other paper
1 dated earlier
2404.11225 (2024-04)
In-Context Learning State Vector with Inner and Momentum Optimization
shuffle_train 1 other paper
1 dated earlier
2404.11225 (2024-04)
In-Context Learning State Vector with Inner and Momentum Optimization
str2list 1 other paper
1 dated earlier
2404.11225 (2024-04)
In-Context Learning State Vector with Inner and Momentum Optimization
target_layer_selection
brick of this paper's assembly: entry
1 other paper
1 dated earlier
2405.14660 (2024-05)
Implicit In-context 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

In-context learning (ICL) allows large language models (LLMs) to adapt to new tasks through demonstrations, yet it suffers from escalating inference costs as context length increases. While task vectors offer a promising alternative by compressing demonstrations into compact hidden-state representations, their quality has been evaluated only through downstream task accuracy. This indirect criterion provides limited insight into how to design more effective task vector extraction methods. In this paper, we posit that inference using task vectors should align their predictive distribution with that of ICL. To quantify this, we introduce d NTP , a metric that measures the discrepancy in next-token probabilities between task vector-based and ICL-based inference. Our empirical analysis reveals that d NTP serves as a performance proxy, exhibiting a strong negative correlation with downstream accuracy. Motivated by this, we develop Linear Task Vector (LTV), a method designed to minimize d NTP via a closed-form linear mapping that estimates demonstration effects through regression. Across eight classification benchmarks and five LLMs, LTV consistently outperforms existing task vector baselines, improving average accuracy by 9.2% while reducing inference latency. We further show that LTV outperforms the baselines on regression tasks. Moreover, we investigate the transferability of LTV across different model scales; an aspect that has remained nascent in task vector research. Specifically, we empirically show that task vectors from a larger model can enhance a smaller model's performance by 6.4%, suggesting a new utility for extracted task representations.

For agents

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

get_harvested_code_for_paper("2605.20730")
get_code_for_paper("2605.20730")
have("2605.20730")

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

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

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

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

Connect an agent — have() is free.