SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.03501 · EMNLP · 2022

Towards Multi-Modal Sarcasm Detection via Hierarchical Congruity Modeling with Knowledge Enhancement

Haoliang Li, Hui Liu, Wenya Wang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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 5 have no contract verdict; 2 failures of our instrument; 2 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/2210.03501.json · badge: /api/ran/2210.03501.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
less-and-less-bugs/hkemodel canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
CutoutDefault Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
less-and-less-bugs/hkemodel/aug_lib.py
code served (permissive licence) · get_code("e4ca38c3c035ccad")
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 numpy as np
from PIL import Image
import random

random.seed(0)
np.random.seed(0)

# Create a small test image
img = Image.new('RGB', (100, 80), color='red')

# Define PARAMETER_MAX for the float_parameter function
PARAMETER_MAX = 10

# Create a mock min_max_vals object for the enhancer_impl function
class MinMaxVals:
    class Enhancer:
        min = 0.1
        max = 1.8
    
    enhancer = Enhancer()

min_max_vals = MinMaxVals()

ARGS = {
    'img': img,
    'v': 20
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — 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
L2_Norm Ran
ran on a synthesized input
less-and-less-bugs/hkemodel/utils/compute_scores.py
code served (permissive licence) · get_code("df17f3e84b39ba95")
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 2, 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
import math

torch.manual_seed(0)

# The function L2_Norm expects two arguments that:
# 1. Support division by a scalar (/)
# 2. Have a .dot() method (vector dot product)
# These are numpy arrays or torch tensors

# Create two alignment distribution vectors as numpy arrays
a1 = np.array([1.0, 2.0, 3.0, 4.0])
a2 = np.array([0.5, 1.5, 2.5, 3.5])

ARGS = {
    "a1": a1,
    "a2": a2
}
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 tuple, ndim 2, 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
get_four_metrics Ran
ran on a synthesized input
less-and-less-bugs/hkemodel/utils/compute_scores.py
code served (permissive licence) · get_code("ed18fb8667743e9d")
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 sklearn.metrics as metrics
import numpy as np

# The function get_four_metrics takes two parameters:
# - labels: ground truth binary labels
# - predicted_labels: predicted binary labels
# 
# The function uses metrics.confusion_matrix which expects:
# - 1D array-like of true labels
# - 1D array-like of predicted labels
# Both should contain binary values (0 and 1)

# Create small binary classification data
labels = np.array([0, 1, 1, 0, 1, 1, 0, 0])
predicted_labels = np.array([0, 1, 0, 0, 1, 1, 1, 0])

ARGS = {
    "labels": labels,
    "predicted_labels": predicted_labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
get_metrics Ran
ran on a synthesized input
less-and-less-bugs/hkemodel/utils/compute_scores.py
code served (permissive licence) · get_code("249b3fa8193d045c")
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 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 numpy as np

torch.manual_seed(0)

# Create a small tensor with shape (N, 2) where N=2
# The function expects y[:, 0] (negative class scores) and y[:, 1] (positive class scores)
y = torch.tensor([
    [0.5, 0.8],
    [0.9, 0.3]
], dtype=torch.float32)

ARGS = {
    "y": y
}
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 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
pad_tensor Ran
ran on a synthesized input
less-and-less-bugs/hkemodel/utils/data_utils.py
code served (permissive licence) · get_code("0e688f22521702da")
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, 5) 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)

# Create a small tensor to pad
# Shape: (2, 3) - batch size 2, feature dim 3
vec = torch.randn(2, 3)

# Total size to pad to in the specified dimension
pad = 5

# Dimension to pad (0 or 1)
dim = 1

ARGS = {
    "vec": vec,
    "pad": pad,
    "dim": dim,
}
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, 5) — shape (2, 5) 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
read_json Ran
ran; our contract draft was wrong, not the code
less-and-less-bugs/hkemodel/utils/data_utils.py
code served (permissive licence) · get_code("621248420b870218")
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 json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
json_file_path = os.path.join(temp_dir, "test_data.json")

sample_data = {
    "name": "test",
    "values": [1, 2, 3],
    "nested": {"key": "value"}
}

with open(json_file_path, 'w', encoding='utf-8') as f:
    json.dump(sample_data, f)

ARGS = {
    "path": json_file_path
}
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 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
reads_json Ran
ran on a synthesized input
less-and-less-bugs/hkemodel/utils/data_utils.py
code served (permissive licence) · get_code("48e784d3b59fd880")
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 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 json
import tempfile
import os

# Create a temporary JSON Lines file
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.jsonl")

# Write some test data as JSON Lines format
test_data = [
    {"id": 1, "text": "hello"},
    {"id": 2, "text": "world"},
    {"id": 3, "text": "test"}
]

with open(temp_file, 'w') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "path": temp_file
}
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 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
float_parameter Not yet run
unverified (harvested, no recorded run)
less-and-less-bugs/hkemodel/aug_lib.py
code served (permissive licence) · get_code("d89b3877276c7068")
How it ran

no invocation recorded.

int_parameter Not yet run
unverified (harvested, no recorded run)
less-and-less-bugs/hkemodel/aug_lib.py
code served (permissive licence) · get_code("f0777303762c1ba8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 4 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.

FunctionAlso present inEarliest-datedOthers named
float_parameter 15 other papers
11 dated earlier, 4 later
1409.4842 (2014-09)
Going deeper with convolutions
1512.00567 (2015-12)
Rethinking the Inception Architecture for Computer Vision
1608.06993 (2016-08)
Densely Connected Convolutional Networks
and 12 more not named here
int_parameter 8 other papers
6 dated earlier, 2 later
1409.4842 (2014-09)
Going deeper with convolutions
1512.00567 (2015-12)
Rethinking the Inception Architecture for Computer Vision
1608.06993 (2016-08)
Densely Connected Convolutional Networks
and 5 more not named here
CutoutDefault 2 other papers
2 later
2305.02507 (2023-05)
Stimulative Training++: Go Beyond The Performance Limits of Residual Networks
2409.06290 (2024-09)
EntAugment: Entropy-Driven Adaptive Data Augmentation Framework for Image Classification
read_json 1 other paper
1 later
2507.04701 (2025-07)
XiYan-SQL: A Novel Multi-Generator Framework For Text-to-SQL

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

Sarcasm is a linguistic phenomenon indicating a discrepancy between literal meanings and implied intentions. Due to its sophisticated nature, it is usually challenging to be detected from the text itself. As a result, multi-modal sarcasm detection has received more attention in both academia and industries. However, most existing techniques only modeled the atomic-level inconsistencies between the text input and its accompanying image, ignoring more complex compositions for both modalities. Moreover, they neglected the rich information contained in external knowledge, e.g., image captions. In this paper, we propose a novel hierarchical framework for sarcasm detection by exploring both the atomic-level congruity based on multi-head cross attention mechanism and the composition-level congruity based on graph neural networks, where a post with low congruity can be identified as sarcasm. In addition, we exploit the effect of various knowledge resources for sarcasm detection. Evaluation results on a public multi-modal sarcasm detection dataset based on Twitter demonstrate the superiority of our proposed model.

For agents

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

get_harvested_code_for_paper("2210.03501")
get_code_for_paper("2210.03501")
have("2210.03501")

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

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

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

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

Connect an agent — have() is free.