arXiv:2610.01685cs.LGOct 2026

Manuscript Offprint

arXiv:2610.01685

MiLoop: Selective Memory Propagation for Neural Combinatorial Optimization

Changliang Zhou, Yuanyao Chen, Rongsheng Chen, Zhiyun Lin, Zhenkun Wang

ABSTRACT

Constructive neural combinatorial optimization (NCO) has emerged as a promising paradigm that learns to construct solutions to combinatorial optimization problems (COPs) step by step, which reduces reliance on handcrafted rules and enables fast inference. While many methods with dynamic embeddings generalize well, they typically rebuild subproblem representations from scratch at each step using deep attention stacks. Many high-performing methods in this category rely on solution labels or pseudo-labels for efficient training, or on aggressive search space pruning during reinforcement learning (RL). To address these limitations, we propose Memory-in-the-Loop (MiLoop), a purely RL-based constructive framework that leverages the multi-step computation already required by a rollout for selective memory propagation. Each rollout provides solution-quality feedback for learning while propagating historical representations, thereby enabling a shallow policy to learn effective dynamic embeddings without external solution labels or training-time search-space pruning. Specifically, MiLoop fuses current embeddings with historical memory before the attention layers and applies adaptive gated updates afterward. The updated representations support both current decisions and stepwise reuse. Extensive experiments across four COPs demonstrate that MiLoop consistently produces high-quality solutions on instances ranging from 100 to 10 million nodes, highlighting its strong generalization ability.

1 INTRODUCTION

Combinatorial optimization problems (COPs) have extensive applications across various domains, including supply chain management (Guerriero et al., 2025), chip design (Gao et al., 2026), and drug discovery (Liu et al., 2017). Many practically important COPs are NP-hard, making exact optimization computationally demanding as the instance size increases. Over the past decades, classical heuristics have achieved competitive solution quality within acceptable time budgets (Vidal, 2022; Helsinki, 2017). However, they rely on handcrafted rules that require substantial domain expertise and problem-specific adaptation. This limitation increases the effort required to develop solvers for complex COPs, especially when expert knowledge is unavailable or expensive to acquire.

In recent years, neural combinatorial optimization (NCO) has emerged as an alternative that reduces reliance on handcrafted rules by learning heuristic rules from data (Bengio et al., 2021; Ba et al., 2026). Among existing NCO methods, constructive neural models directly generate complete feasible solutions for a given instance in a single rollout, without requiring time-consuming iterative search. Their efficient inference makes them particularly attractive when facing real-time scenarios. Existing constructive methods generally follow either an autoregressive (AR) (Vinyals et al., 2015; Kool et al., 2019; Zhou et al., 2026b) or a non-autoregressive (NAR) (Joshi et al., 2019; Sun & Yang, 2023).

∗^{*}Equal contribution

†^{\dagger}Corresponding author

Figure

Figure 1: Comparison of different embeddings. Unlike traditional dynamic embeddings, MiLoop maintains a trajectory memory throughout each rollout, with selective updates for subsequent reuse.

paradigm. Compared with the NAR construction, AR construction (Kwon et al., 2020; Gao et al., 2024; Zhou et al., 2026c) enables the model to adjust its decisions as the generated partial solution state evolves and is readily applicable to a wide range of COPs. These properties have made AR construction one of the predominant paradigms in NCO.

As shown in Figure 1, AR constructive neural solvers broadly adopt two embedding strategies: static and dynamic. Methods with static embeddings (Kwon et al., 2020; Zhou et al., 2026a) compute node or edge embeddings once and reuse them across subsequent decoding steps. Their computational efficiency and compatibility with reinforcement learning (RL) have contributed to their widespread adoption. In contrast, methods with dynamic embeddings (Luo et al., 2023; Drakulic et al., 2023) re-embed the current subproblem at each construction step, producing representations that reflect the current construction state. These methods have shown promising generalization to larger instances.

Despite these advances, each embedding strategy faces its own challenges. Static-embedding methods still exhibit substantial degradation in solution quality on instances much larger than those seen during training (e.g., with more than 1,000 nodes) (Kwon et al., 2020; Kim et al., 2022). Many dynamic-embedding methods reconstruct contextual relationships within the current subproblem from scratch at each step, without reusing representations computed in previous steps. They typically use relatively deep Transformer (Vaswani et al., 2017) stacks (e.g., 6 layers) to obtain effective embeddings (Luo et al., 2023; Drakulic et al., 2023). Many high-performing methods in this category are trained using supervised learning (Luo et al., 2023; Drakulic et al., 2023) or self-improvement with high-quality pseudo-labels generated by advanced search techniques (Luo et al., 2025a; Pirnay & Grimm, 2024). More recently, search space reduction has been used to ease solution construction in RL-trained solvers with dynamic embeddings (Fang et al., 2024; Zhou et al., 2026b). However, aggressive pruning during training may exclude actions required for high-quality solutions. A detailed review of constructive methods with static and dynamic embeddings is provided in Appendix A.

Recent advances in large language models have demonstrated the potential of looped Transformers for reasoning (Saunshi et al., 2025; Jeddi et al., 2026). These models repeatedly apply shared Transformer blocks to refine latent representations, increasing effective depth without increasing the parameter count. In RL-based constructive NCO methods, each rollout already involves repeatedly applying the same policy to construct a complete solution. This sequential structure provides a natural basis for a memory loop across construction steps. However, as the construction state changes, the relevance of historical information may vary across nodes, feature channels, and construction steps. Effective memory reuse requires incorporating current information while retaining and revising useful historical context. This raises the following question: Can we turn the multi-step computation already required by RL rollouts into an advantage through selective memory propagation, enabling a shallow policy to learn effective dynamic embeddings?

In this paper, we propose Memory-in-the-Loop (MiLoop), an RL-based framework that integrates selective memory propagation into solution construction rollouts. Each rollout provides solution-quality feedback for learning while carrying structural representations forward to subsequent decisions. By reusing memories across decoding steps, MiLoop uses substantially fewer attention layers than the existing dynamic-embedding baselines. Our main contributions are as follows:

• We introduce an RL-based framework that leverages the multi-step computation already required by construction rollouts to enable stepwise representation reuse, allowing a shallow policy to learn dynamic embeddings without any external solution labels.

• We develop a selective memory propagation architecture that fuses current embeddings with memory states before the attention stacks and applies adaptive gated updates afterward at each construction step, allowing the updated representations to support both current decisions and reuse in subsequent steps.

• Our evaluation covers four COPs and includes instances ranging from 100 to 10 million nodes. Extensive experiments demonstrate that MiLoop consistently produces high-quality solutions across this size range and exhibits strong generalization ability.

References (61)