SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.21534 · NeurIPS · 2024

ControlMLLM: Training-Free Visual Prompt Learning for Multimodal Large Language Models

Rongrong Ji, Xiaoshuai Sun, Hao Fei, Jiayi Ji, Mingrui Wu, Xinyue Cai, Jiale Li, Oucheng Huang, Gen Luo, Guannan Jiang, Training Method

arXiv · PDF · Open in the Atlas

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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 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/2407.21534.json · badge: /api/ran/2407.21534.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
mrwu-mac/controlmllm canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
att_window_from_bbox Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mrwu-mac/controlmllm/controlmllm++/qwen2_5_vl/qwen_utils.py
code served (permissive licence) · get_code("75d76a38bbfdc998")
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, ndim 1, dtype family int; 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 numpy as np

ARGS = {
    "bbox": (10, 20, 100, 150),
    "image_size": (640, 480),
    "att_shape": (14, 14),
    "clip": True
}
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, ndim 1, dtype family int — a tuple 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
build_mask_from_bbox Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mrwu-mac/controlmllm/controlmllm++/qwen2_5_vl/qwen_utils.py
code served (permissive licence) · get_code("ac99733f80f7b69e")
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 2, dtype family float, shape (8, 12) 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 numpy as np

torch.manual_seed(0)

# Define the arguments for build_mask_from_bbox
bbox = (10, 20, 50, 80)  # (x1, y1, x2, y2) - bounding box coordinates
image_size = (640, 480)  # (width, height) - image dimensions
grid_shape = (8, 12)  # (height, width) - attention grid shape
device = 'cpu'

ARGS = {
    'bbox': bbox,
    'image_size': image_size,
    'grid_shape': grid_shape,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (8, 12) — shape (8, 12) 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
compute_ca_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mrwu-mac/controlmllm/controlmllm++/llava/utils.py
code served (permissive licence) · get_code("62f41cf13196989a")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
height = 4
width = 3

# rel_map: attention map with shape (batch, height*width)
rel_map = torch.rand(batch_size, height * width)

# masks: list of binary masks, each with shape (height, width)
masks = [
    torch.rand(height, width),
    torch.rand(height, width)
]

# choice: optional string parameter
choice = 'Scribble'

# mu: standard deviation parameter for gaussian
mu = 0.3

# object_positions: optional parameter (not used in function body, but included in signature)
object_positions = None

ARGS = {
    'rel_map': rel_map,
    'masks': masks,
    'choice': choice,
    'mu': mu,
    'object_positions': object_positions
}
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
compute_ca_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mrwu-mac/controlmllm/controlmllm/instructblip/utils.py
code served (permissive licence) · get_code("18de0523aa840ac7")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Construct rel_map: shape (batch, height, width)
# The function reshapes it to (b, H, W), so we need a 3D tensor
rel_map = torch.randn(2, 4, 3)  # batch=2, H=4, W=3

# Construct masks: list of 2D tensors, each with shape (H, W)
# The function accesses masks[obj_idx].shape to get H, W
mask1 = torch.randn(4, 3)  # H=4, W=3
mask2 = torch.randn(4, 3)  # H=4, W=3
masks = [mask1, mask2]

# choice parameter - can be None, 'Scribble', or 'Point'
choice = None

# object_positions parameter - appears to be unused in function body
object_positions = None

ARGS = {
    "rel_map": rel_map,
    "masks": masks,
    "choice": choice,
    "object_positions": object_positions,
}
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
gaussian Ran
ran; our contract draft was wrong, not the code
mrwu-mac/controlmllm/controlmllm++/llava/utils.py
code served (permissive licence) · get_code("a9210833fb8a046d")
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 2, dtype family float, shape (2, 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 torch

torch.manual_seed(0)

# The function gaussian(x, mu, sigma) computes a Gaussian probability density
# It performs element-wise operations on tensors, so we need:
# - x: a tensor (the input values)
# - mu: a tensor (the mean)
# - sigma: a tensor (the standard deviation)

x = torch.randn(2, 4)
mu = torch.tensor(0.0)
sigma = torch.tensor(1.0)

ARGS = {
    "x": x,
    "mu": mu,
    "sigma": sigma,
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
get_grid_shape Ran
ran; our contract draft was wrong, not the code
mrwu-mac/controlmllm/controlmllm++/qwen2_5_vl/qwen_utils.py
code served (permissive licence) · get_code("dd419e18dc676bcc")
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, ndim 1, dtype family int; 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)

class StandInImageProcessor(nn.Module):
    def __init__(self):
        super().__init__()
    
    def __call__(self, images):
        # The function expects aux['image_grid_thw'] to be a tensor
        # with shape (batch_size, 3) where indices 1 and 2 are height and width
        # We create a minimal return dict with the required key
        batch_size = len(images) if isinstance(images, list) else images.shape[0]
        
        # image_grid_thw should have shape (batch_size, 3)
        # Set values so that h = int(value[0, 1] / 2) and w = int(value[0, 2] / 2)
        # We'll use 8 and 6 so h=4 and w=3
        image_grid_thw = torch.tensor(
            [[2, 8, 6]], dtype=torch.float32
        ).repeat(batch_size, 1)
        
        return {'image_grid_thw': image_grid_thw}

class StandInProcessor(nn.Module):
    def __init__(self):
        super().__init__()
        self.image_processor = StandInImageProcessor()

# Create processor
processor = StandInProcessor()

# Create image inputs - can be a list or tensor
image_inputs = [torch.randn(3, 64, 64) for _ in range(2)]

ARGS = {
    'processor': processor,
    'image_inputs': image_inputs
}
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 tuple, ndim 1, dtype family int — a tuple 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
show_image_relevance Not yet run
unverified (harvested, no recorded run)
mrwu-mac/controlmllm/controlmllm++/llava/utils.py
code served (permissive licence) · get_code("4c90a0e507c16145")
How it ran

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, 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 7 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

In this work, we propose a training-free method to inject visual prompts into Multimodal Large Language Models (MLLMs) through test time optimization of a learnable latent variable. We observe that attention, as the core module of MLLMs, connects text prompt tokens and visual tokens, ultimately determining the final results. Our approach involves adjusting visual tokens from the MLP output at test time, controlling the attention response to ensure text prompt tokens attend to visual tokens in referring regions. We optimize a learnable latent variable based on an energy function, enhancing the strength of referring regions in the attention map. This enables detailed region description and reasoning without the need for substantial training costs or model retraining. Our method offers a promising direction for integrating referring abilities into MLLMs, and supports referring with box, mask, scribble and point. The results demonstrate that our method exhibits out-of-domain generalization and interpretability. Code: https://github. com/mrwu-mac/ControlMLLM.

For agents

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

get_harvested_code_for_paper("2407.21534")
get_code_for_paper("2407.21534")
have("2407.21534")

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

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

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

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

Connect an agent — have() is free.