SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.14289 · 2024

TinyLLaVA: A Framework of Small-scale Large Multimodal Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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; 4 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/2402.14289.json · badge: /api/ran/2402.14289.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
dlcv-buaa/tinyllavabench canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran; our contract draft was wrong, not the code
dlcv-buaa/tinyllavabench/tinyllava/eval/model_vqa_loader.py
code served (permissive licence) · get_code("20e4f665698a3d18")
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 torch

torch.manual_seed(0)

# The collate_fn expects a batch which is a list/iterable of tuples
# Each tuple contains (input_ids, image_tensor, image_size)
# The function unpacks these, stacks input_ids and image_tensors, and returns image_sizes as-is

# Create sample data items
item1 = (
    torch.randint(0, 100, (4,)),  # input_ids: small tensor
    torch.randn(3, 8, 8),          # image_tensor: 3-channel image, 8x8
    (8, 8)                         # image_size: tuple
)

item2 = (
    torch.randint(0, 100, (4,)),  # input_ids: same shape
    torch.randn(3, 8, 8),          # image_tensor: same shape
    (8, 8)                         # image_size: tuple
)

# Create batch as a list of tuples
batch = [item1, item2]

ARGS = {
    "batch": batch
}
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 — 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
get_chunk Ran
ran; our contract draft was wrong, not the code
dlcv-buaa/tinyllavabench/tinyllava/eval/model_vqa.py
code served (permissive licence) · get_code("42a46570620cd9fa")
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 list, 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 math

def split_list(lst, n):
    """Split a list into n (roughly) equal-sized chunks"""
    chunk_size = math.ceil(len(lst) / n)
    return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]

def get_chunk(lst, n, k):
    chunks = split_list(lst, n)
    return chunks[k]

# Setup code
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3
k = 1

ARGS = {
    "lst": lst,
    "n": n,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 list, ndim 1, dtype family int — 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
get_value_from_kwargs Ran
ran; our contract draft was wrong, not the code
dlcv-buaa/tinyllavabench/tinyllava/model/modeling_tinyllava.py
code served (permissive licence) · get_code("c2cb10d944648763")
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 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 torch

torch.manual_seed(0)

# The function get_value_from_kwargs takes two parameters:
# 1. kwargs: a dictionary
# 2. name: a string key to look up in the dictionary

# Construct a kwargs dict with some test values
kwargs = {
    "param1": "value1",
    "param2": 42,
    "param3": torch.randn(2, 4),
    "param4": [1, 2, 3]
}

# The name parameter is a string to look up
name = "param1"

ARGS = {
    "kwargs": kwargs,
    "name": name
}
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 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
load_pretrained_model Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dlcv-buaa/tinyllavabench/tinyllava/model/load_model.py
code served (permissive licence) · get_code("f0a5e0f0713718b3")
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 float; no output shape is stated. 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 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
from collections import OrderedDict
from unittest.mock import Mock, MagicMock, patch

torch.manual_seed(0)

# Create minimal stand-in classes for the models
class TinyImageProcessor:
    def __init__(self):
        pass

class TinyVisionTower(nn.Module):
    def __init__(self):
        super().__init__()
        self._vision_tower = nn.Linear(4, 4)
        self._image_processor = TinyImageProcessor()

class TinyLanguageModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)

class TinyConnector(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)

class TinyLlavaConfig:
    def __init__(self):
        self.max_sequence_length = 2048
    
    @classmethod
    def from_pretrained(cls, path):
        return cls()

class TinyTokenizer:
    def __init__(self):
        pass

class TinyLlavaForConditionalGeneration(nn.Module):
    def __init__(self, config=None):
        super().__init__()
        self.config = config or TinyLlavaConfig()
        self.vision_tower = TinyVisionTower()
        self.language_model = TinyLanguageModel()
        self.connector = TinyConnector()
        self.tokenizer = TinyTokenizer()
    
    @classmethod
    def from_pretrained(cls, path, low_cpu_mem_usage=False):
        return cls()
    
    def to(self, dtype):
        return self

# Patch the required classes in the module namespace
import sys
current_module = sys.modules[__name__]
current_module.TinyLlavaForConditionalGeneration = TinyLlavaForConditionalGeneration
current_module.TinyLlavaConfig = TinyLlavaConfig

ARGS = {
    'model_name_or_path': 'gpt2',
    'load_type': 'hf',
    'load_8bit': False,
    'load_4bit': False,
    'device_map': 'cpu',
    'device': 'cpu',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
peft, torch, transformers — 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 float — 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
parse_multi_choice_response Ran
ran; our contract draft was wrong, not the code
dlcv-buaa/tinyllavabench/tinyllava/eval/model_vqa_mmmu.py
code served (permissive licence) · get_code("f3018307f9301da1")
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 random
import numpy as np

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

# Define the arguments for parse_multi_choice_response
ARGS = {
    "response": "The answer is (B) because it makes the most sense.",
    "all_choices": ['A', 'B', 'C', 'D'],
    "index2ans": {
        'A': 'first option',
        'B': 'second option',
        'C': 'third option',
        'D': 'fourth option'
    }
}
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 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
split_list Ran
ran; our contract draft was wrong, not the code
dlcv-buaa/tinyllavabench/tinyllava/eval/model_vqa.py
code served (permissive licence) · get_code("076c252c52cbb161")
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 list. 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 math

def split_list(lst, n):
    """Split a list into n (roughly) equal-sized chunks"""
    chunk_size = math.ceil(len(lst) / n)
    return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]

# Setup code
lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3

ARGS = {
    "lst": lst,
    "n": n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 list — a list 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
convert_legecy_config_to_tinyllavaconfig Not yet run
unverified (harvested, no recorded run)
dlcv-buaa/tinyllavabench/tinyllava/model/convert_legecy_weights_to_tinyllavafactory.py
code served (permissive licence) · get_code("2a36b652e10f69fa")
How it ran

no invocation recorded.

convert_legecy_weights_to_tinyllavafactory Not yet run
unverified (harvested, no recorded run)
dlcv-buaa/tinyllavabench/tinyllava/model/convert_legecy_weights_to_tinyllavafactory.py
code served (permissive licence) · get_code("909c4c1d00783db8")
How it ran

no invocation recorded.

convert_state_dict_to_tinyllavafactory Not yet run
unverified (harvested, no recorded run)
dlcv-buaa/tinyllavabench/tinyllava/model/convert_legecy_weights_to_tinyllavafactory.py
code served (permissive licence) · get_code("a351ee8258c5cd44")
How it ran

no invocation recorded.

load_base_ckp_for_lora Not yet run
unverified (harvested, no recorded run)
dlcv-buaa/tinyllavabench/tinyllava/model/load_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Fantasyele/LLaVA-KD, is pointer only (licence: NONE) · get_code("391fc0746cff81a2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Fantasyele/LLaVA-KD, and GitHub detected no licence in that repository 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 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, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 4 the same month, 6 later) and 4 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
split_list 197 other papers
26 dated earlier, 10 the same month, 154 later, 6 same year, order not determinable, 1 undated
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 194 more not named here
get_chunk 189 other papers
25 dated earlier, 9 the same month, 149 later, 6 same year, order not determinable
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2306.17107 (2023-06)
LLaVAR: Enhanced Visual Instruction Tuning for Text-Rich Image Understanding
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 186 more not named here
collate_fn 54 other papers
4 dated earlier, 2 the same month, 48 later
2308.13566 (2023-08)
MLLM-DataEngine: An Iterative Refinement Approach for MLLM
2310.08588 (2023-10)
Octopus: Embodied Vision-Language Programmer from Environmental Feedback
2311.07362 (2023-11)
Volcano: Mitigating Multimodal Hallucination through Self-Feedback Guided Revision
and 51 more not named here
parse_multi_choice_response 9 other papers
1 dated earlier, 1 the same month, 7 later
2311.10774 (2023-11)
MMC: Advancing Multimodal Chart Understanding with Large-scale Instruction Tuning
2402.11530 (2024-02)
Efficient Multimodal Learning from Data-centric Perspective
2406.09411 (2024-06)
MuirBench: A Comprehensive Benchmark for Robust Multi-image Understanding
and 6 more not named here
get_value_from_kwargs 2 other papers
2 later
2410.16236 (2024-10)
LLaVA-KD: A Framework of Distilling Multimodal Large Language Models
2503.21776 (2025-03)
Video-R1: Reinforcing Video Reasoning in MLLMs
load_base_ckp_for_lora 1 other paper
1 later
2410.16236 (2024-10)
LLaVA-KD: A Framework of Distilling Multimodal Large Language Models

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

We present the TinyLLaVA framework that provides a unified perspective in designing and analyzing the small-scale Large Multimodal Models (LMMs). We empirically study the effects of different vision encoders, connection modules, language models, training data and training recipes. Our extensive experiments showed that better quality of data combined with better training recipes, smaller LMMs can consistently achieve on-par performances compared to bigger LMMs. Under our framework, we train a family of small-scale LMMs. Our best model, TinyLLaVA-3.1B, achieves better overall performance against existing 7B models such as LLaVA-1.5 and Qwen-VL. We hope our findings can serve as baselines for future research in terms of data scaling, training setups and model selections. Our model weights and codes will be made public.

For agents

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

get_harvested_code_for_paper("2402.14289")
get_code_for_paper("2402.14289")
have("2402.14289")

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

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

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

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

Connect an agent — have() is free.