Papers › Beyond A*: Better Planning with Transformers via Search Dynamics Bootstrapping

Beyond A*: Better Planning with Transformers via Search Dynamics Bootstrapping

21 Feb 2024arXiv:2402.14083archive 2025-07-28

Lucas Lehnert, Sainbayar Sukhbaatar, DiJia Su, Qinqing Zheng, Paul McVay, Michael Rabbat, Yuandong Tian

While Transformers have enabled tremendous progress in various application settings, such architectures still trail behind traditional symbolic planners for solving complex decision making tasks. In this work, we demonstrate how to train Transformers to solve complex planning tasks. This is accomplished by training an encoder-decoder Transformer model to predict the search dynamics of the A^* search algorithm. We fine tune this model to obtain a Searchformer, a Transformer model that optimally solves previously unseen Sokoban puzzles 93.7% of the time, while using up to 26.8% fewer search steps than the A^* implementation that was used for training initially. In our training method, A^*'s search dynamics are expressed as a token sequence outlining when task states are added and removed into the search tree during symbolic planning. Searchformer significantly outperforms baselines that predict the optimal plan directly with a 5-10× smaller model size and a 10× smaller training dataset. Lastly, we demonstrate how Searchformer scales to larger and more complex decision making tasks with improved percentage of solved tasks and shortened search dynamics.

PaperPDFCodeCode 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="2402.14083")

Code

Syntology Ran 13 of 14 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 13 ran with no contract checked.

By repository: official repository: 14 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

facebookresearch/searchformer officialmentioned in papermentioned on GitHubpytorchNOASSERTION 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

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

13ran
1unverified

Licence: 14 of the 14 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 facebookresearch/searchformer. “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.

astar facebookresearch/searchformer/searchformer/astar.py official repository ran licence not identified · pointer only · 5d068b31b9254b5a · report
build_optimizer facebookresearch/searchformer/searchformer/transformer/optim.py official repository ran licence not identified · pointer only · e7297099a6671090 · report
fixed_size_maze_dataset_name facebookresearch/searchformer/searchformer/maze.py official repository ran licence not identified · pointer only · 3a942bcaa7ded890 · report
lr_constant facebookresearch/searchformer/searchformer/transformer/optim.py official repository ran fingerprinted licence not identified · pointer only · 2de53a847ce3ebdb · report
lr_cosine facebookresearch/searchformer/searchformer/transformer/optim.py official repository ran licence not identified · pointer only · b5030440560f7a3c · report
manhattan_distance facebookresearch/searchformer/searchformer/sokoban.py official repository ran fingerprinted licence not identified · pointer only · e6efc6bfc4f2862d · report
num_model_parameters facebookresearch/searchformer/searchformer/transformer/utils.py official repository ran licence not identified · pointer only · 21203a2dc99cc011 · report
repeat_kv facebookresearch/searchformer/searchformer/transformer/model.py official repository ran fingerprinted licence not identified · pointer only · f12b7a7b213cf517 · report
sample_greedy facebookresearch/searchformer/searchformer/transformer/utils.py official repository ran fingerprinted licence not identified · pointer only · 099db59e5044649b · report
sample_probability facebookresearch/searchformer/searchformer/transformer/utils.py official repository ran licence not identified · pointer only · 90652748c49c021a · report
sokoban_state_to_pretty_string facebookresearch/searchformer/searchformer/sokoban.py official repository ran licence not identified · pointer only · 22d075deea2c904a · report
sokoban_state_to_string facebookresearch/searchformer/searchformer/sokoban.py official repository ran licence not identified · pointer only · c30029071ba9902f · report
split_df_columns_to_value facebookresearch/searchformer/searchformer/utils.py official repository ran licence not identified · pointer only · 3b7d3d5ef085446a · report
sequence_mask_to_attention_mask facebookresearch/searchformer/searchformer/transformer/model.py official repository unverified licence not identified · pointer only · 31adf392ad5e3e28 · report

Tasks

Decision MakingDecoderSokoban

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

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