SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Hong_CogAgent_A_Visual_Language_Model_for_GUI_Agents_CVPR_2024_paper · CVPR · 2024

CogAgent: A Visual Language Model for GUI Agents

Yuxiao Dong, Jie Tang, Yan Wang, Ming Ding, Wenyi Hong, Zihan Wang, Qingsong Lv, Jiazheng Xu, Wenmeng Yu, Weihan Wang, Junhui Ji

Open in the Atlas

Code that ran

5 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 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/Hong_CogAgent_A_Visual_Language_Model_for_GUI_Agents_CVPR_2024_paper.json · badge: /api/ran/Hong_CogAgent_A_Visual_Language_Model_for_GUI_Agents_CVPR_2024_paper.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
THUDM/CogVLM canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
data_collator Ran
ran; our contract draft was wrong, not the code
THUDM/CogVLM/finetune_demo/evaluate_cogvlm_demo.py
code served (permissive licence) · get_code("54a2b4c8804d95b2")
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 dict. 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 numpy as np

torch.manual_seed(0)

# Create example batch items following the structure expected by data_collator
example1 = {
    'vision': {
        'pixel_values': torch.randn(2, 3, 4, 4),
        'image_sizes': [224, 224]
    },
    'input_ids': torch.tensor([[101, 2054, 2003, 102]]),
    'attention_mask': torch.tensor([[1, 1, 1, 1]]),
    'cross': torch.randn(2, 5)
}

example2 = {
    'vision': {
        'pixel_values': torch.randn(2, 3, 4, 4),
        'image_sizes': [224, 224]
    },
    'input_ids': torch.tensor([[101, 2054, 2003, 102]]),
    'attention_mask': torch.tensor([[1, 1, 1, 1]]),
    'cross': torch.randn(2, 5)
}

examples = [example1, example2]

ARGS = {
    'examples': examples
}
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 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
override_dist_dtype_device_args Ran
ran; our contract draft was wrong, not the code
THUDM/CogVLM/utils/models/cogvlm_model.py
code served (permissive licence) · get_code("f3df71c28fae6837")
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 Namespace. 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 argparse
from copy import deepcopy

def test_override_dist_dtype_device_args():
    # Create a base args object for inference mode
    args_inference = argparse.Namespace(
        world_size=1,
        rank=0,
        local_rank=0,
        skip_init=False,
        use_gpu_initialization=False,
        deepspeed=False,
        bf16=False,
        fp16=False,
        mode='inference',
        device='cpu'
    )
    
    # Create a base args object for training mode with all required attributes
    args_training = argparse.Namespace(
        world_size=2,
        rank=0,
        local_rank=0,
        skip_init=False,
        use_gpu_initialization=True,
        deepspeed=True,
        bf16=True,
        fp16=False,
        mode='training',
        device='cpu',
        checkpoint_activations=True,
        checkpoint_num_layers=12,
        model_parallel_size=4
    )
    
    # Create a base args object for training mode with vit_checkpoint_activations
    args_vit = argparse.Namespace(
        world_size=1,
        rank=0,
        local_rank=0,
        skip_init=True,
        use_gpu_initialization=False,
        deepspeed=False,
        bf16=False,
        fp16=True,
        mode='training',
        device='cpu',
        vit_checkpoint_activations=False,
        checkpoint_num_layers=6,
        model_parallel_size=2
    )

ARGS = {
    'args': argparse.Namespace(
        world_size=1,
        rank=0,
        local_rank=0,
        skip_init=False,
        use_gpu_initialization=False,
        deepspeed=False,
        bf16=False,
        fp16=False,
        mode='inference',
        device='cpu'
    ),
    'b': {}
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
postprocess_image Ran
ran; our contract draft was wrong, not the code
THUDM/CogVLM/composite_demo/conversation.py
code served (permissive licence) · get_code("d8de666d9830ab8d")
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.

from PIL import Image, ImageDraw
import re

# Create a test image (200x200 RGB image with white background)
test_image = Image.new('RGB', (200, 200), color='white')

# Create test text with bounding box patterns
# Pattern format: [[x1,y1,x2,y2]] for rectangles or [[x,y]] for points
# The function scales coordinates by multiplying by 0.001 and image dimensions
test_text = "Here is a box [[100,100,200,200]] and another [[300,300,400,400;500,500,600,600]] and a point [[50,50]]"

ARGS = {
    'text': test_text,
    'img': test_image,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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
postprocess_text Ran
ran; our contract draft was wrong, not the code
THUDM/CogVLM/composite_demo/conversation.py
code served (permissive licence) · get_code("2ce3e067b29fa052")
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 torch

# Example arguments for postprocess_text function
template = "The generated task is: <TASK>"
text = "  classify images into categories  "

ARGS = {
    "template": template,
    "text": text,
}
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 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
process_image_without_resize Ran
ran; our contract draft was wrong, not the code
THUDM/CogVLM/basic_demo/web_demo.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from thudm/cogcom, is pointer only (licence: NOASSERTION) · get_code("dc039cc4ef751f3a")
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 thudm/cogcom, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

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, 5 are also present in other papers whose code we hold (5 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
process_image_without_resize 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.08914 (2023-12)
CogAgent: A Visual Language Model for GUI Agents
2402.04236 (2024-02)
CogCoM: A Visual Language Model with Chain-of-Manipulations Reasoning
data_collator 1 other paper
1 dated earlier
2312.08914 (2023-12)
CogAgent: A Visual Language Model for GUI Agents
override_dist_dtype_device_args 1 other paper
1 dated earlier
2312.08914 (2023-12)
CogAgent: A Visual Language Model for GUI Agents
postprocess_image 1 other paper
1 dated earlier
2312.08914 (2023-12)
CogAgent: A Visual Language Model for GUI Agents
postprocess_text 1 other paper
1 dated earlier
2312.08914 (2023-12)
CogAgent: A Visual Language Model for GUI Agents

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

People are spending an enormous amount of time on digital devices through graphical user interfaces (GUIs), e.g., computer or smartphone screens. Large language models (LLMs) such as ChatGPT can assist people in tasks like writing emails, but struggle to understand and interact with GUIs, thus limiting their potential to increase automation levels. In this paper, we introduce CogAgent, an 18billion-parameter visual language model (VLM) specializing in GUI understanding and navigation. By utilizing both low-resolution and high-resolution image encoders, CogAgent supports input at a resolution of 1120⇥1120, enabling it to recognize tiny page elements and text. As a generalist visual language model, CogAgent achieves the state of the art on five text-rich and four general VQA benchmarks, including VQAv2, OK-VQA, Text-VQA, ST-VQA, ChartQA, infoVQA, DocVQA, MM-Vet, and POPE. CogAgent, using only screenshots as input, outperforms LLM-based methods that consume extracted HTML text on both PC and Android GUI navigation tasks-Mind2Web and AITW, advancing the state of the art. The model and codes are available at https://github.com/THUDM/CogVLM .

For agents

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

get_harvested_code_for_paper("Hong_CogAgent_A_Visual_Language_Model_for_GUI_Agents_CVPR_2024_paper")
get_code_for_paper("Hong_CogAgent_A_Visual_Language_Model_for_GUI_Agents_CVPR_2024_paper")
have("Hong_CogAgent_A_Visual_Language_Model_for_GUI_Agents_CVPR_2024_paper")

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

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

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

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

Connect an agent — have() is free.