Dataset Viewer
Auto-converted to Parquet Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    CastError
Message:      Couldn't cast
sample_id: string
code: string
source_file: string
genome: string
io_pairs: string
num_io_pairs: int64
correct_io_input: string
correct_io_output: string
incorrect_io_input: string
incorrect_io_output: string
metric_N1: double
metric_N2: double
metric_alpha_count: double
metric_approx_word_count: double
metric_average_clustering: double
metric_average_shortest_path_length: double
metric_avg_opcode_count: double
metric_blank: double
metric_bugs: double
metric_calculated_length: double
metric_code: null
metric_code_length: double
metric_comments: double
metric_contains_emails: double
metric_contains_numbers: double
metric_contains_special_sequences: double
metric_contains_urls: double
metric_cyclomatic_complexity: double
metric_density: double
metric_diameter: double
metric_dict_count: double
metric_difficulty: double
metric_digit_count: double
metric_effort: double
metric_graph_nodes_!=: double
metric_graph_nodes_%: double
metric_graph_nodes_(: double
metric_graph_nodes_): double
metric_graph_nodes_*: double
metric_graph_nodes_**: double
metric_graph_nodes_*=: double
metric_graph_nodes_+: double
metric_graph_nodes_+=: double
metric_graph_nodes_,: double
metric_graph_nodes_-: double
metric_graph_nodes_-=: double
metric_graph_nodes_.: double
metric_graph_nodes_//: double
metric_graph_nodes_:: double
metric_graph_nodes_:=: double
metric_graph_nodes_;: double
metric_graph_nodes_<: double
metric_graph_nodes_<=: double
metric_graph_nodes_=: double
metric_graph_nodes_==: double
metri
...
ount: double
metric_special_char_count: double
metric_sum_opcodes: double
metric_time: double
metric_top_0_opcode_name: double
metric_top_10_opcode_name: double
metric_top_11_opcode_name: double
metric_top_12_opcode_name: double
metric_top_13_opcode_name: double
metric_top_14_opcode_name: double
metric_top_15_opcode_name: double
metric_top_16_opcode_name: double
metric_top_17_opcode_name: double
metric_top_18_opcode_name: double
metric_top_19_opcode_name: double
metric_top_1_opcode_name: double
metric_top_2_opcode_name: double
metric_top_3_opcode_name: double
metric_top_4_opcode_name: double
metric_top_5_opcode_name: double
metric_top_6_opcode_name: double
metric_top_7_opcode_name: double
metric_top_8_opcode_name: double
metric_top_9_opcode_name: double
metric_try_count: double
metric_tuple_count: double
metric_variable_count: double
metric_vocabulary: double
metric_volume: double
llm_codellama_13b_success: bool
llm_codellama_13b_num_correct: int64
llm_codellama_13b_num_total: int64
llm_gpt_oss_120b_success: bool
llm_gpt_oss_120b_num_correct: int64
llm_gpt_oss_120b_num_total: int64
llm_llama_3_3_70b_success: bool
llm_llama_3_3_70b_num_correct: int64
llm_llama_3_3_70b_num_total: int64
llm_mistral_small_24b_success: bool
llm_mistral_small_24b_num_correct: int64
llm_mistral_small_24b_num_total: int64
llm_phi4_success: bool
llm_phi4_num_correct: int64
llm_phi4_num_total: int64
-- schema metadata --
huggingface: '{"info": {"features": {"sample_id": {"dtype": "string", "_t' + 16714
to
{'sample_id': Value('string'), 'code': Value('string'), 'genome': Value('string'), 'io_pairs': Value('string'), 'correct_io_input': Value('string'), 'correct_io_output': Value('string'), 'incorrect_io_input': Value('string'), 'incorrect_io_output': Value('string')}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
                  return get_rows(
                         ^^^^^^^^^
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
                  rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2674, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2208, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2232, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 483, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 384, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/parquet/parquet.py", line 209, in _generate_tables
                  yield Key(file_idx, batch_idx), self._cast_table(pa_table)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/parquet/parquet.py", line 147, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              sample_id: string
              code: string
              source_file: string
              genome: string
              io_pairs: string
              num_io_pairs: int64
              correct_io_input: string
              correct_io_output: string
              incorrect_io_input: string
              incorrect_io_output: string
              metric_N1: double
              metric_N2: double
              metric_alpha_count: double
              metric_approx_word_count: double
              metric_average_clustering: double
              metric_average_shortest_path_length: double
              metric_avg_opcode_count: double
              metric_blank: double
              metric_bugs: double
              metric_calculated_length: double
              metric_code: null
              metric_code_length: double
              metric_comments: double
              metric_contains_emails: double
              metric_contains_numbers: double
              metric_contains_special_sequences: double
              metric_contains_urls: double
              metric_cyclomatic_complexity: double
              metric_density: double
              metric_diameter: double
              metric_dict_count: double
              metric_difficulty: double
              metric_digit_count: double
              metric_effort: double
              metric_graph_nodes_!=: double
              metric_graph_nodes_%: double
              metric_graph_nodes_(: double
              metric_graph_nodes_): double
              metric_graph_nodes_*: double
              metric_graph_nodes_**: double
              metric_graph_nodes_*=: double
              metric_graph_nodes_+: double
              metric_graph_nodes_+=: double
              metric_graph_nodes_,: double
              metric_graph_nodes_-: double
              metric_graph_nodes_-=: double
              metric_graph_nodes_.: double
              metric_graph_nodes_//: double
              metric_graph_nodes_:: double
              metric_graph_nodes_:=: double
              metric_graph_nodes_;: double
              metric_graph_nodes_<: double
              metric_graph_nodes_<=: double
              metric_graph_nodes_=: double
              metric_graph_nodes_==: double
              metri
              ...
              ount: double
              metric_special_char_count: double
              metric_sum_opcodes: double
              metric_time: double
              metric_top_0_opcode_name: double
              metric_top_10_opcode_name: double
              metric_top_11_opcode_name: double
              metric_top_12_opcode_name: double
              metric_top_13_opcode_name: double
              metric_top_14_opcode_name: double
              metric_top_15_opcode_name: double
              metric_top_16_opcode_name: double
              metric_top_17_opcode_name: double
              metric_top_18_opcode_name: double
              metric_top_19_opcode_name: double
              metric_top_1_opcode_name: double
              metric_top_2_opcode_name: double
              metric_top_3_opcode_name: double
              metric_top_4_opcode_name: double
              metric_top_5_opcode_name: double
              metric_top_6_opcode_name: double
              metric_top_7_opcode_name: double
              metric_top_8_opcode_name: double
              metric_top_9_opcode_name: double
              metric_try_count: double
              metric_tuple_count: double
              metric_variable_count: double
              metric_vocabulary: double
              metric_volume: double
              llm_codellama_13b_success: bool
              llm_codellama_13b_num_correct: int64
              llm_codellama_13b_num_total: int64
              llm_gpt_oss_120b_success: bool
              llm_gpt_oss_120b_num_correct: int64
              llm_gpt_oss_120b_num_total: int64
              llm_llama_3_3_70b_success: bool
              llm_llama_3_3_70b_num_correct: int64
              llm_llama_3_3_70b_num_total: int64
              llm_mistral_small_24b_success: bool
              llm_mistral_small_24b_num_correct: int64
              llm_mistral_small_24b_num_total: int64
              llm_phi4_success: bool
              llm_phi4_num_correct: int64
              llm_phi4_num_total: int64
              -- schema metadata --
              huggingface: '{"info": {"features": {"sample_id": {"dtype": "string", "_t' + 16714
              to
              {'sample_id': Value('string'), 'code': Value('string'), 'genome': Value('string'), 'io_pairs': Value('string'), 'correct_io_input': Value('string'), 'correct_io_output': Value('string'), 'incorrect_io_input': Value('string'), 'incorrect_io_output': Value('string')}
              because column names don't match

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Beyond Accuracy: Code Comprehension Dataset

Dataset for the paper "Beyond Accuracy: Characterizing Code Comprehension Capabilities in (Large) Language Models" by Machtle, Serr, Loose & Eisenbarth (University of Luebeck).

[Paper] | [Code]

Task

Binary I/O consistency: given a Python program p, an input x, and a candidate output y, determine whether y is the correct output of running p(x).

Each sample contains a correct I/O pair (label=1) and an incorrect I/O pair (label=0). Incorrect pairs are generated via in-program shuffling — pairing an input with the output of a different input to the same program — preserving lexical and stylistic characteristics while being semantically wrong.

Quick Start

from datasets import load_dataset

ds = load_dataset("Felix6326727/beyond-accuracy-code-comprehension", split="test")

sample = ds[0]
print(sample["code"][:200])
print(f"Correct:   {sample['correct_io_input']!r} -> {sample['correct_io_output']!r}")
print(f"Incorrect: {sample['incorrect_io_input']!r} -> {sample['incorrect_io_output']!r}")
print(f"GPT-OSS 120B success: {sample['llm_gpt_oss_120b_success']}")
print(f"Cyclomatic complexity: {sample['metric_cyclomatic_complexity']}")

Dataset Summary

Columns 249
Source Python subset of Project CodeNet
I/O generation Type-aware fuzzing with hill-climbing type inference
Models evaluated 5 LLMs
Code metrics 224 static analysis features

Column Groups

Core Columns (10)

Column Type Description
sample_id string Unique identifier ({problem_id}.{solution_id})
code string Python source code
source_file string Original CodeNet file path
genome string Inferred input type signature (e.g. "is" = integer + string)
io_pairs string JSON array of all generated [input, output] pairs
num_io_pairs int Number of I/O pairs generated
correct_io_input string Input for the correct I/O test case
correct_io_output string Expected output (ground truth)
incorrect_io_input string Input for the incorrect I/O test case
incorrect_io_output string Shuffled (wrong) output

LLM Evaluation Columns (15)

Per-model results from the binary I/O consistency evaluation. Each model has 3 columns:

Column pattern Type Description
llm_{model}_success bool True if the model answered all test cases correctly for this sample
llm_{model}_num_correct int Number of test cases answered correctly (out of num_total)
llm_{model}_num_total int Total test cases for this sample (typically 2: one correct, one incorrect)

Code Metric Columns (224)

All prefixed with metric_. Values are floats (or null if unavailable).

Size & Complexity (67 columns) — includes cyclomatic_complexity, loc, sloc, lloc, maintainability_index, code_length, Halstead metrics (h1, h2, N1, N2, vocabulary, length, volume, difficulty, effort, bugs), num_branches, num_loops, num_identifiers, num_literals, num_data_flows, parameter_count, variable_count, and more.

AST / Graph Structure (118 columns)metric_graph_nodes_* columns counting occurrences of each AST node type: if_statement, for_statement, call, assignment, binary_operator, identifier, block, etc. Also includes graph-level metrics: num_nodes, num_edges, density, diameter, average_shortest_path_length, average_clustering.

Opcode Statistics (39 columns) — Python bytecode features: num_opcodes, sum_opcodes, avg_opcode_count, min_opcode_count, max_opcode_count, individual opcode counts (opcode_1, opcode_83, ...), opcodes_used0opcodes_used3, and top_0_opcode_name through top_19_opcode_name.

Data Generation Pipeline

Python files (CodeNet)
        |
        v
  hill_climb.py ─── infer input types ("genome") via coverage-guided search
        |
        v
  fuzzer.py ──────── generate & shrink minimal I/O pairs
        |
        v
  export_io.py ───── create correct + incorrect (shuffled) I/O pairs
        |
        v
  This dataset

See the GitHub repository for the full pipeline code.

Citation

@article{machtle2025beyond,
  title={Beyond Accuracy: Characterizing Code Comprehension Capabilities in (Large) Language Models},
  author={Machtle, Felix and Serr, Jan-Niclas and Loose, Nils and Eisenbarth, Thomas},
  journal={arXiv preprint arXiv:2601.12951},
  year={2025}
}

License

Derived from Project CodeNet (Apache 2.0).

Downloads last month
9

Paper for Felix6326727/beyond-accuracy-code-comprehension