mlsanityData to 14 Oct 2026

BlackBoxToBlueprint: Extracting Interpretable Logic from Legacy Systems using Reinforcement Learning and Counterfactual Analysis

arXiv 2507.00180 ↗First posted 30 Jun 2025cs.AI cs.LGcited by 0

On the map: Deep reinforcement learning methods → Interpretable and logic-guided RL

Abstract (arXiv)

Modernizing legacy software systems is a critical but challenging task, often hampered by a lack of documentation and understanding of the original system's intricate decision logic. Traditional approaches like behavioral cloning merely replicate input-output behavior without capturing the underlying intent. This paper proposes a novel pipeline to automatically extract interpretable decision logic from legacy systems treated as black boxes. The approach uses a Reinforcement Learning (RL) agent to explore the input space and identify critical decision boundaries by rewarding actions that cause meaningful changes in the system's output. These counterfactual state transitions, where the output changes, are collected and clustered using K-Means. Decision trees are then trained on these clusters to extract human-readable rules that approximate the system's decision logic near the identified boundaries. I demonstrated the pipeline's effectiveness on three dummy legacy systems with varying complexity, including threshold-based, combined-conditional, and non-linear range logic. Results show that the RL agent successfully focuses exploration on relevant boundary regions, and the extracted rules accurately reflect the core logic of the underlying dummy systems, providing a promising foundation for generating specifications and test cases during legacy migration.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Interpretable and logic-guided RL, one of 15 directions in Deep reinforcement learning methods. Builds on 1 of its 15 references that are in the map. First posted on arXiv 30 Jun 2025.

Builds on

1 of 15 references.

References · 1

  1. 2017Proximal Policy Optimization Algorithmscited by 15,215

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026From Black Box to Executable Logic: Explainable Reinforcement Learning through Prolog Expert Systems
  2. 2026Explaining Reinforcement Learning Agents via Inductive Logic Programming
  3. 2025STACHE: Local Black-Box Explanations for Reinforcement Learning Policies
  4. 2023π2vec: Policy Representations with Successor Features
  5. 2024Why the Agent Made that Decision: Contrastive Explanation Learning for Reinforcement Learning
  6. 2022Decisions that Explain Themselves: A User-Centric Deep Reinforcement Learning Explanation System
  7. 2025R-Log: Incentivizing Log Analysis Capability in LLMs via Reasoning-based Reinforcement Learning
  8. 2026Interpretable reinforcement learning with decision-tree pruning