Manuscript Offprint
arXiv:2610.02528Autoregressive Differentiable Method for Integer Programming
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
We introduce an autoregressive differentiable method to solve 0-1 integer programs. We fix an arbitrary order of the binary variables and we train a transformer to predict the next bit while remaining in the feasible set. Our method is first trained on feasible incumbents provided by any solver, thus allowing us to initialize the transformer in the feasible set. Our procedure then implements a Lagrangian penalty to penalize infeasible solutions, and the transformer is further trained to explore the feasible set using Gumbel-softmax activations on the relaxed objective. We have tested our method on non-convex instances of quadratic knapsack problem and demonstrated consistent improvement upon state-of-the-art open-source solvers for dense problems up to 10,000 binary variables. In particular, we empirically demonstrate a phenomenon akin to a tunneling effect where the effective change of variables from binary variable to the continuous weights of the transformer that the method implements enables crossing barriers in the relaxed objective landscape.
1 INTRODUCTION
Binary integer programming is a central modeling language for combinatorial optimization (Nemhauser & Wolsey, 1988). Problems including knapsack (Martello & Toth, 1990), maximum cut (Goemans & Williamson, 1995), facility location (Cornuéjols et al., 1990), sparse regression (Bertsimas et al., 2016), and scheduling (Pinedo, 2016) can be formulated over binary vectors, yet many practically relevant instances remain computationally challenging (Belotti et al., 2013; Bertsimas et al., 2016; Bixby, 2012; Lodi, 2010; Gleixner et al., 2021). Modern branch-and-cut solvers and primal heuristics are extremely powerful, but can still spend substantial time improving a good feasible incumbent (Berthold, 2013; Fischetti & Lodi, 2003; Rothberg, 2007).
We ask whether autoregressive differentiable models can serve as enhanced primal mechanisms for binary integer programs (Vinyals et al., 2015; Bello et al., 2017; Geng et al., 2025). Rather than predicting a solution from scratch, we initialize a neural model at a feasible incumbent obtained from a standard solver (Nair et al., 2020; Khalil et al., 2022; Han et al., 2023), then optimize it directly against a differentiable relaxation of the original objective with a Lagrangian penalty for constraint violation (Di Pillo & Grippo, 1989). The resulting method searches in neural network weight space rather than directly in the decision variables. This formulation is intended to complement conventional integer programming machinery: the solver supplies a feasible point and the neural reparameterization is used only for subsequent primal improvement. The central question is whether the nonlinear, shared autoregressive parametrization exposes useful optimization directions that differ from direct coordinate-wise movement in the binary decision space.
Our starting point is deliberately instance-specific. The neural network is not trained to generalize across a dataset of optimization instances; instead, it is initialized at a solution already found by a solver and used as a local improvement mechanism. This separates feasibility discovery from neural improvement and lets the transformer exploit a high-quality incumbent without learning the combinatorial problem from scratch.
We focus on binary quadratic integer programs

Figure 1: Overview of ADIP. Starting from a feasible incumbent obtained from a standard integer-programming solver, Phase 1 trains an autoregressive transformer to reproduce the incumbent using smoothed binary targets. Phase 2 optimizes the transformer parameters directly against the relaxed integer-program objective with a Lagrangian feasibility penalty, using Gumbel-softmax to maintain near-discrete outputs. Hard candidates are decoded throughout training, and the best feasible solution encountered is returned.
where , , and . Our experimental testbed is the quadratic knapsack problem (QKP), following and extending Lopez Piqueres & Chen (2025). QKP is known to remain strongly NP-hard even with small integer weights (Gallo et al., 1980; Pisinger et al., 2007), and arbitrary Q yields a non-convex relaxed landscape. Although we experiment with non-convex quadratic objectives, the method applies whenever the binary objective admits a differentiable continuous relaxation.
Our method, which we call Autoregressive Differentiable Integer Programming (ADIP), has two phases. We fix an arbitrary variable ordering and use a causal transformer to learn . For each instance, an open-source solver such as SCIP (Hojny et al., 2025), HiGHS (Huangfu & Hall, 2018), CP-SAT (Perron et al., 2023), or CBC (Forrest & Lougee-Heimer, 2005; COIN-OR, 2026) first produces a feasible incumbent . In Phase 1, the transformer is trained to reproduce using targets and (instead of 0 and 1), preventing softmax saturation and preserving gradients. In Phase 2, the same weights are optimized against
where is generated autoregressively. Gumbel-softmax activations (Jang et al., 2017; Maddison et al., 2017) encourage near-discrete exploration, while the best feasible hard solution encountered is retained throughout training.
For the purpose of advancing open-source software and open science, we deliberately chose to compare against state-of-the-art open-source solvers, and not against their closed-source competitors. Our contributions are fourfold. First, we introduce an autoregressive nonlinear reparametrization of relaxed binary decision variables for integer programs, in which the shared parameters of the autoregressive model themselves become the optimization variables. Second, we present our specific method ADIP combining transformer-based incumbent imitation, finite-logit targets, Gumbel-softmax exploration, and a Lagrangian feasibility penalty in a two-phase primal-improvement procedure. Third, we provide theoretical results showing that incumbent improvement remains NP-hard, that the transformer reparametrization retains the binary search space, and that parameter-space gradient flow induces a state-dependent geometry in decision space. Fourth, we evaluate ADIP on random QKP instances under matched computational budgets and study whether its trajectories reach attraction basins different from those reached by combinatorial optimization or by direct relaxed optimization, uncovering a “tunneling-like” phenomenon.
Autoregressive models have previously been used for combinatorial optimization and mixed-integer programming. Tang et al. (2025) use autoregressive reinforcement learning to sequentially fix MILP variables before a conventional solver completes the solution, while variational neural annealing uses autoregressive distributions for Ising-type combinatorial optimization (Hibat-Allah et al., 2021). In contrast, ADIP first fits an autoregressive model to a feasible solver incumbent and then makes its shared parameters the optimization variables themselves: the original relaxed objective is backpropagated through the nonlinear map . To the best of our knowledge, this combination of incumbent initialization, autoregressive reparametrization, and direct differentiable optimization of the integer-program objective has not previously been proposed for general binary integer programming.
ADIP is also related to quantum-inspired generative optimization. Constrained tensor networks (Lopez Piqueres & Chen, 2025) encode linear constraints exactly into matrix product states and optimize a distribution supported only on feasible configurations; their QKP benchmark directly motivates ours. In contrast, ADIP does not encode the feasible set architecturally, but initializes from a feasible incumbent and optimizes through a Lagrangian penalty. The Generative Quantum Eigensolver (Nakaji et al., 2024) likewise places the trainable parameters in a classical autoregressive model, but uses the transformer to generate quantum circuits rather than the decision variables themselves. Quantum Hamiltonian Descent (Leng et al., 2023) provides a complementary quantum mechanism for traversing non-convex landscapes via Hamiltonian dynamics and motivates our tunneling analogy.
3 PRELIMINARIES
We consider Eq. 1 with feasible set and continuous relaxation . Under a fixed variable ordering, a causal transformer (Vaswani et al., 2017) factorizes
We use a causal transformer with alphabet , and for differentiable self-generation, a relaxed bit is embedded via token embeddings as
which allows gradients to propagate through the generated prefix .
For logits , independent Gumbel noises , and temperature , Gumbel-softmax (Jang et al., 2017) gives
In our experiments we use the straight-through variant: the forward pass uses , while the backward pass differentiates the continuous relaxation in Eq. 5.
4 METHODOLOGY
We now describe ADIP, the proposed autoregressive differentiable method for binary integer programming. The method has two phases. The first phase initializes a transformer at a feasible
Algorithm 1 ADIP: Autoregressive Differentiable Integer Programming
Require: , solver , , , , penalty , temperature
1: Run for ; let be its best feasible incumbent
2: Initialize transformer parameters
3: for do
4: Update to minimize in Eq. 7 under teacher forcing
5: end for
6:
7: for do
8: Generate autoregressively using Gumbel–softmax temperature
9: Ascend from Eq. 8
10: Decode and update if it is feasible and improves the objective
11: end for
12: return
incumbent found by an external solver. The second phase optimizes the transformer weights using a differentiable relaxation of the objective with a feasibility penalty.
4.1 OVERVIEW
Given an instance of Eq. 1, ADIP first runs a conventional solver for and extracts its best feasible incumbent . A causal transformer is then trained under teacher forcing to reproduce this incumbent. Starting from those trained weights, Phase 2 generates a relaxed sequence autoregressively with Gumbel–softmax and ascends the penalized objective, while every hard-decoded candidate is checked against the original constraints and the best feasible solution is retained. Algorithm 1 summarizes the procedure.
4.2 COMPLEXITY OF INCUMBENT IMPROVEMENT
It is worth noting that starting from a feasible incumbent does not make the residual search problem easy.
Theorem 1 (Hardness of incumbent improvement). For QKP with integer-valued objective coefficients and strictly positive integer weights, given a feasible incumbent , deciding whether there exists a feasible with is NP-complete.
The proof, in Appendix A.3, reduces QKP decision to incumbent improvement by adding a capacity-saturating item of value . Thus ADIP addresses an NP-hard residual search problem even after a feasible point is provided.
4.3 EXPRESSIVITY OF THE AUTOREGRESSIVE PARAMETRIZATION
Universal approximation results for transformers (Yun et al., 2020) imply that the neural change of variables does not discard binary solutions.
Proposition 1 (Combinatorial expressivity). Fix sequence length and a transformer class satisfying the universal approximation property of Yun et al. (2020). For every and , there exist parameters such that . Hence threshold decoding at is surjective onto .
Corollary 1 (Hardness under autoregressive reparametrization). Under Proposition 1 and given , deciding whether there exists such that subject to is NP-hard.
Proofs are in Appendices A.4-A.5. The parametrization therefore retains the combinatorial search space and its worst-case hardness. This separates expressivity from optimization: the role of the transformer reparameterization is to provide a different continuous geometry through which the discrete search space is explored (see Paragraph 4.8).
This is the decision version of globally optimizing the objective via the hard-decoded transformer.
4.4 PHASE 1: FEASIBLE INCUMBENT IMITATION
Let be the best feasible solver incumbent. For each position , the transformer receives and predicts . Exact targets in can drive the logits toward saturation, so we use
with in our experiments. Here target smoothing enforces a finite logit gap , whereas exact targets are reached only in the infinite-logit limit. Thus Phase 1 yields a model whose hard decoding reproduces the feasible incumbent while retaining usable gradients for Phase 2. The decoded hard sequence agrees with whenever the predicted probabilities are on the correct side of 1/2. At the same time, the relaxed output remains a finite-logit representation near the incumbent, so Phase 2 begins from a feasible discrete anchor without having destroyed the gradient signal needed to move away from it.
4.5 PHASE 2: DIFFERENTIABLE OPTIMIZATION IN TRANSFORMER WEIGHT SPACE
Let denote the relaxed autoregressive output and define
We maximize with respect to . During Phase 2 we monitor hard decoded feasibility ; the returned solution is always the best feasible hard candidate encountered.
For integer-valued constraints, the incumbent admits a conservative finite penalty scale for binary solutions.
Proposition 2 (Sufficient penalty for binary feasibility). Let and . If are integer-valued and , every infeasible binary satisfies ; hence no global maximizer of the penalized binary objective is infeasible.
The proof is in Appendix A.6. The guarantee does not extend to arbitrary relaxed points, whose violations can be arbitrarily small. Proposition 2 cannot be interpreted as proving that the complete relaxed trajectory remains feasible, however, in practice, we will see in the subsequent paragraph 4.7 that Gumbel-softmax activations often yield near-discrete bits, and this proposition thus explains why near-discrete solutions encountered on the trajectory remain feasible thanks to the Lagrangian penalty.
4.6 AUTOREGRESSIVE RELAXED ROLLOUT
Phase 2 differentiates through the complete generated sequence. Using Eq. 4, at step i the model computes and from Eq. 5. This recursion defines a differentiable map , so the relaxed objective can be backpropagated through the entire autoregressive computational graph. This dependence across positions is essential: changing the parameters that affect an early relaxed token also changes the prefix consumed at all subsequent generation steps. The resulting Jacobian therefore couples coordinates through the shared autoregressive computation and does not treat the relaxed variables as independent optimization parameters.
4.7 NEAR-DISCRETE EXPLORATION WITH GUMBEL-SOFTMAX
Standard softmax optimization can traverse highly fractional vectors with no combinatorial meaning: a fractional point may have high relaxed objective value while corresponding to no good feasible binary solution. Gumbel–softmax biases Phase 2 toward near-binary configurations. This has two practical implications. First, objective values encountered during training are evaluated near the combinatorial vertices. Second, the trajectory can make relatively sharp moves between near-discrete configurations rather than slowly traversing the interior of . In the binary case, with logit difference and Gumbel noise difference , we have where is the logistic function.
Proposition 3 (Low-temperature Gumbel–softmax). Let and let q be the standard logistic density. For finite , as ,
with .
Thus decreasing confines the forward transition to an -wide region while preserving a finite expected gradient through increasingly rare switching events carrying gradients; the diverging variance motivates keeping bounded away from zero. In our autoregressive model, switching an early coordinate also changes the conditioning prefix of all later decisions, thus flipping multiple bits in one gradient step. The proof is in Appendix A.7.
4.8 WHY OPTIMIZE IN TRANSFORMER SPACE?
The central motivation for ADIP is the nonlinear change of variables , where . Let .
Theorem 2 (Induced decision-space dynamics). For continuous-time gradient ascent ,
Proof. By the chain rule, and , giving Eq. 10. Moreover .
Direct relaxed gradient ascent follows , corresponding to , whereas ADIP can rotate, suppress, or amplify directions through the state-dependent kernel , analogous to parameter-space kernel dynamics in neural networks (Jacot et al., 2018). Theorem 2 therefore makes precise why the transformer is more than a high-dimensional encoding of . Direct optimization follows the Euclidean gradient of , whereas ADIP follows that gradient after multiplication by a positive-semidefinite matrix determined by the current network Jacobian. Because changes during training, the induced kernel is itself state-dependent.
The induced geometry also depends on the specific parameters, not only on the represented solution. For one attention head with input representation , let (queries), (keys), and (values). Causally masked attention is softmax( )V, so the forward map depends on , through their product while gradient descent acts on the matrices separately.
Theorem 3 ((informal) Path-dependent induced geometry). Assume an attention head affects the relaxed rollout nontrivially. For , replace by and by , leaving all other parameters fixed. The resulting transformer defines exactly the same autoregressive map for every prefix, yet for some its kernel differs. Moreover, there exists a quadratic objective for which the two functionally identical transformers induce different instantaneous velocities in relaxed decision space.
In Appendix A.8, we state a formal version of the above theorem and provide a full proof. The key symmetry is that is invariant under this rescaling, while the corresponding Jacobian blocks scale as and . Thus the weights retain geometric information invisible in itself. Theorem 3 establishes that one can construct rescaled models that are functionally indistinguishable, producing the same conditional distributions at every autoregressive step, yet gradient ascent can evolve differently because it acts on the parameterization rather than on the represented function alone. In particular, the ADIP trajectory cannot in general be described by an autonomous vector field depending only on the current relaxed solution: two parameterizations can represent exactly the same autoregressive map and nevertheless induce different local optimization dynamics. Motivated by this result, we call a trajectory “tunneling-like” if it reaches a point whose endpoint under direct relaxed gradient ascent belongs to a different attraction basin from that of the initial incumbent. This operational notion is tested in Section 5.3.
Table 1: Matched-budget results on random QKP instances. Means and standard deviations (between parentheses) are computed across 100 runs per experiment for size and 10 runs per experiment for sizes .
| n | Base solver | Matched solver obj. | ADIP obj. | Improvement (%) |
|---|---|---|---|---|
| 400 | SCIP | 2080.51 (339.71) | 2145.45 (338.41) | 5.71 (4.57) |
| 1000 | SCIP | 5081.30 (562.45) | 5710.90 (620.19) | 12.78 (10.29) |
| 10000 | SCIP | 0.00 (0.00) | 60.21 (26.01) | ∞ |
| 400 | HiGHS | 226.00 (240.42) | 893.00 (796.20) | 378.48 (156.70) |
| 1000 | HiGHS | 0.00 (0.00) | 300.00 (323.85) | ∞ |
| 400 | CP-SAT | 726.00 (234.76) | 1277.50 (355.67) | 77.31 (8.35) |
| 1000 | CP-SAT | 1317.50 (106.77) | 2687.50 (584.78) | 102.85 (27.95) |
| 400 | CBC | 19.50 (13.44) | 133.50 (21.92) | 848.45 (765.87) |
| 1000 | CBC | 0.00 (0.00) | 300.00 (323.85) | ∞ |
5 EXPERIMENTS
We evaluate whether ADIP improves solver incumbents under matched wall-clock budgets and whether its weight-space trajectory accesses different basins of the relaxed objective. The experiments therefore address two complementary questions: whether the method provides practical primal improvement over state-of-the-art open-source solvers given the same total time, and whether the proposed reparametrization changes the local optimization behavior in the relaxed landscape.
5.1 QUADRATIC KNAPSACK BENCHMARK AND PROTOCOL
Following Lopez Piqueres & Chen (2025), we consider
where are item weights and is the capacity. In our experiments, is a random non-symmetric integer-valued matrix, , , , , and we generate 100 instances per experiment for size , and 10 instances per experiment for sizes . Our baselines are SCIP (Achterberg, 2009; Hojny et al., 2025), HiGHS (Huangfu & Hall, 2018), CP-SAT (Perron et al., 2023), and CBC (Forrest & Lougee-Heimer, 2005; COIN-OR, 2026). Only SCIP can natively run quadratic integer programs, the other solvers require performing Fortet linearization (Fortet, 1960) leading to integer linear programs with variables, which may become impractical already at sizes . Each solver runs for seconds to provide ; ADIP then trains for seconds. The matched baseline runs the solver alone for , and we report
The default model is a two-layer causal transformer with embedding dimension 64, four heads, and feed-forward dimension 256. Phase 1 uses , , and ; Phase 2 uses , for size (respectively for sizes ), for size (respectively for sizes ) and . Full implementation details are given in Appendix A.2. The code to reproduce the experiments is available at https://github.com/ouns972/adip-paper.
5.2 MAIN RESULTS
Table 1 reports the matched-budget comparison. We find that ADIP outperforms SCIP in of the runs across the experiments, of the runs across the experiments, and of the runs across the experiments, suggesting that ADIP is stronger when the solvers leave greater room for improvement (at large problem sizes).
Figure 2 shows a representative objective-value trajectory. Starting from a SCIP incumbent, the best feasible decoded solution improves during transformer training. The staircase structure reflects

Figure 2: Representative objective-value trajectory: initial incumbent search and hard-decoded objective over ADIP training.
improvements of the discrete incumbent rather than the continuous relaxed training objective. The improvement also correlates with the SCIP gap at ; this secondary diagnostic is shown in Appendix A.2. This observation is consistent with the intuition that the neural improvement procedure is most useful when substantial optimization remains after the seed phase, although the gap alone should not be interpreted as determining ADIP performance.
5.3 BARRIER-CROSSING AND TUNNELING-LIKE BEHAVIOR
We next investigate whether the transformer reparametrization accesses regions of the relaxed landscape that are difficult to reach by combinatorial optimization or by direct optimization in -space. Let denote the energy associated with the maximization objective. For an initial relaxed point , we run direct gradient descent on over the continuous feasible relaxation,
checking at each step. We apply this procedure to two types of initial points: the original solver incumbent , viewed as a point in , and relaxed transformer outputs encountered during Phase 2. We iterate until convergence or until the feasible boundary prevents further improvement. If these initial points converge to different endpoints, we can infer that they belong to different attraction basins of the direct relaxed dynamics. The comparison therefore asks whether the transformer trajectory has entered a different region of the non-convex relaxed landscape.
Empirically, ADIP visits points whose relaxed-gradient endpoints differ from that of the initial incumbent, indicating that optimization in transformer parameter space can cross basin boundaries not crossed by direct local optimization from the incumbent. This experiment directly probes the geometric claim of Theorems 2–3: if the transformer merely reproduced ordinary Euclidean optimization in -space, points generated from the incumbent would not be expected to systematically acquire different direct-gradient endpoints. We interpret this as a tunneling-like effect induced by the autoregressive reparametrization. Figure 3 visualizes the trajectories; t-SNE is used only for visualization, while basin identity is determined from endpoints in the original high-dimensional relaxed space.
Overall, the experiments show that ADIP can improve solver incumbents under matched computational budgets and that optimization in transformer parameter space can reach regions of the relaxed landscape that are not reached by combinatorial solvers or direct optimization from the solver incumbent. We therefore view ADIP as a complementary primal-improvement mechanism.
QKP incumbent / phase-2 / relax rays (base_seed=102, n=400)

SCIP: 2 snapshots | 2 BESTSOL callbacks | n_best_found=2 | stored_solns=3
Figure 3: Visualization of the tunneling-like experiment. The solver incumbents, relaxed ADIP trajectory, and direct-relaxation endpoints are projected with t-SNE; the vertical axis shows objective value. Basin identity is determined in the original space.
Table 2: Representative basin analysis of the relaxed landscape.
| n | Trajectory points | Distinct endpoints | Incumbent endpoint | Best endpoint |
|---|---|---|---|---|
| 400 | 73 | 45 | 1931.3 | 1971.8 |
| 400 | 72 | 52 | 1842.5 | 2020.4 |
| 1000 | 90 | 35 | 4281.0 | 5083.0 |
| 1000 | 88 | 29 | 5248.0 | 5874.1 |
6 LIMITATIONS
ADIP is trained separately for each instance and requires a feasible incumbent from an external solver. The Lagrangian penalty does not guarantee feasibility of every relaxed intermediate point, although Gumbel-softmax exploration remains close to the original combinatorial structure and the algorithm always returns the best feasible hard solution encountered. Our tunneling analogy is geometric and empirical and does not imply global optimization guarantees. Finally, our experiments focus on random QKP instances; evaluating the method on larger and more diverse integer-programming benchmarks, as well as amortizing it across related instances, are important directions for future work.
7 CONCLUSION
We introduced ADIP, which uses an autoregressive transformer as a nonlinear reparametrization of relaxed binary decision variables for primal improvement in integer programming. Optimizing through the transformer induces a state-dependent geometry in decision space, providing a search mechanism that differs from combinatorial optimization and from direct optimization of the relaxed variables. On random QKP instances, ADIP improves state-of-the-art solver incumbents under matched computational budgets and accesses distinct attraction basins of the relaxed landscape. Together, these results suggest that autoregressive neural reparametrization can provide a complementary search mechanism for hard discrete optimization.
REFERENCES
Tobias Achterberg. SCIP: Solving constraint integer programs. Mathematical Programming Computation, 1(1):1–41, 2009. doi: 10.1007/s12532-008-0001-1.
Irwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. International Conference on Learning Representations Workshop, 2017. URL https://arxiv.org/abs/1611.09940.
Pietro Belotti, Christian Kirches, Sven Leyffer, Jeff Linderoth, James Luedtke, and Ashutosh Mahajan. Mixed-integer nonlinear optimization. Acta Numerica, 22:1–131, 2013. doi:10.1017/S0962492913000032.
Timo Berthold. Measuring the impact of primal heuristics. Operations Research Letters, 41(6):611–614, 2013. doi: 10.1016/j.orl.2013.08.007.
Dimitris Bertsimas, Angela King, and Rahul Mazumder. Best subset selection via a modern optimization lens. The Annals of Statistics, 44(2):813–852, 2016. doi: 10.1214/15-AOS1388.
Robert E. Bixby. A brief history of linear and mixed-integer programming computation. Documenta Mathematica, Extra Volume ISMP:107–121, 2012. doi: 10.4171/DMS/6/16.
Shreya Chaudhary, Jinglei Cheng, Samuel Kushnir, Jiaqi Leng, Pengyu Liu, Yuxiang Peng, Hanrui Wang, and Xiaodi Wu. Quantum-inspired hamiltonian descent for mixed-integer quadratic programming. In NeurIPS 2025 Workshop on GPU-Accelerated and Scalable Optimization (ScaleOPT), 2025.
COIN-OR. CBC: Coin-or branch-and-cut solver, 2026. URL https://github.com/coin-or/Cbc. Open-source mixed-integer programming solver.
Gérard Cornuéjols, George L. Nemhauser, and Laurence A. Wolsey. The uncapacitated facility location problem. In P. B. Mirchandani and R. L. Francis (eds.), Discrete Location Theory, pp. 119–171. John Wiley & Sons, New York, 1990.
Gianni Di Pillo and Luigi Grippo. Exact penalty functions in constrained optimization. SIAM Journal on Control and Optimization, 27(6):1333–1360, 1989.
Matteo Fischetti and Andrea Lodi. Local branching. Mathematical Programming, 98(1–3):23–47, 2003. doi: 10.1007/s10107-003-0395-5.
John Forrest and Robin Lougee-Heimer. CBC user guide. In TutORials in Operations Research: Emerging Theory, Methods, and Applications, pp. 257–277. INFORMS, 2005. doi: 10.1287/educ.1053.0020.
Robert Fortet. Applications de l'algèbre de boole en recherche opérationnelle. Revue Française de Recherche Opérationnelle, 4(14):17–26, 1960.
Giorgio Gallo, Peter L. Hammer, and Bruno Simeone. Quadratic knapsack problems. In Manfred W. Padberg (ed.), Combinatorial Optimization, volume 12 of Mathematical Programming Studies, pp. 132–149. Springer, Berlin, Heidelberg, 1980. doi: 10.1007/BFb0120892.
Zijie Geng, Jie Wang, Xijun Li, Fangzhou Zhu, Jianye Hao, Bin Li, and Feng Wu. Differentiable integer linear programming. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=FPfCUJTsCn.
Ambros Gleixner, Gregor Hendel, Gerald Gamrath, Tobias Achterberg, Michael Bastubbe, Timo Berthold, Philipp M. Christophel, Kati Jarck, Thorsten Koch, Jeff Linderoth, Marco E. Lübbecke, Hans D. Mittelmann, Derya Ozyurt, Ted K. Ralphs, Domenico Salvagnin, and Yuji Shinano. MI-PLIB 2017: Data-driven compilation of the 6th mixed-integer programming library. Mathematical Programming Computation, 13(3):443–490, 2021. doi: 10.1007/s12532-020-00194-3.
Michel X. Goemans and David P. Williamson. Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming. Journal of the ACM, 42(6):1115–1145, 1995. doi: 10.1145/227683.227684.
Qingyu Han, Linxin Yang, Qian Chen, Xiang Zhou, Dong Zhang, Akang Wang, Ruoyu Sun, and Xiaodong Luo. A GNN-guided predict-and-search framework for mixed-integer linear programming. In The Eleventh International Conference on Learning Representations, 2023.
Mohamed Hibat-Allah, Estelle M. Inack, Roeland Wiersema, Roger G. Melko, and Juan Carrasquilla. Variational neural annealing. Nature Machine Intelligence, 3:952–961, 2021.
Christopher Hojny, Mathieu Besançon, Ksenia Bestuzheva, Sander Borst, João Dionísio, Johannes Ehls, Leon Eifler, Mohammed Ghannam, Ambros Gleixner, Adrian Göß, Alexander Hoen, Jacob von Holly-Ponientzietz, Rolf van der Hulst, Dominik Kamp, Thorsten Koch, Kevin Kofler, Jurgen Lentz, Marco Lübbecke, Stephen J. Maher, Paul Matti Meinhold, Gioni Mexi, Til Mohr, Erik Mühmer, Krunal Kishor Patel, Marc E. Pfetsch, Sebastian Pokutta, Chantal Reinartz Groba, Felipe Serrano, Yuji Shinano, Mark Turner, Stefan Vigerske, Matthias Walter, Dieter Weninger, and Liding Xu. The SCIP optimization suite 10.0, 2025.
Qi Huangfu and J. A. J. Hall. Parallelizing the dual revised simplex method. Mathematical Programming Computation, 10(1):119–142, 2018. doi: 10.1007/s12532-017-0130-5.
Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, volume 31, 2018.
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. In International Conference on Learning Representations, 2017. URL https://arxiv.org/abs/1611.01144.
Elias B. Khalil, Christopher Morris, and Andrea Lodi. MIP-GNN: A data-driven framework for guiding combinatorial solvers. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 10219–10227, 2022.
Jiaqi Leng, Ethan Hickman, Joseph Li, and Xiaodi Wu. Quantum hamiltonian descent, 2023.
Andrea Lodi. Mixed integer programming computation. In Michael Jünger, Thomas M. Liebling, Denis Naddef, George L. Nemhauser, William R. Pulleyblank, Gerhard Reinelt, Giovanni Rinaldi, and Laurence A. Wolsey (eds.), 50 Years of Integer Programming 1958–2008: From the Early Years to the State-of-the-Art, pp. 619–645. Springer, Berlin, Heidelberg, 2010. doi: 10.1007/978-3-540-68279-0_16.
Javier Lopez Piqueres and Jing Chen. Cons-training tensor networks: Embedding and optimization over discrete linear constraints. SciPost Physics, 18:192, 2025. doi: 10.21468/SciPostPhys.18.6.192.
Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Representations, 2017. URL https://arxiv.org/abs/1611.00712.
Silvano Martello and Paolo Toth. Knapsack Problems: Algorithms and Computer Implementations. John Wiley & Sons, Chichester, 1990.
Vinod Nair, Sergey Bartunov, Felix Gimeno, Ingrid von Glehn, Pawel Lichocki, Ivan Lobov, Brendan O'Donoghue, Nicolas Sonnerat, Christian Tjandraatmadja, Pengming Wang, Ravichandra Addanki, Tharindi Hapuarachchi, Thomas Keck, James Keeling, Pushmeet Kohli, Ira Ktena, Yujia Li, Oriol Vinyals, and Yori Zwols. Solving mixed integer programs using neural networks. arXiv preprint arXiv:2012.13349, 2020. URL https://arxiv.org/abs/2012.13349.
Kouhei Nakaji, Lasse Bjørn Kristensen, Jorge A. Campos-Gonzalez-Angulo, Mohammad Ghazi Vakili, Haozhe Huang, Mohsen Bagherimehrab, Christoph Gorgulla, FuTe Wong, Alex McCaskey, Jin-Sung Kim, Thien Nguyen, Pooja Rao, et al. The generative quantum eigensolver (GQE) and its application for ground state search, 2024.
George L. Nemhauser and Laurence A. Wolsey. Integer and Combinatorial Optimization. John Wiley & Sons, New York, NY, 1988. ISBN 9780471828198. doi: 10.1002/9781118627372.
Laurent Perron, Frédéric Didier, and Steven Gay. The CP-SAT-LP solver. In 29th International Conference on Principles and Practice of Constraint Programming (CP 2023), volume 280 of Leibniz International Proceedings in Informatics, pp. 3:1–3:2. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi: 10.4230/LIPIcs.CP.2023.3.
Michael L. Pinedo. Scheduling: Theory, Algorithms, and Systems. Springer, 5 edition, 2016. doi:10.1007/978-3-319-26580-3.
W. David Pisinger, Anders Bo Rasmussen, and Rune Sandvik. Solution of large quadratic knapsack problems through aggressive reduction. INFORMS Journal on Computing, 19(2):280–290, 2007. doi: 10.1287/ijoc.1050.0172.
Edward Rothberg. An evolutionary algorithm for polishing mixed integer programming solutions. INFORMS Journal on Computing, 19(4):534–541, 2007. doi: 10.1287/ijoc.1060.0189.
Thanawat Sornwanee. Differentiable integer linear programming is not differentiable & it's not a mere technical problem, 2026. URL https://arxiv.org/abs/2601.17800.
Paul Mingzheng Tang, Moses Hong De Lee, and Hoong Chuin Lau. Autoregressive rl approach for mixed-integer linear programs. In Learning and Intelligent Optimization, volume 15745 of Lecture Notes in Computer Science, pp. 1–17. Springer, 2025. doi: 10.1007/978-3-032-09192-5_1.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, pp. 5998–6008. Curran Associates, Inc., 2017.
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, volume 28, 2015.
Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi, and Sanjiv Kumar. Are transformers universal approximators of sequence-to-sequence functions? In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=ByxRM0Ntvr.
A APPENDIX
A.1 ADDITIONAL DETAILS ON RELATED WORKS
Our experimental setup is directly inspired by the constrained tensor-network approach of Lopez Piqueres & Chen (2025), which introduces constrained matrix product states (MPS) whose block structure exactly restricts their support to binary configurations satisfying prescribed linear constraints. The authors optimize the resulting generative model using an unsupervised annealing procedure and evaluate it on the QKP, where they report improvements over SCIP on random instances. In fact, their QKP experiments form the basis of our experimental benchmark: following Lopez Piqueres & Chen (2025), we consider randomly generated integer-valued quadratic objectives and knapsack constraints and compare the quality of solutions obtained against SCIP under controlled computational budgets. The two approaches differ fundamentally, however, in how feasibility and optimization are represented. Constrained MPS encode the linear constraints exactly into the tensor-network architecture, so that samples have support only on the feasible set. This is a serious limitation of their method, as in general, exact encoding of linear constraints over binary variables via MPS requires exponentially many parameters. Our transformer does not hard-code the feasible set into its architecture; instead, it is first initialized on a feasible incumbent returned by SCIP and subsequently optimized using a differentiable objective together with a Lagrangian feasibility penalty. Moreover, while the constrained-MPS algorithm updates a probability distribution over feasible configurations through an annealed sample-and-train procedure, our method differentiates the relaxed QKP objective end-to-end through an autoregressive map and thereby performs optimization directly in the shared parameter space of the transformer. Thus, while our QKP benchmark and its motivation are explicitly inherited from Lopez Piqueres & Chen (2025), our method investigates a different mechanism for navigating the combinatorial landscape: differentiable autoregressive reparametrization, which has better scalability potential than exact constraint encoding via MPS.
The second conceptual connection is the Generative Quantum Eigensolver (GQE) of Nakaji et al. (2024). GQE departs from conventional variational quantum eigensolvers by placing the trainable parameters in a classical generative model rather than directly in a parameterized quantum circuit. In its GPT-QE realization, a transformer autoregressively generates sequences of quantum-circuit components, and the generative model is iteratively trained so that the circuits it produces attain lower energies. This perspective is closely related to the motivation of our method: in both cases, a difficult optimization problem is lifted from its original representation into the parameter space of a classical autoregressive generative model, whose shared parameters induce correlated changes in the generated object. The crucial difference is that GQE generates descriptions of quantum circuits whose energies must subsequently be evaluated, whereas our transformer directly generates the binary decision variables of the integer program through a differentiable relaxation. Consequently, our objective can be backpropagated through the generated variables to the transformer weights, making an explicit differentiable reparametrization of the original optimization landscape. Our method therefore shares GQE's broader quantum-inspired idea of optimizing through a classical generative representation, but applies it entirely classically and directly to constrained discrete optimization, with the additional use of solver-incumbent initialization and Gumbel–softmax relaxation to obtain a differentiable, near-discrete optimization trajectory.
A complementary connection is Quantum Hamiltonian Descent (QHD) (Leng et al., 2023), which formulates continuous non-convex optimization as a time-dependent quantum Hamiltonian evolution. QHD is motivated in part by the ability of quantum dynamics to exploit trajectories that are inaccessible to classical local descent, including tunneling across barriers in the objective landscape. This motivation is closely related to our empirical tunneling analogy, but the underlying mechanisms are fundamentally different. QHD requires a quantum Hamiltonian evolution over the original continuous variables, whereas ADIP is entirely classical: it changes the optimization geometry by lifting the relaxed decision vector to the parameter space of an autoregressive transformer. In particular, our induced dynamics provide a classical, state-dependent reparametrization of the gradient field, while the observed basin crossing arises from optimization through this neural representation together with stochastic near-discrete exploration.
Recent concurrent work on Quantum-Inspired Hamiltonian Descent (QIHD) (Chaudhary et al., 2025) similarly transfers Hamiltonian intuition to a classical optimizer for mixed-integer quadratic programs. QIHD explicitly simulates momentum-position Hamiltonian dynamics with constraint penalties, whereas ADIP obtains non-Euclidean decision-space dynamics implicitly through the Jacobian of an autoregressive neural reparametrization.
A.2 EXPERIMENTAL DETAILS
Compute environment. All reported runs were executed on a single Apple MacBook Pro with an Apple M4 Max CPU (14 cores: 10 performance + 4 efficiency) and 36 GB unified memory. Training used CPU-only PyTorch; no GPU acceleration was used as transformers used are small and GPU overheads dominate here. Warm-start solvers were restricted to a single thread. BLAS/OpenMP thread counts were likewise set to 1 for reproducibility. Wall-clock timing was used for SCIP, HiGHs, CP-SAT and CBC with fixed random seeds.
Instance generation. As in the main text, for each size , for each experiment, we sample (integer, nonsymmetric), , and capacity . Instances are identified by a base seed. The generation code is released in the repository.
Warm-start models. SCIP solves the native nonconvex quadratic integer program (quadratic epigraph). HiGHS and CBC receive a Fortet/McCormick linearization of the binary quadratic, introducing an auxiliary binary for each nonzero product term together with , , . CP-SAT uses the same auxiliaries but encodes via OR-Tools AddMultiplicationEquality (equivalent on ). For dense indefinite , the linearized models have binaries and constraints, which becomes severe already at for LP-based MIP solvers; CP-SAT's SAT/CP search often returns a feasible incumbent sooner under the same 500 s budget.
Matched-budget protocol. Each base solver is allotted to produce . ADIP then runs with a Phase-2 wall-clock cap (and at most Adam steps, with early stopping on plateau). The matched baseline continues the same solver alone for . We report relative improvement
and write when the matched solver objective is identically zero while ADIP returns a strictly positive feasible objective (common for linearized solvers at large , and for SCIP at under our budgets).
Architecture and optimization. The model is a two-layer causal transformer over the binary alphabet with embedding dimension , 4 heads, feed-forward width , and banded sparse attention retaining a fraction 0.1 of previous positions. Phase 1 minimizes the smoothed teacher-forcing CE equation 7 with Adam, maximum steps, learning rate , plateau patience and minimum delta , and target smoothing . Phase 2 maximizes the soft Lagrangian equation 8 with Adam, Gumbel–softmax straight-through estimation at temperature , soft weight , and plateau patience (minimum delta ). Size-dependent Phase 2 knobs are:
| Phase-2 LR | knapsack penalty | |
|---|---|---|
| 400 | (same as ) | |
| 1000, 10000 |
At every Phase 2 step we hard-decode , test knapsack feasibility, and retain the best feasible objective encountered. Phase-1 CE uses a one-pass implementation; Phase-2 rollouts use KV caching with chunked gradient checkpointing to keep long sequences tractable.
Objective-value trajectory (Fig. 2). Figure 2 compares the matched SCIP-alone curve over 1000 s with the SCIP+ ADIP curve. The plot uses a broken -axis (near-zero band and high-objective zoom) and a late-time expanding -scale to emphasize improvements near the end of the budget.
% improvement (rounded vs warm SCIP) vs SCIP MIP gap (N=400, n=100)

Figure 4: Percentage improvement of SCIP+ADIP vs. matched SCIP, plotted against the SCIP MIP gap after s (n = 400, 100 seeds).
Basin / tunneling diagnostic (Sec. 5.3, Fig. 3). Along a recorded ADIP trajectory, from each point (and from SCIP incumbent snapshots), we run projected gradient ascent of the continuous objective subject to the knapsack boundary , with step size 0.05, at most 3000 iterations, and tolerances (capacity) / (projected gradient). Two endpoints are counted as distinct if their distance exceeds . Table 2 reports trajectory length, the number of distinct endpoints, and the objective at the incumbent-started vs. best endpoint. The 3D visualization in Fig. 3 is a t-SNE projection of the same points (perplexity 30) with objective on the vertical axis; basin identity is always decided in the original space, not in the t-SNE embedding.
Software. Experiments used Python ≥ 3.10, NumPy < 2, PyTorch ≥ 2, pyscipopt / SCIP 10, HiGHS (highspy), and OR-Tools (CBC + CP-SAT). Pinned source hashes and reproduction commands are included in the repository.
Additional experimental figure. Figure 4 plots, for the SCIP matched-budget sweep (100 seeds), the percentage improvement of SCIP+ADIP over the matched SCIP objective against the SCIP MIP gap at . Larger residual gaps after the seed phase tend to leave more room for ADIP improvement, consistent with Sec. 5.2, but the gap is not a deterministic predictor of ADIP success.
A.3 PROOF OF THEOREM 1
Membership in NP is immediate: given a candidate , one can verify both feasibility and strict improvement in polynomial time.
For NP-hardness, consider the decision version of QKP. Given , strictly positive weights , capacity , and an integer threshold , the problem asks whether there exists such that
This decision problem is NP-hard (Gallo et al., 1980; Pisinger et al., 2007).
Construct an augmented instance by introducing one additional binary variable z. Give this variable weight C and define
The capacity remains C. Consider the explicitly known incumbent
It is feasible and has objective value K - 1.
Because all original weights are strictly positive, any feasible solution with must set every original variable to zero: the additional variable alone exhausts the entire capacity. Hence no feasible solution with can strictly improve upon . A strictly improving solution must therefore have , in which case its objective is precisely . Since the objective is integer-valued,
Thus the augmented instance admits a feasible solution strictly improving upon if and only if the original quadratic knapsack decision instance is a YES instance. The construction is polynomial, which proves NP-hardness.
A.4 PROOF OF PROPOSITION 1
Fix an arbitrary . Consider the constant sequence-to-sequence map
on any compact input domain . This map is continuous. By the universal approximation theorem for transformers with positional encodings (Yun et al., 2020), for every there exists a transformer such that
In particular, there is an input initiating the autoregressive rollout yielding,
Choose . If , then
whereas if , then
Thresholding each coordinate at 1/2 therefore yields
for every . Since was arbitrary, the hard-decoded transformer parametrization covers the entire binary hypercube .
A.5 PROOF OF COROLLARY 1
By Proposition 1,
Therefore optimization over the hard-decoded transformer contains the original binary quadratic program exactly:
Since the decision version of the problem on the right-hand side is NP-hard, so is global optimization over .
A.6 PROOF OF PROPOSITION 2
Because A, b, and x are integer-valued, Ax - b is integer-valued. Hence if a binary vector x is infeasible, at least one constraint is violated by at least one unit, and therefore
Furthermore, since ,
Thus every infeasible binary x satisfies
where the final inequality follows from the condition in Proposition 2.
Since is feasible, , and its penalized objective is exactly . Therefore no infeasible binary point can globally maximize the penalized objective.
A.7 PROOF OF PROPOSITION 3
The almost-sure convergence follows directly from the zero-temperature limit of the sigmoid:
for every .
Let . Since has density ,
Using the substitution gives
By dominated convergence and ,
Similarly,
Since
we obtain
Because converges to the finite value , the second moment dominates asymptotically, yielding .
A.8 PROOF OF THEOREM 4
We start by stating a formal version of the theorem.
Consider one attention head with input representation H, query, key, and value matrices
and causally masked attention
where M is the causal mask.
Theorem 4 (Path-dependent induced geometry). Let be the parameters of a causal transformer and suppose that, for some attention head, the output of the relaxed autoregressive rollout depends nontrivially on at least one of its query or key matrices, i.e.
For every c > 0, define a reparametrized transformer by
with every other parameter unchanged.
Then:
- the two transformers define exactly the same autoregressive map,
- nevertheless, except in the degenerate case , there exists for which
- there exists a QKP objective for which the two transformers induce different instantaneous velocities in relaxed decision space
In other words there exist two transformers representing exactly the same binary solution but inducing different local optimization geometries in relaxed decision space.
Proof. Under the rescaling stated in Theorem 4, the query and key matrices become
and
Their product is therefore invariant:
Hence the matrix entering the causally masked attention softmax is unchanged. Since and every subsequent model parameter are also unchanged, the output of this attention head is identical. Applying the same argument throughout the autoregressive rollout shows that
for every prefix z. This proves the first statement.
We now examine the parameter Jacobian. The attention scores depend on and through
For a perturbation around the reparametrized point,
so the sensitivity to is multiplied by . Similarly, the sensitivity to is multiplied by c. Consequently,
Let denote the Jacobian with respect to all remaining parameters. Since the forward computation is unchanged under this rescaling, their contribution is unchanged. Hence
At c = 1,
Suppose, for contradiction, that these two matrices were equal for every c > 0. Then
for every . Taking implies
and therefore . Taking similarly yields . This contradicts the nondegeneracy assumption in Theorem 4.
Therefore, whenever the attention head affects the generated solution nontrivially, there exists such that
Combining Eq. 54 with Theorem 2, the two functionally equivalent initializations satisfy
where
for an appropriate c. Thus two transformers representing the same current solution can induce different trajectory kernels solely because of how that solution is encoded in weight space.
We next show that there exists a quadratic objective
for which the two transformers induce different instantaneous trajectories:
Let
Since , there exists some such that
We show that g can be realized as the gradient of a quadratic objective at . Let
and define the symmetric matrix
A direct calculation gives
Set
Because S is symmetric,
Therefore
Thus the different geometries produced by the self-attention symmetry can lead to genuinely different trajectories for an objective of exactly the quadratic form considered in this proof.
19
□