Papers › Contrastive Reinforcement Learning of Symbolic Reasoning Domains

Contrastive Reinforcement Learning of Symbolic Reasoning Domains

16 Jun 2021NeurIPS 2021 12arXiv:2106.09146archive 2025-07-28

Gabriel Poesia, WenXin Dong, Noah Goodman

Abstract symbolic reasoning, as required in domains such as mathematics and logic, is a key component of human intelligence. Solvers for these domains have important applications, especially to computer-assisted education. But learning to solve symbolic problems is challenging for machine learning algorithms. Existing models either learn from human solutions or use hand-engineered features, making them expensive to apply in new domains. In this paper, we instead consider symbolic domains as simple environments where states and actions are given as unstructured text, and binary rewards indicate whether a problem is solved. This flexible setup makes it easy to specify new domains, but search and planning become challenging. We introduce four environments inspired by the Mathematics Common Core Curriculum, and observe that existing Reinforcement Learning baselines perform poorly. We then present a novel learning algorithm, Contrastive Policy Learning (ConPoLe) that explicitly optimizes the InfoNCE loss, which lower bounds the mutual information between the current state and next states that continue on a path to the solution. ConPoLe successfully solves all four domains. Moreover, problem representations learned by ConPoLe enable accurate prediction of the categories of problems in a real mathematics curriculum. Our results suggest new directions for reinforcement learning in symbolic domains, as well as applications to mathematics education.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2106.09146")

Code

Syntology Ran 4 of 15 code samples harvested from 2 repositories linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 3 ran with no contract checked.

By repository: official repository: 14 samples from 1 repository, 3 ran; community (archive-listed): 1 sample from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

gpoesia/socratic-tutor officialmentioned in papermentioned on GitHubpytorch report
sagnikanupam/mathdsl mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 4 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
3ran
11unverified

Licence: 15 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

RacketEnvironment gpoesia/socratic-tutor/agent.py official repository ran no licence file found · pointer only · 3d82da901d88aa3c · report
random_initial_seed gpoesia/socratic-tutor/agent.py official repository ran no licence file found · pointer only · 8e74322415ba2a24 · report
register gpoesia/socratic-tutor/agent.py official repository ran · our draft was wrong no licence file found · pointer only · 6a1ad0909c55aa20 · report
Action gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 82b383962990e9ba · report
ContrastiveExample gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · e38eefb547b2a7fd · report
InverseLength gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · bbc1dc4497b5ec6b · report
LearningAgent gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 6740a0d260d2a467 · report
MultiTaskEnvironment gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · cd47224c2bdbef51 · report
NCE gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 519728cf68d959ec · report
QFunction gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 05426ee7aeefc5ac · report
RandomQFunction gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 4566b327bd686f0c · report
RubiksGreedyHeuristic gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 2db358be2ba65b5e · report
RustEnvironment gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · 6f6ab6bad7d94b64 · report
State gpoesia/socratic-tutor/agent.py official repository unverified no licence file found · pointer only · a263044fe206c128 · report
Tree sagnikanupam/mathdsl/dreamcoder/domains/conpole/conpoleMathPrimitives.py community (archive-listed) ran no licence file found · pointer only · 43eefe3507985e75 · report

Tasks

Reinforcement LearningReinforcement Learning (RL)reinforcement-learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

InfoNCE

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections