SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.05383 · EMNLP · 2024

Towards Low-Resource Harmful Meme Detection with LMM Agents

Guang Chen, Jing Ma, Ziyang Luo, Hongzhan Lin, Jianzhao Huang, Ziyan Liu

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 3 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2411.05383.json · badge: /api/ran/2411.05383.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
jianzhao-huang/lorehm canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_metrics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jianzhao-huang/lorehm/utils/utils.py
code served (permissive licence) · get_code("2fcda73a00485621")
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
import numpy as np
from sklearn.metrics import classification_report, confusion_matrix

torch.manual_seed(0)

# Create simple dummy predictions and ground truth labels
# For classification_report and confusion_matrix to work, we need:
# - y_true: array-like of true labels
# - y_pred: array-like of predicted labels
# Both should have the same length and contain integer class labels

y_true = np.array([0, 1, 2, 0, 1, 2, 0, 1])
y_pred = np.array([0, 1, 1, 0, 2, 2, 0, 1])

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
    'is_print': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
image_parser Ran
ran; our contract draft was wrong, not the code
jianzhao-huang/lorehm/utils/run_llava.py
code served (permissive licence) · get_code("a7bee88c1c7fd6a3")
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 float; 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 numpy as np

class Args:
    def __init__(self):
        self.image_file = "image1.jpg,image2.png,image3.bmp"
        self.sep = ","

ARGS = {"args": Args()}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — 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 float — 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
load_image Ran
ran, honoured the contract we drafted
jianzhao-huang/lorehm/utils/run_llava.py
code served (permissive licence) · get_code("4552e857b0cf7ef7")
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 Image. 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 requests
from PIL import Image
from io import BytesIO
from unittest.mock import Mock, patch

# Create a small test image in memory
img = Image.new('RGB', (10, 10), color='red')
img_bytes = BytesIO()
img.save(img_bytes, format='PNG')
img_bytes.seek(0)

# Mock the requests.get to return our test image
mock_response = Mock()
mock_response.content = img_bytes.getvalue()

# Test with a URL
test_url = 'https://example.com/test.png'

ARGS = {
    'image_file': test_url
}

# Patch requests.get for the function call
import sys
sys.modules['requests'].get = Mock(return_value=mock_response)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, requests — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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_images Ran
ran, honoured the contract we drafted
jianzhao-huang/lorehm/utils/run_llava.py
code served (permissive licence) · get_code("99d66c86efac69ff")
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 list, ndim 4, 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 tempfile
import os
from PIL import Image
import io

# Create temporary image files for testing
def create_temp_image():
    """Create a temporary RGB image file"""
    img = Image.new('RGB', (100, 100), color='red')
    fd, path = tempfile.mkstemp(suffix='.png')
    os.close(fd)
    img.save(path)
    return path

# Create two temporary image files
temp_image_1 = create_temp_image()
temp_image_2 = create_temp_image()

# Define ARGS for load_images function
ARGS = {
    'image_files': [temp_image_1, temp_image_2]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, requests — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, 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
parse_answer Ran
ran; our contract draft was wrong, not the code
jianzhao-huang/lorehm/utils/utils.py
code served (permissive licence) · get_code("c61e5f3d725c152a")
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. 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

# The function parse_answer takes a judge_result string and a separator string
# It splits the string, extracts a portion, and classifies it as harmless (0) or harmful (1)

# Test case 1: Result containing "harmless"
judge_result_1 = "The response is harmless. This is safe."
sep_1 = "is"

# Test case 2: Result containing "harmful"
judge_result_2 = "The judge says: harmful content detected, needs review."
sep_2 = "says:"

# Test case 3: Edge case with multiple separators and punctuation
judge_result_3 = "Classification: harmless. No issues found, proceed with caution."
sep_3 = "Classification:"

ARGS = {
    "judge_result": judge_result_1,
    "sep": sep_1
}
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 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
breakpoint_resume Not yet run
unverified (harvested, no recorded run)
jianzhao-huang/lorehm/utils/utils.py
code served (permissive licence) · get_code("87af52ca59ef1f8b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 3 later) and 3 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
load_image 85 other papers
58 dated earlier, 4 the same month, 19 later, 4 same year, order not determinable
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2305.10973 (2023-05)
Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold
2307.10490 (2023-07)
Abusing Images and Sounds for Indirect Instruction Injection in Multi-Modal LLMs
and 82 more not named here
load_images 20 other papers
13 dated earlier, 2 the same month, 4 later, 1 same year, order not determinable
2312.14867 (2023-12)
VIEScore: Towards Explainable Metrics for Conditional Image Synthesis Evaluation
2024.findings-emnlp.268 (2024 (year only))
Math-LLaVA: Bootstrapping Mathematical Reasoning for Multimodal Large Language Models
2403.13805 (2024-03)
RAR: Retrieving And Ranking Augmented MLLMs for Visual Recognition
and 17 more not named here
image_parser 16 other papers
12 dated earlier, 3 later, 1 same year, order not determinable
2304.08485 (2023-04)
Visual Instruction Tuning
2311.05437 (2023-11)
LLaVA-Plus: Learning to Use Tools for Creating Multimodal Agents
2024.findings-emnlp.268 (2024 (year only))
Math-LLaVA: Bootstrapping Mathematical Reasoning for Multimodal Large Language Models
and 13 more not named here

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

The proliferation of Internet memes in the age of social media necessitates effective identification of harmful ones. Due to the dynamic nature of memes, existing data-driven models may struggle in low-resource scenarios where only a few labeled examples are available. In this paper, we propose an agency-driven framework for low-resource harmful meme detection, employing both outward and inward analysis with few-shot annotated samples. Inspired by the powerful capacity of Large Multimodal Models (LMMs) on multimodal reasoning, we first retrieve relative memes with annotations to leverage label information as auxiliary signals for the LMM agent. Then, we elicit knowledge-revising behavior within the LMM agent to derive well-generalized insights into meme harmfulness. By combining these strategies, our approach enables dialectical reasoning over intricate and implicit harmindicative patterns. Extensive experiments conducted on three meme datasets demonstrate that our proposed approach achieves superior performance than state-of-the-art methods on the low-resource harmful meme detection task.

For agents

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

get_harvested_code_for_paper("2411.05383")
get_code_for_paper("2411.05383")
have("2411.05383")

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

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

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

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

Connect an agent — have() is free.