Traditional genetic algorithm mutation strategies typically apply stochastic gene modifications without considering broader genomic context or learning from historical evolutionary data. To address this, we introduce BERT Mutation for Genetic Algorithms (GAs), a novel, domain-independent contextual mutation operator that adapts the Transformer architecture to fixed-length genetic representations. While deep learning-based operators have shown success in Genetic Programming, extending them to GAs is challenged by “semantic opacity”—the lack of explicit structural definitions in linear integer or binary vectors. To overcome this, we propose a novel data augmentation strategy that generates pseudo-training examples derived from the population’s elite. This strategy enriches the training signal by constructing augmented trajectories toward high-fitness solutions, stabilizing the reinforcement learning process. We evaluate the operator across four diverse domains: Frozen Lake, Artificial Ant, Graph Coloring, and Unweighted Set Cover. Our results demonstrate that BERT Mutation consistently outperforms traditional stochastic operators (One-Point, Uniform, and Zigzag) and an adaptive operator (AOS) in both convergence speed and final solution quality. Notably, BERT Mutation achieves superior average fitness in approximately half the wall-clock time and fewer than half the generations required by competing baselines. Furthermore, diversity analysis confirms that BERT Mutation preserves structured, meaningful population diversity, avoiding the premature convergence seen in simpler operators.
In Genetic Algorithms (GAs), the selection operator plays a critical role in balancing exploration and exploitation. However, classical and adaptive selection mechanisms largely rely on static rules or handcrafted heuristics that fail to adapt to the real-time dynamics of the evolving population. In this work, we introduce Deep Tournament Selection (DTS), a novel domain-independent selection operator that reformulates tournament selection as a Markov Decision Process optimized via reinforcement learning. DTS evaluates candidate solutions in a tournament using a Transformer encoder augmented with global and local rank-based positional encodings, along with a self-attention pointer mechanism. This architecture allows the selection policy to jointly capture global fitness relationships and local competitive context. The policy is trained fully online using policy-gradient reinforcement learning without requiring additional fitness evaluations, enabling the operator to dynamically adjust its selection pressure. We evaluate DTS on three canonical combinatorial optimization domains: Graph Coloring, Set Cover, and the Traveling Salesman Problem. Empirical results demonstrate that DTS achieves faster convergence, improved solution quality, and robust performance across problem instances compared to classical and dynamic selection baselines, while introducing negligible computational overhead and preserving population diversity.
Deep-learning-based genetic operators can substantially improve evolutionary search quality, but they also introduce significant computational and energy overhead, bringing the Red AI vs. Green AI tension into evolutionary computation. In this work, we study the energy footprint of Deep Neural Crossover, a reinforcement-learning-based multi-parent crossover operator, and evaluate parameter-level strategies to reduce its power consumption without sacrificing solution quality. We profile experiments with process-level energy measurements and analyze two optimization levers: training batch size and a new fitness-based scheduling threshold that triggers backpropagation only after meaningful fitness improvement. Experiments on benchmark Bin-Packing and Graph Coloring instances show that changing batch size alone has little effect on total energy, whereas the proposed scheduling strategy yields substantial savings. In particular, using larger scheduling thresholds considerably reduces energy consumption while keeping fitness close to the best-performing configurations and, in several cases, matching or improving it. These results provide a practical pathway for greener neuro-evolutionary algorithms through adaptive training schedules.
We introduce BERT mutation, a novel, domain-independent mutation operator for Genetic Programming (GP) that leverages advanced Natural Language Processing (NLP) techniques to improve convergence, particularly using the Masked Language Modeling approach. By combining the capabilities of deep reinforcement learning and the BERT transformer architecture, BERT mutation intelligently suggests node replacements within GP trees to enhance their fitness. Unlike traditional stochastic mutation methods, BERT mutation adapts dynamically by using historical fitness data to optimize mutation decisions, resulting in more effective evolutionary improvements. Through comprehensive evaluations across three benchmark domains, we demonstrate that BERT mutation significantly outperforms conventional and state-of-the-art mutation operators in terms of convergence speed and solution quality. This work represents a pivotal step toward integrating state-of-the-art deep learning into evolutionary algorithms, pushing the boundaries of adaptive optimization in GP.
Predicting player behavior in strategic games, especially complex ones like chess, presents a significant challenge. The difficulty arises from several factors. First, the sheer number of potential outcomes stemming from even a single position, starting from the initial setup, makes forecasting a player's next move incredibly complex. Second, and perhaps even more challenging, is the inherent unpredictability of human behavior. Unlike the optimized play of engines, humans introduce a layer of variability due to differing playing styles and decision-making processes. Each player approaches the game with a unique blend of strategic thinking, tactical awareness, and psychological tendencies, leading to diverse and often unexpected actions. This stylistic variation, combined with the capacity for creativity and even irrational moves, makes predicting human play difficult. Chess, a longstanding benchmark of artificial intelligence research, has seen significant advancements in tools and automation. Engines like Deep Blue, AlphaZero, and Stockfish can defeat even the most skilled human players. However, despite their exceptional ability to outplay top-level grandmasters, predicting the moves of non-grandmaster players, who comprise most of the global chess community – remains complicated for these engines. This paper proposes a novel approach combining expert knowledge with machine learning techniques to predict human players' next moves. By applying feature engineering grounded in domain expertise, we seek to uncover the patterns in the moves of intermediate-level chess players, particularly during the opening phase of the game. Our methodology offers a promising framework for anticipating human behavior, advancing both the fields of AI and human-computer interaction.
Bugs, especially those in concurrent systems, are often hard to reproduce because they manifest only under rare conditions. Testers frequently encounter failures that occur only under specific inputs, often at low probability. We propose an approach to systematically amplify the occurrence of such elusive bugs. We treat the system under test as a black-box system and use repeated trial executions to train a predictive model that estimates the probability of a given input configuration triggering a bug. We evaluate this approach on a dataset of 17 representative concurrency bugs spanning diverse categories. Several model-based search techniques are compared against a brute-force random sampling baseline. Our results show that an ensemble stacking classifier can significantly increase bug occurrence rates across nearly all scenarios, often achieving an order-of-magnitude improvement over random sampling. The contributions of this work include the following: (i) a novel formulation of bug amplification as a rare-event classification problem; (ii) an empirical evaluation of multiple techniques for amplifying bug occurrence, demonstrating the effectiveness of model-guided search; and (iii) a practical, non-invasive testing framework that helps practitioners to expose hidden concurrency faults without altering the internal system architecture.
This paper investigates how Behavioral Programming (BP), and executable specifications in general, can more effectively align models with requirements, addressing a key motivation behind BP’s development. While BP has traditionally supported safety requirements—defining what a system may, must, and must not do—it lacks direct mechanisms for expressing liveness requirements, which ensure that certain tasks are eventually completed. We introduce a “must-finish” idiom for BP, allowing explicit specification of liveness requirements. We demonstrate how this approach allows for the direct representation of common requirements patterns, supported by a user study that highlights positive outcomes, particularly in improving the alignment between software components and their corresponding requirements. While formal modeling languages that allow specification of liveness requirements are mostly used in the context of model-checking and synthesis, the focus of BP is on the executability of the model. To this end, we propose two execution mechanisms: one based on translation to Büchi automata and another using Markov decision processes (MDP), with the latter offering scalability through deep reinforcement learning. A formal analysis of the MDP-based mechanism is provided, together with qualitative and quantitative evaluations of a proof-of-concept tool.
We present a novel approach to performing fitness approximation in genetic algorithms (GAs) using machine learning (ML) models, focusing on dynamic adaptation to the evolutionary state. We compare different methods for (1) switching between actual and approximate fitness, (2) sampling the population, and (3) weighting the samples. Experimental findings demonstrate significant improvement in evolutionary runtimes, with fitness scores that are either identical or slightly lower than those of the fully run GA—depending on the ratio of approximate-to-actual-fitness computation. Although we focus on evolutionary agents in Gymnasium (game) simulators—where fitness computation is costly—our approach is generic and can be easily applied to many different domains.
Emerging LLM-based code generation tools enable programmers to specify desired functionality and automatically generate code. However, these tools fall short in comparison to human ability when it comes to creating complete system models from requirements. This is because humans typically formulate a software design before implementing a system. In this paper, we propose to use the behavioral programming (BP) model-based paradigm as a general design approach that allows for the direct translation of requirements of any reactive systems into code. We demonstrate that each requirement can be automatically transformed into a dedicated code module without the need for a global view of the system. The key lies in BP's capability to enable modules to implement both scenarios and anti-scenarios separately. This means that each module can independently define behaviors that may happen, must happen, and must not happen. Subsequently, an application-agnostic execution engine interprets and interweaves these modules at runtime to generate cohesive system behavior consistent with system requirements. The fact that each requirement is translated into a small module also facilitates the verification of its implementation, thereby helping to reduce errors in LLM code generation. We present an initial evaluation of our approach and demonstrate how the characteristics of BP aid in generating aligned and correct implementations.
We present two novel domain-independent genetic operators that harness the capabilities of deep learning: a crossover operator for genetic algorithms and a mutation operator for genetic programming. Deep Neural Crossover leverages the capabilities of deep reinforcement learning and an encoder-decoder architecture to select offspring genes. BERT mutation masks multiple gp-tree nodes and then tries to replace these masks with nodes that will most likely improve the individual's fitness. We show the efficacy of both operators through experimentation.
We evolve survivors for the CodeGuru competition --- assembly programs that run the longest in shared memory, by resisting attacks from adversary survivors and finding their weaknesses. For evolving top-notch solvers, we specify a Backus Normal Form (BNF) for the assembly language and synthesize the code from scratch using Genetic Programming (GP). We evaluate the survivors by running CodeGuru games against human-written winning survivors. Our evolved programs found weaknesses in the programs they were trained against and utilized them. This work has important applications for cyber-security, as we utilize evolution to detect weaknesses in survivors. The assembly BNF is domain-independent; thus, by modifying the fitness function, it can detect code weaknesses and help fix them. Finally, the CodeGuru competition offers a novel platform for analyzing GP and code evolution in adversarial environments. To support further research in this direction, we provide a thorough qualitative analysis of the evolved survivors and the weaknesses found.
We present a novel multi-parent crossover operator in genetic algorithms (GAs) called “Deep Neural Crossover” (DNC). Unlike conventional GA crossover operators that rely on a random selection of parental genes, DNC leverages the capabilities of deep reinforcement learning (DRL) and an encoder-decoder architecture to select the genes. Specifically, we use DRL to learn a policy for selecting promising genes. The policy is stochastic, to maintain the stochastic nature of GAs, representing a distribution for selecting genes with a higher probability of improving fitness. Our architecture features a recurrent neural network (RNN) to encode the parental genomes into latent memory states, and a decoder RNN that utilizes an attention-based pointing mechanism to generate a distribution over the next selected gene in the offspring. To improve the training time, we present a pre-training approach, wherein the architecture is initially trained on a single problem within a specific domain and then applied to solving other problems of the same domain. We compare DNC to known operators from the literature over two benchmark domains – bin packing and graph coloring. We compare with both two- and three-parent crossover, outperforming all baselines. DNC is domain-independent and can be easily applied to other problem domains.
We present a novel multi-parent crossover operator in genetic algorithms (GAs) called "Deep Neural Crossover" (DNC). Unlike conventional GA crossover operators that rely on a random selection of parental genes, DNC leverages the capabilities of deep reinforcement learning (DRL) and an encoder-decoder architecture to select the genes. Specifically, we use DRL to learn a policy for selecting promising genes. The policy is stochastic, to maintain the stochastic nature of GAs, representing a distribution for selecting genes with a higher probability of improving fitness. Our architecture features a recurrent neural network (RNN) to encode the parental genomes into latent memory states, and a decoder RNN that utilizes an attention-based pointing mechanism to generate a distribution over the next selected gene in the offspring. The operator's architecture is designed to find linear and nonlinear correlations between genes and translate them to gene selection. To reduce computational cost, we present a transfer-learning approach, wherein the architecture is initially trained on a single problem within a specific domain and then applied to solving other problems of the same domain. We compare DNC to known operators from the literature over two benchmark domains, outperforming all baselines.
One of the benefits of using executable specifications such as Behavioral Programming (BP) is the ability to align the system implementation with its requirements. This is facilitated in BP by a protocol that allows independent implementation modules that specify what the system may, must, and must not do. By that, each module can enforce a single system requirement, including negative specifications such as “don't do X after Y.” The existing BP protocol, however, allows only the enforcement of safety requirements and does not support the execution of liveness properties such as “do X at least three times.” To model liveness requirements in BP directly and independently, we propose idioms for tagging states with “must-finish;’ indicating that tasks are yet to be completed. We show that this idiom allows a direct specification of known requirements patterns from the literature. We also offer semantics and two execution mechanisms, one based on a translation to Büchi automata and the other based on a Markov decision process (MDP). The latter approach offers the possibility of utilizing deep reinforcement learning (DRL) algorithms, which bear the potential to handle large software systems effectively. This paper presents a qualitative and quantitative assessment of the proposed approach using a proof-of-concept tool. A formal analysis of the MDP-based execution mechanism is given in an appendix.
EC-KitY is a comprehensive Python library for doing evolutionary computation (EC), licensed under the BSD 3-Clause License, and compatible with scikit-learn. Designed with modern software engineering and machine learning integration in mind, EC-KitY can support all popular EC paradigms, including genetic algorithms, genetic programming, coevolution, evolutionary multi-objective optimization, and more. This paper provides an overview of the package, including the ease of setting up an EC experiment, the architecture, the main features, and a comparison with other libraries.
Context-aware systems keep on emerging in all of our daily activities. Context, which can be a location, a user, an actual activity, or physical conditions, plays a major role in such systems. Actually, everything we refer to in our systems can be considered as context. Mechanisms for managing context were devised to cope with this new situation, including frameworks and programming languages. However, modeling languages that address the notion of context are rare. In this paper, we aim to frame and further define the requirements for context modeling languages. Such a conceptualized framework sets the ground for designing and evaluating modeling languages for context-aware systems. We demonstrate a possible use of the proposed framework through the evaluation of context-oriented modeling languages: UML-based Context Modeling and Context-Oriented Live Sequence Chart (CO-LSC).
We identify and demonstrate a weakness of Petri Nets (PN) in specifying composite behavior of reactive systems. Specifically, we show how, when specifying multiple requirements in one PN model, modelers are obliged to specify mechanisms for combining these requirements. This yields, in many cases, over-specification and incorrect models. We demonstrate how some execution paths are missed, and some are generated unintentionally. To support this claim, we analyze PN models from the literature, identify the combination mechanisms, and demonstrate their effect on the correctness of the model. To address this problem, we propose to model the system behavior using behavioral programming (BP), a software development and modeling paradigm designed for seamless integration of independent requirements. Specifically, we demonstrate how the semantics of BP, which define how to interweave scenarios into a single model, allow for avoiding the over-specification. Additionally, while BP maintains the same mathematical properties as PN, it provides means for changing the model dynamically, thus increasing the agility of the specification. We compare BP and PN in quantitative and qualitative measures by analyzing the models, their generated execution paths, and the specification process. Finally, while BP is supported by tools that allow for applying formal methods and reasoning techniques to the model, it lacks the legacy of PN tools and algorithms. To address this issue, we propose semantics and a tool for translating BP models to PN and vice versa.
Context-aware systems keep on emerging in all of our daily activities. To cope with this new situation, programming languages were extended to support the notion of context. Although context-oriented programming languages exist for over 15 years, they were tested for their suitability in developing context-aware systems only to a limited extent. In this paper, we propose a framework for analyzing context-oriented languages from that viewpoint. In this framework, we refer to context definition and activation, reasoning capabilities, process aspects of how to work with the suggested extension, and pragmatic considerations. To demonstrate the use of the framework, we applied it to a relatively new context-oriented programming paradigm, namely context-oriented behavioral programming. The proposed framework can support users of context-oriented programming languages in deciding on the most fitted language for their purpose. Developers of context-oriented programming languages can also use the framework to improve such languages and their supporting tools.
We present a new model-based approach for testing systems that use sequences of actions and assertions as test vectors. Our solution includes a method for quantifying testing quality, a tool for generating high-quality test suites based on the coverage criteria we propose, and a framework for assessing risks. For testing quality, we propose a method that specifies generalized coverage criteria over sequences of actions, which extends previous approaches. Our publicly available tool demonstrates how to extract effective test suites from test plans based on these criteria. We also present a Bayesian approach for measuring the probabilities of bugs or risks, and show how this quantification can help achieve an informed balance between exploitation and exploration in testing. Finally, we provide an empirical evaluation demonstrating the effectiveness of our tool in finding bugs, assessing risks, and achieving coverage.