arXiv:2610.23190cs.LGOct 2026

Manuscript Offprint

arXiv:2610.23190

LangNCO: Compiling Natural-Language Constraints into Inference-Time Interventions for Neural Combinatorial Optimization

Hironori Ohigashi

Abstract

Neural combinatorial optimization (NCO) rapidly produces high-quality solutions for problem structures encountered during training, but operational requirements may change after deployment and be communicated in natural language. We propose LangNCO, a framework that compiles instance-specific requirements into structured inference-time interventions for a frozen NCO solver, without changing the pretrained policy's architecture, learned input representation, or parameters. A pretrained LLM serves as a replaceable semantic front end, translating each requirement into a schema-validated domain-specific language (DSL) rule set. A deterministic Rule Executor applies the rules as nonexpansive hard action masks. Because local masking prevents immediate violations but does not ensure that a complete feasible continuation remains reachable, Critical-Offset Decoding extracts rule-referenced critical nodes and reallocates part of a fixed rollout budget to multi-strength biased rollouts. Using controlled task-specific language to isolate solver adaptation from open-ended language robustness, we evaluate a CVRP policy on road closures, time windows, vehicle assignments, visitor-order requirements, all pairwise combinations, and twelve additional constraint types. LangNCO achieves 100% feasibility on the four primary datasets with mean reference gaps of 1.63–3.26%, 97.33–100% feasibility when separately generated rules are composed for pairwise constraints, and 98.67% feasibility across the additional constraints. These results demonstrate modular post-training adaptation of a frozen NCO solver through inspectable language-derived rules, without retraining.

1 Introduction

Combinatorial optimization underlies routing, scheduling, production planning, and robotic decision making. In these domains, high-quality discrete decisions often must be produced repeatedly under tight time limits. Neural combinatorial optimization (NCO) learns models that accelerate solution generation for such problems on new instances (Bello et al. 2017; Bengio, Lodi, and Prouvost 2021). A central line of NCO research focuses on constructive policies that directly build complete solutions under problem structures specified during training, enabling fast inference after training (Vinyals, Fortunato, and Jaitly 2015; Nazari et al. 2018; Kool, van Hoof, and Welling 2019; Kwon et al. 2020). In routing, these policies typically construct routes autoregressively by repeatedly selecting the next customer.

Operational requirements, however, often change after deployment. Roads may close, customer time requirements may change, or temporary vehicle-assignment and visit-order rules may be introduced. Natural language provides a flexible interface for specifying such instance-specific requirements, but a standard pretrained solver cannot interpret constraints absent from its training-time problem definition. Retraining the policy, adding constraint-specific inputs, or redesigning the decoder for every transient requirement is impractical.

We study inference-time adaptation to state-action-level constraints, whose effects can be evaluated during decoding from the current partial solution, candidate attributes, and exposed environment state. This class covers restrictions involving transitions, time, vehicle identity, visit history, capacity, depot access, and other state-dependent conditions. Constraints requiring evaluation only after all routes are complete are outside this scope. Starting from a policy trained only on the standard capacitated vehicle routing problem (CVRP), our goal is to incorporate instance-specific natural-language requirements without constraint-specific policy inputs, architecture changes, or weight updates.

Recent multi-task and unified NCO systems generalize across routing variants through shared architectures and attribute representations (Liu et al. 2024a; Zhou et al. 2024; Berto et al. 2025b; Li et al. 2025; Goh et al. 2025; Zhou et al. 2026). Their zero-shot settings nevertheless assume that the relevant attributes, state interfaces, and feasibility mechanisms are defined before training; the unseen element is typically a problem variant or a combination of supported attributes within that interface. We instead address post-training requirements first specified in natural language for a concrete instance. LLM-based optimization methods have also generated solutions, mathematical formulations, solver programs, and heuristics (Yang et al. 2024; Liu et al. 2024b; Ahmaditeshnizi, Gao, and Udell 2024; Jiang et al. 2025b,a; Romera-Paredes et al. 2024). Rather than assigning combinatorial search to the LLM or reconstructing the base problem through a separate solver pipeline, we retain the pretrained NCO policy as the search engine and use the LLM only to specify state-dependent action interventions.

To realize this division of labor, we propose LangNCO, an inference-time framework in which an LLM, serving as a replaceable semantic front end, translates each requirement into a compact, schema-validatable domain-specific language (DSL) that specifies state-dependent changes to the feasible action set. The validated rules are deterministically compiled, and a Rule Executor applies them as action masks over the frozen decoder's base feasibility mask. The NCO policy remains responsible for route construction and cost minimization. This design preserves the routing policy's inductive bias and fast inference, makes interventions inspectable, and avoids free-form tensor code generation.

Hard masking ensures immediate action legality but not completion viability: a legal choice may consume capacity needed by an assigned customer, delay a time-window customer beyond recovery, or close a route before a prerequisite is served. We therefore introduce Critical-Offset Decoding, which extracts explicitly referenced critical nodes from the generated rules and reallocates part of a fixed rollout budget to multi-strength biased rollouts. It never revives a masked action and balances completion-oriented exploration with the original policy's cost-oriented search.

Our contributions are threefold. First, we formulate post-training request adaptation of a fixed CVRP policy and introduce a modular language-to-rule interface whose validated output drives deterministic, nonexpansive action intervention, without adding constraint-specific inputs to the NCO policy or changing its architecture or weights. Second, we propose Critical-Offset Decoding, which biases a subset of rollouts toward rule-derived critical nodes, reducing future deadlocks and improving solution quality without increasing the rollout budget. Third, we evaluate the framework on four primary constraint types, all pairwise combinations, and twelve additional types. The complete method attains 100% feasibility on all four primary datasets with mean reference gaps of 1.63–3.26%, 97.33–100% feasibility when separately generated rules are composed for pairwise constraints, and 98.67% feasibility across the additional constraints. These results show that structured language-derived rules can extend a frozen NCO solver beyond its training-time problem definition without retraining.

References (39)