# From Scores to Safe Sets: Exact Safety--Constrained Decoding for Medication Recommendation

arXiv: https://arxiv.org/abs/2610.29228 · HTML: https://mlsanity.com/paper/2610.29228/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Builds on 14 of its 29 references that are in the map.
- Submitted 21 Oct 2026.

## Builds on (most cited first, 14 of 14)

- [Pre-training of Graph Augmented Transformers for Medication Recommendation](https://mlsanity.com/paper/1906.00346/) (2019)
- [Parallelizing the dual revised simplex method](https://mlsanity.com/paper/1503.01889/) (2015)
- [GAMENet: Graph Augmented MEmory Networks for Recommending Medication Combination](https://mlsanity.com/paper/1809.01852/) (2018)
- [SafeDrug: Dual Molecular Graph Encoders for Recommending Effective and Safe Drug Combinations](https://mlsanity.com/paper/2105.02711/) (2021)
- [Change Matters: Medication Change Prediction with Recurrent Residual Networks](https://mlsanity.com/paper/2105.01876/) (2021)
- [Conditional Generation Net for Medication Recommendation](https://mlsanity.com/paper/2202.06588/) (2022)
- [Dual Memory Neural Computer for Asynchronous Two-view Sequential Learning](https://mlsanity.com/paper/1802.00662/) (2018)
- [Large Language Model Distilling Medication Recommendation Model](https://mlsanity.com/paper/2402.02803/) (2024)
- [Leave No Patient Behind: Enhancing Medication Recommendation for Rare Disease Patients](https://mlsanity.com/paper/2403.17745/) (2024)
- [VITA: 'Carefully Chosen and Weighted Less' Is Better in Medication Recommendation](https://mlsanity.com/paper/2312.12100/) (2023)
- [CausalMed: Causality-Based Personalized Medication Recommendation Centered on Patient health state](https://mlsanity.com/paper/2404.12228/) (2024)
- [Fine-grained List-wise Alignment for Generative Medication Recommendation](https://mlsanity.com/paper/2505.20218/) (2025)
- [Natural Language-Assisted Multi-modal Medication Recommendation](https://mlsanity.com/paper/2501.07166/) (2025)
- [ARMR: Adaptively Responsive Network for Medication Recommendation](https://mlsanity.com/paper/2507.04428/) (2025)

## Abstract (arXiv)

Recent generative medication recommendation systems ultimately produce sets of drugs, but drug--drug interaction (DDI) constraints depend on the set as a whole. A natural post-hoc approach is to first predict medications and then locally repair interacting pairs by removing one drug at a time. We ask whether this local repair step itself introduces avoidable error. Using fixed medication scores from FLAME's frozen classifier on MIMIC-III, we compare increasingly strong local repair strategies with an exact global decoder while holding the scores, output size, and DDI constraint fixed. The global decoder jointly selects the highest-scoring feasible medication set using mixed-integer linear programming. Across validation and test splits, global decoding consistently achieves higher Jaccard similarity than greedy repair, degree-aware repair, and degree-aware repair strengthened with exhaustive 1-swap local search. Its advantage is small under loose DDI constraints and becomes larger as the constraint tightens; on the test split it reaches +0.0064 Jaccard over the strongest local baseline at the strict DDI operating point. The finding also holds across a fine accuracy--DDI sweep at matched realized DDI exposure and under three score representations. At the strict setting, global decoding retains more true-positive medications while removing more false positives. These results show that medication recommendation is not only a representation-learning problem: even with a frozen clinical model, how its scores are converted into a constrained medication set can materially affect the final prediction.
