SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.10452 · ICLR · 2022

CrossBeam: Learning to Search in Bottom-Up Program Synthesis

Hanjun Dai, Charles Sutton, Kevin Ellis, Kensen Shi

arXiv · PDF · Open in the Atlas

Code that ran

1 of 6 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 0 have no contract verdict; 1 failure of our instrument; 5 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/2203.10452.json · badge: /api/ran/2203.10452.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
google-research/crossbeam canonical (classifier label)
classifier basis: classifier_2025
1 ran · 5 no recorded run
FunctionStatusWhere it lives
beam_search Ran
ran; our contract draft was wrong, not the code
google-research/crossbeam/crossbeam/algorithm/synthesis.py
code served (permissive licence) · get_code("d66de1c630616a06")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class ScoreModel(nn.Module):
    """Minimal score model implementing required methods for beam_search"""
    
    def __init__(self, embed_dim, num_choices):
        super().__init__()
        self.embed_dim = embed_dim
        self.num_choices = num_choices
        self.state_proj = nn.Linear(embed_dim, embed_dim)
        self.score_proj = nn.Linear(embed_dim, num_choices)
    
    def get_init_state(self, init_embed, batch_size=1):
        """Initialize state from init_embed"""
        # init_embed shape: [embed_dim]
        # Return state of shape [batch_size, embed_dim]
        state = self.state_proj(init_embed).unsqueeze(0)
        return state.expand(batch_size, -1)
    
    def step_state(self, state, update_embed):
        """Update state given current state and embedding update
        state: [batch_size, embed_dim]
        update_embed: [batch_size, embed_dim]
        Returns: [batch_size, embed_dim]
        """
        combined = state + update_embed
        new_state = self.state_proj(combined)
        return new_state
    
    def step_score(self, state, choice_embed):
        """Compute scores for all choices given current state
        state: [batch_size, embed_dim]
        choice_embed: [num_choices, embed_dim]
        Returns: [batch_size, num_choices]
        """
        batch_size = state.shape[0]
        scores = torch.matmul(state, choice_embed.t())  # [batch_size, num_choices]
        return scores
    
    def state_select(self, state, indices):
        """Select states by indices
        state: [batch_size, embed_dim]
        indices: [k]
        Returns: [k, embed_dim]
        """
        return state[indices]


# Create minimal tensors
embed_dim = 4
num_choices = 3
beam_steps = 2
k = 2

torch.manual_seed(0)

# Initialize components
choice_embed = torch.randn(num_choices, embed_dim)
init_embed = torch.randn(embed_dim)
score_model = ScoreModel(embed_dim, num_choices)
device = 'cpu'

# Optional: choice masks for each step (list of tensors with valid choice indicators)
choice_masks = [
    (0, torch.ones(num_choices)),
    (1, torch.ones(num_choices))
]

ARGS = {
    'beam_steps': beam_steps,
    'k': k,
    'choice_embed': choice_embed,
    'init_embed': init_embed,
    'score_model': score_model,
    'device': device,
    'choice_masks': choice_masks,
    'is_stochastic': False
}
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 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_operation_value Not yet run
unverified (harvested, no recorded run)
google-research/crossbeam/crossbeam/algorithm/synthesis.py
code served (permissive licence) · get_code("0685fc573dd40aa9")
How it ran

no invocation recorded.

init_values Not yet run
unverified (harvested, no recorded run)
google-research/crossbeam/crossbeam/algorithm/synthesis.py
code served (permissive licence) · get_code("3e120a0b9c46f67a")
How it ran

no invocation recorded.

synthesize Not yet run
unverified (harvested, no recorded run)
google-research/crossbeam/crossbeam/algorithm/synthesis.py
code served (permissive licence) · get_code("675acb9ef15bac5e")
How it ran

no invocation recorded.

update_masks Not yet run
unverified (harvested, no recorded run)
google-research/crossbeam/crossbeam/algorithm/synthesis.py
code served (permissive licence) · get_code("095b16af6c6e949c")
How it ran

no invocation recorded.

update_with_better_value Not yet run
unverified (harvested, no recorded run)
google-research/crossbeam/crossbeam/algorithm/synthesis.py
code served (permissive licence) · get_code("64745a0a11dc8a44")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Many approaches to program synthesis perform a search within an enormous space of programs to find one that satisfies a given specification. Prior works have used neural models to guide combinatorial search algorithms, but such approaches still explore a huge portion of the search space and quickly become intractable as the size of the desired program increases. To tame the search space blowup, we propose training a neural model to learn a hands-on search policy for bottom-up synthesis, instead of relying on a combinatorial search algorithm. Our approach, called CROSSBEAM, uses the neural model to choose how to combine previouslyexplored programs into new programs, taking into account the search history and partial program executions. Motivated by work in structured prediction on learning to search, CROSSBEAM is trained on-policy using data extracted from its own bottom-up searches on training tasks. We evaluate CROSSBEAM in two very different domains, string manipulation and logic programming. We observe that CROSSBEAM learns to search efficiently, exploring much smaller portions of the program space compared to the state-of-the-art. * Equal contribution. † Equal contribution.

For agents

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

get_harvested_code_for_paper("2203.10452")
get_code_for_paper("2203.10452")
have("2203.10452")

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

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

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

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

Connect an agent — have() is free.