SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.02349 · ICLR · 2025

Large (Vision) Language Models are Unsupervised In-Context Learners

Maria Brbić, Artyom Gadetsky, Andrei Atanov, Zhitong Gao, Yulun Jiang, Ghazal Hosseini, Mighan Zamir

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2504.02349.json · badge: /api/ran/2504.02349.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
mlbio-epfl/joint-inference canonical (classifier label)
classifier basis: classifier_2025
3 ran · 2 no recorded run
FunctionStatusWhere it lives
replace_none_with_default Ran
ran; our contract draft was wrong, not the code
mlbio-epfl/joint-inference/unsupervised_ft_llm.py
code served (permissive licence) · get_code("00a886c1703d3ae6")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:17:35Z). 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

torch.manual_seed(0)

# The function takes a dict and replaces None values with empty strings
# It iterates through keys and checks if values are None

data = {
    'key1': None,
    'key2': 'some_value',
    'key3': None,
    'key4': 42,
    'key5': None
}

ARGS = {
    'data': data
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
find_len_of_common_prefix Ran
ran, honoured the contract we drafted
mlbio-epfl/joint-inference/unsupervised_icl_llm.py
code served (permissive licence) · get_code("cac6357ee909bfae")
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 int64, 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 numpy as np

# The function takes two lists and converts them to numpy arrays
# It finds the length of the common prefix between the two arrays
# by comparing elements and finding the first mismatch

list1 = [1, 2, 3, 4, 5]
list2 = [1, 2, 3, 7, 8]

ARGS = {
    "list1": list1,
    "list2": list2
}
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 int64, 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_location_prefix Ran
ran; our contract draft was wrong, not the code
mlbio-epfl/joint-inference/unsupervised_icl_llm.py
code served (permissive licence) · get_code("640a420f34882a39")
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 tuple. 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 numpy as np
from unittest.mock import MagicMock

LOC_FINDER_TOKEN = '<loc_finder>'

class MockTokenizer:
    def __init__(self):
        self.special_tokens_map = {
            'additional_special_tokens': [LOC_FINDER_TOKEN, '<other>']
        }
    
    def __call__(self, text):
        # Simple mock tokenizer that returns different token sequences
        # based on whether LOC_FINDER_TOKEN is in the text
        if LOC_FINDER_TOKEN in text:
            # Return a shorter sequence when LOC_FINDER_TOKEN is present
            return {'input_ids': [101, 1045, 2572, 102]}
        else:
            # Return a longer sequence for the full template
            return {'input_ids': [101, 1045, 2572, 2054, 2003, 102]}

def mock_template(input_dict, y):
    """Mock template function that formats input_dict and y into a string"""
    return f"This is {input_dict.get('key', 'template')} with {y}"

input_dict = {
    'key': 'value',
    'context': 'some context'
}

y = 'target_token'

prefix = 'prefix: '

tokenizer = MockTokenizer()

template = mock_template

ARGS = {
    'template': template,
    'tokenizer': tokenizer,
    'input_dict': input_dict,
    'y': y,
    'prefix': prefix
}
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 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
balanced_sampling Not yet run
unverified (harvested, no recorded run)
mlbio-epfl/joint-inference/unsupervised_icl_llm.py
code served (permissive licence) · get_code("83f821a080f6142a")
How it ran

no invocation recorded.

icl_inference Not yet run
unverified (harvested, no recorded run)
mlbio-epfl/joint-inference/unsupervised_icl_llm.py
code served (permissive licence) · get_code("09dd1dd500c5dec3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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-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 advances in large language and vision-language models have enabled zeroshot inference, allowing models to solve new tasks without task-specific training. Various adaptation techniques such as prompt engineering, In-Context Learning (ICL), and supervised fine-tuning can further enhance the model's performance on a downstream task, but they require substantial manual effort to construct effective prompts or labeled examples. In this work, we introduce a joint inference framework for fully unsupervised adaptation, eliminating the need for manual prompt engineering and labeled examples. Unlike zero-shot inference, which makes independent predictions, the joint inference makes predictions simultaneously for all inputs in a given task. Since direct joint inference involves computationally expensive optimization, we develop efficient approximation techniques, leading to two unsupervised adaptation methods: unsupervised fine-tuning and unsupervised ICL. We demonstrate the effectiveness of our methods across diverse tasks and models, including language-only Llama-3.1 on natural language processing tasks, reasoning-oriented Qwen2.5-Math on grade school math problems, vision-language OpenFlamingo on vision tasks, and the API-only access GPT-4o model on massive multi-discipline tasks. Our experiments demonstrate substantial improvements over the standard zero-shot approach, including 39% absolute improvement on the challenging GSM8K math reasoning dataset. Remarkably, despite being fully unsupervised, our framework often performs on par with supervised approaches that rely on ground truth labels. * Equal contribution. 1 This usually also involves having a task-specific textual instruction which we omit here for simplicity.

For agents

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

get_harvested_code_for_paper("2504.02349")
get_code_for_paper("2504.02349")
have("2504.02349")

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

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

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

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

Connect an agent — have() is free.