SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.11694 · 2022

Multi-View Reasoning: Consistent Contrastive Learning for Math Word Problem

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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 7 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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.11694.json · badge: /api/ran/2210.11694.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
zwq2018/multi-view-consistency-for-mwp canonical (classifier label)
classifier basis not recorded on the link
9 ran · 4 no recorded run
FunctionStatusWhere it lives
compute Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/src/eval/utils.py
code served (permissive licence) · get_code("6cca9d6a936ecfcc")
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 float, ndim 0, dtype family float, shape () 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 math

ARGS = {
    'left': 5.0,
    'right': 3.0,
    'op': '+'
}
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 float, ndim 0, dtype family float, shape () — shape () 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
compute_value Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/src/eval/utils.py
code served (permissive licence) · get_code("01d6defe25112d21")
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 float, ndim 0, dtype family float, shape () 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 math
from typing import List

torch_not_needed = True

# Analyzing the function:
# - equations: List of tuples with 4 elements each (left_var_idx, right_var_idx, op_idx, _)
# - num_list: List of numbers that can be indexed by (idx - num_constant)
# - num_constant: Integer representing the count of constants
# - uni_labels: List of operation strings indexed by op_idx
# - constant_values: List of floats for constant values

# Create small test data
num_constant = 2
num_list = [5.0, 10.0, 15.0]  # 3 numbers, indices 2,3,4 (since 0,1 are constants)
constant_values = [2.0, 3.0]  # 2 constants at indices 0,1

# Equations format: (left_var_idx, right_var_idx, op_idx, unused)
# left_var_idx >= num_constant refers to num_list, else refers to constant_values
# right_var_idx works similarly
equations = [
    (0, 2, 0, None),      # constant_values[0] + num_list[0]
    (1, 3, 1, None),      # constant_values[1] - num_list[1]
]

uni_labels = ['+', '-', '*', '/', '^']

ARGS = {
    'equations': equations,
    'num_list': num_list,
    'num_constant': num_constant,
    'uni_labels': uni_labels,
    'constant_values': constant_values,
}
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 float, ndim 0, dtype family float, shape () — shape () 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
compute_value_for_incremental_equations Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/src/eval/utils.py
code served (permissive licence) · get_code("360275f90909519f")
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 math

# Define the ARGS dictionary with valid arguments for compute_value_for_incremental_equations

ARGS = {
    'equations': [
        (0, 1, 0, 0),  # left_var_idx=0, right_var_idx=1, op_idx=0, unused_field=0
        (2, 3, 1, 0),  # left_var_idx=2, right_var_idx=3, op_idx=1, unused_field=0
    ],
    'num_list': [5.0, 10.0, 3.0, 2.0],
    'num_constant': 2,
    'uni_labels': ['+', '-', '*', '/', '-_rev', '/_rev', '^', '^_rev'],
    'constant_values': [7.0, 8.0],
}
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 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
copy_list Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/src/model/tree_decoder.py
code served (permissive licence) · get_code("2f2e884c6e5f1525")
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. 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)

# Analyze the function: copy_list(l)
# - Takes a parameter 'l' which should be a list
# - Recursively copies lists, handling nested lists
# - Non-list items are appended as-is

# Test with various nested list structures
test_list = [
    1,
    2.5,
    "string",
    [3, 4, [5, 6]],
    [7, [8, 9]],
    42
]

ARGS = {
    "l": test_list
}
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 — a list 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
get_combination_mask Ran
ran; our contract draft was wrong, not the code
zwq2018/multi-view-consistency-for-mwp/src/model/universal_model.py
code served (permissive licence) · get_code("dc88195e78925e47")
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, 3) 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)

# Construct arguments for get_combination_mask
batched_num_variables = torch.tensor([3, 4])  # batch_size=2, each element is a count
combination = torch.tensor([[0, 1], [1, 2], [2, 0]])  # num_combinations=3, each has 2 indices

ARGS = {
    "batched_num_variables": batched_num_variables,
    "combination": combination,
}
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, 3) — shape (2, 3) 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
have_pi Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/preprocess/process_math23k.py
code served (permissive licence) · get_code("87b16c0cfd687a02")
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 bool, ndim 0, dtype family float, shape () 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
import numpy as np

# Analyze the function:
# have_pi takes target_template: List
# It iterates over val in target_template
# For each val, it calls val.strip() and checks if result equals 'PI'
# So target_template should be a list of strings

# Test case 1: List with 'PI' present
target_template_with_pi = ['hello', '  PI  ', 'world']

# Test case 2: List without 'PI' present
target_template_without_pi = ['hello', 'world', 'test']

# Create ARGS dict with a target_template that contains 'PI'
ARGS = {
    'target_template': ['start', ' PI ', 'end']
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
have_square Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/preprocess/process_math23k.py
code served (permissive licence) · get_code("e06f898b70a977ff")
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 bool, ndim 0, dtype family float, shape () 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

ARGS = {
    "target_template": [" ^ ", "hello", "  ^  ", "world"]
}
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 bool, ndim 0, dtype family float, shape () — shape () 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_data Ran
ran; our contract draft was wrong, not the code
zwq2018/multi-view-consistency-for-mwp/src/utils.py
code served (permissive licence) · get_code("2f69ddcd06d5421f")
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 valid data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

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

ARGS = {
    "file": 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 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
sequence_mask Ran
ran on a synthesized input
zwq2018/multi-view-consistency-for-mwp/src/model/tree_decoder.py
code served (permissive licence) · get_code("e966aac70ae27f8f")
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, 3) 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)

# sequence_length should be a 1D tensor of integers representing sequence lengths
# batch_size is inferred from sequence_length.size(0)
sequence_length = torch.tensor([3, 2], dtype=torch.long)

# dev is the device - None means CPU
dev = None

# max_len is optional, can be None or an integer
max_len = None

ARGS = {
    "sequence_length": sequence_length,
    "dev": dev,
    "max_len": max_len,
}
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, 3) — shape (2, 3) 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
get_batched_prediction_consider_multiple_m0 Not yet run
unverified (harvested, no recorded run)
zwq2018/multi-view-consistency-for-mwp/main_math23k.py
code served (permissive licence) · get_code("6f6a7869a7797e21")
How it ran

no invocation recorded.

have_constant Not yet run
unverified (harvested, no recorded run)
zwq2018/multi-view-consistency-for-mwp/preprocess/process_math23k.py
code served (permissive licence) · get_code("68123269a97bdff9")
How it ran

no invocation recorded.

masked_cross_entropy Not yet run
unverified (harvested, no recorded run)
zwq2018/multi-view-consistency-for-mwp/src/model/tree_decoder.py
code served (permissive licence) · get_code("80f5fed9c34adca3")
How it ran

no invocation recorded.

parse_arguments Not yet run
unverified (harvested, no recorded run)
zwq2018/multi-view-consistency-for-mwp/main_math23k.py
code served (permissive licence) · get_code("aa868b456e259fdc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
get_combination_mask 2 other papers
2 dated earlier
2201.11903 (2022-01)
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
2203.10316 (2022-03)
Learning to Reason Deductively: Math Word Problem Solving as Complex Relation Extraction
read_data 1 other paper
1 later
2211.10435 (2022-11)
PAL: Program-aided Language Models

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

Math word problem solver requires both precise relation reasoning about quantities in the text and reliable generation for the diverse equation. Current sequence-to-tree or relation extraction methods regard this only from a fixed view, struggling to simultaneously handle complex semantics and diverse equations. However, human solving naturally involves two consistent reasoning views: top-down and bottom-up, just as math equations also can be expressed in multiple equivalent forms: pre-order and post-order. We propose a multi-view consistent contrastive learning for a more complete semantics-to-equation mapping. The entire process is decoupled into two independent but consistent views: top-down decomposition and bottom-up construction, and the two reasoning views are aligned in multi-granularity for consistency, enhancing global generation and precise reasoning. Experiments on multiple datasets across two languages show our approach significantly outperforms the existing baselines, especially on complex problems. We also show after consistent alignment, multi-view can absorb the merits of both views and generate more diverse results consistent with the mathematical laws.

For agents

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

get_harvested_code_for_paper("2210.11694")
get_code_for_paper("2210.11694")
have("2210.11694")

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

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

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

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

Connect an agent — have() is free.