code-conflict
收藏资源简介:
Code Conflict数据集是一个专门设计用于评估视觉语言模型在跨模态冲突场景下表现的基准数据集。该数据集包含100个视觉Python代码冲突样本,核心特点是构建了代码截图(视觉模态)与文本描述(语言模态)之间的语义冲突。数据集包含5种不同的Python代码冲突类型,每种类型20个样本,包括:运算符替换(如+变为-)、操作数顺序变化(如a - b变为b - a)、循环边界修改(如range(10)变为range(100))、数组索引变化(如arr[0]变为arr[-1])和布尔值反转(如返回True而非False)。每个数据样本包含以下字段:高分辨率语法高亮的代码截图图像、与视觉代码逻辑匹配的真实文本描述、表示冲突的错误/误导性文本描述、不透露答案的中性评估问题、匹配代码截图的正确选项(VLM视觉偏见选择)、匹配误导文本的选项(VLM文本偏见选择)、看似合理但错误的干扰选项、序列ID(1-100)、冲突类型类别以及文本语言(英语)。该数据集支持多语言配置,但评估文本均为英语,适用于视觉语言模型的模态偏见分析、跨模态一致性评估和代码理解能力测试等研究任务。
The Code Conflict dataset is a benchmark specifically designed to evaluate the performance of vision-language models (VLMs) in cross-modal conflict scenarios. It contains 100 visual Python code conflict samples, with its core feature being the construction of semantic conflicts between code screenshots (visual modality) and textual descriptions (linguistic modality). The dataset includes 5 distinct types of Python code conflicts, with 20 samples for each type, namely: operator replacement (e.g., changing + to -), operand order reversal (e.g., changing a - b to b - a), loop boundary modification (e.g., changing range(10) to range(100)), array index adjustment (e.g., changing arr[0] to arr[-1]), and boolean value inversion (e.g., returning True instead of False). Each data sample contains the following fields: high-resolution syntax-highlighted code screenshot images, authentic textual descriptions matching the visual code logic, erroneous or misleading textual descriptions indicating the conflict, neutral evaluation questions that do not reveal the answer, correct options aligned with the code screenshots (VLM visual bias selection), options aligned with the misleading text (VLM text bias selection), plausible but incorrect distractor options, sequence ID (1-100), conflict type category, and text language (English). The dataset supports multilingual configuration, while all evaluation texts are in English, and is applicable to research tasks such as modal bias analysis of VLMs, cross-modal consistency evaluation, and code comprehension capability testing.
数据集概述
数据集名称: Code Conflict Dataset 数据集地址: https://huggingface.co/datasets/multilingual-vlm-conflict/code-conflict
核心目的: 该数据集旨在评估视觉-语言模型(VLM)在跨模态冲突(即代码截图与描述文本不一致)情况下的行为表现。
数据集规模与构成:
- 总样本数: 100个样本。
- 样本结构: 每个样本包含一张Python代码截图和两段相互矛盾的描述文本。
- 语言: 评估文本语言为英语(English)。
- 冲突类型: 包含5种不同的Python代码冲突类型,每种类型20个样本:
- operator_substitution: 运算或逻辑操作符替换(如
+变-,==变!=)。 - operand_order: 参数或操作数顺序变更(如
a - b变b - a)。 - loop_boundary: 循环边界或“差一错误”变更(如
range(10)变range(100))。 - array_indexing: 数组索引或切片偏移(如
arr[0]变arr[-1])。 - boolean_inversion: 条件分支的逻辑反转(如返回
True变False)。
- operator_substitution: 运算或逻辑操作符替换(如
数据模式 (Schema)
每个样本包含以下字段:
| 字段名 | 数据类型 | 描述 |
|---|---|---|
image |
image |
具有语法高亮的Python代码截图。 |
original_caption |
string |
与代码截图逻辑相符的真实描述。 |
conflicting_caption |
string |
与代码截图逻辑不符的错误/误导性描述。 |
question |
string |
中立的评估性问题,不透露答案。 |
image_bias |
string |
与代码截图匹配的正确选项(视觉偏向选择)。 |
text_bias |
string |
与误导性文字描述匹配的选项(文本偏向选择)。 |
distractor |
string |
看似合理但错误的干扰选项。 |
serial_no |
int64 |
样本序列号(1至100)。 |
conflict_type |
string |
代码冲突的类型。 |
language |
string |
评估文本的语言(固定为 english)。 |
数据子集 (Configs)
数据集支持24个子集(config),对应24种语言。每个子集结构与默认集一致,仅 language 字段值不同。所有子集均只包含一个训练集(train split),该训练集包含100个样本。
语言子集列表: ar, cs, de, el, es, fa, fr, he, hi, id, it, ja, ko, nl, pl, pt, ro, ru, tr, uk, vi, zh, 以及 default(英语).
子集规模示例:
default子集: train_split 大小约为 937KB。ja(日语) 子集: train_split 大小约为 946KB。- 各语言子集的 train split 大小略有不同,但均包含100个样本。
应用背景
该数据集在测试中使用了 Gemini 3.5 Flash 模型,用于研究模型在面对视觉与文本信息冲突时的模态仲裁行为。




