Dual-Cluster Memory Agent: Resolving Multi-Paradigm Ambiguity in Optimization Problem Solving

Xinyu Zhang, Yuchen Wan, Boxuan Zhang, Zesheng Yang, Lingling Zhang, Bifan Wei, Jun LiuarXiv 2026 · arXiv

TL;DR

Large Language Models (LLMs) often stumble when solving complex optimization problems due to "multi-paradigm ambiguity"—where a single problem description contains conflicting cues for different mathematical frameworks. The Dual-Cluster Memory Agent (DCM-Agent) resolves this without retraining by organizing historical solutions into decoupled modeling and coding clusters, distilling them into actionable guidelines (Approaches, Checklists, and Pitfalls). This training-free approach boosts optimization accuracy by 11% to 21% across multiple benchmarks and enables smaller models to "inherit" advanced reasoning capabilities from larger ones.

What Problem Does This Paper Address?

Optimization problems (such as supply chain logistics, scheduling, or resource allocation) are notoriously tricky to automate. When using LLMs to translate natural language descriptions into mathematical formulations and executable code, a major bottleneck arises: cognitive interference from entangled modeling paradigms.

As shown in Figure 1, a single problem description might contain constraints that simultaneously hint at Integer Linear Programming (ILP), Constraint Programming (CP), or Dynamic Programming (DP).

Figure 1: Illustration of a single production planning problem formalized via distinct algorithmic paradigms.

This structural ambiguity confuses LLMs, leading them to apply incorrect templates or fail at verifying paradigm-specific constraints (e.g., missing an integrality gap vs. a recurrence failure). Current methods either blindly fine-tune models on rigid templates—which fail when subtle variations occur—or rely on static agentic prompts (like "Check if correct") that lack the granularity to detect these paradigm-specific pitfalls.

Methods

The authors introduce the Dual-Cluster Memory Agent (DCM-Agent), a training-free framework that externalizes reasoning patterns into a structured historical archive.

Figure 2: Overview of the Dual-Cluster Memory Agent (DCM-Agent). This agent operates in two distinct phases: (1) Dual-Cluster Memory Construction: Historical solutions are stratified into three types to distill structured knowledge K. These are organized into decoupled Modeling Clusters and Coding Clusters, bridged by a weighted bipartite graph G. (2) Memory-Augmented Inference: For a new problem, the agent retrieves relevant cluster paths to guide the sequential generation of the mathematical formulation ˆm and executable code ˆc.

As illustrated in Figure 2, it operates in two main phases:

  1. Dual-Cluster Memory Construction: Historical problem-solution trajectories are analyzed and categorized into three node types: Type A (Always Correct), Type B (Recovered), and Type C (Persistent Failure). From these, the agent distills three tiers of structured knowledge: Approach (how to solve), Checklist (what to verify), and Pitfall (what to avoid). Crucially, it decouples this knowledge into independent Modeling Clusters (abstract math logic) and Coding Clusters (concrete implementation), connected by a weighted Bipartite Graph that tracks their compatibility.
  2. Memory-Augmented Inference: When faced with a new problem, the agent performs a dual-retrieval step (at both the instance and cluster level) to find the most relevant modeling paths. It then navigates a prioritized queue of solution paths using a dynamic Generate-Verify-Repair-Backtrack pipeline. If the code executor fails, the agent uses cluster-specific Pitfalls and Checklists to systematically repair the error or autonomously backtrack to an alternative modeling paradigm.

Datasets

  • Memory Construction: 500 problems randomly sampled from the mathematical programming and combinatorial optimization domains within the OptiVerse benchmark (ensuring no overlap with evaluation sets).
  • Evaluation Benchmarks: The framework was rigorously tested across seven diverse optimization datasets:
  • Linear/Mixed-Integer Programming: NL4Opt and NLP4LP
  • High-Complexity Tasks: OptiBench, OptMATH, and the ComplexLP subset of MAMO
  • Real-World Applications: IndustryOR and ComplexOR

Key Insights and Ideas

  • Decoupling Math from Code is Crucial: Separating abstract mathematical modeling from concrete code generation prevents the LLM from getting bogged down by syntax errors while trying to figure out the underlying logic. Ablation studies showed that removing modeling clusters caused a sharper performance drop than removing coding clusters.
  • "Knowledge Inheritance": A fascinating finding is that a memory constructed by a larger, superior model (like GPT-5.1 or Qwen3-235B) can be plugged directly into a smaller model (like Qwen3-8B), significantly elevating the smaller model's performance. The smaller model effectively "inherits" advanced structural reasoning without any fine-tuning.
  • Failures are First-Class Citizens: By explicitly analyzing persistent failures (Type C) and recovered solutions (Type B), the agent builds highly effective "Pitfall" warnings. Knowing what not to do proves just as important as knowing what template to follow.
  • Granular Understanding Scale: Larger models naturally generate a higher number of distinct modeling clusters, indicating they possess a more granular understanding of abstract problem structures compared to smaller models.

Key Results

  • Consistent Accuracy Boosts: Across all seven benchmarks, DCM-Agent achieved an average performance improvement of 11% to 21% compared to standalone LLMs.
  • Outperforming Specialized Baselines: DCM-Agent consistently beat state-of-the-art specialized optimization frameworks including OptiMUS, AF-MCTS, and OptiTree across various model scales (8B to 235B+ parameters). For example, on the Qwen3-8B scale, DCM-Agent achieved an average accuracy of 49.43%, outperforming the next best agentic framework (OptiTree) by nearly 10%.
  • Computational Efficiency: Compared to heavy tree-search methods like AF-MCTS, DCM-Agent significantly reduced execution time (e.g., 73.4 seconds vs 205.7 seconds on the OptMATH benchmark using Qwen3-235B), proving that memory-driven guidance is far more computationally purposeful than exhaustive search.

Limitations and Future Work

  • Initialization Latency: The primary limitation is the upfront cost of building the dual-cluster memory. Collecting, classifying, and clustering historical trajectories to build the bipartite graph introduces a non-negligible one-time computational overhead compared to zero-shot prompting.
  • Future Directions: The authors frame this initialization as a "sunk cost" since inference is highly efficient once the memory is stabilized. However, to mitigate this, they suggest exploring online learning mechanisms in future work, allowing the memory to evolve dynamically through real-time user interactions rather than requiring full reconstruction cycles.

Summary updated

Abstract

Large Language Models (LLMs) often struggle with structural ambiguity in optimization problems, where a single problem admits multiple related but conflicting modeling paradigms, hindering effective solution generation. To address this, we propose Dual-Cluster Memory Agent (DCM-Agent) to enhance performance by leveraging historical solutions in a training-free manner. Central to this is Dual-Cluster Memory Construction. This agent assigns historical solutions to modeling and coding clusters, then distills each cluster's content into three structured types: Approach, Checklist, and Pitfall. This process derives generalizable guidance knowledge. Furthermore, this agent introduces Memory-augmented Inference to dynamically navigate solution paths, detect and repair errors, and adaptively switch reasoning paths with structured knowledge. The experiments across seven optimization benchmarks demonstrate that DCM-Agent achieves an average performance improvement of 11%- 21%. Notably, our analysis reveals a ``knowledge inheritance'' phenomenon: memory constructed by larger models can guide smaller models toward superior performance, highlighting the framework's scalability and efficiency.
BibTeX
@misc{zhang2026dual,
  author = {Xinyu Zhang and Yuchen Wan and Boxuan Zhang and Zesheng Yang and Lingling Zhang and Bifan Wei and Jun Liu},
  title = {{Dual-Cluster Memory Agent: Resolving Multi-Paradigm Ambiguity in Optimization Problem Solving}},
  year = {2026},
  eprint = {2604.20183},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.20183},
}

Loading related content...

Figure