arXiv:2611.07254cs.LGNov 2026

Manuscript Offprint

arXiv:2611.07254

Using Transformers for Teaching and Learning via Symbolic Distillation of Neural A-life Agents

Shuwei Wang, Vadim Bulitko, Matthew R. G. Brown, Michael Youngblood, Ramon Lawrence, Roscoe Smith, Shinichi Nakagawa, William Yeoh

ABSTRACT

Neural networks controlling behavior of A-life agents can evolve over multiple generations. While effective in making the agents survive, such networks are generally opaque to a human observer. Furthermore, the neural weights cannot be transferred between agents with different neural architectures. Distilling such neural networks into compact symbolic policies can help humans understand agent behavior in A-life. Additionally, it allows the agents to share their knowledge in a compact fashion, improving population-level learning. Distilling a neural policy into a symbolic policy is typically performed by searching the space of symbolic policies to find one that approximates the neural policy. However, even with a domain-specific language the space of policies can be large, necessitating incomplete stochastic search such as genetic algorithms. Yet the distillation remains computationally expensive. We propose to instead use a transformer pre-trained on readily available random percept-action data. Doing so speeds up distillation substantially. We derive the transformer architecture via a neural architecture search. Empirical results compare different distillation methods and the influence of the symbolic space on A-life population dynamics through self-reflection and teaching and learning.

Keywords Artificial life · Symbolic distillation · Transformers · Neurosymbolic AI · Teaching and learning

1 Introduction

While neural networks have enabled breakthrough performance in many applications over the last decade [Mnih et al., 2015] their learned knowledge is encoded non-transparently via a large number of trained parameters (weights). The training process itself can be unstable and the learned knowledge cannot be compactly transferred between different neural architectures. Neurosymbolic Artificial Intelligence (AI) [Chaudhuri et al., 2021, Kautz, 2022, Hitzler et al., 2022, Garcez and Lamb, 2023] seeks to address these three shortcomings by complementing neurally represented knowledge with symbolically represented knowledge. One way of doing so is distillation of neural control policies: finding a compact symbolic policy of similar behavior [Verma et al., 2018].

The distillation methods used in this process often come from the field of symbolic regression [Gulwani et al., 2017] and involve searching a space of programs [Odena et al., 2020]. Because the space of programs is usually large, incomplete

A PREPRINT

stochastic methods are utilized. In particular, stochastic search in the form of simulated annealing [Medeiros et al., 2022] and genetic algorithms (GA) [Koza, 1992, Cranmer et al., 2020] is common in program synthesis [Bulitko et al., 2022, Wang et al., 2023] and neural distillation [Deproost et al., 2024]. While it has been successfully used for neurosymbolic AI [Udrescu and Tegmark, 2020, Acharya et al., 2023] it can be slow and unreliable.

In this paper we adopt the idea of symbolic regression via pre-trained transformers [Biggio et al., 2021, Vaswani et al., 2017] and synthesize compact symbolic policies of neural agents evolved within A-life. The transformer receives a set of an agent's percepts and the actions taken by the agent and produces a series of tokens describing a symbolic policy that approximately matches the percept-action pairs. We use a neural architecture search [Chen et al., 2021] to automatically find an effective neural architecture for the transformer. Once trained the transformer can be enhanced with bagging [Kamienny et al., 2022] and beam search [Vaswani et al., 2017]. We show that not only can it surpass the accuracy of symbolic policies produced by genetic algorithms but its distillation is also substantially faster.

The distillation allows a population of A-life agents to exchange their knowledge in a compact, symbolic fashion. Such knowledge sharing enables population-level learning. The compact nature of the symbolic policies also makes them human-readable which may lead to theoretical verifiability [Zhu et al., 2019, Bastani et al., 2018, Stevens et al., 2023] and human insight [Wang et al., 2024]. The symbolic policies can also be used to stabilize the neural training in an iterative manner [Verma et al., 2018, 2019] and to communicate knowledge between agents with different neural architectures [Stanley and Miikkulainen, 2002].

The paper makes the following contributions. We propose a method for automatically designing and training a transformer for distilling neural policies of A-life agents. Once trained the transformer surpasses the distillation accuracy of a genetic algorithm on average while being substantially faster. The short per-policy distillation time makes teaching and learning within A-life more practical. In particular, we consider the impact of the space of symbolic policies used for the distillation on teaching and learning in the population. Finally, we discuss human readability of symbolic policies. Our code and data are available to other researchers upon request.

References (67)